/* ============================================================
   LEONARDO MONTES DE OCA — portfolio
   ember-black · fire accents · Fraunces × Archivo × JetBrains Mono
   ============================================================ */

/* ---------- fonts (self-hosted, latin) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-italic-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pinyon Script";
  src: url("../assets/fonts/pinyon-script-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #0B0908;            /* ember black (JS morphs body bg per section) */
  --glow-now: #FF5A28;      /* ambient glow color (JS morphs) */
  --ink: #F4EDE3;           /* bone */
  --muted: #A79C8D;         /* warm gray */
  --line: rgba(244, 237, 227, .10);
  --accent: #FF5A28;        /* vermilion */
  --accent-2: #FFB03A;      /* sun gold */
  --fire: linear-gradient(100deg, #FF3D14 0%, #FF7A1A 52%, #FFB03A 100%);
  --card: #120E0B;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --tlpad: clamp(30px, 4.5vw, 60px);
  --pad: clamp(20px, 5vw, 72px);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html.lenis { scroll-behavior: auto; height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 380;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--accent); color: #140A06; }

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

.serif { font-family: var(--serif); }
.script { font-family: "Pinyon Script", cursive; font-weight: 400; }
.mono {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 450;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.container { max-width: 1240px; margin-inline: auto; padding-inline: var(--pad); }

/* ---------- reveal defaults (JS-gated so no-JS still reads) ---------- */
html.js .reveal { opacity: 0; transform: translateY(30px); }
html.js.reduced .reveal { opacity: 1; transform: none; }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 300;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-2%,3%); }
  40% { transform: translate(3%,-2%); } 60% { transform: translate(-3%,-3%); }
  80% { transform: translate(2%,2%); }
}

/* ---------- ambient glow (color morphs with section) ---------- */
body::before {
  content: "";
  position: fixed; z-index: 0; pointer-events: none;
  inset: -30% -20% auto -20%; height: 80vh;
  background: radial-gradient(55% 60% at 50% 0%, var(--glow-now), transparent 70%);
  opacity: .09;
}

/* ---------- progress hairline ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 400; background: transparent;
}
.progress span {
  display: block; height: 100%; width: 100%;
  background: var(--fire);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  height: 74px;
  padding-inline: var(--pad);
  background: rgba(11, 9, 8, 0);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(0px);
  transition: background .45s ease, border-color .45s ease, backdrop-filter .45s ease;
}
.nav.is-scrolled {
  background: rgba(11, 9, 8, .58);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.mark-logo { width: 100%; height: auto; display: block; }

/* monograma MR entrelazado (referencia de Leo), gradiente fuego.
   El gradiente va POR LETRA: background-clip:text del padre no pinta
   dentro de hijos con transform (crean su propia capa). */
.mark-mr {
  position: relative; line-height: 1; font-size: 1.7rem;
  transform: translateY(-3px);
  white-space: nowrap;
}
.mr-m, .mr-r {
  display: inline-block;
  background: var(--fire);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mr-r { margin-left: -.3em; transform: translate(0, .22em); }
.brand-name { font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); position: relative; padding-block: 6px;
  transition: color .3s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--fire); transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .45s cubic-bezier(.65,.05,0,1);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); transform-origin: 0 50%; }

