/* ============ TOKENS ============ */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --text: #141416;
  --muted: #6b6a66;
  --border: #e6e3db;
  --accent: #ff5b2e;
  --accent-2: #ff8a5c;
  --accent-soft: rgba(255, 91, 46, .1);
  --accent-text: #ffffff;
  --glow: rgba(255, 91, 46, .18);
  --dots: rgba(20, 20, 22, .07);
  --radius: 28px;
  --gap: 16px;
  --shadow: 0 1px 2px rgba(20,20,22,.04), 0 12px 32px -12px rgba(20,20,22,.10);
  --shadow-hover: 0 2px 4px rgba(20,20,22,.05), 0 24px 48px -16px rgba(20,20,22,.18);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0d;
    --surface: #141417;
    --surface-2: #1d1d21;
    --text: #f3f1ec;
    --muted: #9a9893;
    --border: #26262b;
    --accent-soft: rgba(255, 91, 46, .14);
    --glow: rgba(255, 91, 46, .16);
    --dots: rgba(255, 255, 255, .05);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset;
    --shadow-hover: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 48px -20px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --surface: #141417;
  --surface-2: #1d1d21;
  --text: #f3f1ec;
  --muted: #9a9893;
  --border: #26262b;
  --accent-soft: rgba(255, 91, 46, .14);
  --glow: rgba(255, 91, 46, .16);
  --dots: rgba(255, 255, 255, .05);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  --shadow-hover: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 48px -20px rgba(0,0,0,.7);
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Fondo: retícula de puntos + resplandor de acento */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 12% -5%, var(--glow), transparent 70%),
    radial-gradient(500px 380px at 95% 10%, var(--glow), transparent 70%),
    radial-gradient(var(--dots) 1px, transparent 1px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%);
}

/* ============ TOPBAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand__mark { width: 58px; height: 28px; color: var(--text); transition: transform .4s var(--ease); }
.brand:hover .brand__mark { transform: scale(1.06); }

/* ============ PANTALLA DE CARGA (4 s) ============ */
html.is-loading { overflow: hidden; }
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg); color: var(--text);
  transition: transform .6s cubic-bezier(.7, 0, .2, 1), opacity .6s;
}
.loader::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 320px at 50% 50%, rgba(181, 141, 85, .14), transparent 70%);
  opacity: 0; animation: fadeIn 1.2s ease .2s forwards;
}
.loader__inner { position: relative; display: grid; justify-items: center; gap: 26px; }
.loader__logo { width: min(260px, 60vw); height: auto; overflow: visible; animation: logoPop 3.4s var(--ease) forwards; }

/* Letras: se dibujan trazo a trazo */
.ls { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .65s cubic-bezier(.65, 0, .35, 1) forwards; }
.ls--b1 { animation-delay: .30s; }
.ls--b2 { animation-delay: .55s; }
.ls--b3 { animation-delay: .80s; animation-duration: .4s; }
.ls--j  { animation-delay: 1.05s; animation-duration: .75s; }
.ls--p  { animation-delay: 1.45s; animation-duration: .8s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Acento dorado: entra deslizándose */
.loader__gold {
  opacity: 0; transform: translate(-60px, 30px); transform-box: fill-box;
  animation: goldIn .6s cubic-bezier(.2, .9, .3, 1.3) 2.15s forwards;
}
@keyframes goldIn { to { opacity: 1; transform: none; } }

@keyframes logoPop {
  0%, 70% { transform: scale(1); }
  80% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.loader__name {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6em; margin-right: -.6em;
  color: var(--muted); opacity: 0; transform: translateY(8px);
  animation: nameIn .8s var(--ease) 2.45s forwards;
}
@keyframes nameIn { to { opacity: 1; transform: none; letter-spacing: .32em; margin-right: -.32em; } }

.loader__bar { width: 140px; height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; }
.loader__bar span {
  display: block; height: 100%; background: #b58d55;
  transform-origin: left; transform: scaleX(0);
  animation: bar 3.3s cubic-bezier(.4, 0, .2, 1) .1s forwards;
}
@keyframes bar { to { transform: scaleX(1); } }
@keyframes fadeIn { to { opacity: 1; } }

/* Salida: el telón sube y deja ver la web */
.loader--done { transform: translateY(-100%); }
.loader--done .loader__inner { transition: transform .6s cubic-bezier(.7, 0, .2, 1), opacity .4s; transform: translateY(-40px); opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .ls, .loader__gold, .loader__name, .loader__bar span, .loader__logo { animation-duration: .01s !important; animation-delay: 0s !important; }
  .loader { transition: opacity .4s; }
  .loader--done { transform: none; opacity: 0; }
}

.nav {
  display: flex; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
}
.nav a { padding: 7px 16px; border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); }
.nav a.active { background: var(--text); color: var(--bg); }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.lang { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); }
.lang button {
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 6px 10px; border-radius: 99px; transition: .2s;
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: transform .3s var(--ease);
}
.icon-btn:hover { transform: rotate(20deg); }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: block; }
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text); border-radius: 99px; padding: 12px 22px;
  transition: transform .3s var(--ease), box-shadow .3s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px var(--text); }
