/* =============================================================
   Jeremy Maldonado — Portafolio
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografía
   5. Componentes · 6. Secciones · 7. Efectos · 8. Responsive
   9. Reduced-motion
   ============================================================= */

/* =============================================================
   0. TIPOGRAFÍAS (alojadas en el propio sitio — sin depender de Google)
   ============================================================= */
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* =============================================================
   1. TOKENS
   ============================================================= */
:root {
  /* superficies */
  --ink:        #08090c;
  --ink-2:      #0b0d12;
  --surface:    #10131a;
  --surface-2:  #151924;
  --line:       rgba(255, 255, 255, .085);
  --line-2:     rgba(255, 255, 255, .14);

  /* texto */
  --text:       #e9ebf1;
  --text-2:     #a7adbd;
  --muted:      #767d8f;

  /* señal */
  --accent:     #ff7a45;
  --accent-2:   #ffa06b;
  --accent-dim: rgba(255, 122, 69, .13);
  --accent-line:rgba(255, 122, 69, .36);
  --live:       #3ddc97;

  /* tipografía */
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* easings */
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --ease-soft:   cubic-bezier(.25, .46, .45, .94);
  --ease-bounce: cubic-bezier(.34, 1.4, .64, 1);

  /* métrica */
  --wrap: 1240px;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --nav-h: 68px;
  --r: 14px;
}

/* =============================================================
   2. RESET & BASE
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

/* el reset de margin anula el display:none nativo del atributo hidden */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; }

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

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

/* =============================================================
   3. UTILIDADES
   ============================================================= */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .65rem 1.1rem; border-radius: 8px;
  background: var(--accent); color: #140a05; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* barra de progreso de scroll */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120;
  background: transparent; pointer-events: none;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent-line);
}

/* grano sutil sobre todo */
.grain {
  position: fixed; inset: 0; z-index: 110; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* =============================================================
   4. TIPOGRAFÍA DE SECCIÓN
   ============================================================= */
.sec-n {
  font-family: var(--mono);
  font-size: .745rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.15rem;
}

.sec-title {
  font-size: clamp(1.85rem, 4.1vw, 3.05rem);
  max-width: 20ch;
  margin-bottom: 1.1rem;
}

.sec-lead {
  color: var(--text-2);
  font-size: clamp(.98rem, 1.25vw, 1.08rem);
  max-width: 62ch;
}

.sec-head { margin-bottom: clamp(2.2rem, 4vw, 3.4rem); }

/* =============================================================
   5. COMPONENTES
   ============================================================= */

/* ---- botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .82rem 1.35rem;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 600; font-size: .93rem;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background .32s var(--ease-out), color .32s var(--ease-out),
              border-color .32s var(--ease-out), transform .3s var(--ease-out),
              box-shadow .35s var(--ease-out);
  will-change: transform;
}
.btn--sm { padding: .55rem 1rem; font-size: .85rem; border-radius: 8px; }

.btn--primary {
  background: var(--accent); color: #150a04;
  box-shadow: 0 0 0 0 var(--accent-line);
}
.btn--primary:hover {
  background: var(--accent-2);
  box-shadow: 0 10px 34px -10px var(--accent-line);
}

.btn--ghost {
  border: 1px solid var(--line-2);
  color: var(--text);
  background: rgba(255, 255, 255, .02);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.btn svg { flex: none; transition: transform .35s var(--ease-out); }
.btn:hover svg { transform: translateY(2px); }

/* ---- topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1.5rem;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease-out), background .4s var(--ease-out);
}
@supports (backdrop-filter: blur(16px)) {
  .topbar { background: color-mix(in srgb, var(--ink) 62%, transparent); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); }
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.brand { display: flex; align-items: center; gap: .7rem; flex: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--display); font-weight: 700; font-size: .78rem;
  letter-spacing: .02em;
  transition: background .3s var(--ease-out), transform .4s var(--ease-bounce);
}
.brand:hover .brand-mark { background: var(--accent); color: #150a04; transform: rotate(-6deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--display); font-size: .9rem; font-weight: 600; letter-spacing: -.015em; }
.brand-text small { font-family: var(--mono); font-size: .66rem; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; gap: .35rem; margin-left: auto; }
.nav a {
  position: relative;
  padding: .45rem .8rem; border-radius: 8px;
  font-size: .88rem; color: var(--text-2);
  transition: color .28s var(--ease-out), background .28s var(--ease-out);
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.nav a.is-current { color: var(--accent); }
.nav a.is-current::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .18rem;
  height: 1px; background: var(--accent);
}

.topbar-right { display: flex; align-items: center; gap: .9rem; flex: none; }

.status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .72rem;
  color: var(--text-2); letter-spacing: .01em;
  padding: .36rem .7rem; border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, .55);
  animation: pulse 2.4s var(--ease-soft) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 151, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.burger { display: none; width: 40px; height: 40px; place-items: center; border-radius: 9px; border: 1px solid var(--line); }
.burger span { display: block; width: 17px; height: 1.6px; background: var(--text); border-radius: 2px; transition: transform .35s var(--ease-out), opacity .25s; }
.burger span + span { margin-top: 5px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.3px) rotate(-45deg); }

.mobile-menu {
  position: sticky; top: var(--nav-h); z-index: 99;
  display: flex; flex-direction: column;
  padding: .6rem var(--gutter) 1.1rem;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a {
  padding: .78rem .2rem;
  font-family: var(--display); font-size: 1.02rem; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; color: var(--accent); }

/* =============================================================
   6. SECCIONES
   ============================================================= */

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex; align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero-glow {
  position: absolute; inset: -40% -20% 20% -20%;
  background: radial-gradient(42% 46% at 22% 44%, rgba(255, 122, 69, .17), transparent 72%);
  filter: blur(90px); pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid; gap: clamp(2.4rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  align-items: center;
}

.kicker {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 1.25rem;
}
.kicker-line { width: 34px; height: 1px; background: var(--accent); flex: none; }

.hero-title {
  font-size: clamp(2.05rem, 5vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  max-width: 20ch;
  margin-bottom: 1.3rem;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero-title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em;
  height: .055em; background: var(--accent-line); border-radius: 2px;
}

.hero-lead {
  color: var(--text-2);
  font-size: clamp(.98rem, 1.3vw, 1.07rem);
  max-width: 52ch; margin-bottom: 1.8rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2.3rem; }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(1.6rem, 4vw, 3.2rem); }
.hero-stats li { display: flex; flex-direction: column; gap: .2rem; }
.hero-stats strong {
  font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600; letter-spacing: -.03em; line-height: 1;
}
.hero-stats span { font-family: var(--mono); font-size: .71rem; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }

/* panel tipo editor */
.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  box-shadow: 0 30px 80px -40px #000, inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .72rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .018);
}
.panel-dots { display: flex; gap: .4rem; }
.panel-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: block; }
.panel-dots i:first-child { background: rgba(255, 122, 69, .55); }
.panel-file { font-family: var(--mono); font-size: .73rem; color: var(--muted); }