.nav-right { display: flex; align-items: center; gap: 20px; }
.lang { display: flex; align-items: center; gap: 7px; }
.lang-btn {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  color: var(--muted); padding: 4px 2px;
  transition: color .3s ease;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active { color: var(--ink); }
.lang-btn.is-active::after { content: ""; display: block; height: 1px; background: var(--fire); }
.lang-sep { color: var(--line); font-size: .7rem; }

/* ---------- buttons ---------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 30px;
  border: 1px solid rgba(244, 237, 227, .22);
  border-radius: 999px;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink);
  overflow: hidden;
  transition: color .35s ease, border-color .35s ease;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--fire);
  transform: translateY(101%); border-radius: inherit;
  transition: transform .5s cubic-bezier(.65,.05,0,1);
}
.btn:hover { color: #140A06; border-color: transparent; }
.btn:hover::before { transform: translateY(0); }
.btn-arrow { width: 14px; height: 14px; transition: transform .35s ease; }
.btn:hover .btn-arrow { transform: translateX(5px); }
.btn-small { padding: 10px 20px; font-size: .66rem; }
.btn-big { padding: 21px 44px; font-size: .82rem; }

.text-link {
  display: inline-flex; align-items: baseline; gap: 8px;
  color: var(--accent-2);
  border-bottom: 1px solid rgba(255, 176, 58, .35);
  padding-bottom: 3px;
  transition: border-color .3s ease, color .3s ease;
  width: fit-content;
}
.text-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- expandable cards (tap to reveal) ---------- */
.card-head {
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; text-align: left; cursor: pointer;
  align-items: stretch;
}
.card-title-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  width: 100%;
}
.card-title-row > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-plus {
  position: relative; flex-shrink: 0;
  width: 34px; height: 34px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 50%;
  transition: transform .45s cubic-bezier(.22,.9,.3,1), border-color .3s ease, background .3s ease;
}
.card-plus::before, .card-plus::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  background: var(--accent-2);
  transform: translate(-50%, -50%);
}
.card-plus::before { width: 12px; height: 1.5px; }
.card-plus::after { width: 1.5px; height: 12px; }
.card-head:hover .card-plus { border-color: rgba(255, 176, 58, .55); }
.card.is-open .card-plus { transform: rotate(45deg); border-color: rgba(255, 176, 58, .55); }

html.js .card-body { height: 0; overflow: hidden; }
html.js.reduced .card-body { height: auto; }
html.reduced .card-plus { display: none; }
.card-body-inner {
  display: flex; flex-direction: column; gap: 18px; align-items: flex-start;
  padding-top: 18px;
}
.mini-case .card-body-inner p { color: var(--muted); max-width: 55ch; font-size: .98rem; }

/* ---------- eyebrow ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fire); flex-shrink: 0;
}

/* ---------- sections ---------- */
.section { position: relative; z-index: 1; padding-block: clamp(70px, 9vh, 118px); }

.sec-head { position: relative; margin-bottom: clamp(38px, 5vw, 60px); max-width: 880px; }
.sec-title {
  font-family: var(--serif); font-weight: 420;
  font-size: clamp(2.5rem, 5.8vw, 4.7rem);
  line-height: 1.02; letter-spacing: -.01em;
  text-wrap: balance;
}
.sec-sub { margin-top: 22px; color: var(--muted); max-width: 58ch; font-size: 1.02rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 120px; padding-bottom: 40px;
  overflow: clip;
}

.sun {
  position: absolute; z-index: -1;
  top: 50%; right: -12vw; transform: translateY(-62%);
  width: min(78vmin, 780px); aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255, 122, 26, .34) 0%,
      rgba(255, 61, 20, .16) 34%,
      rgba(255, 61, 20, .05) 55%,
      transparent 68%);
}
.sun::after {
  content: ""; position: absolute; inset: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 58, .5), rgba(255, 90, 40, .12) 62%, transparent 72%);
  filter: blur(2px);
}

.hero-grid { position: relative; }
.hero-eyebrow { margin-bottom: clamp(26px, 4vh, 44px); }

.hero-name {
  font-family: var(--serif); font-weight: 400;
  letter-spacing: -.015em;
}
.hero-line {
  display: block;
  font-size: clamp(2.9rem, 9.6vw, 7.6rem);
  line-height: 1.02;
}
.hero-line-small {
  font-size: clamp(1.35rem, 3.2vw, 2.3rem);
  font-style: italic; font-weight: 430;
  color: var(--muted);
  margin-bottom: clamp(10px, 1.6vh, 20px);
  letter-spacing: .01em;
}
.accent-period {
  background: var(--fire);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-foot {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 90px);
  align-items: end;
  margin-top: clamp(36px, 6vh, 64px);
}
.hero-thesis { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.65; max-width: 46ch; color: var(--ink); }
.hero-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; justify-self: end; }
.hero-avatar {
  width: clamp(110px, 12vw, 148px); height: clamp(110px, 12vw, 148px);
  border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255, 176, 58, .5);
  box-shadow: 0 0 0 6px rgba(255, 122, 26, .09), 0 18px 50px -16px rgba(0, 0, 0, .85);
}
.hero-loc { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.loc-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(255, 176, 58, .5);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 176, 58, .45); }
  70% { box-shadow: 0 0 0 12px rgba(255, 176, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 176, 58, 0); }
}

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 56px);
  margin-top: clamp(48px, 9vh, 96px);
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat-num {
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  font-weight: 500; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink); text-transform: none;
}
.stat-label { color: var(--muted); font-size: .86rem; line-height: 1.5; max-width: 26ch; }

