/* ═══════════════════════════════════════════
   Tokens
   ═══════════════════════════════════════════ */
:root {
  --bg:        #0b0d12;
  --bg-alt:    #10131a;
  --surface:   #161a23;
  --line:      #262c39;
  --line-soft: #1c212c;
  --fg:        #e9ecf2;
  --fg-mid:    #a2abbd;
  --fg-dim:    #6d7789;
  --accent:    #ff6b4a;
  --accent-dim: #ff6b4a22;
  --accent-fg: #fff;

  --wrap: 1160px;
  --r: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="light"] {
  --bg:        #fbfbfd;
  --bg-alt:    #f2f3f7;
  --surface:   #ffffff;
  --line:      #dfe3ec;
  --line-soft: #eceef4;
  --fg:        #14171f;
  --fg-mid:    #4d5566;
  --fg-dim:    #838c9e;
  --accent:    #e04a26;
  --accent-dim: #e04a2618;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #fbfbfd;
    --bg-alt:    #f2f3f7;
    --surface:   #ffffff;
    --line:      #dfe3ec;
    --line-soft: #eceef4;
    --fg:        #14171f;
    --fg-mid:    #4d5566;
    --fg-dim:    #838c9e;
    --accent:    #e04a26;
    --accent-dim: #e04a2618;
  }
}

/* ═══════════════════════════════════════════
   Base
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--accent-dim); color: var(--accent); padding: .1em .38em; border-radius: 5px; }
em { font-style: normal; color: var(--fg); font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-fg);
  padding: 12px 20px; border-radius: 0 0 var(--r) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ═══════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════ */
.eyebrow {
  font-size: 12.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}

.h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.12; letter-spacing: -.025em; font-weight: 800;
  margin: 0 0 20px; max-width: 20ch;
}

.h3 {
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.25; letter-spacing: -.018em; font-weight: 700; margin: 0 0 16px;
}

.h4 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-dim); margin: 0 0 18px; }

.lead { font-size: clamp(17px, 1.9vw, 19.5px); color: var(--fg-mid); max-width: 62ch; margin: 0 0 8px; }

/* ═══════════════════════════════════════════
   Nav
   ═══════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.nav.is-stuck { border-bottom-color: var(--line-soft); }

.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.nav__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.nav__mark {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 9px; background: var(--accent); color: var(--accent-fg);
  font-size: 12.5px; font-weight: 800; letter-spacing: -.02em;
}
.nav__name { font-size: 15.5px; }
@media (max-width: 420px) { .nav__name { display: none; } }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.lang { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.lang__btn {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--fg-dim); padding: 5px 11px; border-radius: 6px;
  transition: color .18s, background .18s;
}
.lang__btn:hover { color: var(--fg); }
.lang__btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }

.theme {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  appearance: none; cursor: pointer; color: var(--fg-mid);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  transition: color .18s, border-color .18s;
}
.theme:hover { color: var(--fg); border-color: var(--fg-dim); }
.theme__moon { display: none; }
:root[data-theme="light"] .theme__sun { display: none; }
:root[data-theme="light"] .theme__moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme__sun { display: none; }
  :root:not([data-theme="dark"]) .theme__moon { display: block; }
}

/* ═══════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border-radius: 10px; text-decoration: none;
  font-size: 15px; font-weight: 650; letter-spacing: -.005em;
  border: 1px solid transparent; transition: transform .15s, background .18s, border-color .18s, color .18s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn--ghost { border-color: var(--line); color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg-dim); background: var(--surface); }

/* ═══════════════════════════════════════════
   Sections
   ═══════════════════════════════════════════ */
.section { padding: clamp(72px, 10vw, 132px) 0; border-top: 1px solid var(--line-soft); }
.section--alt { background: var(--bg-alt); }

/* ── Hero ─────────────────────────────────── */
.hero { padding: clamp(56px, 9vw, 108px) 0 clamp(64px, 10vw, 120px); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% 30% auto -20%; height: 620px;
  background: radial-gradient(ellipse at center, var(--accent-dim), transparent 65%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 68px); align-items: center; }
@media (max-width: 940px) { .hero__inner { grid-template-columns: 1fr; } }

.hero__title {
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.06; letter-spacing: -.035em; font-weight: 800;
  margin: 0 0 22px; text-wrap: balance;
}
.hero__lead { font-size: clamp(16.5px, 1.9vw, 19px); color: var(--fg-mid); margin: 0 0 32px; max-width: 54ch; }
.hero__lead strong { color: var(--fg); font-weight: 650; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }

.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hero__chips li {
  font-size: 12.5px; font-weight: 600; color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: 100px; padding: 5px 13px;
}

/* ── Producto ─────────────────────────────── */
.prod { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(28px, 4.5vw, 60px); align-items: start; margin-top: 8px; }
@media (max-width: 900px) { .prod { grid-template-columns: 1fr; } }
.prod__copy p { color: var(--fg-mid); margin: 0 0 18px; max-width: 52ch; }
.prod__copy p:last-child { margin-bottom: 0; }

