/* ============================================================
 * ELIAN — portafolio
 * Lenguaje visual reinterpretado desde Buirend:
 * fondo #0a0a0b, dorado #d9b65f, teal #46b8a4,
 * Space Grotesk (display) · Hanken Grotesk (texto) · JetBrains Mono (labels)
 * ========================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0b;
  --surface: rgba(255,255,255,.03);
  --surface-2: rgba(255,255,255,.055);
  --ink: #f4f4f1;
  --muted: rgba(244,244,241,.6);
  --muted-2: rgba(244,244,241,.42);

  --gold: #d9b65f;
  --gold-rgb: 217,182,95;
  --teal: #46b8a4;
  --teal-rgb: 70,184,164;

  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --r-card: 22px;
  --r-item: 16px;
  --r-chip: 10px;

  --ease: cubic-bezier(.2,.8,.2,1);
  --nav-h: 64px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.5;
}
::selection { background: rgba(var(--gold-rgb), .28); color: var(--ink); }

/* ===== CAPAS DE FONDO ===== */
#bg3d {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: .9;
}
.eng-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 50% 0%, black 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, black 0%, transparent 78%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ===== UTILIDADES ===== */
.label-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Reveal on scroll (JS añade .in-view) */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease) var(--rd, 0s), transform .7s var(--ease) var(--rd, 0s);
  will-change: opacity, transform;
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
}
.nav.is-scrolled {
  background: rgba(10,10,11,.72);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.nav-inner {
  max-width: 1120px; height: 100%;
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: .04em; color: var(--ink); text-decoration: none;
}
.nav-logo-mark {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(var(--gold-rgb), .8);
}
.nav-logo-dot { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); text-decoration: none;
  padding: 8px 12px; border-radius: var(--r-chip);
  border: 1px solid transparent;
  transition: color .25s, border-color .25s, background .25s;
}
.nav-num { color: var(--gold); opacity: .75; margin-right: 6px; font-size: 10px; }
.nav-link:hover { color: var(--ink); background: var(--surface); }
.nav-link.is-active { color: var(--ink); border-color: var(--border); background: var(--surface); }
.nav-link--cta { border: 1px solid rgba(var(--gold-rgb), .35); color: var(--gold); }
.nav-link--cta:hover { background: rgba(var(--gold-rgb), .1); color: var(--gold); border-color: rgba(var(--gold-rgb), .55); }
.nav-link--cta .nav-num { opacity: 1; }
.nav-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transform-origin: 0 50%; transform: scaleX(0);
}
@media (max-width: 720px) {
  .nav-link { padding: 8px 9px; }
  .nav-link:not(.nav-link--cta) .nav-num { display: none; }
}
@media (max-width: 560px) {
  .nav-links .nav-link:not(.nav-link--cta) { display: none; }
}

/* ===== HERO ===== */
.hero {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 32px) 20px 88px;
}
.hero-inner {
  display: flex; flex-direction: column; align-items: center;
  max-width: 720px;
  will-change: transform;
}
.hero-k { color: var(--gold); margin-bottom: 26px; }
.hero-id { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 0 0 5px rgba(255,255,255,.03),
    0 0 34px rgba(var(--gold-rgb), .16);
}
.hero-t {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(56px, 12vw, 128px);
  line-height: .92; letter-spacing: -.01em;
  color: var(--ink);
  min-height: 1em;
}
.hero-role { color: var(--muted); margin-top: 20px; }
.hero-s {
  font-size: clamp(15px, 2vw, 18px); color: var(--muted);
  max-width: 480px; line-height: 1.55; margin-top: 18px;
}
.hero-s strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  text-decoration: none;
  padding: 13px 24px; border-radius: 999px;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s, border-color .3s, color .3s;
}
.btn i { font-size: 16px; transition: transform .3s var(--ease); }
.btn--solid {
  background: var(--gold); color: #141005;
  box-shadow: 0 6px 26px rgba(var(--gold-rgb), .28);
}
.btn--solid:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(var(--gold-rgb), .4); }
.btn--solid:hover i { transform: translateY(3px); }
.btn--ghost {
  color: var(--ink); border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.02);
}
.btn--ghost:hover { border-color: rgba(var(--gold-rgb), .5); color: var(--gold); transform: translateY(-2px); }
.btn--ghost:hover i { transform: translateX(3px); }

.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted-2); text-decoration: none;
  transition: color .25s;
}
.hero-scroll:hover { color: var(--gold); }
.hero-scroll-line {
  width: 1px; height: 44px; overflow: hidden; position: relative;
  background: rgba(255,255,255,.12);
}
.hero-scroll-line::after {
  content: ""; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--gold));
  animation: scrollHint 2.2s var(--ease) infinite;
}
@keyframes scrollHint {
  0% { top: -100%; } 60%, 100% { top: 100%; }
}