.scroll-hint {
  position: absolute; right: var(--pad); bottom: 34px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); font-size: .62rem;
}
.scroll-line {
  width: 1px; height: 52px;
  background: linear-gradient(to bottom, var(--accent-2), transparent);
  animation: drop 2.2s cubic-bezier(.65,.05,0,1) infinite;
  transform-origin: top;
}
@keyframes drop {
  0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; }
  55% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   THE REEL — scroll-scrubbed image sequence (pinned)
   ============================================================ */
.reel { padding-block: 0; }
.reel-stage {
  position: relative;
  height: 100svh;
  overflow: hidden;
  display: grid; place-items: center;
}
.reel-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reel-glow {
  position: absolute;
  width: min(64vh, 560px); aspect-ratio: 9 / 16;
  border-radius: 40px;
  background: radial-gradient(60% 55% at 50% 45%, rgba(255, 90, 40, .34), transparent 70%);
  filter: blur(40px);
}
.reel-fallback { display: none; }

.reel-caption {
  position: absolute; z-index: 2;
  max-width: 15ch;
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  font-weight: 430; line-height: 1.15; letter-spacing: -.005em;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .75), 0 0 60px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden;
}
.reel-c1 { left: max(var(--pad), 6vw); top: 20%; }
.reel-c2 { right: max(var(--pad), 6vw); top: 26%; text-align: right; }
.reel-c3 { left: max(var(--pad), 6vw); bottom: 24%; }
.reel-c4 {
  left: 50%; bottom: 13%; transform: translateX(-50%);
  text-align: center; max-width: 24ch; width: max-content;
}
.reel-c4 p:first-child { font-size: clamp(1.5rem, 3.4vw, 2.7rem); font-weight: 430; line-height: 1.15; text-shadow: 0 2px 30px rgba(0,0,0,.75); }
.reel-credit {
  margin-top: 14px; color: var(--accent-2); font-size: .64rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .9);
}

.reel-hint {
  position: absolute; z-index: 2; right: var(--pad); bottom: 34px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink); font-size: .62rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .8);
}

/* gauge circular: se llena con el progreso del reel */
.reel-gauge {
  position: absolute; z-index: 2; left: var(--pad); bottom: 30px;
  width: 44px; height: 44px;
}
.reel-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: rgba(244, 237, 227, .14); stroke-width: 2; }
.gauge-fill {
  fill: none; stroke: url(#gaugeFire); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 106.8; stroke-dashoffset: 106.8;
}
.gauge-core {
  position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fire);
  box-shadow: 0 0 14px rgba(255, 122, 26, .8);
  transform: scale(.4); opacity: .5;
}
html.reduced .reel-gauge { display: none; }

@media (max-width: 700px) {
  .reel-caption { max-width: 13ch; font-size: clamp(1.35rem, 6.4vw, 1.9rem); }
  .reel-c4 { max-width: 90vw; width: auto; }
}

/* reduced motion / capture: static frame + stacked captions */
html.reduced .reel-stage { height: auto; padding: 90px var(--pad); display: flex; flex-direction: column; align-items: center; gap: 26px; }
html.reduced .reel-canvas, html.reduced .reel-glow, html.reduced .reel-hint { display: none; }
html.reduced .reel-fallback {
  display: block; max-height: 74svh; border-radius: 22px;
  border: 1px solid var(--line);
}
html.reduced .reel-caption {
  position: static; opacity: 1; visibility: visible; transform: none;
  text-align: center; max-width: 30ch;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-grid {
  display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}

.portrait { position: sticky; top: 120px; }
.portrait-inner {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255, 90, 40, .10), transparent 55%),
    var(--card);
  display: grid; place-items: center;
  overflow: hidden;
}
.portrait-mark { display: none; }
.portrait-letter { position: absolute; font-size: clamp(4rem, 8vw, 6.4rem); line-height: 1; white-space: nowrap; }
.portrait-letter .mr-m, .portrait-letter .mr-r {
  display: inline-block;
  background: var(--fire);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.portrait-letter .mr-r { margin-left: -.3em; transform: translate(0, .22em); }
.portrait-note {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: var(--muted); font-size: .62rem; letter-spacing: .2em;
}
.portrait-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.profile-copy { display: flex; flex-direction: column; gap: 26px; }
.profile-copy .lead { font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.55; font-weight: 400; }
.profile-copy p:not(.lead) { color: var(--muted); max-width: 62ch; }
.profile-copy p:not(.lead) strong, .profile-copy .lead strong { color: var(--ink); font-weight: 500; }

.profile-facts {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--line);
}
.profile-facts li {
  padding: 16px 18px 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .66rem;
  display: flex; align-items: center; gap: 10px;
}
.profile-facts li::before { content: "→"; color: var(--accent); }

