/* =========================================================
   William Ramos — Portafolio
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display-weight: 700;
  --display-tracking: -0.035em;
  --body-size: 1rem;

  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 72px;

  /* Tema claro */
  --bg: #f4f6fa;
  --bg-alt: #eceff5;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --text: #0b1220;
  --muted: #536078;
  --border: rgba(11, 18, 32, .09);
  --border-strong: rgba(11, 18, 32, .18);
  --accent: #0891b2;
  --accent-text: #0e7490;
  --accent-soft: rgba(8, 145, 178, .10);
  --primary: #0e7490;
  --on-primary: #ffffff;
  --accent-2: #e8522f;
  --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 18px 40px -22px rgba(11, 18, 32, .28);
  --shadow-lg: 0 30px 70px -30px rgba(11, 18, 32, .35);
  --grid-line: rgba(11, 18, 32, .055);
  --blob-1: rgba(6, 182, 212, .35);
  --blob-2: rgba(232, 82, 47, .20);
  --blob-3: rgba(99, 102, 241, .22);
  --header-bg: rgba(244, 246, 250, .72);
  --code-bg: #0b1222;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #060a14;
  --bg-alt: #090f1d;
  --surface: #0d1425;
  --surface-2: #111a2e;
  --text: #e8edf6;
  --muted: #95a2ba;
  --border: rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .16);
  --accent: #22d3ee;
  --accent-text: #67e8f9;
  --accent-soft: rgba(34, 211, 238, .10);
  --primary: #22d3ee;
  --on-primary: #03121a;
  --accent-2: #ff7a5c;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 48px -28px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .85);
  --grid-line: rgba(255, 255, 255, .045);
  --blob-1: rgba(34, 211, 238, .22);
  --blob-2: rgba(255, 122, 92, .13);
  --blob-3: rgba(99, 102, 241, .22);
  --header-bg: rgba(6, 10, 20, .7);
  --code-bg: #0a1020;
  color-scheme: dark;
}

/* Tipografías intercambiables */
:root[data-font="editorial"] {
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --display-weight: 600;
  --display-tracking: -0.025em;
}
:root[data-font="tecnica"] {
  --font-display: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'JetBrains Mono', ui-monospace, monospace;
  --display-weight: 700;
  --display-tracking: -0.05em;
  --body-size: .94rem;
}
:root[data-font="amigable"] {
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.04em;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--accent); color: var(--on-primary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--primary); color: var(--on-primary);
  padding: .6rem 1rem; border-radius: 10px; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

.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;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 1rem; }

.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand b { color: var(--accent); }

.nav-links { display: flex; gap: .25rem; }
.nav-links a {
  position: relative; display: block; padding: .45rem .8rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: color .25s, background-color .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-active { color: var(--text); background: var(--accent-soft); }

.controls { display: flex; align-items: center; gap: .5rem; margin-left: .5rem; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text);
  transition: border-color .25s, transform .25s var(--ease), background-color .25s;
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Language switch */
.lang-switch {
  position: relative; display: flex; padding: 3px; height: 40px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.lang-switch button {
  position: relative; z-index: 1; width: 38px; border-radius: 9px;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  transition: color .3s;
}
.lang-switch button[aria-pressed="true"] { color: var(--on-primary); }
.lang-switch__pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 38px; border-radius: 9px;
  background: var(--primary);
  transition: transform .45s var(--ease);
}
.lang-switch[data-active="en"] .lang-switch__pill { transform: translateX(38px); }

/* Font picker */
.font-picker { position: relative; }
.font-picker__glyph { font-family: var(--font-display); font-weight: 700; font-size: .95rem; letter-spacing: -.02em; }
.font-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: .5rem;
  transform-origin: top right;
  animation: pop .25s var(--ease);
}
.font-menu[hidden] { display: none; }
.font-menu__title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .4rem .6rem .5rem; }
.font-menu button {
  width: 100%; display: flex; align-items: center; gap: .75rem; text-align: left;
  padding: .55rem .6rem; border-radius: 10px; transition: background-color .2s;
}
.font-menu button:hover { background: var(--surface-2); }
.font-menu button[aria-checked="true"] { background: var(--accent-soft); }
.font-menu button[aria-checked="true"] .font-sample { border-color: var(--accent); color: var(--accent-text); }
.font-menu b { display: block; font-size: .9rem; font-weight: 600; font-family: var(--font-body); }
.font-menu small { display: block; font-size: .74rem; color: var(--muted); font-family: var(--font-body); }
.font-sample {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px; font-size: 1.1rem; font-weight: 700;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } }

/* Theme toggle */
.theme-toggle svg { position: absolute; transition: transform .5s var(--ease), opacity .3s; }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
[data-theme="dark"] .theme-toggle .i-sun { transform: translateY(0) rotate(0); opacity: 1; }
[data-theme="dark"] .theme-toggle .i-moon { transform: translateY(24px) rotate(40deg); opacity: 0; }
[data-theme="light"] .theme-toggle .i-sun { transform: translateY(-24px) rotate(-90deg); opacity: 0; }
[data-theme="light"] .theme-toggle .i-moon { transform: translateY(0) rotate(0); opacity: 1; }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }

/* Mobile menu */
.menu-btn { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  background: var(--bg); padding: 2rem var(--gutter);
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu li { border-bottom: 1px solid var(--border); opacity: 0; transform: translateY(16px); animation: menuIn .5s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 50ms + 50ms); }
.mobile-menu a { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.9rem; letter-spacing: var(--display-tracking); }
.mobile-menu small { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-text); font-weight: 500; letter-spacing: 0; }
@keyframes menuIn { to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  --mx: 0px; --my: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  height: 52px; padding: 0 1.5rem; border-radius: 14px;
  font-weight: 600; font-size: .98rem;
  transform: translate(var(--mx), var(--my));
  transition: transform .35s var(--ease), background-color .25s, border-color .25s, box-shadow .3s, color .25s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 30px -10px var(--accent); }
.btn--primary:hover { box-shadow: 0 16px 40px -12px var(--accent); }
.btn--ghost { border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 5rem;
  overflow: hidden; isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.blob--1 { width: 520px; height: 520px; background: var(--blob-1); top: -120px; right: -80px; animation: drift1 18s ease-in-out infinite alternate; }
.blob--2 { width: 420px; height: 420px; background: var(--blob-2); bottom: -120px; left: 20%; animation: drift2 22s ease-in-out infinite alternate; }
.blob--3 { width: 380px; height: 380px; background: var(--blob-3); top: 25%; left: -120px; animation: drift3 20s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-120px, 140px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(160px, -100px) scale(.9); } }
@keyframes drift3 { to { transform: translate(120px, 60px) scale(1.1); } }

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.spotlight {
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--sx, 70%) var(--sy, 30%), var(--accent-soft), transparent 70%);
  transition: opacity .4s;
}

.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }

.status-badge {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .9rem .4rem .7rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 500; color: var(--muted);
  box-shadow: var(--shadow);
}
.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero__hello { margin-top: 2rem; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); font-weight: 500; }

.hero__name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(3.2rem, 10vw, 7.4rem); line-height: .92; letter-spacing: var(--display-tracking);
  margin: .3rem 0 1.4rem;
}
.hero__name .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__name .line > span { display: inline-block; }
.js .hero__name .line > span { transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero__name em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__name .line:nth-child(2) > span {
  background: linear-gradient(100deg, var(--text) 30%, var(--accent) 70%, var(--accent-2));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 1.1s var(--ease) .12s forwards, shimmer 6s ease-in-out 1.4s infinite alternate;
}
.hero__name .line:nth-child(2) > span em { -webkit-text-fill-color: var(--accent-2); }
@keyframes rise { to { transform: translateY(0); } }
@keyframes shimmer { from { background-position: 0% 0; } to { background-position: 100% 0; } }

.hero__role {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono); font-size: clamp(1rem, 2.2vw, 1.25rem); font-weight: 500;
  color: var(--accent-text); min-height: 1.9em;
}
.hero__role-prefix { color: var(--accent-2); }
.caret { width: 2px; height: 1.2em; background: var(--accent); margin-left: -4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__summary { margin-top: 1.2rem; max-width: 56ch; font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--muted); }

.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

.hero__social { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 2.2rem; }
.hero__social a {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); color: var(--muted);
  transition: color .25s, border-color .25s, transform .3s var(--ease);
}
.hero__social a:hover { color: var(--accent-text); border-color: var(--accent); transform: translateY(-3px); }
.hero__social svg { width: 18px; height: 18px; fill: currentColor; }
.hero__social svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero__location { display: flex; align-items: center; gap: .4rem; margin-left: .6rem; font-size: .9rem; color: var(--muted); }
.hero__location svg { width: 17px; height: 17px; }