.btn--small { padding: 9px 16px; font-size: 14px; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--text); box-shadow: none; }

/* ============ CARDS ============ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s;
}
a.card:hover, .project:hover, .service:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.card--accent {
  background:
    radial-gradient(120% 120% at 100% 0%, var(--accent-2), transparent 55%),
    var(--accent);
  color: var(--accent-text); border-color: transparent;
  box-shadow: 0 20px 40px -20px var(--accent);
  overflow: hidden;
}
.card--accent::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px) 0 0 / 16px 16px;
  -webkit-mask-image: linear-gradient(135deg, transparent 30%, #000);
          mask-image: linear-gradient(135deg, transparent 30%, #000);
}
.card--accent .card__label { color: rgba(255,255,255,.85); }
.card__label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card__big { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 5vw, 68px); line-height: .95; letter-spacing: -.02em; }
.card__head { display: flex; justify-content: space-between; align-items: center; }

.arrow-circle {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255,255,255,.2); font-size: 18px; transition: transform .4s var(--ease), background .3s;
}
a.card:hover .arrow-circle { transform: rotate(45deg); background: rgba(255,255,255,.32); }

.link-arrow { display: inline-flex; gap: 6px; font-weight: 600; margin-top: auto; }
.link-arrow span { transition: transform .3s var(--ease); }
.card:hover .link-arrow > span:last-child { transform: translateX(5px); }

/* ============ BENTO ============ */
.bento {
  display: grid; gap: var(--gap); padding-top: 28px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "hero hero hero contact"
    "hero hero hero facts"
    "links projects projects projects";
}
.card--hero { grid-area: hero; flex-direction: row; gap: 36px; align-items: stretch; padding: 20px; overflow: hidden; }
.card--contact { grid-area: contact; justify-content: space-between; min-height: 210px; }
.card--facts { grid-area: facts; }
.card--links { grid-area: links; justify-content: space-between; }
.card--projects { grid-area: projects; }

.hero__photo {
  position: relative; flex: 0 0 40%; min-height: 440px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #ffb199);
}
.hero__photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%;
  transition: transform 1.2s var(--ease);
}
.card--hero:hover .hero__photo img { transform: scale(1.04); }
.hero__photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35), transparent 40%);
}
.hero__badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 99px;
  background: rgba(255,255,255,.85); color: #141416;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 600;
}
.hero__text { display: flex; flex-direction: column; gap: 18px; justify-content: center; padding: 16px 16px 16px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.22); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34,197,94,.04); } }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 7.4vw, 100px); line-height: .9; letter-spacing: -.025em; }
h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.hero__role { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.hero__role::before { content: ""; width: 28px; height: 2px; background: var(--accent); border-radius: 2px; }
.hero__bio { color: var(--muted); max-width: 48ch; font-size: 16px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.card__mail { font-weight: 600; word-break: break-all; position: relative; z-index: 1; }

.facts { display: grid; gap: 14px; margin: 0; }
.facts div { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; }
.facts dt { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--accent); }
.facts dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.35; }

.social { display: grid; }
.social a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-weight: 500; transition: color .2s, padding .3s var(--ease); }
.social a span { margin-left: auto; color: var(--muted); }
.social a svg { color: var(--muted); transition: color .2s; }
.social a:hover { color: var(--accent); padding-left: 4px; }
.social a:hover svg { color: var(--accent); }
.location { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

.count { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--accent); }
.project-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; counter-reset: p; }
.project-list li { counter-increment: p; padding: 11px 0; border-bottom: 1px solid var(--border); font-weight: 500; display: flex; align-items: baseline; gap: 12px; }
.project-list li::before { content: counter(p, decimal-leading-zero); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ============ MARQUEE ============ */
.marquee {
  margin-top: 56px; overflow: hidden; padding: 18px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 40s linear infinite; }
.marquee span { font-family: var(--serif); font-size: 34px; line-height: 1; white-space: nowrap; }
.marquee i { font-style: normal; color: var(--accent); font-size: 16px; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 14px)); } }