/* ── Stats ────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(228px, 100%), 1fr)); gap: 14px; margin-top: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px 24px 24px;
}
.stat__n {
  font-size: clamp(32px, 4vw, 42px); font-weight: 800; letter-spacing: -.04em;
  line-height: 1; margin-bottom: 12px; font-variant-numeric: tabular-nums;
}
.stat__u { font-size: .62em; margin-left: 1px; }
.stat__l { font-size: 14.5px; color: var(--fg-mid); line-height: 1.5; }
.stat--wide { grid-column: 1 / -1; }
.stat--accent { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(135deg, var(--accent-dim), transparent 55%), var(--surface); }
.stat--accent .stat__n { color: var(--accent); }
.stat--accent .stat__l { max-width: 68ch; font-size: 15.5px; color: var(--fg); }

/* ── Features ─────────────────────────────── */
.feats { display: flex; flex-direction: column; gap: clamp(56px, 8vw, 104px); margin-top: clamp(44px, 6vw, 72px); }

.feat { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(28px, 4.5vw, 60px); align-items: center; }
.feat--rev .feat__body { order: 2; }
@media (max-width: 900px) {
  .feat, .feat--rev { grid-template-columns: 1fr; }
  .feat--rev .feat__body { order: 0; }
}

.feat__num {
  display: block; font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--accent); letter-spacing: .1em; margin-bottom: 12px;
}
.feat__problem, .feat__solution { margin: 0 0 16px; color: var(--fg-mid); font-size: 16px; max-width: 54ch; }
.feat__solution { margin-bottom: 0; }
.feat__problem b, .feat__solution b {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-dim); margin-bottom: 6px;
}
.feat__solution b { color: var(--accent); }

/* ── Placeholders de imagen ───────────────── */
.shot {
  margin: 0; position: relative; aspect-ratio: 3 / 2;
  display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(45deg, var(--line-soft) 0 10px, transparent 10px 20px),
    var(--surface);
  border: 1.5px dashed var(--line); border-radius: var(--r);
  overflow: hidden;
}
.shot--hero { aspect-ratio: 7 / 5; }
.shot figcaption { display: flex; flex-direction: column; gap: 7px; padding: 20px; }
.shot__label { font-size: 14px; font-weight: 600; color: var(--fg-mid); }
.shot__dim { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); letter-spacing: .06em; }
.shot::after {
  content: attr(data-shot);
  position: absolute; top: 10px; left: 10px;
  font-family: var(--mono); font-size: 10.5px; color: var(--fg-dim);
  background: var(--bg); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 5px;
}
/* Cuando reemplaces el figure por <img>, esto le da el mismo marco */
.shot > img { width: 100%; height: 100%; object-fit: cover; }

/* ── Mi rol ───────────────────────────────── */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px; margin-top: clamp(36px, 5vw, 56px); }
.role {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px 24px;
}
.role__t { font-size: 17px; font-weight: 700; letter-spacing: -.012em; margin: 0 0 10px; }
.role p { margin: 0; font-size: 15px; color: var(--fg-mid); line-height: 1.6; }

/* ── Arquitectura ─────────────────────────── */
.arch { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(28px, 4.5vw, 56px); align-items: start; margin-top: clamp(36px, 5vw, 56px); }
@media (max-width: 900px) { .arch { grid-template-columns: 1fr; } }

.arch__svg { width: 100%; height: auto; overflow: visible; }
.lay rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.lay--core rect {
  stroke: var(--accent); stroke-width: 2;
  fill: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.lay__t { font-family: var(--mono); font-size: 17px; font-weight: 600; fill: var(--fg); }
.lay--core .lay__t { fill: var(--accent); }
.lay__d { font-family: var(--font); font-size: 13.5px; fill: var(--fg-mid); }
.lay__tag { font-family: var(--mono); font-size: 11.5px; fill: var(--fg-dim); }
.arw { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; }

.stack { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; }
.stack dt {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  color: var(--fg); padding-top: 14px;
}
.stack dd {
  margin: 3px 0 0; padding-bottom: 14px; font-size: 14px;
  color: var(--fg-mid); border-bottom: 1px solid var(--line-soft); line-height: 1.5;
}
.stack dd:last-of-type { border-bottom: 0; }

/* ── Decisiones ───────────────────────────── */
.decs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-top: clamp(36px, 5vw, 56px); }
.dec {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 30px 28px; display: flex; flex-direction: column;
}
.dec__n { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .1em; margin-bottom: 14px; }
.dec p { margin: 0 0 14px; font-size: 15.5px; color: var(--fg-mid); }
.dec__metric {
  margin: auto 0 0 !important; padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim) !important; line-height: 1.6;
}

/* ── Contacto ─────────────────────────────── */
.section--contact { text-align: center; }
.contact .eyebrow, .contact .h2, .contact .lead { margin-inline: auto; }
.contact .h2 { max-width: none; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }

/* ── Footer ───────────────────────────────── */
.foot { border-top: 1px solid var(--line-soft); padding: 30px 0; background: var(--bg-alt); }
.foot__inner { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: 13.5px; color: var(--fg-dim); }

/* ── Reveal on scroll ─────────────────────────────────────────────
   El estado por defecto es VISIBLE. El JS agrega .is-hidden sólo a lo
   que está fuera de pantalla, y lo saca al entrar. Así, si el JS falla,
   si las transiciones no corren o si el navegador no pinta la pestaña,
   el texto se lee igual. Nunca al revés.
   ───────────────────────────────────────────────────────────────── */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal.is-hidden { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-hidden { opacity: 1; transform: none; transition: none; }
}