/* Code window */
.hero__visual { position: relative; padding: 2.5rem 1rem; }
.code-window {
  position: relative; border-radius: 18px; overflow: hidden;
  background: var(--code-bg); color: #d6deeb;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(34, 211, 238, .06), 0 0 80px -20px rgba(34, 211, 238, .35);
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: transform .8s var(--ease);
  animation: floaty 7s ease-in-out infinite;
}
.hero__visual:hover .code-window { transform: perspective(1200px) rotateY(0) rotateX(0); }
@keyframes floaty { 50% { translate: 0 -10px; } }
.code-window__bar { display: flex; align-items: center; gap: 7px; padding: .85rem 1rem; background: rgba(255, 255, 255, .03); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.code-window__bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code-window__bar span:nth-child(2) { background: #febc2e; }
.code-window__bar span:nth-child(3) { background: #28c840; }
.code-window__bar p { margin-left: auto; margin-right: auto; font-family: var(--font-mono); font-size: .75rem; color: #7f8ea8; transform: translateX(-20px); }
.code { margin: 0; padding: 1.3rem 1.4rem 1.5rem; font-family: var(--font-mono); font-size: clamp(.72rem, 1.2vw, .86rem); line-height: 1.85; overflow-x: auto; }
.code i { font-style: normal; }
.cl { display: inline-block; }
.js .cl { opacity: 0; transform: translateX(-8px); animation: codeIn .5s var(--ease) forwards; animation-delay: calc(.7s + var(--i) * .13s); }
@keyframes codeIn { to { opacity: 1; transform: none; } }
.c-com { color: #637777; } .c-key { color: #c792ea; } .c-var { color: #82aaff; }
.c-prop { color: #7fdbca; } .c-str { color: #ecc48d; } .c-num { color: #f78c6c; } .c-pun { color: #89ddff; }
.code-caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 4px; vertical-align: -2px; background: #22d3ee; animation: blink 1s steps(1) infinite; }

.orbit-chip {
  position: absolute; display: flex; align-items: center; gap: .45rem;
  padding: .45rem .8rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: .8rem; font-weight: 600; white-space: nowrap;
  animation: bob 6s ease-in-out infinite;
}
.orbit-chip .ti { width: 18px; height: 18px; }
.orbit-chip--1 { top: 0; left: -4%; animation-delay: -1s; }
.orbit-chip--2 { top: 8%; right: -6%; animation-delay: -3s; }
.orbit-chip--3 { top: 48%; right: -10%; animation-delay: -2s; }
.orbit-chip--4 { bottom: 2%; right: 12%; animation-delay: -4s; }
.orbit-chip--5 { bottom: 12%; left: -8%; animation-delay: -5s; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-2deg); } }

.vtex-dot, .aws-dot, .dot { flex: none; width: 10px; height: 10px; border-radius: 3px; background: #f71963; transform: rotate(45deg); }
.aws-dot { background: #ff9900; border-radius: 50%; transform: none; }
.dot { background: var(--accent); border-radius: 50%; width: 8px; height: 8px; transform: none; }

.scroll-hint { position: absolute; left: 50%; bottom: 1.6rem; translate: -50% 0; opacity: .7; transition: opacity .3s; }
.scroll-hint:hover { opacity: 1; }
.scroll-hint__mouse { display: block; width: 24px; height: 38px; border: 2px solid var(--border-strong); border-radius: 14px; position: relative; }
.scroll-hint__mouse span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; border-radius: 2px; background: var(--accent); translate: -50% 0; animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; border-block: 1px solid var(--border); background: var(--bg-alt);
  padding: 1.1rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; gap: 3rem; padding-right: 3rem; }
.marquee.is-ready .marquee__track { animation: marquee 45s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee li { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--muted); white-space: nowrap; transition: color .25s; }
.marquee li:hover { color: var(--text); }
.marquee .ti { width: 24px; height: 24px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.ti { width: 20px; height: 20px; object-fit: contain; flex: none; }
[data-theme="dark"] .ti--invert { filter: invert(1); }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(5rem, 11vw, 8.5rem) 0; }
.section--alt { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); max-width: 760px; }
.section-head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1rem;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow span:first-child { padding: .15rem .45rem; border-radius: 6px; background: var(--accent-soft); }
.section-title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: var(--display-tracking);
}
.section-title em, .contact__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-font="editorial"] .section-title em, [data-font="editorial"] .contact__title em { font-style: italic; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about__text p { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--muted); }
.about__text p + p { margin-top: 1.2rem; }
.about__facts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
.about__facts li {
  display: flex; flex-direction: column; padding: .7rem 1rem; min-width: 130px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.about__facts span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.about__facts b { font-weight: 600; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat {
  position: relative; overflow: hidden;
  padding: 1.6rem 1.4rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat::before {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 50%;
  background: var(--accent-soft); transition: transform .6s var(--ease);
}
.stat:hover::before { transform: scale(1.5); }
.stat b { position: relative; display: block; font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1; letter-spacing: var(--display-tracking); color: var(--accent-text); }
.stat > span { position: relative; display: block; margin-top: .6rem; font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 1.5rem; padding-left: 2.2rem; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px;
}
.timeline::before { background: var(--border); }
.timeline::after {
  background: linear-gradient(var(--accent), var(--accent-2));
  transform-origin: top; transform: scaleY(var(--progress, 0));
}
.tl-item { position: relative; }
.tl-dot {
  position: absolute; left: calc(-2.2rem + 1px); top: 1.9rem; z-index: 1;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--accent);
}
.tl-dot.is-current { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-card {
  padding: clamp(1.3rem, 3vw, 2rem); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .5s var(--ease), border-color .3s;
}
.tl-card:hover { transform: translateX(6px); border-color: var(--border-strong); }
.tl-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; }
.tl-logo {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}
.tl-title h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.2; }
.tl-title p { font-size: .9rem; color: var(--muted); }
.tl-date { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.now { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; border-radius: 999px; background: rgba(34, 197, 94, .12); color: #16a34a; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
[data-theme="dark"] .now { color: #4ade80; }
.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.4s steps(1) infinite; }
.tl-badge {
  display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.1rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: linear-gradient(120deg, rgba(247, 25, 99, .12), rgba(124, 58, 237, .12));
  border: 1px solid rgba(247, 25, 99, .25);
  font-size: .8rem; font-weight: 600; color: #db2777;
}
[data-theme="dark"] .tl-badge { color: #f9a8d4; }
.tl-badge svg { width: 14px; height: 14px; fill: currentColor; }
.tl-list { margin-top: 1.1rem; display: grid; gap: .55rem; }
.tl-list li { position: relative; padding-left: 1.3rem; color: var(--muted); font-size: .97rem; }
.tl-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 2px; border-radius: 2px; background: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.2rem; }
.tags li {
  padding: .22rem .6rem; border-radius: 8px;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .4rem; padding: 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.chip { padding: .5rem 1rem; border-radius: 10px; font-size: .88rem; font-weight: 600; color: var(--muted); transition: color .25s, background-color .25s; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--primary); color: var(--on-primary); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.5rem; }
.project {
  --rx: 0deg; --ry: 0deg;
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transform-style: preserve-3d;
}
.js .project.is-visible { transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease), opacity .9s var(--ease), border-color .3s, box-shadow .4s; }
.project.is-tilting { transition: transform .08s linear, border-color .3s, box-shadow .4s !important; }
.project:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.project[hidden] { display: none; }
.project.is-entering { animation: cardIn .55s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.project::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .10), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.project:hover::after { opacity: 1; }

.project__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.project__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.project:hover .project__media img { transform: scale(1.06); }
.project__cat {
  position: absolute; top: 12px; left: 12px;
  padding: .25rem .65rem; border-radius: 999px;
  background: rgba(6, 10, 20, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .72rem; font-weight: 600; letter-spacing: .03em;
}
.project__body { display: flex; flex-direction: column; flex: 1; padding: 1.4rem 1.4rem 1.5rem; }
.project__meta { font-family: var(--font-mono); font-size: .74rem; color: var(--accent-text); letter-spacing: .02em; }
.project h3 { margin-top: .35rem; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.2; }
.project__body > p:not(.project__meta):not(.project__private) { margin-top: .6rem; color: var(--muted); font-size: .94rem; }
.project .tags { margin-top: 1rem; }
.project__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: 1.3rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .95rem; border-radius: 10px;
  background: var(--primary); color: var(--on-primary);
  font-size: .86rem; font-weight: 600;
  transition: transform .3s var(--ease), opacity .25s;
}
.link-btn:hover { transform: translateY(-2px); }
.link-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.link-btn:hover svg { transform: translate(2px, -2px); }
.link-btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.link-btn--ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.project__private { display: flex; align-items: flex-start; gap: .45rem; margin-top: auto; padding-top: 1.3rem; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.project__private svg { flex: none; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.skill-card {
  position: relative; padding: 1.6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: border-color .3s, transform .5s var(--ease);
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.skill-card--wide { grid-column: span 2; }
.skill-card--full { grid-column: 1 / -1; }
.skill-card header { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.2rem; }
.skill-card__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.skill-card__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skill-card h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.12rem; letter-spacing: -.01em; }
.skill-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.skill-list li {
  position: relative; display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .8rem; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .88rem; font-weight: 500;
  transition: transform .3s var(--ease), border-color .25s, background-color .25s;
}
.skill-list li:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent-soft); }
.skill-list li.is-new { border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); }
.skill-list li.is-new::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px var(--surface); }
.skill-note { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .8rem; color: var(--muted); }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); flex: none; }

