/* =============================================================
   Sandor Hernandez · Aura Homes — styles.css
   Concepto: First Light — ver el negocio antes que el mercado.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --emerald: #0B3D2E;
  --emerald-2: #124A39;
  --ivory: #F7F5F0;
  --onyx: #222222;
  --aura: #116248;
  --sage: #A9C9B8;
  --mute: #6B6B66;
  --line: #E2DED4;
  --line-dark: rgba(169, 201, 184, 0.22);

  --serif: "Cormorant Garamond", Cambria, Georgia, serif;
  --sans: "Montserrat", Calibri, system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1320px;
  --nav-h: 76px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--onyx);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
.ledger-number, .calc-cap, .field-val, .calc-metrics dd, .delta, .hero-foot strong, .p-n, .numbers td { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
::selection { background: var(--aura); color: var(--ivory); }
:focus-visible { outline: 2px solid var(--aura); outline-offset: 3px; border-radius: 2px; }

/* Bilingüe: el HTML trae ambos idiomas, se muestra el activo */
html[lang="es"] body [lang="en"],
html[lang="en"] body [lang="es"] { display: none !important; }

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ivory); color: var(--emerald);
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.label {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--sans); font-size: .72rem; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--aura);
}
.is-dark .label { color: var(--sage); }

/* Motivo: horizonte con diamante */
.horizon { display: flex; align-items: center; width: 100%; }
.horizon::before {
  content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55;
}
.horizon::after {
  content: ""; width: 7px; height: 7px; margin-left: -1px;
  background: currentColor; transform: rotate(45deg);
}
.diamond {
  display: inline-block; width: 6px; height: 6px;
  background: currentColor; transform: rotate(45deg);
}

.is-dark { background: var(--emerald); color: var(--ivory); }