/* ============================================================
   CAREER — timeline
   ============================================================ */
.timeline { position: relative; padding-left: var(--tlpad); max-width: 880px; }
.tl-line {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px;
  background: var(--line);
}
.tl-line span {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(to bottom, #FF3D14, #FF7A1A, #FFB03A);
  transform: scaleY(0); transform-origin: 0 0;
}

.tl-item { position: relative; padding-bottom: clamp(44px, 6vw, 72px); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute;
  left: calc(-1 * var(--tlpad) - 4.5px); top: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-date { color: var(--accent-2); margin-bottom: 14px; }
.tl-role {
  font-weight: 440; font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.15; letter-spacing: -.005em; text-wrap: balance;
}
.tl-item-flag .tl-role { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.tl-org { margin-top: 10px; color: var(--muted); }
.tl-copy { color: var(--muted); max-width: 62ch; }
.tl-item .card-body-inner { padding-top: 14px; gap: 6px; }
.tl-item .tl-org { margin-top: 0; }
.tl-copy strong { color: var(--ink); font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted); font-size: .62rem;
  white-space: nowrap;
}
.chip-hot { border-color: rgba(255, 90, 40, .5); color: var(--accent-2); }

.tl-edu { opacity: .96; }

/* ============================================================
   AI LAB
   ============================================================ */
.case-flag {
  display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
  gap: clamp(44px, 6vw, 96px);
  align-items: center;
  margin-bottom: clamp(90px, 12vw, 150px);
}

.case-media { position: relative; display: grid; place-items: center; padding-block: 30px; }

.phone {
  position: relative; width: min(300px, 74vw);
  padding: 11px;
  background: #17120E;
  border: 1px solid rgba(244, 237, 227, .14);
  border-radius: 50px;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, .8),
    0 0 90px -20px rgba(255, 90, 40, .28),
    inset 0 0 0 1px rgba(0, 0, 0, .6);
}
.phone-notch {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 88px; height: 25px; background: #17120E; border-radius: 0 0 16px 16px;
  z-index: 2;
}
.phone-video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 40px; background: #000; }

.still {
  position: absolute; padding: 7px;
  background: #17120E; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .7);
}
.still img { border-radius: 7px; }
.still-a { width: 128px; right: -6%; top: 2%; transform: rotate(6deg); }
.still-b { width: 148px; left: -8%; bottom: 3%; transform: rotate(-7deg); }

.case-copy { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.case-title {
  font-weight: 430; font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  line-height: 1.06; letter-spacing: -.01em; text-wrap: balance;
}
.case-lead { font-size: 1.13rem; line-height: 1.6; }
.case-copy > p:not(.case-lead):not(.eyebrow) { color: var(--muted); max-width: 60ch; }

.case-metrics {
  display: grid; grid-template-columns: repeat(3, auto);
  gap: clamp(24px, 3.5vw, 52px);
  padding-block: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.metric { display: flex; flex-direction: column; gap: 6px; }
.metric-num {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 500;
  font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0;
}
.metric-label { color: var(--muted); font-size: .8rem; line-height: 1.45; max-width: 18ch; }

/* --- secondary cases --- */
.case-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(64px, 8vw, 110px) clamp(40px, 5vw, 72px);
}
.mini-case { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.mini-case > .eyebrow { margin-top: 10px; }
.mini-title {
  font-weight: 440; font-size: clamp(1.4rem, 2.3vw, 1.75rem);
  line-height: 1.18; letter-spacing: -.005em; text-wrap: balance;
}
.mini-case > p:not(.eyebrow) { color: var(--muted); max-width: 55ch; font-size: .98rem; }

/* case hover micro-interactions (fine pointers) */
@media (pointer: fine) {
  .mini-case .browser, .mini-case .boards, .mini-case .spec, .mini-case .teach {
    transition: transform .5s cubic-bezier(.22,.9,.3,1), box-shadow .5s ease;
  }
  .mini-case:hover .browser, .mini-case:hover .boards, .mini-case:hover .spec, .mini-case:hover .teach {
    transform: translateY(-6px);
  }
  .browser img { transition: transform 1.2s cubic-bezier(.22,.9,.3,1); }
  .mini-case:hover .browser img { transform: scale(1.025); }
  .mini-case .mini-title { transition: color .35s ease; }
  .mini-case:hover .mini-title { color: var(--accent-2); }
  .case-media { perspective: 900px; }
  .phone { will-change: transform; }
}

/* browser mockup */
.browser {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: #17120E;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75);
}
.browser-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.browser-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(244, 237, 227, .16); }
.browser-bar .dot:first-child { background: rgba(255, 90, 40, .6); }
.browser-url {
  margin-left: 12px; color: var(--muted); font-size: .62rem; letter-spacing: .08em;
  text-transform: lowercase;
}

/* signage boards */
.boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.board {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #000;
  box-shadow: 0 24px 50px -26px rgba(0, 0, 0, .8);
}
.board video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }

/* cleo spec card */
.spec {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 26px 22px;
  display: flex; flex-direction: column; gap: 13px;
  text-transform: none; letter-spacing: .04em; font-size: .78rem;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75);
}
.spec p { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px dashed rgba(244, 237, 227, .08); padding-bottom: 12px; }
.spec p:last-child { border-bottom: none; padding-bottom: 0; }
.spec-key { color: var(--muted); }
.spec-val { color: var(--ink); text-align: right; }
.spec-hot { color: var(--accent-2); }
.blink { animation: blink 1.1s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* teaching card */
.teach {
  width: 100%; aspect-ratio: 16 / 7.2;
  border: 1px solid var(--line); border-radius: 14px;
  background:
    radial-gradient(90% 130% at 85% -20%, rgba(255, 176, 58, .16), transparent 60%),
    var(--card);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 6px; padding: 26px 30px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75);
}
.teach-num {
  font-size: clamp(3rem, 6vw, 4.6rem); font-weight: 460; line-height: 1;
  background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.teach-caption { color: var(--muted); font-size: .62rem; }

/* ============================================================
   BENTO — botones-proyecto (cada uno abre su página dedicada)
   ============================================================ */
.bento {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.2vw, 26px);
}
.proj-btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  padding: clamp(20px, 2.6vw, 30px);
  transition: transform .55s cubic-bezier(.22,.9,.3,1), border-color .4s ease, box-shadow .55s ease;
}
.proj-big { grid-column: 1 / -1; min-height: clamp(380px, 56vh, 520px); }

