/* ==========================================================
   TOKENS
   ========================================================== */
:root {
  --bg: #0b0b0d;
  --bg-2: #141418;
  --bg-3: #1c1c22;
  --fg: #ecebe6;
  --muted: #8c8c96;
  --line: #2a2a31;
  --accent: #c5ff4a;
  --accent-ink: #0b0b0d;
  --violet: #9d85ff;

  --font-display: 'Syne', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1100px;
  /* margen lateral: nunca menos que el gutter, y centra el contenido en pantallas grandes */
  --side: max(var(--gutter), calc((100% - var(--max)) / 2));
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ==========================================================
   BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body.is-loading { overflow: hidden; }

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd {
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: .15em .45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-2);
}

.mono { font-family: var(--font-mono); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==========================================================
   LOADER
   ========================================================== */
.loader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: var(--gutter);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s var(--ease);
}
.loader.is-done { clip-path: inset(0 0 100% 0); }
.loader__label { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.loader__count {
  font-size: clamp(4rem, 16vw, 12rem);
  font-weight: 800;
  line-height: .8;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   CURSOR · GRANO · PROGRESO
   ========================================================== */
.cursor, .cursor-dot { display: none; }

.has-cursor, .has-cursor a, .has-cursor button, .has-cursor input { cursor: none; }
.has-cursor .cursor, .has-cursor .cursor-dot {
  display: block;
  position: fixed; left: 0; top: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}
.cursor::before {
  content: '';
  position: absolute;
  width: 38px; height: 38px; left: -19px; top: -19px;
  border: 1px solid #fff;
  border-radius: 50%;
  transition: transform .35s var(--ease), background-color .35s;
}
.cursor.is-hover::before { transform: scale(1.9); background: #fff; }
.cursor.is-drag::before { transform: scale(2.4); border-style: dashed; }
.cursor.is-text::before { transform: scaleX(.08) scaleY(.7); background: #fff; }
.cursor-dot::before {
  content: '';
  position: absolute;
  width: 5px; height: 5px; left: -2.5px; top: -2.5px;
  background: #fff; border-radius: 50%;
}

.grain {
  position: fixed; inset: -50%;
  z-index: 9000;
  pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 200;
}

/* ==========================================================
   NAV
   ========================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 16px var(--side);
  transition: transform .5s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(var(--bg), transparent);
  pointer-events: none;
  z-index: -1;
}
.nav__logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -.04em; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 1.6rem; font-size: .9rem; }
.nav__links a {
  position: relative;
  color: var(--muted);
  transition: color .3s;
}
.nav__links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__cmd { display: flex; gap: .3rem; padding: .4rem; border-radius: 10px; transition: background .3s; }
.nav__keys { display: flex; gap: .3rem; }
.nav__menu {
  display: none;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
}
.nav__cmd:hover { background: var(--bg-3); }

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  --name-h: 240px;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero__eyebrow, .hero__role {
  position: absolute; left: 50%;
  margin: 0;
  text-align: center;
  width: calc(100% - 2 * var(--gutter));
  pointer-events: none;
}
.hero__eyebrow {
  top: calc(50% - var(--name-h) * .55);
  transform: translate(-50%, -100%);
  color: var(--accent);
  font-size: clamp(.8rem, 1.4vw, 1rem);
}
.hero__role {
  top: calc(50% + var(--name-h) * .5);
  transform: translateX(-50%);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 500;
  color: var(--muted);
}
.typed { color: var(--fg); }
.caret {
  display: inline-block;
  width: .08em; height: 1em;
  margin-left: .08em;
  vertical-align: -.12em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__hint, .hero__scroll {
  position: absolute; bottom: 28px;
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 0;
}
.hero__hint { left: var(--gutter); display: flex; align-items: center; gap: .6rem; }
.hero__hint .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
.hero__scroll { right: var(--gutter); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.hero__scroll span {
  width: 1px; height: 48px;
  background: linear-gradient(var(--fg), transparent);
  background-size: 100% 200%;
  animation: drip 1.8s var(--ease) infinite;
}
@keyframes drip {
  0% { background-position: 0 100%; }
  100% { background-position: 0 -100%; }
}

/* ==========================================================
   MARQUEE
   ========================================================== */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding: .9rem 0;
  background: var(--bg);
}
.marquee__inner {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee__inner { animation-play-state: paused; }
.marquee__item {
  display: flex; align-items: center; gap: 1.5rem;
  padding-right: 1.5rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.marquee__item:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--fg); }
.marquee__item::after { content: '✦'; color: var(--accent); font-size: .5em; -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================
   SECCIONES
   ========================================================== */
.section { padding: clamp(70px, 12vh, 120px) var(--side); }

.section__head {
  display: flex; align-items: flex-start; gap: clamp(.6rem, 1.5vw, 1rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.section__num { color: var(--accent); font-size: .8rem; padding-top: .4em; }
.section__head h2, .contact__title {
  margin: 0;
  font-size: clamp(1.6rem, 7vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
  min-width: 0;
}
.section__sub { color: var(--muted); margin: -.8rem 0 1.5rem; font-size: .9rem; }
.section__sub b { color: var(--accent); font-weight: 600; }

/* Texto partido letra a letra */
.split .word { display: inline-block; overflow: hidden; white-space: nowrap; padding-bottom: .08em; margin-bottom: -.08em; }
.split .char {
  display: inline-block;
  transform: translateY(110%);
  transition: transform .9s var(--ease) calc(var(--i) * 28ms);
}
.split.in .char { transform: none; }

[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ==========================================================
   SOBRE MÍ
   ========================================================== */
.toggle {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: .85rem;
}
.toggle button {
  position: relative; z-index: 1;
  padding: .55rem 1.2rem;
  border-radius: 999px;
  color: var(--muted);
  transition: color .4s;
}
.toggle button.is-active { color: var(--accent-ink); }
.toggle__pill {
  position: absolute; top: 4px; bottom: 4px; left: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: transform .5s var(--ease), width .5s var(--ease);
}

.view { display: none; }
.view.is-active { display: block; animation: viewIn .6s var(--ease); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

.about__lead {
  max-width: 40ch;
  margin: 0 0 2.5rem;
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.about__lead em { font-style: normal; color: var(--violet); }
.about__lead .hl {
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 85% / 100% .2em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.stat { padding: 1.5rem 1rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 1.5rem; }
.stat__num { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat__label { color: var(--muted); font-size: .8rem; }

.code {
  margin: 0;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: clamp(.78rem, 1.3vw, .95rem);
  line-height: 1.75;
  max-width: 760px;
  overflow-x: auto;
}
.code .c { color: var(--muted); font-style: italic; }
.code .k { color: var(--violet); }
.code .s { color: var(--accent); }
.code .n { color: #ff9b5e; }
.code .p { color: #7fd8ff; }
.code .v { color: var(--fg); font-weight: 600; }

/* ==========================================================
   SKILLS
   ========================================================== */
.skills__stage {
  position: relative;
  height: clamp(400px, 60vh, 560px);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg-2);
}
.skills__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.skills__controls { position: absolute; top: 16px; right: 16px; display: flex; gap: .5rem; }
.skills__legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.2rem;
  list-style: none; margin: 1rem 0 0; padding: 0;
  font-size: .8rem; color: var(--muted);
}
.skills__legend li { display: flex; align-items: center; gap: .45rem; }
.skills__legend i { width: 10px; height: 10px; border-radius: 50%; }
.skills__legend .l0 { background: var(--accent); }
.skills__legend .l1 { background: var(--fg); }
.skills__legend .l2 { border: 1.5px solid var(--fg); }

.contact__note {
  display: flex; align-items: center; gap: .6rem;
  margin: -1.5rem 0 0;
  color: var(--muted); font-size: .9rem;
}
.contact__note .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.chip {
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: .78rem;
  transition: border-color .3s, color .3s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================
   RECORRIDO (cuadrícula de tarjetas)
   ========================================================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.2rem;
}

.card { perspective: 1000px; min-width: 0; }
.card__inner {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  transform-style: preserve-3d;
  transition: transform .25s ease-out, border-color .4s;
  --mx: 50%; --my: 50%;
}
.card__inner::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgb(255 255 255 / .07), transparent 40%);
  pointer-events: none;
}
.card:hover .card__inner { border-color: hsl(var(--h) 90% 65% / .6); }
.card__top { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.card__visual {
  position: relative;
  aspect-ratio: 16 / 8;
  border-radius: 12px;
  overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 30%, hsl(var(--h) 95% 60%), transparent 55%),
    radial-gradient(circle at 80% 70%, hsl(calc(var(--h) + 60) 90% 55%), transparent 55%),
    radial-gradient(circle at 60% 10%, hsl(calc(var(--h) - 40) 90% 45%), transparent 50%),
    #111;
  background-size: 180% 180%;
  animation: blobs 10s ease-in-out infinite alternate;
  transform: translateZ(30px);
}
@keyframes blobs {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
.card__glyph {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  color: #fff;
  mix-blend-mode: overlay;
  letter-spacing: -.04em;
}
.card__title { margin: .2rem 0 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; transform: translateZ(20px); }
.card__desc { margin: 0; color: var(--muted); font-size: .9rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.card__tags li { font-family: var(--font-mono); font-size: .7rem; padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.card__link { margin-top: auto; display: inline-flex; gap: .4rem; font-weight: 700; width: max-content; }
.card__link span { transition: transform .4s var(--ease); }
.card__link:hover span { transform: translateX(6px); }

.card--end .card__inner {
  justify-content: center; align-items: flex-start;
  background: transparent;
  border-style: dashed;
  padding: 2rem;
}
.card--end p { margin: 0 0 .5rem; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.card--end a { color: var(--accent); font-family: var(--font-mono); padding: .6rem 0; }

/* ==========================================================
   TERMINAL
   ========================================================== */
.term {
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #08080a;
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--accent) 25%, transparent);
}
.term__bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .8rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.term__bar > span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.term__bar > span:nth-child(2) { background: #febc2e; }
.term__bar > span:nth-child(3) { background: #28c840; }
.term__bar p { margin: 0 auto; padding-right: 3rem; font-size: .8rem; color: var(--muted); }
.term__body {
  height: 380px;
  overflow-y: auto;
  padding: 1.1rem;
  font-size: .85rem;
  line-height: 1.7;
  cursor: text;
}
.t-line { white-space: pre-wrap; word-break: break-word; }
.t-cmd { color: var(--fg); }
.t-cmd b { color: var(--accent); font-weight: 400; }
.t-muted { color: var(--muted); }
.t-accent { color: var(--accent); }
.t-violet { color: var(--violet); }
.t-err { color: #ff6b6b; }
.t-line a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.term__input { display: flex; gap: .6rem; align-items: center; }
.term__prompt { color: var(--violet); white-space: nowrap; }
.term__prompt b { color: var(--accent); font-weight: 400; }
.term__input input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: var(--fg);
  font: inherit;
  caret-color: var(--accent);
}

/* ==========================================================
   CONTACTO
   ========================================================== */
.contact { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 2rem; }
.contact .section__num { padding: 0; }
.contact__title { font-size: clamp(1.8rem, 8.2vw, 4.8rem); max-width: 16ch; text-transform: none !important; letter-spacing: -.04em; }
.contact__row { display: flex; align-items: center; gap: clamp(2rem, 5vw, 4rem); flex-wrap: wrap; }
.contact__btn {
  width: clamp(130px, 14vw, 160px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .95rem;
  display: grid; place-items: center;
  transition: transform .4s var(--ease);
  position: relative;
}
.contact__btn::before {
  content: '';
  position: absolute; inset: -12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: .4;
  animation: ring 3s var(--ease) infinite;
}
@keyframes ring {
  0% { transform: scale(.9); opacity: .6; }
  100% { transform: scale(1.25); opacity: 0; }
}
.contact__socials { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; font-size: 1rem; }
.contact__socials a { position: relative; display: inline-flex; gap: .6rem; padding: .5rem 0; color: var(--muted); transition: color .3s; }
.contact__socials a::before { content: '↗'; color: var(--accent); }
.contact__socials a:hover { color: var(--fg); }

[data-magnetic] { transition: transform .5s var(--ease); }

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 24px var(--side);
  border-top: 1px solid var(--line);
  font-size: .75rem;
  color: var(--muted);
}

/* ==========================================================
   PALETA DE COMANDOS
   ========================================================== */
.palette {
  position: fixed; inset: 0; z-index: 9500;
  background: rgb(5 5 7 / .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 14vh 16px 16px;
  animation: fade .25s ease;
}
.palette[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.palette__panel {
  width: min(620px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgb(0 0 0 / .6);
  animation: pop .3s var(--ease);
}
@keyframes pop { from { transform: translateY(-12px) scale(.98); opacity: 0; } }
.palette__input {
  width: 100%;
  padding: 1.1rem 1.2rem;
  background: none; border: 0; outline: 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-size: 1rem;
}
.palette__list { list-style: none; margin: 0; padding: .4rem; max-height: 50vh; overflow-y: auto; }
.palette__list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem .8rem;
  border-radius: 10px;
  cursor: pointer;
}
.palette__list li small { font-family: var(--font-mono); color: var(--muted); font-size: .7rem; }
.palette__list li.is-selected { background: var(--bg-3); }
.palette__list li.is-selected::before { content: '→'; color: var(--accent); margin-right: .6rem; }
.palette__list li span { margin-right: auto; }
.palette__empty { color: var(--muted); cursor: default !important; }
.palette__foot { margin: 0; padding: .7rem 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* ==========================================================
   TOAST
   ========================================================== */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 9600;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: .8rem 1.2rem;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .85rem;
  text-align: center;
  overflow-wrap: anywhere;
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  transition: transform .5s var(--ease), visibility 0s .5s;
  pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); visibility: visible; transition: transform .5s var(--ease); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
  .nav__links { display: none; }
  /* En móvil la paleta hace de menú */
  .nav__keys { display: none; }
  .nav__menu { display: block; }
}

/* Pantallas táctiles: sin atajos de teclado */
@media (hover: none), (pointer: coarse) {
  .palette__foot { display: none; }
  .palette { padding-top: 10vh; }
}

@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-bottom: 1rem; }
  .stat { padding-bottom: 1rem; }
  .hero__hint { font-size: .68rem; }
  .term__body { height: 360px; font-size: .8rem; padding: 1rem; }
  .skills__stage { height: clamp(340px, 56vh, 440px); border-radius: 20px; }
  .skills__controls { top: 12px; right: 12px; }
  .code { white-space: pre-wrap; padding: 1rem; font-size: .78rem; }
}

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