/* ============ SECCIONES ============ */
.section { padding-top: 96px; }
.section__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.section__num {
  font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums;
  padding: 4px 10px; border-radius: 99px; background: var(--accent-soft);
  transform: translateY(-8px);
}
.section__title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.5vw, 64px); line-height: 1; letter-spacing: -.02em; }
.grid { display: grid; gap: var(--gap); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* Servicios */
.service { gap: 12px; overflow: hidden; }
.service::before {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(var(--glow), transparent 70%); opacity: 0; transition: opacity .5s;
}
.service:hover::before { opacity: 1; }
.service__icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--accent-soft); color: var(--accent);
  transition: transform .5s var(--ease), background .3s, color .3s;
}
.service:hover .service__icon { transform: rotate(-8deg) scale(1.06); background: var(--accent); color: #fff; }
.service h3, .project h3 { font-size: 19px; letter-spacing: -.01em; line-height: 1.3; }
.service p, .project p:not(.card__label) { color: var(--muted); font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }

/* Experiencia: línea temporal */
.timeline { gap: 0; padding: 12px 36px; }
.job { position: relative; display: grid; grid-template-columns: 190px 1fr; gap: 36px; padding: 30px 0; border-bottom: 1px solid var(--border); }
.job:last-child { border-bottom: 0; }
.job__date { color: var(--muted); font-size: 14px; font-weight: 500; padding-top: 2px; font-variant-numeric: tabular-nums; position: relative; }
.job__body { display: grid; gap: 12px; position: relative; padding-left: 36px; }
.job__body::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--muted); background: var(--surface);
}
.job__body::after {
  content: ""; position: absolute; left: 5px; top: 26px; bottom: -42px; width: 1px; background: var(--border);
}
.job:last-child .job__body::after { display: none; }
.job--current .job__body::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.job h3 { font-size: 20px; letter-spacing: -.01em; line-height: 1.35; }
.job .at { color: var(--muted); font-weight: 500; }
.job p { color: var(--muted); max-width: 72ch; }
.badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
}

/* Proyectos */
.project { padding: 12px; gap: 0; overflow: hidden; }
.project__body { display: flex; flex-direction: column; gap: 10px; padding: 22px 18px 18px; }
.project__thumb {
  position: relative; aspect-ratio: 2 / 1; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 25%, hsl(var(--h) 95% 70% / .75), transparent 55%),
    radial-gradient(circle at 85% 80%, hsl(calc(var(--h) + 50) 90% 62% / .6), transparent 55%),
    var(--surface-2);
}
.project__thumb::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--dots) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--dots) 1px, transparent 1px) 0 0 / 28px 28px;
}
.project__glyph {
  position: relative; width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.35);
  color: var(--text);
  transition: transform .6s var(--ease);
}
.project__glyph svg { width: 38px; height: 38px; }
.project:hover .project__glyph { transform: translateY(-6px) rotate(-6deg); }
.project__num {
  position: absolute; top: 14px; left: 16px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text);
}
.project .card__label { color: var(--accent); }
.project .link-arrow { margin-top: 6px; color: var(--text); font-size: 15px; }
.project:hover .link-arrow > span:last-child { transform: translate(3px, -3px); }

.project--wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.project--wide .project__thumb { flex: 0 0 52%; aspect-ratio: auto; min-height: 260px; }
.project--wide .project__glyph { width: 108px; height: 108px; border-radius: 30px; }
.project--wide .project__glyph svg { width: 48px; height: 48px; }
.project--wide .project__body { justify-content: center; padding: 28px 32px; }
.project--wide h3 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; }

/* Sobre mí */
.bento--about {
  padding-top: 0;
  grid-template-columns: 2fr 1fr;
  grid-template-areas: "about langs" "stack stack";
}
.card--about { grid-area: about; }
.card--langs { grid-area: langs; }
.card--stack { grid-area: stack; }