/* =============================================================
   4. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: 1rem 1.6rem;
  font-size: .78rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 0;
  transition: background .4s var(--ease-out), color .4s var(--ease-out), border-color .4s var(--ease-out), transform .4s var(--ease-out);
  will-change: transform;
}
.btn .arrow { transition: transform .4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--solid { background: var(--aura); border-color: var(--aura); color: var(--ivory); }
.btn--solid:hover { background: var(--emerald); border-color: var(--emerald); }
.is-dark .btn--solid, .hero .btn--solid { background: var(--sage); border-color: var(--sage); color: var(--emerald); }
.is-dark .btn--solid:hover, .hero .btn--solid:hover { background: var(--ivory); border-color: var(--ivory); }
.btn--ghost:hover { background: var(--onyx); border-color: var(--onyx); color: var(--ivory); }
.is-dark .btn--ghost:hover, .hero .btn--ghost:hover { background: var(--ivory); border-color: var(--ivory); color: var(--emerald); }

.link-line {
  position: relative; display: inline-block;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out);
}
.link-line:hover { background-size: 100% 1px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  color: var(--ivory);
  transition: background .5s var(--ease-out), color .5s var(--ease-out), border-color .5s var(--ease-out), transform .5s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled, .nav--solid {
  background: rgba(247, 245, 240, 0.94);
  color: var(--onyx);
  border-bottom-color: var(--line);
}
@supports (backdrop-filter: blur(12px)) {
  .nav.is-scrolled, .nav--solid { background: rgba(247, 245, 240, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.nav.is-hidden { transform: translateY(-100%); }
.nav-inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.wordmark { display: inline-flex; flex-direction: column; gap: .35rem; line-height: 1; }
.wordmark-name {
  font-family: var(--serif); font-size: 1.12rem; letter-spacing: .32em; text-transform: uppercase;
}
.wordmark .horizon { color: currentColor; width: 100%; }
.wordmark .horizon::after { width: 5px; height: 5px; }
.nav.is-scrolled .wordmark .horizon, .nav--solid .wordmark .horizon { color: var(--aura); }
.wordmark-sub { font-size: .58rem; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }

.wordmark-name, .nav-links a, .nav-cta { white-space: nowrap; }
.nav-links { display: none; gap: clamp(1.2rem, 2vw, 2.2rem); font-size: .76rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-toggle {
  display: inline-flex; border: 1px solid currentColor; font-size: .68rem; letter-spacing: .14em; font-weight: 500;
}
.lang-toggle button { padding: .45rem .6rem; opacity: .55; transition: opacity .3s, background .3s; }
html[lang="es"] .lang-toggle [data-lang="es"],
html[lang="en"] .lang-toggle [data-lang="en"] { opacity: 1; background: currentColor; }
html[lang="es"] .lang-toggle [data-lang="es"] span,
html[lang="en"] .lang-toggle [data-lang="en"] span { color: var(--emerald); }
html[lang="es"] .nav.is-scrolled .lang-toggle [data-lang="es"] span,
html[lang="en"] .nav.is-scrolled .lang-toggle [data-lang="en"] span,
html[lang="es"] .nav--solid .lang-toggle [data-lang="es"] span,
html[lang="en"] .nav--solid .lang-toggle [data-lang="en"] span { color: var(--ivory); }
html.menu-open .nav .lang-toggle button[aria-pressed="true"] span { color: var(--emerald) !important; }
.nav-cta { display: none; padding: .75rem 1.1rem; font-size: .7rem; }
.nav.is-scrolled .nav-cta, .nav--solid .nav-cta { background: var(--aura); border-color: var(--aura); color: var(--ivory); }

.menu-btn { width: 40px; height: 40px; display: grid; place-content: center; gap: 6px; }
.menu-btn span { display: block; width: 24px; height: 1px; background: currentColor; transition: transform .4s var(--ease-out); }
.menu-open .menu-btn span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--emerald); color: var(--ivory);
  display: flex; flex-direction: column; justify-content: center; gap: 1.6rem;
  padding: var(--nav-h) var(--gutter) 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease-out);
  visibility: hidden;
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; }
.menu-open .nav { color: var(--ivory); background: transparent; border-color: transparent; backdrop-filter: none; }
.mobile-menu a { font-family: var(--serif); font-size: clamp(2.2rem, 9vw, 3.4rem); line-height: 1.1; }
.mobile-menu .mobile-meta { margin-top: 2rem; font-size: .8rem; letter-spacing: .1em; color: var(--sage); }

/* =============================================================
   5. Splash
   ============================================================= */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--emerald); color: var(--sage);
  transition: clip-path 1s var(--ease-out), opacity .6s;
  clip-path: inset(0 0 0 0);
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out { clip-path: inset(0 0 100% 0); pointer-events: none; }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-inner { width: min(320px, 70vw); text-align: center; }
.splash-name {
  font-family: var(--serif); color: var(--ivory); font-size: 1.1rem; letter-spacing: clamp(.2em, 1vw, .4em); white-space: nowrap;
  text-transform: uppercase; opacity: 0; animation: fadeIn .8s .45s var(--ease-out) forwards;
}
.splash .horizon { margin-top: 1rem; }
.splash .horizon::before { transform-origin: left; transform: scaleX(0); animation: drawLine 1.1s .1s var(--ease-out) forwards; opacity: .8; }
.splash .horizon::after { opacity: 0; animation: fadeIn .4s 1s forwards; }
@keyframes drawLine { to { transform: scaleX(1); } }
@keyframes fadeIn { to { opacity: 1; } }

/* =============================================================
   6. Sections
   ============================================================= */

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  color: var(--ivory); background: var(--emerald);
  padding-block: calc(var(--nav-h) + 3rem) clamp(2rem, 5vh, 3.5rem);
  isolation: isolate; overflow: clip;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img {
  width: 100%; height: 115%; object-fit: cover; object-position: center 40%;
  transform-origin: center; animation: heroZoom 14s var(--ease-soft) forwards;
}
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11,61,46,.55) 0%, rgba(11,61,46,.25) 35%, rgba(11,61,46,.88) 78%, var(--emerald) 100%),
    linear-gradient(90deg, rgba(11,61,46,.6), transparent 70%);
}
/* "First light": un barrido de luz que cruza el horizonte */
.hero::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 58%;
  height: 40%; pointer-events: none;
  background: radial-gradient(40% 60% at 50% 0%, rgba(169,201,184,.28), transparent 70%);
  animation: firstLight 9s var(--ease-soft) infinite alternate;
  mix-blend-mode: screen;
}
@keyframes firstLight { from { transform: translateX(-30%); opacity: .5; } to { transform: translateX(30%); opacity: 1; } }

