/* =========================================================
   Daniel Mateos García · CV
   Estética tecnológica oscura, acento cian/menta + cálido
   ========================================================= */

:root {
  --bg: #06080c;
  --bg-2: #0b0f16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf4;
  --muted: #8a94a6;
  --accent: #3cf0c5;
  --accent-2: #4d8dff;
  --warm: #ff6b3d;
  --warm-2: #ffb547;
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::selection { background: var(--accent); color: var(--bg); }

.mono { font-family: var(--mono); }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.gradient-text {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 60%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
.gradient-text--warm { background-image: linear-gradient(100deg, var(--warm) 0%, var(--warm-2) 60%, var(--warm) 100%); }
@keyframes shine { to { background-position: 200% center; } }

.eyebrow { color: var(--accent); font-size: .82rem; letter-spacing: .08em; margin-bottom: 14px; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
/* Sin JavaScript: el loader se anima y desaparece solo con CSS */
html:not(.js) .loader { animation: loaderOut .6s ease 1.6s forwards; }
.js .loader { animation: loaderOut .6s ease 5s forwards; } /* salida de seguridad */
html:not(.js) .loader__bar span { animation: loaderFill 1.5s ease forwards; }
html:not(.js) .loader__pct { display: none; }
@keyframes loaderFill { to { width: 100%; } }
@keyframes loaderOut { to { opacity: 0; visibility: hidden; } }
.loader__inner { display: grid; gap: 16px; justify-items: center; }
.loader__code { font-family: var(--mono); font-size: 2rem; color: var(--accent); letter-spacing: .1em; }
.loader__bar { width: 200px; height: 2px; background: var(--border); overflow: hidden; border-radius: 2px; }
.loader__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.loader__pct { font-size: .75rem; color: var(--muted); }

/* ---------- Fondo y efectos ---------- */
.bg-net { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: .55; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(800px 500px at 85% -10%, rgba(77, 141, 255, .12), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(60, 240, 197, .08), transparent 60%);
}
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: -1; pointer-events: none;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(60, 240, 197, .09), transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
}
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- Animaciones de entrada ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px max(24px, calc((100vw - var(--max)) / 2 + 24px));
  transition: padding .4s var(--ease), background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(6, 8, 12, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-color: var(--border);
}
.nav__logo { font-weight: 500; font-size: 1.1rem; letter-spacing: .12em; }
.blink { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav__links { display: flex; gap: 6px; align-items: center; }
.nav__links a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: .92rem; color: var(--muted);
  transition: color .3s, background .3s;
}
.nav__links a[data-num]::before {
  content: attr(data-num); font-family: var(--mono); font-size: .65rem;
  color: var(--accent); margin-right: 6px; opacity: .7;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__cta { border: 1px solid var(--border-strong); color: var(--text) !important; margin-left: 8px; }
.nav__cta:hover { border-color: var(--accent); }
.nav__burger { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav__burger span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); transition: transform .35s var(--ease), top .35s; }
.nav__burger span:first-child { top: 15px; }
.nav__burger span:last-child { top: 23px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 500; font-size: .95rem;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s, border-color .3s;
  will-change: transform;
}
.btn--primary { background: var(--accent); color: #04130f; box-shadow: 0 0 0 0 rgba(60, 240, 197, .5); }
.btn--primary:hover { box-shadow: 0 10px 40px -8px rgba(60, 240, 197, .6); }
.btn--ghost { border: 1px solid var(--border-strong); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--lg { padding: 17px 32px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 130px 0 110px; position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }
.hero__title { font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: .98; letter-spacing: -.035em; font-weight: 700; margin-bottom: 22px; }
.hero__role { font-size: clamp(.95rem, 1.6vw, 1.15rem); color: var(--text); margin-bottom: 22px; min-height: 1.6em; }
.prompt { color: var(--accent); }
.caret { display: inline-block; width: 9px; height: 1.1em; vertical-align: -3px; background: var(--accent); margin-left: 3px; animation: blink 1s steps(1) infinite; }
.hero__lead { color: var(--muted); font-size: 1.1rem; max-width: 520px; margin-bottom: 34px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__visual { display: flex; justify-content: center; perspective: 1000px; }
.portrait {
  position: relative; width: min(100%, 400px); aspect-ratio: 3 / 4;
  border-radius: 28px; overflow: visible;
  transform-style: preserve-3d; transition: transform .25s ease-out;
}
.portrait picture, .portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; }
.portrait img { filter: saturate(.9) contrast(1.05); }
.portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: 28px; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(6, 8, 12, .55));
}
.portrait__frame {
  position: absolute; inset: -14px; border-radius: 36px; pointer-events: none;
  border: 1px solid var(--border-strong);
  -webkit-mask: linear-gradient(135deg, #000 0 20%, transparent 20% 80%, #000 80%);
          mask: linear-gradient(135deg, #000 0 20%, transparent 20% 80%, #000 80%);
}
.portrait__frame::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  border: 1px solid var(--accent); opacity: .7;
}
.portrait__scan {
  position: absolute; left: 0; right: 0; top: 0; height: 30%; z-index: 2; border-radius: 28px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(60, 240, 197, .18), transparent);
  animation: scan 5s ease-in-out infinite;
}
@keyframes scan { 0%, 100% { transform: translateY(-10%); opacity: 0; } 10% { opacity: 1; } 50% { transform: translateY(250%); opacity: 1; } 60% { opacity: 0; } }

.chip {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; font-size: .78rem;
  background: rgba(11, 15, 22, .78); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: translateZ(40px);
  animation: float 6s ease-in-out infinite;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.chip--a { top: 12%; left: -14%; }
.chip--b { top: 48%; right: -16%; animation-delay: -2s; }
.chip--b .dot { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.chip--c { bottom: 10%; left: -8%; animation-delay: -4s; }
.chip--c .dot { background: var(--warm); box-shadow: 0 0 10px var(--warm); }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 80px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-2); padding: 26px 28px; display: flex; align-items: center; gap: 18px; }
.stat__num { font-size: 2.6rem; font-weight: 700; color: var(--accent); font-family: var(--mono); line-height: 1; }
.stat__label { color: var(--muted); font-size: .92rem; line-height: 1.35; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  font-size: .7rem; color: var(--muted); letter-spacing: .2em;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint span { width: 1px; height: 36px; background: linear-gradient(var(--accent), transparent); animation: drip 2s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Secciones ---------- */
.section { padding: 130px 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(11, 15, 22, .7) 15%, rgba(11, 15, 22, .7) 85%, transparent); }
.section__head { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 48px; }
.section__num {
  font-size: clamp(3.5rem, 8vw, 6rem); line-height: .85; font-weight: 500;
  color: transparent; -webkit-text-stroke: 1px var(--border-strong);
}
.section__title { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; max-width: 760px; }
.section__intro { color: var(--muted); font-size: 1.12rem; max-width: 680px; margin-bottom: 52px; }
.lead { font-size: 1.2rem; color: var(--text); margin-bottom: 18px; }

/* Profesional */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-bottom: 80px; }
.split__text p:not(.lead) { color: var(--muted); margin-bottom: 26px; }
.link-arrow { color: var(--accent); font-size: .9rem; border-bottom: 1px solid rgba(60, 240, 197, .3); padding-bottom: 3px; transition: border-color .3s; }
.link-arrow:hover { border-color: var(--accent); }

.terminal { background: #090c12; border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(60, 240, 197, .05); }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
.terminal__bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a2f3a; }
.terminal__bar i:nth-child(1) { background: #ff5f57; }
.terminal__bar i:nth-child(2) { background: #febc2e; }
.terminal__bar i:nth-child(3) { background: #28c840; }
.terminal__bar span { margin-left: auto; font-size: .75rem; color: var(--muted); }
.terminal__body { padding: 22px; font-size: .84rem; line-height: 1.8; min-height: 290px; white-space: pre-wrap; color: #c7d0dc; }
.terminal__body .t-c { color: var(--accent); }
.terminal__body .t-m { color: var(--muted); }
.terminal__body .t-ok { color: #28c840; }
.terminal__body .t-w { color: var(--warm-2); }

.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.skill-card {
  position: relative; padding: 28px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .4s, transform .4s var(--ease), background .4s;
  overflow: hidden;
}
.skill-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(60, 240, 197, .1), transparent 45%);
}
.skill-card:hover { border-color: rgba(60, 240, 197, .35); transform: translateY(-6px); }
.skill-card:hover::before { opacity: 1; }
.skill-card__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(60, 240, 197, .08); border: 1px solid rgba(60, 240, 197, .2); margin-bottom: 20px; }
.skill-card svg, .passion__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skill-card h3 { font-size: 1.12rem; margin-bottom: 10px; letter-spacing: -.01em; }
.skill-card p { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: .7rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); }

/* Editorial */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.media-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 34px 30px 30px; min-height: 260px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01));
  border: 1px solid var(--border); overflow: hidden;
  transition: transform .5s var(--ease), border-color .4s;
}
.media-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.media-card:hover { transform: translateY(-8px); border-color: var(--border-strong); }
.media-card:hover::after { transform: scaleX(1); }
.media-card__tag { font-size: .72rem; color: var(--accent); letter-spacing: .05em; }
.media-card h3 { font-size: 1.6rem; letter-spacing: -.02em; }
.media-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.media-card__go { font-size: .8rem; color: var(--muted); transition: color .3s, transform .3s; }
.media-card:hover .media-card__go { color: var(--accent); transform: translateX(4px); }

