/* ============ Tokens ============ */
:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --r: 14px;
  --r-sm: 9px;
  --wrap: 1120px;
  --gut: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f14;
  --bg-alt: #0d141b;
  --surface: #111a23;
  --surface-2: #16212c;
  --line: #1e2b38;
  --line-2: #2a3a4b;
  --ink: #e6edf4;
  --ink-2: #b9c6d3;
  --muted: #8396a9;
  --accent: #2fd3bf;
  --accent-2: #5fe3d3;
  --accent-ink: #032420;
  --accent-soft: rgba(47, 211, 191, .12);
  --red: #ff6b5e;
  --red-soft: rgba(255, 107, 94, .13);
  --blue: #4ea8ff;
  --blue-soft: rgba(78, 168, 255, .13);
  --amber: #f3b54a;
  --amber-soft: rgba(243, 181, 74, .13);
  --ok: #3ddc84;
  --ok-soft: rgba(61, 220, 132, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --term-bg: #070b0f;
  --mono-ink: #ffffff;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7f9;
  --bg-alt: #edf1f5;
  --surface: #ffffff;
  --surface-2: #f3f6f9;
  --line: #dde4eb;
  --line-2: #c9d3de;
  --ink: #0c1620;
  --ink-2: #33475b;
  --muted: #566a7e;
  --accent: #0b8a7c;
  --accent-2: #087567;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 138, 124, .1);
  --red: #c93a2d;
  --red-soft: rgba(201, 58, 45, .09);
  --blue: #1f6fcc;
  --blue-soft: rgba(31, 111, 204, .09);
  --amber: #9a6400;
  --amber-soft: rgba(196, 128, 0, .11);
  --ok: #138a4a;
  --ok-soft: rgba(19, 138, 74, .1);
  --shadow: 0 1px 2px rgba(12, 22, 32, .05), 0 10px 28px -14px rgba(12, 22, 32, .18);
  --term-bg: #0b1117;
  --mono-ink: #181717;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none;
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

/* ============ Icons ============ */
[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; fill: var(--c, currentColor); }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
/* El desenfoque va en una capa aparte: en .nav convertiría a la barra en el
   bloque contenedor del menú móvil (position: fixed) y lo dejaría sin alto. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
.nav-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: var(--accent-ink); font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
:root[data-theme="light"] .brand-mark { color: #fff; }
.brand-text { font-size: 14px; color: var(--ink); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative; padding: 10px 12px; font-size: 14px; color: var(--ink-2); text-decoration: none;
  border-radius: 8px; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-tools { display: flex; gap: 8px; }
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .2s, transform .15s var(--ease), background-color .2s;
}
.tool:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tool:active { transform: translateY(0) scale(.96); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.i-moon { fill: currentColor !important; stroke: none !important; }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }
.lang-btn { font: 500 13px var(--mono); }
.lang-btn span { color: var(--muted); transition: color .2s; }
.lang-btn .sep { opacity: .5; }
html[lang="es"] .lang-btn [data-l="es"], html[lang="en"] .lang-btn [data-l="en"] { color: var(--accent); }
.menu-btn { display: none; }
.menu-cta { display: none; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 550; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); box-shadow: 0 8px 24px -10px var(--accent); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; }

/* ============ Hero / perfil ============ */
.hero { padding: 24px 0 56px; }
.banner {
  position: relative; height: 240px; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 85% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(90% 120% at 10% 100%, color-mix(in srgb, var(--blue) 20%, transparent), transparent 60%),
    var(--surface);
}
.banner::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}
#net { position: absolute; inset: 0; width: 100%; height: 100%; }
#net .edge { stroke: color-mix(in srgb, var(--accent) 38%, var(--line-2)); stroke-width: 1.2; fill: none; }
#net .edge.hot { stroke: color-mix(in srgb, var(--red) 55%, transparent); stroke-dasharray: 4 5; }
#net .node { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
#net .node.core { fill: var(--accent); }
#net .node.alert { stroke: var(--red); }
#net .ring { fill: none; stroke: var(--red); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: ring 2.6s var(--ease) infinite; }
#net .lbl { font: 500 11px var(--mono); fill: var(--muted); letter-spacing: .04em; }
#net .lbl.alert { fill: var(--red); }
#net .pkt { fill: var(--accent-2); }
#net .pkt.red { fill: var(--red); }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
.banner-tag {
  position: absolute; left: 16px; top: 14px; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; font-size: 11px; letter-spacing: .08em; color: var(--ink-2);
  background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live 2.4s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.profile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 24px;
  padding: 0 8px; margin-top: 18px; position: relative;
}
.avatar {
  position: relative; width: 132px; height: 132px; border-radius: 30px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #0f2a33, #0b1a2a 55%, #102536);
  border: 5px solid var(--bg); box-shadow: var(--shadow); margin-top: -74px;
}
.avatar span {
  font: 650 46px var(--font); letter-spacing: -.03em;
  background: linear-gradient(135deg, #5fe3d3, #4ea8ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.avatar .status {
  position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok); border: 4px solid var(--bg);
}
.who { padding-bottom: 4px; min-width: 0; }
.who h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.035em; }
.role { margin-top: 6px; color: var(--ink-2); font-size: 17px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 99px;
  font: 500 12px var(--mono); letter-spacing: .02em;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.profile-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding-top: 6px; }