.hero-grid { display: grid; gap: 2.5rem; width: 100%; }
.hero .label { color: var(--sage); }
.hero-title {
  font-size: clamp(3rem, 10.5vw, 9.4rem);
  line-height: .94; letter-spacing: -0.025em;
  max-width: 11ch; margin-top: 1.4rem;
}
.hero-title em { font-style: italic; color: var(--sage); }
.hero-lede { max-width: 46ch; font-size: clamp(.98rem, 1.3vw, 1.1rem); color: rgba(247,245,240,.82); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-horizon { color: var(--sage); margin-top: 2.6rem; }
.hero-horizon::before { transform-origin: left; animation: drawLine 1.8s 1.2s var(--ease-out) both; transform: scaleX(0); }
.hero-foot {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem 2rem; margin-top: 1.4rem;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(247,245,240,.7);
}
.hero-foot strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.9rem; letter-spacing: 0; text-transform: none; color: var(--ivory); line-height: 1.1; }

/* Split words (hero) */
.split-word { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-word > span { display: inline-block; transform: translateY(105%); animation: wordUp 1.1s var(--ease-out) forwards; animation-delay: calc(var(--i) * 70ms + 1.1s); }
@keyframes wordUp { to { transform: translateY(0); } }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line-dark);
  background: var(--emerald); color: var(--sage);
  overflow: clip; padding-block: .6rem;
}
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee-track span {
  display: inline-flex; align-items: center; gap: 2.4rem; padding-right: 2.4rem;
  font-family: var(--serif); font-size: 1.2rem; font-style: italic; white-space: nowrap;
}
.marquee-track span i { width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section shell ---------- */
.section { position: relative; padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.section-head { display: grid; gap: .8rem; margin-bottom: clamp(1.25rem, 2.5vw, 2.25rem); }
.section-title { font-size: clamp(2rem, 3.6vw, 3.3rem); max-width: 22ch; }
.section-title em { font-style: italic; color: var(--aura); }
.is-dark .section-title em { color: var(--sage); }
.section-intro { max-width: 52ch; color: var(--mute); font-size: .95rem; }
.is-dark .section-intro { color: rgba(247,245,240,.72); }

/* ---------- Listed vs real (pasos sin scroll) ---------- */
.ledger { display: grid; gap: 1.5rem; }
.ledger-kicker { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.ledger-number {
  font-family: var(--serif); font-size: clamp(4.5rem, 13vw, 9.5rem); line-height: .95; letter-spacing: -0.04em;
  color: var(--onyx); font-variant-numeric: tabular-nums; transition: color .6s var(--ease-out);
}
.ledger-number small { font-size: .38em; letter-spacing: 0; margin-left: .05em; }
.ledger-number.is-real { color: var(--aura); }
.ledger-bar { position: relative; height: 1px; background: var(--line); margin-top: 1rem; }
.ledger-bar span { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--aura); transform-origin: left; transition: transform .9s var(--ease-out); }
.ledger-noi { margin-top: .7rem; font-size: .82rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.ledger-noi strong { color: var(--onyx); font-weight: 500; }

.ledger-steps { display: grid; border-top: 1px solid var(--line); }
.ledger-step {
  display: grid; grid-template-columns: 2rem 1fr; align-items: baseline;
  padding-block: .85rem; border-bottom: 1px solid var(--line); cursor: pointer;
}
.ledger-step .step-n { font-size: .7rem; letter-spacing: .22em; color: var(--aura); font-weight: 500; }
.ledger-step h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); color: var(--mute); transition: color .4s var(--ease-out); }
.ledger-step:hover h3 { color: var(--aura); }
.ledger-step.is-active h3 { color: var(--onyx); }
.step-detail { grid-column: 2; display: grid; grid-template-rows: 1fr; transition: grid-template-rows .6s var(--ease-out); }
.step-detail > div { overflow: hidden; min-height: 0; }
.js .ledger-step:not(.is-active) .step-detail { grid-template-rows: 0fr; }
.step-detail p { color: var(--mute); font-size: .92rem; max-width: 52ch; padding-top: .4rem; }
.ledger-step .delta { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--onyx); font-variant-numeric: tabular-nums; margin-top: .2rem; }