/* ===== SECCIONES ===== */
.sec { position: relative; z-index: 1; padding: 110px 24px; }
.sec-inner { max-width: 1040px; margin: 0 auto; }
.sec-inner--narrow { max-width: 660px; }
.sec-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 44px;
}
.sec-head--center { justify-content: center; text-align: center; }
.sec-num { color: var(--gold); }
.sec-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 5vw, 46px); letter-spacing: -.02em;
  line-height: 1.05; color: var(--ink);
}
.sec-statement {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(24px, 4.4vw, 40px); line-height: 1.18; letter-spacing: -.015em;
  color: var(--ink);
  max-width: 640px; margin-bottom: 56px;
}
.sec-statement em { font-style: normal; color: var(--gold); }

/* ===== 01 · ENFOQUE ===== */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.pillar {
  position: relative;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.pillar:hover { transform: translateY(-4px); border-color: rgba(var(--gold-rgb), .35); background: var(--surface-2); }
.pillar-num { position: absolute; top: 22px; right: 22px; color: var(--muted-2); }
.pillar-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; font-size: 22px; color: var(--gold);
  background: rgba(var(--gold-rgb), .1);
  border: 1px solid rgba(var(--gold-rgb), .24);
  border-radius: 13px;
  margin-bottom: 18px;
}
.pillar-t {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  letter-spacing: -.01em; margin-bottom: 8px;
}
.pillar-d { font-size: 14px; color: var(--muted); line-height: 1.55; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

/* ===== 02 · QUÉ HAGO ===== */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.service {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.service:hover { transform: translateY(-4px); border-color: rgba(var(--teal-rgb), .38); background: var(--surface-2); }
.service-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; font-size: 22px; color: var(--teal);
  background: rgba(var(--teal-rgb), .1);
  border: 1px solid rgba(var(--teal-rgb), .24);
  border-radius: 13px;
}
.service-t {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  letter-spacing: -.01em; margin-bottom: 6px;
}
.service-d { font-size: 14px; color: var(--muted); line-height: 1.55; }
@media (max-width: 760px) { .services { grid-template-columns: 1fr; } }

/* Marquee de stack */
.marquee {
  margin-top: 40px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
  display: flex; gap: 28px; width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-track span {
  font-family: var(--font-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); white-space: nowrap;
}
.marquee-track span:nth-child(even) { color: rgba(var(--gold-rgb), .55); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== 03 · PROYECTOS ===== */
.projects { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.project {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 20px;
  min-height: 300px;
  padding: 30px 28px;
  text-decoration: none; color: inherit;
  border: 1px solid rgba(var(--gold-rgb), .22);
  border-radius: var(--r-card);
  background:
    linear-gradient(155deg, rgba(var(--gold-rgb), .1) 0%, rgba(var(--gold-rgb), 0) 48%),
    var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform-style: preserve-3d;
  transition: transform .45s var(--ease), border-color .3s, box-shadow .3s;
}
.project:hover {
  border-color: rgba(var(--gold-rgb), .5);
  box-shadow: 0 22px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(var(--gold-rgb), .14) inset;
}
.project--open {
  border-color: rgba(var(--teal-rgb), .24);
  background:
    linear-gradient(155deg, rgba(var(--teal-rgb), .1) 0%, rgba(var(--teal-rgb), 0) 48%),
    var(--surface);
}
.project--open:hover {
  border-color: rgba(var(--teal-rgb), .5);
  box-shadow: 0 22px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(var(--teal-rgb), .14) inset;
}
.project-glow {
  position: absolute; top: -34%; right: -16%;
  width: 240px; height: 240px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--gold-rgb), .26), transparent 70%);
  opacity: .55; transform: scale(.9);
  transition: opacity .45s, transform .45s;
}
.project-glow--teal { background: radial-gradient(closest-side, rgba(var(--teal-rgb), .26), transparent 70%); }
.project:hover .project-glow { opacity: 1; transform: scale(1.08); }
.project-top { display: flex; align-items: center; gap: 14px; }
.project-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; font-size: 22px; color: var(--gold);
  background: rgba(var(--gold-rgb), .12);
  border: 1px solid rgba(var(--gold-rgb), .3);
  border-radius: 13px;
}
.project-icon--teal {
  color: var(--teal);
  background: rgba(var(--teal-rgb), .12);
  border-color: rgba(var(--teal-rgb), .3);
}
.project-tag { color: var(--gold); }
.project-tag--teal { color: var(--teal); }
.project-body { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.project-t {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 3vw, 30px); letter-spacing: -.015em;
  line-height: 1.12; color: var(--ink);
}
.project-sub { color: var(--muted-2); font-size: 10px; }
.project-d { font-size: 14px; color: var(--muted); line-height: 1.58; max-width: 46ch; }
.project-cta {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--gold);
}
.project-cta--teal { color: var(--teal); }
.project-cta i { font-size: 15px; transition: transform .3s var(--ease); }
.project:hover .project-cta i { transform: translate(3px, -3px); }
.project--open:hover .project-cta i { transform: translateX(4px); }
@media (max-width: 820px) {
  .projects { grid-template-columns: 1fr; }
  .project { min-height: 240px; }
}