.panel-body {
  margin: 0; padding: 1.15rem 1.25rem;
  font-family: var(--mono); font-size: .795rem; line-height: 1.95;
  color: var(--text-2);
  overflow-x: auto;
}
.panel-body code { font-family: inherit; }
.c-p  { color: #8ab4ff; }
.c-s  { color: var(--accent-2); }
.c-ok { color: var(--live); }

.panel-foot {
  display: flex; flex-wrap: wrap; gap: 1.1rem;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--line);
}
.panel-foot a {
  font-family: var(--mono); font-size: .74rem; color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.panel-foot a:hover { color: var(--accent); border-bottom-color: var(--accent-line); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; z-index: 2;
  transform: translateX(-50%);
  width: 24px; height: 38px; border-radius: 99px;
  border: 1px solid var(--line-2);
  display: grid; place-items: start center; padding-top: 7px;
}
.scroll-cue span { width: 3px; height: 7px; border-radius: 2px; background: var(--accent); animation: cue 1.9s var(--ease-soft) infinite; }
@keyframes cue { 0%,100% { transform: translateY(0); opacity: 1; } 55% { transform: translateY(11px); opacity: .15; } }

/* ---------- secciones genéricas ---------- */
.section { padding: clamp(4.5rem, 9vw, 8rem) 0; position: relative; }
.section--alt { background: var(--ink-2); border-block: 1px solid var(--line); }

/* ---------- FILTROS ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-bottom: 2rem;
}
.filter {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .52rem 1rem; border-radius: 99px;
  border: 1px solid var(--line);
  font-size: .87rem; color: var(--text-2);
  transition: color .28s var(--ease-out), border-color .28s var(--ease-out), background .28s var(--ease-out);
}
.filter i { font-style: normal; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.filter:hover { color: var(--text); border-color: var(--line-2); }
.filter.is-active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.filter.is-active i { color: var(--accent); }

.filter-note {
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
  margin-left: .4rem;
}
.filter-note button { color: var(--accent); border-bottom: 1px solid var(--accent-line); }

/* ---------- GRID DE PROYECTOS ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 1.8vw, 1.4rem);
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .4s var(--ease-out), transform .45s var(--ease-out),
              box-shadow .45s var(--ease-out), opacity .4s var(--ease-out);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0;
  background: radial-gradient(360px 220px at var(--mx, 50%) var(--my, 0%), rgba(255, 122, 69, .11), transparent 70%);
  transition: opacity .4s var(--ease-out);
}
.card:hover { border-color: var(--accent-line); transform: translateY(-4px); box-shadow: 0 26px 56px -34px #000; }
.card:hover::after { opacity: 1; }
.card.is-dim { opacity: .28; filter: saturate(.3); }
.card.is-hidden { display: none; }

/* marcador de captura pendiente — placeholder intencional */
.shot {
  position: relative;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 60%),
    repeating-linear-gradient(0deg,  rgba(255, 255, 255, .035) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 34px),
    var(--ink-2);
  display: grid; place-items: center;
  overflow: hidden;
}
.shot::before {
  content: ""; position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 69, .2), transparent 68%);
  filter: blur(34px);
  transition: transform .9s var(--ease-out), opacity .6s var(--ease-out);
  opacity: .75;
}
.shot[data-motif="1"]::before { top: -18%; left: -8%; }
.shot[data-motif="2"]::before { bottom: -22%; right: -6%; }
.shot[data-motif="3"]::before { top: -20%; right: -10%; }
.shot[data-motif="4"]::before { bottom: -18%; left: -10%; }
.shot[data-motif="5"]::before { top: 8%; left: 42%; }
.shot[data-motif="6"]::before { bottom: -24%; left: 34%; }
.shot[data-motif="7"]::before { top: -16%; left: 36%; }
.shot[data-motif="8"]::before { bottom: -14%; right: 30%; }
.shot[data-motif="9"]::before { top: 14%; right: -6%; }
.card:hover .shot::before { transform: scale(1.22); opacity: 1; }