.marquee { margin-top: 70px; overflow: hidden; border-block: 1px solid var(--border); padding: 20px 0; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; gap: 32px; width: max-content; animation: marquee 32s linear infinite; font-size: 1rem; color: var(--muted); white-space: nowrap; }
.marquee__track span:nth-child(even) { color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Empresario */
.timeline { position: relative; display: grid; gap: 26px; padding-left: 38px; margin-bottom: 70px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.tl-item { position: relative; }
.tl-item__dot { position: absolute; left: -38px; top: 30px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 5px rgba(60, 240, 197, .1); }
.tl-item__card { padding: 28px 30px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .4s, background .4s; }
.tl-item__card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tl-item__role { font-size: .74rem; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.tl-item h3 { font-size: 1.5rem; margin: 6px 0 10px; letter-spacing: -.015em; }
.tl-item p { color: var(--muted); margin-bottom: 16px; max-width: 720px; }
.verified { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: .78rem; color: var(--accent); padding: 6px 12px; border-radius: 999px; background: rgba(60, 240, 197, .08); border: 1px solid rgba(60, 240, 197, .25); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pillar { background: var(--bg-2); padding: 32px 28px; }
.pillar span { color: var(--accent); font-size: .8rem; }
.pillar h4 { font-size: 1.2rem; margin: 10px 0 8px; }
.pillar p { color: var(--muted); font-size: .94rem; }

/* Personal */
.section--personal .eyebrow, .section--personal .section__num { color: var(--warm); }
.section--personal .section__num { color: transparent; -webkit-text-stroke-color: rgba(255, 107, 61, .35); }
.passions { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 18px; margin-bottom: 56px; }
.passion { padding: 30px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform .4s var(--ease), border-color .4s; }
.passion:hover { transform: translateY(-6px); border-color: rgba(255, 107, 61, .35); }
.passion__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 107, 61, .08); border: 1px solid rgba(255, 107, 61, .25); margin-bottom: 20px; }
.passion__icon svg { stroke: var(--warm); }
.passion h3 { font-size: 1.2rem; margin-bottom: 8px; }
.passion p { color: var(--muted); font-size: .94rem; }
.passion--feature { background: linear-gradient(150deg, rgba(255, 107, 61, .12), rgba(255, 181, 71, .03)); border-color: rgba(255, 107, 61, .25); }
.passion--feature h3 { font-size: 1.4rem; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 250px; grid-auto-flow: dense; gap: 14px; }
.gallery__item { position: relative; border-radius: 16px; overflow: hidden; cursor: zoom-in; background: var(--bg-2); }
.gallery__item--tall { grid-row: span 2; }
.gallery__item--wide { grid-column: span 2; }
.gallery__item picture, .gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item img { transition: transform 1.2s var(--ease), filter .8s, opacity .8s; }
.gallery__item:hover img { transform: scale(1.06); }
.gallery__item figcaption {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  font-size: .74rem; padding: 6px 12px; border-radius: 999px;
  background: rgba(6, 8, 12, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  transform: translateY(8px); opacity: 0; transition: .4s var(--ease);
}
.gallery__item:hover figcaption { transform: none; opacity: 1; }

/* Lazy load: esqueleto con brillo hasta que llega la imagen */
.lazy { position: relative; display: block; }
.js .lazy::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%) var(--bg-2);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  transition: opacity .6s;
}
.js .lazy img { opacity: 0; filter: blur(16px); transform: scale(1.04); }
.lazy.is-loaded::before { opacity: 0; animation: none; }
.lazy.is-loaded img { opacity: 1; filter: none; transform: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Contacto */
.contact { text-align: center; padding: 150px 0; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__title { font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.05; letter-spacing: -.03em; max-width: 900px; margin-bottom: 20px; }
.contact .section__intro { margin-bottom: 40px; }
.contact__actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.footer a:hover { color: var(--accent); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px;
  background: rgba(3, 5, 8, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 14px; transform: scale(.94); transition: transform .5s var(--ease); }
.lightbox.is-open img { transform: none; }
.lightbox__close { position: absolute; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.6rem; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
  .passions { grid-template-columns: 1fr 1fr; }
  .passion--feature { grid-column: span 2; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .nav__burger { display: block; z-index: 2; }
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 12px;
    background: rgba(6, 8, 12, .97); backdrop-filter: blur(14px);
    opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; }
  .nav__links a { font-size: 1.5rem; }
  .nav__cta { margin-left: 0; margin-top: 12px; }

  .hero { padding-top: 110px; }
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__visual { order: -1; }
  .portrait { width: min(72%, 320px); }
  .chip--a { left: -18%; } .chip--b { right: -22%; } .chip--c { left: -14%; }
  .hero__stats { grid-template-columns: 1fr; margin-top: 56px; }
  .scroll-hint { display: none; }

  .section { padding: 90px 0; }
  .section__head { flex-direction: column; gap: 6px; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .media-grid, .pillars { grid-template-columns: 1fr; }
  .cursor-glow { display: none; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .skills, .passions { grid-template-columns: 1fr; }
  .passion--feature { grid-column: auto; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; gap: 10px; }
  .gallery__item--wide { grid-column: span 2; }
  .gallery__item figcaption { opacity: 1; transform: none; }
  .timeline { padding-left: 28px; }
  .tl-item__dot { left: -28px; }
  .terminal__body { font-size: .74rem; padding: 16px; }
  .chip { font-size: .68rem; padding: 7px 11px; }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  html { scroll-behavior: auto; }
}