/* ---------- Calculator ---------- */
.calc { display: grid; gap: 1.5rem; }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; align-content: start; }
.field { display: grid; gap: .25rem; min-width: 0; }
.field-top { display: grid; gap: .1rem; }
.field-name { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(247,245,240,.72); }
.field-val { font-family: var(--serif); font-size: 1.35rem; color: var(--ivory); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
  --p: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px; background: linear-gradient(90deg, var(--sage) var(--p), var(--line-dark) var(--p));
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--line-dark); }
input[type="range"]::-moz-range-progress { height: 1px; background: var(--sage); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6.5px;
  background: var(--sage); transform: rotate(45deg); border: 0; border-radius: 0;
  transition: transform .3s var(--ease-out);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; background: var(--sage); border: 0; border-radius: 0; transform: rotate(45deg); }
input[type="range"]:active::-webkit-slider-thumb { transform: rotate(45deg) scale(1.35); }

.calc-out {
  background: var(--emerald-2); padding: clamp(1.1rem, 2vw, 1.6rem);
  border: 1px solid var(--line-dark);
  display: grid; gap: .8rem; align-content: start;
}
.calc-hero-label { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sage); }
.calc-cap { font-family: var(--serif); font-size: clamp(3.5rem, 7vw, 5.5rem); line-height: .9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.calc-cap small { font-size: .4em; }
.calc-verdict { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--sage); }
.calc-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.calc-metrics div { background: var(--emerald-2); padding: .6rem .7rem; }
.calc-metrics dt { font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(247,245,240,.6); }
.calc-metrics dd { font-family: var(--serif); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.calc-note { font-size: .7rem; color: rgba(247,245,240,.55); }

/* ---------- Asset rail ---------- */
.rail-wrap { position: relative; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 380px); gap: 1.2rem;
  overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory;
  padding: .5rem var(--gutter) .75rem;
  scrollbar-width: none; cursor: grab;
  overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.is-dragging * { pointer-events: none; }
.asset {
  scroll-snap-align: start; position: relative;
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  transition: border-color .4s var(--ease-out), transform .5s var(--ease-out);
}
.asset:hover { border-color: var(--aura); transform: translateY(-4px); }
.asset-media { position: relative; aspect-ratio: 16 / 10; overflow: clip; background: var(--emerald); }
.asset-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); filter: saturate(.85); }
.asset:hover .asset-media img { transform: scale(1.05); }
.asset-body { padding: .9rem 1rem 1rem; display: grid; gap: .3rem; }
.asset-n { font-size: .66rem; letter-spacing: .22em; color: var(--aura); font-weight: 500; }
.asset h3 { font-size: 1.5rem; }
.asset p { font-size: .84rem; line-height: 1.45; color: var(--mute); }
.asset ul { list-style: none; display: grid; gap: .3rem; margin-top: .3rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .74rem; }
.asset li { display: flex; gap: .6rem; align-items: center; }
.asset li::before { content: ""; width: 4px; height: 4px; background: var(--aura); transform: rotate(45deg); flex: none; }
.rail-foot { display: flex; align-items: center; gap: 1rem; }
.rail-controls { display: flex; gap: .5rem; }
.rail-controls button { width: 40px; height: 40px; border: 1px solid var(--line); display: grid; place-items: center; transition: background .3s, border-color .3s, color .3s; }
.rail-controls button:hover { background: var(--aura); border-color: var(--aura); color: var(--ivory); }
.rail-progress { flex: 1; height: 1px; background: var(--line); position: relative; }
.rail-progress span { position: absolute; inset: 0 auto 0 0; width: 100%; transform-origin: left; transform: scaleX(.2); background: var(--aura); }