/* Estudios */
.studies { display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr); }
.master {
  grid-column: 1 / -1; flex-direction: row; gap: 32px; overflow: hidden;
  background:
    radial-gradient(500px 300px at 0% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(420px 260px at 100% 100%, rgba(181, 141, 85, .12), transparent 70%),
    var(--surface);
}
.master__head { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 16px; }
.master__icon {
  width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center;
  background: var(--accent); color: #fff; box-shadow: 0 16px 32px -14px var(--accent);
}
.badge--live { display: inline-flex; align-items: center; gap: 8px; margin: 0; background: rgba(34,197,94,.12); color: #16a34a; }
.master__body { display: flex; flex-direction: column; gap: 16px; flex: 1; min-width: 0; }
.master__title { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.5vw, 52px); line-height: 1; letter-spacing: -.02em; }
.master__school { color: var(--muted); }
.master__facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.master__facts div {
  display: flex; align-items: baseline; gap: 6px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.master__facts dt { font-family: var(--serif); font-size: 28px; line-height: 1; color: var(--accent); }
.master__facts dd { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.master__sub { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.chips--gold li { border-color: rgba(181, 141, 85, .45); background: rgba(181, 141, 85, .1); }
.master__link { margin-top: 4px; color: var(--accent); }
.master__link:hover > span:last-child { transform: translate(3px, -3px); }

.degree { gap: 12px; }
.degree:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.reveal.visible.degree:hover { transform: translateY(-4px); }
.degree__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.degree__level {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border);
}
.degree__years { color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.degree h3 { font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.degree__school { color: var(--accent); font-weight: 600; font-size: 14px; }
.degree__text { color: var(--muted); font-size: 15px; }
.lead { font-family: var(--serif); font-size: 28px; line-height: 1.25; letter-spacing: -.01em; }
.info { display: grid; gap: 0; font-size: 15px; color: var(--muted); margin-top: 8px; }
.info li { padding: 10px 0; border-top: 1px solid var(--border); }
.info strong { color: var(--text); font-weight: 600; }

.edu { display: grid; gap: 18px; }
.edu li { display: grid; gap: 4px; padding-left: 16px; border-left: 2px solid var(--border); line-height: 1.35; }
.edu li:first-child { border-left-color: var(--accent); }
.edu span { color: var(--muted); font-size: 13px; }

.langs { display: grid; gap: 20px; }
.langs li { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; font-weight: 500; }
.langs small { color: var(--muted); }
.langs .bar { grid-column: 1 / -1; grid-row: 2; height: 6px; border-radius: 99px; background: var(--surface-2); position: relative; overflow: hidden; }
.langs .bar::after {
  content: ""; position: absolute; inset: 0; width: var(--v); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .3s;
}
.visible .langs .bar::after, .langs .bar.no-anim::after { transform: scaleX(1); }

.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.stack h4 { font-size: 14px; margin-bottom: 12px; font-weight: 600; }

/* CTA */
.card--cta { padding: 56px; gap: 22px; }
.card--cta .card__big { font-size: clamp(52px, 9vw, 120px); position: relative; z-index: 1; }
.cta__mail { display: inline-flex; align-items: center; gap: 14px; font-weight: 600; font-size: 18px; position: relative; z-index: 1; }

/* Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 48px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }
.to-top:hover { color: var(--text); }

/* Animación de entrada */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease), box-shadow .5s var(--ease), border-color .3s; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.visible:is(a.card, .project, .service):hover { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .langs .bar::after { transform: scaleX(1); }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas: "hero hero" "contact facts" "links links" "projects projects";
  }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .bento--about { grid-template-columns: 1fr; grid-template-areas: "about" "langs" "stack"; }
  .stack { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .card--hero { flex-direction: column; gap: 8px; }
  .hero__photo { flex: none; min-height: 0; aspect-ratio: 4 / 4.2; }
  .hero__text { padding: 12px 10px 14px; }
  .project--wide { flex-direction: column; }
  .project--wide .project__thumb { flex: none; aspect-ratio: 2 / 1; min-height: 0; }
  .project--wide .project__body { padding: 22px 18px 18px; }
  .project--wide h3 { font-size: 32px; }
  .master { flex-direction: column; gap: 20px; }
  .master__head { flex-direction: row; align-items: center; width: 100%; }
}
@media (max-width: 640px) {
  :root { --radius: 24px; }
  .topbar__inner { height: 60px; gap: 8px; }
  .brand__name { display: none; }
  #printCv span { display: none; }
  #printCv { padding: 9px 11px; }
  .bento, .bento--about { grid-template-columns: 1fr; grid-template-areas: none; }
  .bento > *, .bento--about > * { grid-area: auto !important; }
  .card { padding: 24px; }
  .card--hero { padding: 12px; }
  .grid--4, .grid--2, .project-list, .stack, .studies { grid-template-columns: 1fr; }
  .master__icon { width: 56px; height: 56px; border-radius: 18px; }
  .job { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .job__date { padding-left: 32px; }
  .job__body { padding-left: 32px; }
  .job__body::before { top: -24px; }
  .job__body::after { top: -6px; bottom: -48px; }
  .timeline { padding: 4px 24px; }
  .lead { font-size: 23px; }
  .card--cta { padding: 36px 24px; }
  .section { padding-top: 72px; }
  .marquee { margin-top: 40px; }
  .marquee span { font-size: 26px; }
}

/* ============ IMPRESIÓN / PDF (versión currículum) ============ */
@media print {
  @page { size: A4; margin: 14mm; }
  html.is-loading { overflow: visible; }
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #111; --muted: #555; --border: #ddd; --shadow: none;
  }
  body { font-size: 10.5pt; line-height: 1.45; }
  .loader, .bg, .topbar, .marquee, #servicios, .card--cta, .card--contact, .card--projects, .footer,
  .hero__cta, .hero__badge, .tags, .project .link-arrow, .project__thumb, .section__num, .badge { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .langs .bar::after { transform: scaleX(1) !important; }
  .container { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; border-radius: 0; box-shadow: none !important; break-inside: avoid; }
  .bento { display: block; padding: 0; }
  .card--hero { flex-direction: row; gap: 22px; padding: 0 0 14px; border-bottom: 2px solid var(--accent); overflow: visible; }
  .hero__photo { flex: 0 0 110px; min-height: 110px; height: 110px; border-radius: 50%; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .hero__photo::after { display: none; }
  .hero__text { padding: 0; gap: 8px; }
  h1 { font-size: 34pt; }
  h1 em { color: var(--accent); background: none; -webkit-background-clip: border-box; background-clip: border-box; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .card--facts, .card--links { display: inline-flex; width: 48%; vertical-align: top; margin-top: 12px; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .facts dt { font-size: 20pt; }
  .social a { padding: 4px 0; border: 0; }
  .social a span { display: none; }
  .social a[href^="http"]::after { content: " · " attr(href); font-size: 8pt; color: var(--muted); font-weight: 400; }
  .section { padding-top: 18px; }
  .section__head { margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
  .section__title { font-size: 20pt; }
  .timeline { padding: 0; }
  .job { grid-template-columns: 120px 1fr; padding: 8px 0; gap: 12px; border: 0; }
  .job__body { padding-left: 0; }
  .job__body::before, .job__body::after { display: none; }
  .grid--2 { grid-template-columns: 1fr 1fr; gap: 10px 24px; }
  .project, .project--wide { padding: 0; flex-direction: column; }
  .project__body, .project--wide .project__body { padding: 0; gap: 4px; }
  .project--wide h3 { font-family: var(--sans); font-weight: 700; font-size: 19px; }
  .lead { font-size: 11pt; }
  .section__head { margin-bottom: 6px; }
  .section { padding-top: 12px; }
  .info { grid-template-columns: 1fr 1fr; column-gap: 24px; font-size: 9.5pt; }
  .info li { padding: 5px 0; }
  .section__head { break-after: avoid; }
  #estudios { break-before: page; padding-top: 0; }
  .master__syllabus, .project .chips, .project__body > p:not(.card__label) { display: none; }
  #proyectos .grid--2 { grid-template-columns: repeat(3, 1fr); gap: 10px 20px; }
  #proyectos .project--wide { grid-column: auto; }
  .chips li { font-size: 8pt; padding: 2px 8px; }
  .edu { gap: 8px; }
  .langs { gap: 12px; }
  .project p:not(.card__label) { font-size: 9.5pt; }
  .project h3 { font-size: 12pt; }
  .project--wide h3 { font-size: 12pt; }
  .bento--about { gap: 10px 24px; }
  .stack { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .stack h4 { font-size: 9.5pt; margin-bottom: 6px; }
  .chips { gap: 4px; }
  .bento--about { display: grid; grid-template-columns: 2fr 1fr; grid-template-areas: "about langs" "stack stack"; gap: 14px 24px; }
  .studies { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
  .master { flex-direction: column; gap: 6px; background: none; }
  .master__icon, .master__facts, .master__link { display: none; }
  .master__head { flex-direction: row; }
  .badge--live { padding: 0; background: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .master__body { gap: 6px; }
  .master__title { font-family: var(--sans); font-weight: 700; font-size: 13pt; }
  .master__sub { font-size: 9.5pt; margin: 4px 0; }
  .degree { gap: 4px; }
  .degree h3 { font-size: 11pt; }
  .degree__text { font-size: 9.5pt; }
  .degree__level { padding: 0; border: 0; background: none; }
  .langs .bar, .langs .bar::after { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .chips li { border: 1px solid var(--border); background: none; }
}