.socials { display: flex; gap: 8px; }
.social {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .15s var(--ease), border-color .2s;
}
.social:hover { transform: translateY(-2px); border-color: var(--line-2); }
.social:active { transform: scale(.96); }
.ctas { display: flex; gap: 10px; }

[data-icon="linkedin"] { --c: #0A66C2; }
[data-icon="github"] { --c: var(--ink); }
[data-icon="tryhackme"] { --c: var(--red); }
:root[data-theme="light"] [data-icon="tryhackme"] { --c: #212C42; }
:root[data-theme="dark"] .social [data-icon="linkedin"], :root[data-theme="dark"] .clink [data-icon="linkedin"] { --c: #4a9be8; }
[data-icon="google"] { --c: #4285F4; }
[data-icon="linux"] { --c: var(--ink); }
[data-icon="windows"] { --c: #0078D4; }
[data-icon="mongodb"] { --c: #47A248; }
[data-icon="react"] { --c: #61DAFB; }
:root[data-theme="light"] [data-icon="react"] { --c: #149eca; }
[data-icon="nodedotjs"] { --c: #5FA04E; }
[data-icon="express"] { --c: var(--ink); }
[data-icon="javascript"] { --c: #F7DF1E; }
:root[data-theme="light"] [data-icon="javascript"] { --c: #c9a800; }
[data-icon="html5"] { --c: #E34F26; }
[data-icon="css3"] { --c: #1572B6; }
[data-icon="mysql"] { --c: #4479A1; }

/* Intro + terminal */
.intro { display: grid; grid-template-columns: 1fr 1.05fr; gap: 28px; margin-top: 44px; align-items: stretch; }
.eyebrow { font-size: 13px; color: var(--accent); letter-spacing: .02em; }
.about { display: flex; flex-direction: column; gap: 16px; }
.lead { font-size: 19px; line-height: 1.55; color: var(--ink); }
.about > p:not(.lead):not(.eyebrow) { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; padding-top: 8px; }
.facts li {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
}
.facts b { font-size: 22px; letter-spacing: -.02em; }
.facts span { font-size: 13px; color: var(--muted); line-height: 1.35; }

.term {
  display: flex; flex-direction: column;
  border-radius: var(--r); overflow: hidden; background: var(--term-bg);
  border: 1px solid #1c2733; box-shadow: var(--shadow); min-height: 340px;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 0 8px 0 14px; height: 44px;
  background: #0e151c; border-bottom: 1px solid #1c2733; color: #7d8fa1;
}
.term-bar > i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar > i:nth-child(2) { background: #febc2e; }
.term-bar > i:nth-child(3) { background: #28c840; }
.term-bar > span { margin-left: 10px; font-size: 12px; }
.term-replay {
  margin-left: auto; min-height: 36px; padding: 0 10px; border-radius: 7px; border: 1px solid transparent;
  background: none; color: #7d8fa1; font-size: 12px; cursor: pointer; transition: color .2s, border-color .2s;
}
.term-replay:hover { color: #e6edf4; border-color: #2a3a4b; }
.term-body {
  flex: 1; margin: 0; padding: 18px 18px 22px; font-size: 13.5px; line-height: 1.75;
  color: #c9d6e2; white-space: pre-wrap; word-break: break-word;
}
.term-body .p { color: #2fd3bf; }
.term-body .c { color: #e6edf4; }
.term-body .o { color: #8ea3b6; }
.term-body .k { color: #4ea8ff; }
.term-body .r { color: #ff6b5e; }
.term-body .g { color: #3ddc84; }
.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: #2fd3bf; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Hero entrance (una sola vez) */
[data-enter] .banner, [data-enter] .profile, [data-enter] .intro { animation: enter .8s var(--ease) both; }
[data-enter] .profile { animation-delay: .08s; }
[data-enter] .intro { animation-delay: .16s; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }

/* ============ Stats ============ */
.stats-band { padding: 0 0 72px; }
.stats { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 20px 22px; background: var(--surface); text-decoration: none; }
.stat b { font-size: 26px; letter-spacing: -.03em; font-weight: 650; }
.stat small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.stat.thm { flex-direction: row; align-items: center; gap: 14px; transition: background-color .2s; }
.stat.thm:hover { background: var(--surface-2); }
.stat.thm > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.stat-ico { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--red-soft); }
:root[data-theme="light"] .stat-ico { background: var(--surface-2); }

/* ============ Secciones ============ */
main > section:not(.hero):not(.stats-band) { padding: 96px 0; }
section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.sec-head { display: grid; gap: 10px; margin-bottom: 40px; max-width: 680px; }
.sec-head h2, .contact h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; }
.sec-sub { color: var(--muted); font-size: 17px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.card h3 { font-size: 20px; margin-top: 18px; }
.card p { color: var(--ink-2); }
.card .org { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ico-box {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
}
.ico-box svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico-box.brand { background: var(--surface-2); border: 1px solid var(--line); }
.ico-box.brand [data-icon] { width: 22px; height: 22px; }
.tag {
  padding: 4px 9px; border-radius: 7px; font-size: 12px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap;
}
.tag.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag.warn { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip, .tags li {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 8px;
  font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip [data-icon], .tags [data-icon] { width: 15px; height: 15px; }

/* Timeline */
.timeline { position: relative; display: grid; gap: 14px; max-width: 880px; }
.timeline::before {
  content: ""; position: absolute; left: 131px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(var(--line-2), var(--accent) 78%, color-mix(in srgb, var(--accent) 0%, transparent));
}
.tl { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 44px; align-items: start; }
.tl::before {
  content: ""; position: absolute; left: 125px; top: 22px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--line-2); z-index: 1;
}
.tl.done::before { background: var(--accent); border-color: var(--accent); }
.tl.now::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.tl.next::before { background: var(--bg-alt); border: 2px dashed var(--accent); }
.tl-date { padding-top: 16px; text-align: right; font-size: 13px; color: var(--muted); }
.tl.now .tl-date { color: var(--amber); }
.tl.next .tl-date { color: var(--accent); }
.tl-card {
  padding: 16px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, transform .2s var(--ease);
}
.tl-card:hover { border-color: var(--line-2); transform: translateX(3px); }
.tl.next .tl-card { border-style: dashed; background: transparent; }
.tl-card h3 { font-size: 17px; letter-spacing: -.01em; }
.tl-card .org { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tl-card p:last-child { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.tl-card a { color: var(--accent); text-underline-offset: 3px; }

/* Certificaciones */
.cert-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: auto auto; gap: 20px; }
.cert.feature { grid-row: span 2; }
.cert.span2 { grid-column: span 2; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-top: 4px; }
.progress span { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 8px !important; }
.checks { display: grid; gap: 10px; margin-top: 18px; }
.checks li { display: flex; gap: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.checks li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 6px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fd3bf' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.cert-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.cert-foot > div { padding: 22px 24px; border-radius: var(--r); border: 1px dashed var(--line-2); }
.mini-h { font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: .02em; margin-bottom: 14px; }
.plain { display: grid; gap: 12px; }
.plain li, .road li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.plain b, .road b { font-weight: 550; }
.plain span { color: var(--muted); font-size: 14px; }
.road { display: grid; gap: 12px; }
.road li { justify-content: flex-start; align-items: center; }
.team { font: 500 11px var(--mono); padding: 3px 7px; border-radius: 6px; letter-spacing: .06em; }
.team.blue { color: var(--blue); background: var(--blue-soft); }
.team.red { color: var(--red); background: var(--red-soft); }

/* Labs */
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); margin: -16px 0 24px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .b, .rooms .b { --t: var(--blue); }
.legend .r, .rooms .r { --t: var(--red); }
.legend .p, .rooms .p { --t: #c77dff; }
:root[data-theme="light"] .legend .p, :root[data-theme="light"] .rooms .p { --t: #8a3fd1; }
.legend i { background: var(--t); }
.rooms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px; }
.rooms li a {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 14.5px; line-height: 1.3;
  transition: transform .2s var(--ease), border-color .2s;
}
.rooms li a:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--t) 50%, var(--line)); }
.rooms li a::before { content: ""; flex: none; width: 4px; align-self: stretch; border-radius: 4px; background: var(--t); }
.link-arrow { display: inline-flex; min-height: 44px; align-items: center; color: var(--accent); font-weight: 550; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 0 1.5px no-repeat; transition: background-size .3s var(--ease); }
.link-arrow:hover { background-size: 100% 1.5px; }

/* Habilidades */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill.wide { grid-column: span 2; }
.skill h3 { margin: 0 0 16px; font-size: 17px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags.soft li { background: transparent; }

/* Contacto */
.contact-sec { background: radial-gradient(70% 90% at 100% 0%, var(--accent-soft), transparent 60%), var(--bg-alt); border-top: 1px solid var(--line); }
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.contact h2 { margin: 10px 0 16px; }
.contact-box { padding: 28px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 22px; }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.mail { font-size: clamp(16px, 2.2vw, 21px); color: var(--ink); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--ease); word-break: break-all; }
.mail:hover { background-size: 100% 1.5px; }
.contact-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clink {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s;
}
.clink:hover { transform: translateY(-2px); border-color: var(--line-2); }
.clink [data-icon] { width: 22px; height: 22px; }
.clink > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.clink b { font-size: 14px; font-weight: 600; }
.clink small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cv-row .dim { font-size: 13px; margin-right: auto; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; background: var(--ink); color: var(--bg);
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .nav-links a { padding: 10px 8px; }
  .brand-text { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.thm { grid-column: span 2; }
  .rooms { grid-template-columns: repeat(3, 1fr); }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .cert.feature { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav-tools { margin-left: auto; }
  /* Menú móvil: panel flotante bajo la barra */
  .nav-links {
    position: fixed; top: 74px; left: var(--gut); right: var(--gut); z-index: 49;
    flex-direction: column; gap: 2px; margin: 0; padding: 10px;
    max-height: calc(100dvh - 90px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .18);
    visibility: hidden; opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .nav-links.open { visibility: visible; opacity: 1; transform: none; }
  .nav-links a {
    display: flex; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 12px;
    font-size: 17px; font-weight: 550; color: var(--ink); transition: background-color .15s;
  }
  .nav-links a:hover, .nav-links a.active { background: var(--surface-2); }
  .nav-links a::after { display: none; }
  .nav-links .menu-cta {
    display: flex; gap: 10px; margin-top: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 650;
  }
  .nav-links .menu-cta:hover { background: var(--accent-2); }
  .menu-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .profile { grid-template-columns: 1fr; gap: 16px; margin-top: 0; padding: 0; }
  .avatar { width: 112px; height: 112px; border-radius: 26px; margin-left: 12px; }
  .avatar span { font-size: 38px; }
  .profile-actions { align-items: stretch; }
  .intro, .grid-2, .contact { grid-template-columns: 1fr; }
  .contact { gap: 28px; }
  .timeline::before { left: 7px; }
  .tl { grid-template-columns: 1fr; gap: 6px; padding-left: 32px; }
  .tl::before { left: 1px; top: 4px; }
  .tl-date { text-align: left; padding-top: 0; }
  .cert-foot { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --gut: 16px; }
  .hero { padding-top: 16px; }
  .banner { height: 180px; border-radius: 16px; }
  .banner-tag { display: none; }
  .ctas { flex-direction: column; }
  .ctas .btn { width: 100%; }
  .socials { justify-content: flex-start; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:last-child { grid-column: span 2; }
  .term { min-height: 0; }
  .term-body { font-size: 12.5px; padding: 14px; }
  .rooms { grid-template-columns: 1fr 1fr; }
  .skills { grid-template-columns: 1fr; }
  .skill.wide { grid-column: auto; }
  .cert-grid { grid-template-columns: 1fr; }
  .cert.feature, .cert.span2 { grid-column: auto; }
  .contact-links { grid-template-columns: 1fr; }
  .contact-box { padding: 20px; }
  .cv-row .btn { flex: 1; }
  .cv-row .dim { width: 100%; }
  main > section:not(.hero):not(.stats-band) { padding: 72px 0; }
  .lead { font-size: 17.5px; }
}
@media (max-width: 380px) {
  .rooms { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
