/* ==========================================================================
   ALAMEDA CASAS — Arquitectura Bioclimática & Steel Frame
   High-End Scrollytelling Architectural Experience (Minimalist & Immersive)
   ========================================================================== */

:root {
  --bg-dark: #070e0a;
  --bg-deep: #0b140f;
  --bg-glass: rgba(12, 22, 16, 0.72);
  --bg-glass-heavy: rgba(8, 16, 11, 0.88);
  --text-main: #f6f5ef;
  --text-dim: rgba(246, 245, 239, 0.72);
  --text-muted: rgba(246, 245, 239, 0.44);
  --accent-gold: #e5a93c;
  --accent-gold-hover: #f0b750;
  --accent-gold-glow: rgba(229, 169, 60, 0.28);
  --forest-green: #1f3f2e;
  --border-subtle: rgba(246, 245, 239, 0.12);
  --border-gold: rgba(229, 169, 60, 0.38);
  --font-serif: "Bodoni Moda", Didot, "Times New Roman", serif;
  --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-ambient: 0 20px 50px rgba(0, 0, 0, 0.6);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg-dark);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   CANVAS & BACKGROUND LIGHTING VEIL
   ========================================================================== */
#cv {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  background: #080f0b;
  pointer-events: none;
  object-fit: cover;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: 
    radial-gradient(circle at 50% 50%, rgba(7, 14, 10, 0.2) 0%, rgba(7, 14, 10, 0.72) 100%),
    linear-gradient(to bottom, rgba(7, 14, 10, 0.6) 0%, rgba(7, 14, 10, 0.08) 30%, rgba(7, 14, 10, 0.15) 70%, rgba(7, 14, 10, 0.85) 100%);
}

/* ==========================================================================
   MINIMAL SITE HEADER (TITLE ONLY IN TOP-LEFT CORNER)
   ========================================================================== */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 24px 44px;
  background: linear-gradient(180deg, rgba(7, 14, 10, 0.78) 0%, rgba(7, 14, 10, 0.35) 60%, rgba(7, 14, 10, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.header-inner {
  max-width: 1400px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-title {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.brand-title:hover {
  opacity: 0.85;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  color: #d4a359;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.brand-title:hover .brand-logo-icon {
  transform: rotate(5deg) scale(1.05);
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1;
  text-transform: lowercase;
}

.brand-subtitle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #d4a359;
  text-transform: uppercase;
  margin-left: 8px;
  line-height: 1;
  opacity: 0.9;
}

/* ==========================================================================
   VERTICAL RAIL HUD (DESKTOP)
   ========================================================================== */
.rail-hud {
  position: fixed;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-step {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.rail-step .step-label {
  opacity: 0;
  transform: translateX(12px);
  transition: all 0.3s var(--ease-out-expo);
  pointer-events: none;
}

.rail-step:hover .step-label,
.rail-step.active .step-label {
  opacity: 1;
  transform: translateX(0);
  color: var(--text-main);
}

.rail-step .step-line {
  display: block;
  width: 24px;
  height: 2px;
  background: rgba(246, 245, 239, 0.25);
  transition: all 0.3s var(--ease-out-expo);
}

.rail-step:hover .step-line {
  background: var(--text-dim);
  width: 38px;
}

.rail-step.active {
  color: var(--accent-gold);
}

.rail-step.active .step-line {
  width: 52px;
  background: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

/* ==========================================================================
   WEEKS COUNTER HUD (BOTTOM RIGHT)
   ========================================================================== */
.hud-counter {
  position: fixed;
  right: 36px;
  bottom: 32px;
  z-index: 40;
  text-align: right;
  pointer-events: none;
  user-select: none;
}

.hud-counter .hud-week-num {
  font-family: var(--font-serif);
  font-size: clamp(64px, 8vw, 110px);
  line-height: 0.85;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text-main);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
  display: block;
}

.hud-counter .hud-week-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: block;
  margin-top: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   MAIN CONTENT & STAGES
   ========================================================================== */
main {
  position: relative;
  z-index: 10;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}

/* HERO STAGE */
.hero-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 80px;
  padding-top: 80px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 24px;
}

.meta-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-gold);
  border-radius: 50%;
  animation: pulseDot 2.2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 var(--accent-gold-glow); }
  70% { transform: scale(1.4); opacity: 0.7; box-shadow: 0 0 0 8px transparent; }
  100% { transform: scale(1); opacity: 1; }
}

h1.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 7vw, 102px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 14ch;
  text-wrap: balance;
  margin-bottom: 28px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

h1.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: #fff;
}

p.hero-lead {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.6;
  max-width: 48ch;
  color: var(--text-dim);
  margin-bottom: 34px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.scroll-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-mouse {
  width: 18px;
  height: 30px;
  border: 1.5px solid var(--text-muted);
  border-radius: 10px;
  position: relative;
}

.scroll-wheel {
  width: 2px;
  height: 6px;
  background: var(--accent-gold);
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  animation: wheelAnim 1.8s infinite;
}

@keyframes wheelAnim {
  0% { transform: translate(-50%, 0); opacity: 1; }
  80% { transform: translate(-50%, 12px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 0; }
}

/* ==========================================================================
   STORY STAGES & FLOATING FROSTED GLASS PANELS
   ========================================================================== */
.story-stage {
  padding-block: 28vh 12vh;
  display: flex;
  flex-direction: column;
  gap: 36vh;
}

#stage-entrega {
  padding-bottom: 36vh;
}

.glass-panel {
  max-width: 580px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 42px 46px;
  box-shadow: var(--shadow-ambient);
  position: relative;
  transition: transform 0.4s var(--ease-out-expo), border-color 0.4s ease;
}

.glass-panel:hover {
  border-color: rgba(229, 169, 60, 0.3);
  transform: translateY(-4px);
}

.glass-panel.panel-right {
  margin-left: auto;
}

.panel-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.panel-title em {
  font-style: italic;
  color: #fff;
}

.panel-desc {
  color: var(--text-dim);
  font-size: 16.5px;
  line-height: 1.7;
  margin-bottom: 22px;
}

/* TECHNICAL MILESTONE LIST */
.tech-milestones {
  list-style: none;
  border-top: 1px solid var(--border-subtle);
  margin-top: 24px;
}

.tech-milestones li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
  color: var(--text-main);
}

.tech-milestones li span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* ARCHITECTURAL SPEC GRID (CASA ALAMO) */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 24px;
  padding-top: 20px;
}

.spec-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

.spec-cell dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.spec-cell dd {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.spec-cell dd small {
  font-size: 16px;
  font-family: var(--font-sans);
  color: var(--text-dim);
  margin-left: 4px;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
footer.site-footer {
  background: #040805;
  border-top: 1px solid var(--border-subtle);
  padding: 48px 32px 64px;
  color: var(--text-muted);
  font-size: 13.5px;
  position: relative;
  z-index: 10;
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-copy {
  max-width: 65ch;
  line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLETS)
   ========================================================================== */
@media (max-width: 860px) {
  .rail-hud {
    display: none;
  }
  
  main {
    padding: 0 18px;
  }
  
  .glass-panel {
    padding: 30px 24px;
    max-width: 100%;
  }

  .hud-counter {
    right: 18px;
    bottom: 20px;
  }
  
  .hud-counter .hud-week-num {
    font-size: 58px;
  }
}