/* ---------- Operator ---------- */
.operator { display: grid; gap: 1.5rem; }
.operator-media { position: relative; aspect-ratio: 16 / 9; overflow: clip; }
.operator-media img { width: 100%; height: 120%; object-fit: cover; }
.operator-media figcaption {
  position: absolute; left: 1rem; bottom: 1rem; right: 1rem;
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ivory);
}
.operator-quote { font-family: var(--serif); font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.25; }
.operator-quote em { color: var(--sage); }
.ventures { list-style: none; margin-top: 1rem; border-top: 1px solid var(--line-dark); }
.ventures li {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: baseline; gap: .75rem;
  padding-block: .45rem; border-bottom: 1px solid var(--line-dark);
  transition: padding .5s var(--ease-out), color .4s;
}
.ventures li:hover { padding-left: .8rem; color: var(--sage); }
.ventures .v-n { font-size: .7rem; letter-spacing: .2em; color: var(--sage); }
.ventures .v-name { font-family: var(--serif); font-size: 1.25rem; }
.ventures .v-lesson { font-size: .78rem; color: rgba(247,245,240,.6); text-align: right; }

/* ---------- Audiences (tabs) ---------- */
.tabs-list { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; padding: 1rem 1.2rem 1.1rem; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500;
  color: var(--mute); transition: color .3s;
}
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--aura); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out); }
.tab[aria-selected="true"] { color: var(--onyx); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab-panel { display: grid; gap: 1rem; padding-top: 1.25rem; }
.tab-panel[hidden] { display: none; }
.tab-panel.is-entering { animation: panelIn .7s var(--ease-out); }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } }
.tab-panel h3 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); max-width: 22ch; }
.tab-panel .tp-copy p { color: var(--mute); max-width: 50ch; margin-top: .6rem; font-size: .92rem; }
.checklist { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.checklist li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.4rem 1fr; gap: .5rem; font-size: .88rem; }
.checklist li::before { content: ""; width: 6px; height: 6px; margin-top: .55em; background: var(--aura); transform: rotate(45deg); }

/* ---------- Process ---------- */
.process { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); counter-reset: step; }
.process li { background: var(--emerald); padding: 1rem; display: grid; gap: .35rem; align-content: start; transition: background .5s var(--ease-out); }
.process li:hover { background: var(--emerald-2); }
.process .p-n { font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--sage); }
.process h3 { font-size: 1.35rem; }
.process p { font-size: .82rem; line-height: 1.5; color: rgba(247,245,240,.7); }

/* ---------- Journal (blog preview / list) ---------- */
.posts { display: grid; gap: 2.6rem 2rem; }
.post-card { display: grid; gap: 1rem; align-content: start; }
.post-card .pc-media { aspect-ratio: 3 / 2; overflow: clip; background: var(--emerald); }
.post-card .pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); filter: saturate(.85); }
.post-card:hover .pc-media img { transform: scale(1.04); }
.pc-meta { display: flex; gap: .9rem; align-items: center; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--aura); font-weight: 500; }
.pc-meta time { color: var(--mute); font-weight: 400; }
.post-card h3 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.1; }
.post-card p { font-size: .92rem; color: var(--mute); }
.post-card .read { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; color: var(--onyx); }
.post-card--feature .pc-media { aspect-ratio: 16 / 9; }
#blog .posts { grid-template-columns: 1fr; gap: 1rem; }
#blog .post-card { grid-template-columns: 96px 1fr; column-gap: .9rem; row-gap: .25rem; }
#blog .pc-media { grid-row: 1 / span 3; aspect-ratio: 1; }
#blog .post-card h3 { font-size: 1.25rem; }
#blog .post-card--ig { grid-template-columns: 1fr; padding: 1rem; border: 1px solid var(--line); align-content: center; }
#blog .post-card--ig p { font-size: .84rem; }
.post-card--feature h3 { font-size: clamp(2.1rem, 4.2vw, 3.6rem); }