.shot-n {
  position: relative; z-index: 1;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(3.4rem, 8vw, 5.2rem);
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .13);
  transition: -webkit-text-stroke-color .45s var(--ease-out);
}
.card:hover .shot-n { -webkit-text-stroke-color: var(--accent-line); }

/* tarjeta con captura real */
.shot--img { display: block; background: var(--ink-2); }
.shot--img img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform .7s var(--ease-out), opacity .4s var(--ease-out);
  opacity: .88;
}
.card:hover .shot--img img { transform: scale(1.035); opacity: 1; }

.shot-tag {
  position: absolute; z-index: 1; left: .75rem; bottom: .7rem;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding: .26rem .55rem; border-radius: 6px;
  border: 1px dashed var(--line-2);
  background: rgba(8, 9, 12, .55);
}

.card-body { padding: 1.35rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }

.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .85rem; }

.badge {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .07em;
  text-transform: uppercase; padding: .28rem .56rem; border-radius: 6px;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.badge--live  { color: var(--live); border-color: rgba(61, 220, 151, .4); background: rgba(61, 220, 151, .08); }
.badge--demo  { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.badge--study { color: var(--text-2); }
.badge--uni   { color: var(--muted); }

.card-period { font-family: var(--mono); font-size: .68rem; color: var(--muted); }

.card-title { font-size: 1.22rem; letter-spacing: -.022em; margin-bottom: .3rem; }
.card-open { text-align: left; }
.card-open::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.card-open:hover { color: var(--accent); }
.card-open:focus-visible { outline-offset: 5px; }

.card-sub { font-family: var(--mono); font-size: .73rem; color: var(--accent); margin-bottom: .8rem; letter-spacing: .01em; }
.card-sum { color: var(--text-2); font-size: .935rem; margin-bottom: 1.05rem; }

.chips { display: flex; flex-wrap: wrap; gap: .38rem; margin-bottom: 1.05rem; }
.chips li {
  font-family: var(--mono); font-size: .68rem;
  padding: .26rem .54rem; border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--text-2);
  transition: border-color .3s var(--ease-out), color .3s var(--ease-out);
}
.card:hover .chips li { border-color: var(--line-2); }
.chips .chip-pending { border-style: dashed; color: var(--muted); background: none; }

.card-result {
  margin-top: auto; padding-top: .9rem;
  border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--text-2);
}
.card-result b { color: var(--text); font-weight: 600; }