/* ===== 04 · CONTACTO (linktree) ===== */
.sec--contact {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.014), transparent 30%);
}
.contact-lead {
  text-align: center; color: var(--muted);
  font-size: 15px; margin: -22px 0 36px;
}
.links-grid { display: flex; flex-direction: column; gap: 10px; }
.link-ac {
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-item);
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden; text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .3s var(--ease), border-color .3s, background .3s, box-shadow .3s;
}
.link-ac.featured {
  border-color: rgba(var(--gold-rgb), .34);
  background: rgba(var(--gold-rgb), .06);
}
.link-ac:hover {
  transform: scale(1.02);
  border-color: rgba(var(--gold-rgb), .42);
  background: rgba(var(--gold-rgb), .04);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
}
.link-ac:hover .ac-tgt,
.link-ac:hover .ac-btn { color: var(--gold); }
.ac-n {
  width: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 22px; line-height: 1;
  transition: transform .3s var(--ease);
}
.ac-n svg { height: 1em; width: auto; display: block; }
.link-ac:hover .ac-n { transform: scale(1.15); }
.ac-content { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac-tgt {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -.01em; color: var(--ink); transition: color .2s;
}
.ac-d { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ac-btn {
  flex-shrink: 0; color: var(--muted-2);
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
  transition: color .2s; white-space: nowrap;
}

/* Email + compartir */
.ftr {
  text-align: center; padding-top: 30px;
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ftr-q {
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: .1em; color: var(--muted);
  text-decoration: none; transition: color .2s; cursor: pointer;
}
.ftr-q:hover { color: var(--gold); }
.ftr-share {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 400;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-chip); padding: 5px 11px;
  cursor: pointer; transition: color .2s, border-color .2s;
}
.ftr-share:hover { color: var(--gold); border-color: rgba(var(--gold-rgb), .4); }
.ftr-share i { font-size: 13px; }

/* ===== FOOTER ===== */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 26px 24px;
}
.footer-inner {
  max-width: 1040px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  color: var(--muted-2);
}
.footer-sep { width: 4px; height: 4px; border-radius: 50%; background: rgba(var(--gold-rgb), .5); }
.footer-note { font-size: 10px; }

/* ===== TOAST ===== */
.ui-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(var(--gold-rgb), .14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--gold-rgb), .38);
  border-radius: var(--r-chip);
  color: var(--gold);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  padding: 8px 18px;
  opacity: 0; pointer-events: none; z-index: 10000;
  transition: opacity .25s, transform .25s;
}
.ui-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== ACCESIBILIDAD ===== */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.link-ac:focus-visible, .project:focus-visible, .btn:focus-visible { outline-offset: 2px; }

@media (max-width: 520px) {
  .sec { padding: 84px 16px; }
  .avatar { width: 76px; height: 76px; }
  .hero-cta { width: 100%; }
  .btn { flex: 1; justify-content: center; min-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  #bg3d { opacity: .5; }
}

/* ============================================================
 * PÁGINAS INTERIORES (lab, blog, sobre-mi, links)
 * ========================================================== */

/* --- Cabecera de página --- */
.page { position: relative; z-index: 1; }
.page-hero {
  max-width: 1040px; margin: 0 auto;
  padding: calc(var(--nav-h) + 84px) 24px 20px;
  text-align: left;
}
.page-hero .hero-k { display: block; margin-bottom: 18px; }
.page-t {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 8vw, 84px); line-height: .95; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 18px;
}
.page-s {
  font-size: clamp(15px, 2vw, 17px); color: var(--muted);
  max-width: 560px; line-height: 1.6;
}
.page-s strong { color: var(--ink); font-weight: 600; }
.sec--flush { padding-top: 44px; }
.sec-more { display: flex; justify-content: center; margin-top: 40px; }