.proj-media {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.22,.9,.3,1), opacity .5s ease;
  opacity: .58;
}
.proj-scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(8, 6, 5, .92) 8%, rgba(8, 6, 5, .35) 52%, rgba(8, 6, 5, .15));
  transition: opacity .5s ease;
}
.proj-abstract {
  position: absolute; inset: 0; z-index: -2;
  display: grid; place-items: start end;
  padding: 54px 30px 0 0;
  background: radial-gradient(120% 130% at 80% -10%, rgba(255, 122, 26, .16), transparent 58%), var(--card);
}
.proj-abstract .big-word {
  font-size: clamp(3.6rem, 7vw, 6rem); font-weight: 460; line-height: 1;
  background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: .55;
  transition: transform .8s cubic-bezier(.22,.9,.3,1), opacity .5s ease;
}
.proj-btn:hover .proj-abstract .big-word { opacity: .8; }

.proj-top { position: absolute; top: clamp(18px, 2.4vw, 26px); left: clamp(20px, 2.6vw, 30px); }
.proj-info { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 56ch; }
.proj-title {
  font-weight: 440; font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1.12; letter-spacing: -.005em; text-wrap: balance;
  transition: color .35s ease;
}
.proj-big .proj-title { font-size: clamp(1.9rem, 3.6vw, 3rem); }
.proj-line { color: var(--muted); font-size: .96rem; max-width: 52ch; }
.proj-go {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; color: var(--accent-2);
  transition: gap .35s ease;
}
.proj-go::after { content: "→"; transition: transform .35s ease; }