.grid-foot {
  margin-top: 2rem; text-align: center;
  color: var(--text-2); font-size: .93rem;
}
.grid-foot a { color: var(--accent); border-bottom: 1px solid var(--accent-line); }
.grid-foot a:hover { color: var(--accent-2); }

/* ---------- STACK ---------- */
.stack { display: grid; gap: clamp(1.6rem, 3vw, 2.4rem); grid-template-columns: 1fr; }
.stack-group h3 {
  font-family: var(--mono); font-size: .73rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding-bottom: .7rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.stack-group ul { display: flex; flex-wrap: wrap; gap: .45rem; }
.stack-group button {
  padding: .5rem .85rem; border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  font-size: .87rem; color: var(--text-2);
  transition: color .3s var(--ease-out), border-color .3s var(--ease-out),
              background .3s var(--ease-out), transform .3s var(--ease-out);
}
.stack-group button:hover {
  color: var(--accent); border-color: var(--accent-line);
  background: var(--accent-dim); transform: translateY(-2px);
}
.stack-group button.is-on { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

/* ---------- TIMELINE ---------- */
.timeline { position: relative; display: grid; gap: clamp(1.6rem, 3vw, 2.4rem); }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}
.timeline::after {
  content: ""; position: absolute; left: 7px; top: 8px;
  width: 1px; height: var(--tl, 0%);
  background: linear-gradient(180deg, var(--accent), var(--accent-line));
  transition: height .25s linear;
}
.tl-item { position: relative; display: grid; gap: .5rem; padding-left: 2.4rem; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: .42rem;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--ink);
  transition: border-color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.tl-item.is-revealed::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.tl-year {
  font-family: var(--mono); font-size: .73rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.tl-body h3 { font-size: 1.18rem; margin-bottom: .18rem; }
.tl-place { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-bottom: .5rem; }
.tl-body p { color: var(--text-2); font-size: .94rem; max-width: 62ch; }

/* ---------- SOBRE MÍ ---------- */
.about { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: 1fr; align-items: start; }
.about-photo { position: relative; }
.about-photo img {
  width: 100%; border-radius: var(--r);
  border: 1px solid var(--line);
  /* el retrato ya es casi monocromo: se baja un punto para que no deslumbre
     sobre el fondo oscuro, y vuelve a su brillo real al pasar el cursor */
  filter: brightness(.94) contrast(1.03);
  transition: filter .6s var(--ease-out);
}
.about-photo:hover img { filter: brightness(1) contrast(1); }
.about-photo figcaption {
  margin-top: .7rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.about-text p { color: var(--text-2); margin-bottom: 1rem; max-width: 58ch; }
.about-text .sec-title { margin-bottom: 1.4rem; }
.about-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }

/* ---------- CONTACTO ---------- */
.contact { text-align: center; }
.contact-title { margin: .4rem 0 1.2rem; }
.contact-title a {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: clamp(2.6rem, 10vw, 6.4rem);
  letter-spacing: -.045em;
  transition: color .35s var(--ease-out);
}
.contact-title a:hover { color: var(--accent); }
.contact-title svg { width: clamp(26px, 5vw, 46px); height: auto; transition: transform .4s var(--ease-bounce); }
.contact-title a:hover svg { transform: translate(5px, -5px); }

.contact-lead { color: var(--text-2); max-width: 54ch; margin: 0 auto 2.6rem; }

.contact-list {
  display: grid; gap: .2rem;
  max-width: 640px; margin-inline: auto; text-align: left;
}
.contact-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1rem .2rem;
  border-bottom: 1px solid var(--line);
}
.contact-list span {
  font-family: var(--mono); font-size: .71rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); flex: none;
}
.contact-list a {
  font-size: .97rem; text-align: right; word-break: break-word;
  border-bottom: 1px solid transparent;
  transition: color .28s var(--ease-out), border-color .28s var(--ease-out);
}
.contact-list a:hover { color: var(--accent); border-bottom-color: var(--accent-line); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 2rem 0; background: var(--ink-2); }
.footer-in { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.footer p { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.to-top {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .74rem; color: var(--text-2);
  transition: color .28s var(--ease-out);
}
.to-top:hover { color: var(--accent); }
.to-top svg { transition: transform .35s var(--ease-out); }
.to-top:hover svg { transform: translateY(-3px); }

/* ---------- MODAL ---------- */
.modal {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(86vh, 900px);
  margin: auto;                 /* el reset de margin mataba el centrado nativo */
  padding: 0; border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 50px 120px -40px #000;
}
.modal::backdrop { background: rgba(4, 5, 7, .78); backdrop-filter: blur(5px); }
.modal[open] { animation: modalIn .38s var(--ease-out); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.modal-close {
  position: absolute; top: .8rem; right: .8rem; z-index: 5;
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line);
  background: rgba(8, 9, 12, .7); color: var(--text-2);
  transition: color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.modal-close:hover { color: var(--accent); border-color: var(--accent-line); }

.modal-body { overflow-y: auto; max-height: min(86vh, 900px); padding: 2rem clamp(1.3rem, 4vw, 2.4rem) 2.2rem; }

.m-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.m-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .35rem; }
.m-sub { font-family: var(--mono); font-size: .8rem; color: var(--accent); margin-bottom: 1.6rem; }

.m-shot {
  aspect-ratio: 16 / 6.5;
  border: 1px dashed var(--line-2); border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .35rem;
  background:
    repeating-linear-gradient(0deg,  rgba(255, 255, 255, .03) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 30px),
    var(--ink-2);
  margin-bottom: 1.8rem;
  text-align: center; padding: 1rem;
}
.m-shot b { font-family: var(--display); font-size: .95rem; color: var(--text-2); font-weight: 500; }
.m-shot small { font-family: var(--mono); font-size: .7rem; color: var(--muted); }

/* galería del caso de estudio */
.m-gal { margin: 0 0 1.8rem; }
/* en el modal se ve la captura completa, sin recortar */
.m-gal-main {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--ink-2);
}
.m-gal-thumbs {
  display: flex; gap: .5rem; margin-top: .55rem;
  overflow-x: auto; overflow-y: visible;
  padding-bottom: .25rem;
  scrollbar-width: thin;
}
.m-thumb {
  flex: 0 0 92px; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: 7px;
  overflow: hidden; opacity: .5;
  transition: opacity .3s var(--ease-out), border-color .3s var(--ease-out);
}
.m-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.m-thumb:hover { opacity: .85; }
.m-thumb.is-on { opacity: 1; border-color: var(--accent); }
.m-gal figcaption {
  margin-top: .6rem;
  font-family: var(--mono); font-size: .71rem;
  color: var(--muted); letter-spacing: .01em;
}

.m-block { margin-bottom: 1.5rem; }
.m-block h4, .m-result h4 {
  font-family: var(--mono); font-size: .71rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .55rem;
}
.m-block p { color: var(--text-2); font-size: .96rem; }

.m-result {
  padding: 1rem 1.15rem; border-radius: 10px;
  border: 1px solid var(--accent-line); background: var(--accent-dim);
  margin-bottom: 1.6rem;
}
.m-result h4 { color: var(--accent); }
.m-result p { color: var(--text); }

.m-stack { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.m-stack li {
  font-family: var(--mono); font-size: .72rem;
  padding: .3rem .6rem; border-radius: 7px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025); color: var(--text-2);
}

.m-note {
  font-size: .86rem; color: var(--muted);
  padding-top: 1.1rem; border-top: 1px solid var(--line);
}
.m-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }

/* =============================================================
   7. EFECTOS (reveal)
   ============================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* =============================================================
   8. RESPONSIVE
   ============================================================= */
@media (min-width: 540px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stack { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .contact-list { gap: .4rem; }
}

@media (min-width: 960px) {
  .hero-inner { grid-template-columns: 1.25fr .85fr; gap: clamp(2.5rem, 5vw, 4.5rem); }
  .about { grid-template-columns: .8fr 1.2fr; gap: clamp(2.5rem, 5vw, 4.5rem); }
  .about-photo { position: sticky; top: calc(var(--nav-h) + 2.5rem); }
  .stack { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- móvil / tablet: ocultar nav de escritorio ---- */
@media (max-width: 959px) {
  .nav { display: none; }
  .status { display: none; }
  .burger { display: grid; margin-left: auto; }
  .topbar-right { display: none; }
  .brand-text small { display: none; }
}
@media (min-width: 960px) {
  .mobile-menu { display: none !important; }
}

@media (max-width: 539px) {
  .hero-stats { gap: 1.4rem; }
  .hero-stats li { min-width: 42%; }
  .contact-list li { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .contact-list a { text-align: left; }
  .card-period { display: none; }
}

/* =============================================================
   9. REDUCED-MOTION — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot { animation: none; }
  .scroll-cue span { animation: none; }
  .hero-canvas { display: none; }
}