/* --- Blog: tarjetas de post --- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.posts--list { grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; }
.sec-inner--blog { max-width: 900px; }
.post-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  text-decoration: none; color: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(var(--gold-rgb), .4); background: var(--surface-2); }
.post-date { color: var(--muted-2); }
.post-t {
  font-family: var(--font-display); font-weight: 600;
  font-size: 18px; letter-spacing: -.01em; line-height: 1.25; color: var(--ink);
}
.post-d { font-size: 14px; color: var(--muted); line-height: 1.55; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.post-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--gold);
}
.post-cta i { transition: transform .3s var(--ease); }
.post-card:hover .post-cta i { transform: translateX(4px); }
@media (max-width: 860px) { .posts { grid-template-columns: 1fr; } }

/* --- Blog: artículo --- */
.post { max-width: 720px; margin: 0 auto; padding: 0 24px 100px; }
.post-hero { padding: calc(var(--nav-h) + 72px) 0 34px; }
.post-back {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none; margin-bottom: 26px;
  transition: color .25s;
}
.post-back:hover { color: var(--gold); }
.post-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 5.4vw, 48px); line-height: 1.1; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 18px;
}
.post-meta { color: var(--muted-2); }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--muted); }
.prose h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  letter-spacing: -.015em; color: var(--ink);
  margin: 44px 0 14px;
}
.prose h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
  color: var(--ink); margin: 32px 0 10px;
}
.prose p { margin: 0 0 18px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(var(--gold-rgb), .4); transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--gold); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--gold); }
.prose code {
  font-family: var(--font-mono); font-size: .85em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px; color: var(--ink);
}
.prose pre {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-item); padding: 18px 20px;
  overflow-x: auto; margin: 0 0 18px;
}
.prose pre code { background: none; border: none; padding: 0; font-size: 13px; }
.prose blockquote {
  border-left: 2px solid var(--gold); padding-left: 18px; margin: 0 0 18px;
  color: var(--muted); font-style: italic;
}
.post-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 52px; padding-top: 30px;
  border-top: 1px solid var(--border);
}

/* --- Lab: filtros y grid --- */
.lab-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}
.chip:hover { color: var(--ink); border-color: var(--border-strong); }
.chip.is-active {
  color: var(--gold); border-color: rgba(var(--gold-rgb), .5);
  background: rgba(var(--gold-rgb), .08);
}
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.project--lab { min-height: 260px; }
.project--lab.is-hidden { display: none; }
.project-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-repo { color: var(--muted-2); }
.lab-note { display: block; text-align: center; color: var(--muted-2); margin-top: 40px; }
@media (max-width: 820px) { .lab-grid { grid-template-columns: 1fr; } }

/* --- Sobre mí: stack y trayectoria --- */
.stack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack-card {
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .4s var(--ease), border-color .3s;
}
.stack-card:hover { transform: translateY(-4px); border-color: rgba(var(--gold-rgb), .35); }
.stack-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 14px; }
.stack-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px; white-space: nowrap;
}
@media (max-width: 760px) { .stack-grid { grid-template-columns: 1fr; } }

.timeline { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.tl-item {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  transition: border-color .3s;
}
.tl-item:hover { border-color: rgba(var(--gold-rgb), .35); }
.tl-tag { color: var(--gold); padding-top: 3px; }
@media (max-width: 600px) {
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
}

/* --- Contacto compacto (home y sobre-mi) --- */
.contact-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* --- Página /links (tarjeta standalone) --- */
.linkspage {
  position: relative; z-index: 1;
  max-width: 620px; margin: 0 auto;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 20px 40px;
}
.linkspage-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; margin-bottom: 30px;
}
.linkspage-hero .avatar { width: 88px; height: 88px; }
.linkspage-t {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 9vw, 56px); line-height: 1; letter-spacing: -.01em;
  color: var(--ink); margin-top: 18px; min-height: 1em;
}
.linkspage-hero .hero-role { margin-top: 12px; }
.linkspage-foot { text-align: center; margin-top: 34px; color: var(--muted-2); }

/* ============================================================
 * INTRO — logo (fade in) + consola escribiendo el nombre
 * ========================================================== */
#intro {
  position: fixed; inset: 0; z-index: 20000;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .5s var(--ease);
  /* si el JS no llega a ejecutarse, la cortina se retira sola */
  animation: intro-fallback .4s ease 5s forwards;
}
#intro.is-done { opacity: 0; pointer-events: none; }
@keyframes intro-fallback { to { opacity: 0; visibility: hidden; } }

.intro-box { display: flex; align-items: center; gap: 20px; }
.intro-logo {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(var(--gold-rgb), .5);
  background: var(--surface);
  color: var(--gold);
  font-family: var(--font-display); font-weight: 700; font-size: 34px;
  box-shadow: 0 0 44px rgba(var(--gold-rgb), .16);
  opacity: 0;
  animation: intro-logo-in .55s var(--ease) .12s forwards;
}
@keyframes intro-logo-in {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
.intro-term {
  display: inline-flex; align-items: center;
  font-size: 22px; letter-spacing: .14em;
  color: var(--ink);
}
.intro-prompt { color: var(--gold); margin-right: 12px; }
.intro-caret {
  width: .58em; height: 1.2em; margin-left: 7px;
  background: var(--gold);
  animation: caret-blink .72s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

@media (max-width: 480px) {
  .intro-logo { width: 52px; height: 52px; font-size: 27px; border-radius: 13px; }
  .intro-term { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  #intro { display: none !important; }
}