/* ---------- Education ---------- */
.edu { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; }
.edu-card, .lang-card { padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.edu-card__top { display: flex; gap: 1rem; align-items: center; }
.edu-card__logo { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, #e11d48, #9f1239); color: #fff; }
.edu-card__logo svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.edu-card h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(1.15rem, 2.2vw, 1.45rem); letter-spacing: -.02em; line-height: 1.2; }
.edu-card__top p { color: var(--muted); font-size: .92rem; margin-top: .2rem; }
.edu-list { display: grid; gap: 1rem; margin-top: 1.6rem; }
.edu-list li { display: grid; gap: .2rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.edu-list b { font-weight: 600; }
.edu-list span { color: var(--muted); font-size: .94rem; }
.lang-card h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 1.4rem; }
.lang-row + .lang-row { margin-top: 1.3rem; }
.lang-row__head { display: flex; justify-content: space-between; margin-bottom: .5rem; font-size: .95rem; }
.lang-row__head b { font-weight: 600; color: var(--accent-text); font-size: .85rem; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease) .3s; }
.is-visible .meter span, html:not(.js) .meter span { transform: scaleX(var(--v)); }

/* ---------- Contact ---------- */
.contact { overflow: hidden; text-align: center; background: var(--bg-alt); isolation: isolate; }
.contact__glow {
  position: absolute; left: 50%; top: 55%; width: min(900px, 120vw); aspect-ratio: 1; translate: -50% -50%; z-index: -1;
  background: radial-gradient(circle, var(--blob-1), transparent 60%);
  filter: blur(40px); animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.15); opacity: .7; } }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(2.4rem, 7.5vw, 5.6rem); line-height: 1; letter-spacing: var(--display-tracking); max-width: 14ch; }