/* ---------- Contact ---------- */
.contact { display: grid; gap: 1.75rem; }
.contact-title { font-size: clamp(2.2rem, 4.5vw, 3.8rem); line-height: 1; }
.contact-title em { color: var(--sage); }
.contact-direct { display: grid; gap: .5rem; margin-top: 1rem; }
.contact-direct a { display: grid; gap: 0; padding-bottom: .5rem; border-bottom: 1px solid var(--line-dark); transition: color .3s, padding .5s var(--ease-out); }
.contact-direct a:hover { color: var(--sage); padding-left: .5rem; }
.contact-direct small { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sage); }
.contact-direct a > span { font-family: var(--serif); font-size: 1.3rem; }
.contact > *, .form > *, .form-row > * { min-width: 0; }
.form fieldset { min-width: 0; padding: 0; margin: 0; }

.form { display: grid; gap: .8rem; }
.form-row { display: grid; gap: .8rem; }
.form label { display: grid; gap: .4rem; }
.form label > span:first-child, .form .lbl { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sage); }
.form input, .form select, .form textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-dark);
  padding: .4rem 0; font-size: .95rem; color: var(--ivory); border-radius: 0;
  transition: border-color .3s;
}
.form select { -webkit-appearance: none; appearance: none; background: linear-gradient(45deg, transparent 50%, var(--sage) 50%) calc(100% - 4px) 55% / 6px 6px no-repeat; }
.form select option { color: var(--onyx); }
.form textarea { resize: vertical; min-height: 56px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-bottom-color: var(--sage); }
.form ::placeholder { color: rgba(247,245,240,.35); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.chips label { display: block; position: relative; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label > span {
  display: inline-block; padding: .55rem .9rem; border: 1px solid var(--line-dark); font-size: .78rem;
  transition: background .3s, color .3s, border-color .3s; cursor: pointer;
}
.chips input:checked + span { background: var(--sage); color: var(--emerald); border-color: var(--sage); }
.chips input:focus-visible + span { outline: 2px solid var(--sage); outline-offset: 2px; }
.form-foot { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: .6rem; }
.form-status { font-size: .84rem; color: var(--sage); min-height: 1.3em; }

/* ---------- Footer ---------- */
.footer { background: var(--emerald); color: rgba(247,245,240,.72); padding-block: 2.25rem 1.5rem; border-top: 1px solid var(--line-dark); font-size: .84rem; }
.footer-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-dark); }
.lockup { display: flex; align-items: center; gap: 1.2rem; color: var(--ivory); }
.lockup .wordmark .horizon { color: var(--sage); }
.lockup-rule { width: 1px; height: 38px; background: var(--line-dark); }
.lockup-aura { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .08em; white-space: nowrap; }
.footer h4 { font-family: var(--sans); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sage); margin-bottom: .9rem; font-weight: 500; }
.footer ul { list-style: none; display: grid; gap: .4rem; }
.footer a:hover { color: var(--ivory); }
.footer-top > :first-child { grid-column: 1 / -1; }
.footer-tag { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ivory); margin-top: .6rem; }
.footer-legal { padding-top: 1rem; display: grid; gap: .35rem; font-size: .72rem; color: rgba(247,245,240,.5); }

/* Floating WhatsApp */
.float-cta {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 80;
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.1rem; background: var(--aura); color: var(--ivory);
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500;
  border: 1px solid rgba(169,201,184,.35);
  transform: translateY(150%); transition: transform .6s var(--ease-out), background .3s;
}
.float-cta.is-visible { transform: none; }
.float-cta:hover { background: var(--emerald); }
.float-cta .diamond { color: var(--sage); }

/* =============================================================
   7. Blog pages
   ============================================================= */