@media (pointer: fine) {
  .proj-btn:hover {
    transform: translateY(-7px);
    border-color: rgba(255, 122, 26, .45);
    box-shadow: 0 34px 80px -34px rgba(0, 0, 0, .85), 0 0 60px -24px rgba(255, 90, 40, .5);
  }
  .proj-btn:hover .proj-media { transform: scale(1.05); opacity: .72; }
  .proj-btn:hover .proj-scrim { opacity: .85; }
  .proj-btn:hover .proj-title { color: var(--accent-2); }
  .proj-btn:hover .proj-go { gap: 13px; }
  .proj-btn:hover .proj-go::after { transform: translateX(3px); }
  .proj-btn:hover .proj-abstract .big-word { transform: scale(1.05); }
}
.proj-btn:focus-visible { border-color: var(--accent-2); }

/* botón ancho de trayectoria */
.career-btn { min-height: 240px; grid-column: 1 / -1; }
.career-btn .chips { margin-top: 14px; }

@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr; }
  .proj-btn { min-height: 300px; }
}

/* ============================================================
   SUBPÁGINAS (proyectos/ + trayectoria)
   ============================================================ */
.pg-hero { padding-top: clamp(150px, 22vh, 220px); padding-bottom: clamp(50px, 7vh, 90px); }
.pg-hero .container { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.pg-title {
  font-family: var(--serif); font-weight: 420;
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.02; letter-spacing: -.012em; text-wrap: balance;
  max-width: 16ch;
}
.pg-lead { font-size: clamp(1.08rem, 1.7vw, 1.32rem); line-height: 1.6; max-width: 54ch; }

.pg-media { padding-block: clamp(30px, 5vh, 70px); }
.pg-body { padding-block: clamp(40px, 6vh, 80px); }
.pg-body .container { display: flex; flex-direction: column; gap: clamp(44px, 6vh, 70px); }
.pg-block { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); }
.pg-block > h2 { color: var(--accent-2); padding-top: 6px; }
.pg-block > div { display: flex; flex-direction: column; gap: 16px; }
.pg-block p { color: var(--muted); max-width: 62ch; }
.pg-block p strong { color: var(--ink); font-weight: 500; }
@media (max-width: 700px) { .pg-block { grid-template-columns: 1fr; gap: 12px; } }

.agent-list { display: flex; flex-direction: column; }
.agent-list li {
  display: grid; grid-template-columns: minmax(110px, 170px) 1fr; gap: 18px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: .95rem; color: var(--muted);
}
.agent-list li:first-child { border-top: 1px solid var(--line); }
.agent-list .agent-name { color: var(--accent-2); font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; padding-top: 4px; }

.pg-next { padding-block: clamp(64px, 9vh, 100px) 0; border-top: 1px solid var(--line); }
.pg-next .container { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.pg-next-title {
  font-family: var(--serif); font-weight: 430;
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.1;
  transition: color .35s ease;
}
.pg-next a:hover .pg-next-title { color: var(--accent-2); }

/* player de audio (página de música) */
.player {
  display: flex; align-items: center; gap: 20px;
  width: 100%; max-width: 620px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 14px 26px 14px 14px;
  background: var(--card);
}
.player-btn {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255, 122, 26, .5);
  display: grid; place-items: center;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.player-btn:hover { border-color: var(--accent-2); box-shadow: 0 0 24px -6px rgba(255, 122, 26, .6); }
.player-btn .ico { width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent var(--accent-2); margin-left: 3px; }
.player.is-playing .player-btn .ico { border: none; width: 12px; height: 15px; margin: 0; border-left: 4px solid var(--accent-2); border-right: 4px solid var(--accent-2); }
.player-track { flex: 1; height: 22px; display: flex; align-items: center; cursor: pointer; }
.player-track::before { content: ""; display: none; }
.player-rail { position: relative; width: 100%; height: 2px; background: rgba(244, 237, 227, .14); border-radius: 2px; overflow: hidden; }
.player-fill { position: absolute; inset: 0; background: var(--fire); transform: scaleX(0); transform-origin: 0 50%; }
.player-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .64rem; letter-spacing: .1em; text-transform: none; }