.contact__text { margin-top: 1.4rem; max-width: 52ch; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); }
.contact__mail { display: flex; align-items: center; gap: .6rem; margin-top: 2.4rem; max-width: 100%; }
.mail-link {
  position: relative; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.05rem, 3.4vw, 1.7rem); letter-spacing: -.02em; overflow-wrap: anywhere;
}
.mail-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(.25); transform-origin: left; transition: transform .5s var(--ease); }
.mail-link:hover::after { transform: scaleX(1); }
.copy-btn { flex: none; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2.2rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 1.8rem 0; font-size: .86rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Floating UI ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease);
}
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 150;
  padding: .7rem 1.1rem; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600;
  translate: -50% 0; opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.is-shown { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
}
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero__visual { max-width: 560px; width: 100%; margin-inline: auto; padding-inline: 0; }
  .code-window { transform: none; }
  .about { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr 1fr; }
  .edu { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .brand span { display: none; }
  .controls { gap: .4rem; }
  .icon-btn { width: 38px; height: 38px; }
  .lang-switch { height: 38px; }
  .hero { padding-bottom: 4rem; }
  .hero__location { width: 100%; margin: .4rem 0 0; }
  .orbit-chip--1, .orbit-chip--5 { display: none; }
  .orbit-chip--2 { right: 0; top: 0; }
  .orbit-chip--3 { right: 0; top: auto; bottom: 0; }
  .orbit-chip--4 { left: 0; right: auto; bottom: 0; }
  .scroll-hint { display: none; }
  .skills { grid-template-columns: 1fr; }
  .skill-card--wide { grid-column: auto; }
  .stats { gap: .7rem; }
  .stat { padding: 1.2rem 1rem; }
  .tl-head { grid-template-columns: auto 1fr; }
  .tl-date { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; }
  .timeline { padding-left: 1.6rem; }
  .tl-dot { left: calc(-1.6rem + 1px); }
  .filters { width: 100%; }
  .chip { flex: 1; padding-inline: .5rem; }
  .btn { height: 48px; padding: 0 1.2rem; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .hero__name .line > span, .js .cl { transform: none; opacity: 1; }
  .marquee .marquee__track { animation: none !important; flex-wrap: wrap; width: auto; justify-content: center; row-gap: 1rem; }
}