.page-head { padding-top: calc(var(--nav-h) + clamp(1.75rem, 4vw, 3rem)); padding-bottom: clamp(1.5rem, 3vw, 2.25rem); border-bottom: 1px solid var(--line); }
.page-title { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: .95; margin-top: 1.2rem; }
.page-title em { font-style: italic; color: var(--aura); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.filter { padding: .55rem 1rem; border: 1px solid var(--line); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; transition: background .3s, color .3s, border-color .3s; }
.filter:hover { border-color: var(--aura); }
.filter[aria-pressed="true"] { background: var(--aura); color: var(--ivory); border-color: var(--aura); }
.post-card.is-filtered { display: none; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; background: transparent; }
.progress span { display: block; height: 100%; background: var(--aura); transform-origin: left; transform: scaleX(0); }

.article-head { padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 5rem)); }
.article-head .wrap { max-width: 980px; }
.article-title { font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: 1; margin-top: 1.2rem; }
.article-title em { color: var(--aura); }
.article-dek { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.35; color: var(--mute); margin-top: 1.4rem; max-width: 40ch; }
.byline { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.byline strong { color: var(--onyx); font-weight: 500; }
.article-figure { margin-block: clamp(2.5rem, 5vw, 4rem); }
.article-figure .fig-media { aspect-ratio: 16 / 8; overflow: clip; }
.article-figure img { width: 100%; height: 115%; object-fit: cover; }
.article-figure figcaption { margin-top: .7rem; font-family: var(--serif); font-style: italic; color: var(--mute); }

.prose { max-width: 68ch; margin-inline: auto; padding-inline: var(--gutter); font-size: 1.07rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); margin-top: 3.2rem; }
.prose h3 { font-size: 1.6rem; margin-top: 2.4rem; }
.prose a { color: var(--aura); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--aura); }
.prose .lede::first-letter {
  float: left; font-family: var(--serif); font-size: 5.4em; line-height: .78; margin: .08em .1em 0 0; color: var(--aura);
}
.pullquote {
  margin-block: 3rem !important; padding: 2rem 0; border-block: 1px solid var(--line);
  font-family: var(--serif); font-style: italic; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.22; color: var(--onyx);
}
.pullquote::before { content: ""; display: block; width: 7px; height: 7px; background: var(--aura); transform: rotate(45deg); margin-bottom: 1.2rem; }
.numbers {
  width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums;
}
.numbers th, .numbers td { padding: .75rem .4rem; border-bottom: 1px solid var(--line); text-align: right; }
.numbers th:first-child, .numbers td:first-child { text-align: left; }
.numbers thead th { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.numbers tr.total td { font-weight: 500; color: var(--onyx); border-bottom-color: var(--onyx); }
.numbers td.hi { color: var(--aura); font-family: var(--serif); font-size: 1.3rem; }
.callout { background: var(--emerald); color: var(--ivory); padding: 1.6rem 1.8rem; }
.callout strong { color: var(--sage); font-weight: 500; }
.disclaimer { font-size: .8rem; color: var(--mute); border-top: 1px solid var(--line); padding-top: 1.2rem; }

.author-box { max-width: 68ch; margin: 4rem auto 0; padding: 2rem var(--gutter); display: grid; gap: .8rem; border-top: 1px solid var(--line); }
.author-box .ab-name { font-family: var(--serif); font-size: 1.7rem; }
.author-box p { color: var(--mute); font-size: .95rem; }

/* =============================================================
   8. Effects
   ============================================================= */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease-out), transform .5s var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

.js .reveal-line { position: relative; }
.js .draw-line { transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease-out); }
.js .draw-line.is-visible { transform: scaleX(1); }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }

/* =============================================================
   9. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .hero-foot { grid-template-columns: repeat(4, auto); justify-content: start; gap: 2.8rem; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .posts { grid-template-columns: repeat(2, 1fr); }
  .calc-metrics { grid-template-columns: repeat(4, 1fr); }
  #blog .posts { grid-template-columns: repeat(2, 1fr); }
  .float-cta { right: 1.6rem; bottom: 1.6rem; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .menu-btn { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1.4fr 1fr; align-items: end; column-gap: 3rem; }
  .section-head .label { grid-column: 1 / -1; }
  .ledger { grid-template-columns: .9fr 1.1fr; gap: 4rem; align-items: center; }
  .calc { grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; }
  .operator { grid-template-columns: .7fr 1.3fr; gap: 3.5rem; align-items: stretch; }
  .operator-media { aspect-ratio: auto; min-height: 100%; }
  .operator-media img { position: absolute; top: 0; left: 0; }
  .tab-panel { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .process { grid-template-columns: repeat(4, 1fr); }
  .posts { grid-template-columns: repeat(3, 1fr); }
  #blog .posts { grid-template-columns: repeat(4, 1fr); }
  #blog .post-card { grid-template-columns: 1fr; }
  #blog .pc-media { grid-row: auto; aspect-ratio: 16 / 10; }
  .posts .post-card--feature { grid-column: 1 / -1; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
  .contact { grid-template-columns: 1fr 1.1fr; gap: 3.5rem; }
  .footer-top { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .rail { grid-auto-columns: 320px; padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
}
@media (min-width: 1280px) {
  .hero-title { max-width: 12ch; }
}

@media (max-width: 539px) {
  .wordmark-name { font-size: .92rem; letter-spacing: .18em; }
  .wordmark-sub { display: none; }
  .nav-actions { gap: .4rem; }
  .menu-btn { width: 34px; }
  .lang-toggle button { padding: .4rem .45rem; }
}

/* =============================================================
   10. Reduced motion (solo lo intrusivo)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media img { animation: none; }
  .hero::after { animation: none; }
}

/* ---------- Cookies (banner) ---------- */
.cookie-box {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 500; max-width: 560px;
  background: var(--emerald); color: var(--ivory); border: 1px solid var(--line-dark);
  padding: 1.1rem 1.2rem; box-shadow: 0 18px 50px rgba(0,0,0,.28); font-size: .8rem; line-height: 1.55;
  opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .4s var(--ease-out);
}
.cookie-box.is-open { opacity: 1; transform: none; }
.cookie-box[hidden], .cookie-box [hidden] { display: none !important; }
.cookie-title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.1; margin-bottom: .35rem; }
.cookie-text a { color: var(--sage); text-decoration: underline; text-underline-offset: 2px; }
.cookie-prefs { display: grid; gap: .45rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line-dark); }
.cookie-prefs label { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.cookie-prefs input { accent-color: var(--sage); margin-top: .2rem; width: 16px; height: 16px; flex: none; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.cookie-btn {
  flex: 1 1 auto; padding: .7rem .9rem; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500;
  color: var(--ivory); background: transparent; border: 1px solid rgba(169,201,184,.45); cursor: pointer; transition: background .3s, color .3s;
}
.cookie-btn:hover, .cookie-btn:focus-visible { background: rgba(169,201,184,.15); }
.cookie-btn--solid { background: var(--sage); color: var(--emerald); border-color: var(--sage); }
.cookie-btn--solid:hover, .cookie-btn--solid:focus-visible { background: var(--ivory); }
@media (min-width: 700px) { .cookie-box { left: 1.6rem; bottom: 1.6rem; right: auto; } }

/* ---------- Consentimiento en el formulario ---------- */
.form .consent { display: flex; gap: .65rem; align-items: flex-start; font-size: .74rem; line-height: 1.5; color: rgba(247,245,240,.72); cursor: pointer; }
.form .consent input { width: 16px; height: 16px; flex: none; margin-top: .15rem; padding: 0; border: 0; accent-color: var(--sage); }
.form .consent a { color: var(--sage); text-decoration: underline; text-underline-offset: 2px; }
.form .consent + .consent { margin-top: -.2rem; }

/* ---------- Enlaces legales en el pie ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.footer-links a, .footer-links button { color: inherit; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.footer-links a:hover, .footer-links button:hover { color: var(--ivory); }

/* ---------- Páginas legales ---------- */
.legal .prose h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-top: 2.4rem; }
.legal .prose { font-size: 1rem; line-height: 1.75; padding-bottom: 4rem; }
.legal .prose table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.legal .prose th, .legal .prose td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal .prose th { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.legal .table-wrap { overflow-x: auto; }
.legal .updated { margin-top: 2rem; font-size: .8rem; color: var(--mute); letter-spacing: .06em; }

/* ---- Formulario GoHighLevel ---- */
.ghl-form { min-width: 0; }
.ghl-form iframe { display: block; width: 100%; background: transparent; }
.ghl-note { margin-top: .8rem; font-size: .75rem; line-height: 1.5; color: var(--sage); }
.ghl-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