.disc {
  width: min(300px, 62vw); aspect-ratio: 1; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #100C09 0 3px, #14100D 3px 6px),
    #100C09;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 60px -20px rgba(255, 90, 40, .35);
  position: relative;
  display: grid; place-items: center;
}
.disc-label {
  width: 46%; height: 46%; border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 176, 58, .55);
}
.disc::after {
  content: ""; position: absolute; inset: 48.6%;
  border-radius: 50%;
  background: #0B0908;
  border: 1px solid rgba(255, 176, 58, .5);
}
.disc.is-spinning { animation: spin 3.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   CAPABILITIES (viven dentro de "Quién soy")
   ============================================================ */
.about-skills {
  margin-top: clamp(48px, 6vh, 76px);
  padding-top: clamp(34px, 5vh, 52px);
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: clamp(24px, 3.5vh, 38px);
}
.skills-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(44px, 6vw, 96px);
}
.skill-head {
  color: var(--accent-2); padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.skill-list li {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex; gap: 14px; align-items: baseline;
  font-size: .99rem;
  transition: color .3s ease, padding-left .3s ease;
}
.skill-list li::before { content: "—"; color: var(--accent); flex-shrink: 0; }
.skill-list li:hover { color: var(--ink); padding-left: 6px; }

.marquee { border-block: 1px solid var(--line); padding: 20px 0; overflow: hidden; }
.contact .marquee { margin-top: clamp(60px, 9vh, 100px); }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track {
  display: inline-flex; gap: 44px; width: max-content;
  color: var(--muted); font-size: .72rem; white-space: nowrap;
  animation: marquee 36s linear infinite;
}
.marquee-track span { flex-shrink: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  min-height: 88svh; display: flex; flex-direction: column; justify-content: center;
  overflow: clip;
  padding-bottom: 0; /* el footer cierra la página — sin espacio muerto debajo */
}
.sun-contact {
  top: auto; bottom: -46vmin; right: auto; left: 50%;
  transform: translateX(-50%);
  opacity: .8;
}
.contact > .container { display: flex; flex-direction: column; gap: 30px; align-items: flex-start; }
.contact-title {
  font-weight: 420; font-size: clamp(2.5rem, 6.6vw, 5.4rem);
  line-height: 1.04; letter-spacing: -.015em;
  max-width: 17ch; text-wrap: balance;
}
.contact-sub { color: var(--muted); max-width: 44ch; font-size: 1.05rem; }

.footer { margin-top: auto; padding-top: clamp(70px, 10vh, 120px); }
.footer-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 30px;
  padding-block: 26px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .6rem; letter-spacing: .16em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .rail { display: none; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-meta { justify-self: start; }
  .profile-grid { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 380px; }
  .case-flag { grid-template-columns: 1fr; gap: 56px; }
  .still { display: none; }
  .case-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; gap: 40px; }
  .scroll-hint { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-name { display: none; }
  .hero { padding-top: 100px; }
  .hero-stats { grid-template-columns: 1fr; gap: 22px; }
  .stat { flex-direction: row; align-items: baseline; gap: 14px; }
  .stat-label { max-width: none; }
  .case-metrics { grid-template-columns: 1fr; gap: 18px; }
  .metric { flex-direction: row; align-items: baseline; gap: 14px; }
  .metric-label { max-width: none; }
  .profile-facts { grid-template-columns: 1fr; }
  .boards { gap: 8px; }
  .btn-big { padding: 17px 30px; font-size: .7rem; }
  .footer-grid { flex-direction: column; }
}

/* ============================================================
   CAPTURE MODE (?capture — full-page screenshots without svh)
   ============================================================ */
html.capture .hero { min-height: auto; padding-top: 170px; padding-bottom: 90px; }
html.capture .contact { min-height: auto; }
html.capture .section { padding-block: 140px; }
html.capture .grain { display: none; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .mark-rays, .portrait-mark, .loc-pulse, .scroll-line, .marquee-track, .blink {
    animation: none !important;
  }
}
