/* ==========================================================================
   LANDEREZ — base.css
   Tokens · tipografía · reset · cabecera · menú · cursor · ambiente · footer
   ========================================================================== */

/* ---------- Tipografías (autoalojadas) ---------- */
@font-face {
  font-family: "Clash Display";
  src: url("../assets/fonts/ClashDisplay-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 300 600;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* color — derivado de la identidad Landerez */
  --ink: #0a0b0e;          /* negro azulado, fondo */
  --ink-2: #111319;        /* superficie */
  --ink-3: #1a1d25;        /* superficie elevada */
  --cream: #efeee4;        /* crema de marca — texto */
  --cream-2: rgba(239, 238, 228, 0.66);
  --cream-3: rgba(239, 238, 228, 0.56);
  --line: rgba(239, 238, 228, 0.12);
  --line-2: rgba(239, 238, 228, 0.22);
  --red: #aa0924;          /* rojo de marca */
  --red-hot: #f03a52;      /* rojo de interacción (AA sobre --ink) */
  --red-deep: #5c0414;

  /* tipo */
  --f-display: "Clash Display", "Arial Narrow", system-ui, sans-serif;
  --f-text: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --fs-micro: 0.6875rem;                              /* 11 */
  --fs-small: 0.8125rem;                              /* 13 */
  --fs-body: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --fs-lead: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --fs-h2: clamp(2.25rem, 1.4rem + 3.6vw, 5rem);
  --fs-h1: clamp(3rem, 1rem + 8vw, 9rem);

  /* espacio */
  --gutter: clamp(1rem, 0.5rem + 2.4vw, 2.5rem);
  --section: clamp(6rem, 4rem + 8vw, 12rem);
  --max: 1600px;
  --header-h: 72px;
  --radius: 16px;
  --radius-sm: 10px;

  /* movimiento */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);        /* salida suave */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 0.25s;
  --t-med: 0.6s;
  --t-slow: 1.1s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--f-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
/* Selección de texto: sin fondo, el propio texto cambia de color
   (rojo sobre oscuro · crema sobre rojo · negro sobre fondos claros o de color) */
::selection { background: transparent; color: var(--red-hot); }
.accent::selection, .accent *::selection, em::selection, .hw--r::selection,
.pcard__num::selection,
.quote__mark::selection, .field__error::selection, .form-status.is-error::selection,
.page-head__count [data-count]::selection, .live-dot + span::selection { color: var(--cream); }
.btn--solid *::selection, .chip[aria-pressed="true"]::selection, .chip[aria-pressed="true"] *::selection,
.lang__opt[aria-pressed="true"]::selection, .skip-link::selection, .wa *::selection, .cursor *::selection { color: var(--ink); }

:focus-visible {
  outline: 1px solid var(--red-hot);
  outline-offset: 4px;
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.35s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in 0.55s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
::view-transition-group(project-cover) { animation-duration: 0.7s; animation-timing-function: var(--ease); }

/* ---------- Utilidades ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 1000;
  padding: 0.75rem 1rem; background: var(--cream); color: var(--ink);
  font-family: var(--f-mono); font-size: var(--fs-small);
  transform: translateY(-200%); transition: transform var(--t-fast) var(--ease);
}
.skip-link:focus { transform: none; }

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

.mono, .label {
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.label { color: var(--cream-2); display: inline-flex; align-items: center; gap: 0.6em; }
.label::before {
  content: ""; width: 0.55em; height: 0.55em; flex: none;
  border-left: 1.5px solid var(--red-hot); border-bottom: 1.5px solid var(--red-hot);
}
.display { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.02em; line-height: 0.95; }
.accent { color: var(--red-hot); }

/* Placeholder claramente identificado (contenido pendiente) */
.pending {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--f-mono); font-size: var(--fs-micro); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cream-3);
  padding: 0.35em 0.6em; border: 1px dashed var(--line-2);
}
.pending::before { content: "◌"; color: var(--red-hot); }

/* ---------- Revelados ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; } /* red de seguridad: el texto dividido nunca queda invisible */
.js .reveal[data-delay="1"] { transition-delay: 0.08s; }
.js .reveal[data-delay="2"] { transition-delay: 0.16s; }
.js .reveal[data-delay="3"] { transition-delay: 0.24s; }

/* Revelado por líneas: máscara + desplazamiento */
.line-mask { display: block; overflow: hidden; padding: 0 0.08em 0.06em 0; margin: 0 -0.08em -0.06em 0; }
.line-mask > span { display: block; transition: transform 1.1s var(--ease); }
.js [data-split]:not(.is-in) .line-mask > span { transform: translateY(105%); }
[data-split] .line-mask:nth-child(2) > span { transition-delay: 0.07s; }
[data-split] .line-mask:nth-child(3) > span { transition-delay: 0.14s; }
[data-split] .line-mask:nth-child(4) > span { transition-delay: 0.21s; }

/* Imagen con revelado diagonal (45° — el ángulo del isotipo) */
.img-reveal { overflow: hidden; border-radius: var(--radius); }
.img-reveal img { border-radius: var(--radius); }
.js .img-reveal img {
  clip-path: polygon(0 0, 0 0, 0 0);
  transform: scale(1.12);
  transition: clip-path 0.85s var(--ease), transform 1.1s var(--ease);
}
.js .img-reveal.is-in img { clip-path: polygon(0 0, 200% 0, 0 200%); transform: none; }

/* ---------- Ambiente: el espacio responde al usuario ---------- */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(92, 4, 20, 0.26), transparent 60%),
    linear-gradient(180deg, #0a0b0e 0%, #0b0c11 100%);
}
.ambient__glow {
  position: absolute; left: 0; top: 0;
  width: 90vmax; height: 90vmax; margin: -45vmax 0 0 -45vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(170, 9, 36, 0.13), rgba(170, 9, 36, 0.05) 45%, transparent 72%);
  opacity: calc(0.7 + var(--heat, 0) * 0.45);
  will-change: transform;
  transition: opacity 0.8s var(--ease);
}
.ambient__glow--echo {
  width: 70vmax; height: 70vmax; margin: -35vmax 0 0 -35vmax;
  background: radial-gradient(closest-side, rgba(170, 9, 36, 0.12), transparent 70%);
  opacity: 0.75;
}
/* Tramado de periódico dentro de la mancha que sigue al cursor (core.js).
   Retícula a 45° como la trama de imprenta: puntos más gruesos en el centro
   y más finos hacia fuera, fundidos con una máscara radial. */
.ambient__tone {
  --w: 64vmax;
  position: absolute; left: 0; top: 0; width: var(--w); height: var(--w); margin: calc(var(--w) / -2) 0 0 calc(var(--w) / -2);
  overflow: hidden; will-change: transform;
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 100%);
  opacity: calc(0.55 + var(--heat, 0) * 0.3);
  transition: opacity 0.8s var(--ease);
}
.ambient__tone i {
  position: absolute; left: 50%; top: 50%; width: 100vw; height: 100vh; will-change: transform;
  --dot: rgba(240, 58, 82, 0.34);
  background-image:
    radial-gradient(circle, var(--dot) 0.75px, transparent 1.15px),
    radial-gradient(circle, var(--dot) 0.75px, transparent 1.15px);
  background-size: 7px 7px; background-position: 0 0, 3.5px 3.5px;
}
.ambient__tone--core { --w: 30vmax; opacity: calc(0.6 + var(--heat, 0) * 0.3); }
.ambient__tone--core i {
  --dot: rgba(240, 58, 82, 0.4);
  background-image:
    radial-gradient(circle, var(--dot) 1.35px, transparent 1.8px),
    radial-gradient(circle, var(--dot) 1.35px, transparent 1.8px);
}

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: transform 0.6s var(--ease), background-color 0.4s var(--ease);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-solid {
  background: rgba(10, 11, 14, 0.94);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand__iso {
  display: block; width: 28px; aspect-ratio: 256 / 250; background: var(--cream);
  -webkit-mask: url("../assets/brand/isotipo.png") center / contain no-repeat;
  mask: url("../assets/brand/isotipo.png") center / contain no-repeat;
  transition: background-color var(--t-fast);
}
.brand:hover .brand__iso { background: var(--red-hot); }

.nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.5vw, 2.75rem); }
.nav__link {
  position: relative;
  font-family: var(--f-mono); font-size: var(--fs-micro); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cream-2);
  padding-block: 0.5rem;
  transition: color var(--t-fast);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 1px;
  background: var(--red-hot); transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--cream); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

/* Selector de idioma — sutil pero descubrible */
.lang {
  cursor: pointer; /* todo el selector es pulsable: alterna ES ⇄ EN */
  position: relative;
  display: inline-grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px;
  font-family: var(--f-mono); font-size: var(--fs-micro); letter-spacing: 0.1em;
}
.lang__opt {
  position: relative; z-index: 1;
  min-width: 2.4rem; padding: 0.45rem 0.6rem;
  color: var(--cream-2); text-align: center; border-radius: 999px;
  transition: color 0.35s var(--ease);
}
.lang__opt[aria-pressed="true"] { color: var(--cream); }
.lang__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--red);
  transition: transform 0.5s var(--ease);
}
html[lang="en"] .lang__thumb { transform: translateX(100%); }
.lang:hover { border-color: var(--cream-3); }
.header-actions { position: relative; }
.sound-hint {
  position: absolute; top: calc(100% + 14px); right: 0; z-index: 5;
  width: max-content; max-width: min(19rem, calc(100vw - 32px));
  font-family: var(--f-mono); font-size: var(--fs-micro); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.5;
  color: var(--cream); background: var(--ink-3); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 0.6rem 0.8rem;
  opacity: 0; transform: translateY(-6px) scale(0.97); transform-origin: calc(100% - var(--ax, 1.4rem)) 0; pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}
.sound-hint::before {
  content: ""; position: absolute; top: -5px; right: calc(var(--ax, 1.4rem) - 4px); width: 8px; height: 8px;
  background: var(--ink-3); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
  transform: rotate(45deg);
}
.sound-hint.is-on { opacity: 1; transform: none; }
.sound-toggle.is-hinted { animation: hint-pulse 2.2s var(--ease) 3; }
@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 58, 82, 0); }
  30% { box-shadow: 0 0 0 6px rgba(240, 58, 82, 0.22); }
}
@media (prefers-reduced-motion: reduce) {
  .sound-hint { transform: none; transition: opacity 0.3s; }
  .sound-toggle.is-hinted { animation: none; border-color: var(--red-hot); }
}

.menu-btn {
  display: none;
  width: 44px; height: 44px; position: relative;
  border: 1px solid var(--line-2); border-radius: 50%;
}
.menu-btn span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--cream);
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 25px; right: 18px; }
.menu-open .menu-btn span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 21px; right: 13px; transform: rotate(-45deg); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Menú móvil a pantalla completa */
.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0);
  transition: clip-path 0.8s var(--ease-io);
  visibility: hidden;
}
.menu-open .mobile-menu { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); visibility: visible; }
.mobile-menu::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 50% at 100% 0%, rgba(170, 9, 36, 0.35), transparent 70%);
}
.mobile-menu__list { position: relative; display: grid; gap: 0.25rem; }
.mobile-menu__link {
  display: flex; align-items: baseline; gap: 1rem;
  font-family: var(--f-display); font-weight: 500; font-size: clamp(2.75rem, 13vw, 5rem); line-height: 1.02; letter-spacing: -0.02em;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease), color var(--t-fast);
}
.mobile-menu__link small { font-family: var(--f-mono); font-size: var(--fs-micro); color: var(--red-hot); letter-spacing: 0.1em; }
.menu-open .mobile-menu__link { opacity: 1; transform: none; }
.menu-open .mobile-menu__list li:nth-child(2) .mobile-menu__link { transition-delay: 0.06s; }
.menu-open .mobile-menu__list li:nth-child(3) .mobile-menu__link { transition-delay: 0.12s; }
.menu-open .mobile-menu__list li:nth-child(4) .mobile-menu__link { transition-delay: 0.18s; }
.mobile-menu__foot {
  position: relative; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
}
.mobile-menu__foot a { font-family: var(--f-mono); font-size: var(--fs-micro); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream-2); }

/* ---------- Cursor (solo punteros finos) ---------- */
.cursor { display: none; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor [data-cursor] { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.has-cursor .cursor {
  display: block; position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none;
  width: 0; height: 0;
}
.cursor__frame {
  position: absolute; left: 0; top: 0;
  width: var(--cw, 26px); height: var(--ch, 26px);
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0);
  transition: width 0.45s var(--ease), height 0.45s var(--ease), opacity 0.3s;
}
.cursor__frame::before, .cursor__frame::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  transition: border-color 0.3s, width 0.45s var(--ease), height 0.45s var(--ease), border-radius 0.45s var(--ease);
}
.cursor__frame::before { left: 0; top: 0; border-left: 1.5px solid var(--cream); border-top: 1.5px solid var(--cream); }
.cursor__frame::after { right: 0; bottom: 0; border-right: 1.5px solid var(--cream); border-bottom: 1.5px solid var(--cream); }
.cursor__dot {
  position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; background: var(--red-hot);
  transform: translate3d(var(--dx, -100px), var(--dy, -100px), 0);
}
.cursor.is-link .cursor__frame::before, .cursor.is-link .cursor__frame::after { border-color: var(--red-hot); width: 12px; height: 12px; }
/* Sobre un botón redondeado, las esquinas del marco se curvan con su mismo radio */
.cursor__frame::before { border-top-left-radius: var(--cr, 0px); }
.cursor__frame::after { border-bottom-right-radius: var(--cr, 0px); }
.cursor.is-round .cursor__frame::before, .cursor.is-round .cursor__frame::after {
  width: min(calc(var(--cr) + 7px), 50%); height: min(calc(var(--cr) + 7px), 50%);
}
.cursor.is-down .cursor__frame { width: calc(var(--cw, 26px) * 0.85); height: calc(var(--ch, 26px) * 0.85); }
.cursor__label {
  position: absolute; left: 0; top: 0;
  transform: translate3d(var(--dx, -100px), var(--dy, -100px), 0);
}
.cursor__label span {
  display: block; margin: 18px 0 0 18px; white-space: nowrap;
  font-family: var(--f-mono); font-size: var(--fs-micro); letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--red); color: var(--cream); padding: 0.5rem 0.7rem;
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  transition: clip-path 0.45s var(--ease);
}
.cursor.has-label .cursor__label span { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.cursor.has-label .cursor__frame { opacity: 0; }
.cursor.is-hidden { opacity: 0; }

/* ---------- Botones y enlaces ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 14px;
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* recorte redondeado fiable en Safari iOS */
  display: inline-flex; align-items: center; gap: 0.9rem;
  padding: 1.05rem 1.5rem;
  font-family: var(--f-mono); font-size: var(--fs-small); letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line-2);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red);
  clip-path: polygon(0 100%, 0 100%, 0 100%); /* barrido diagonal */
  transition: clip-path 0.6s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { clip-path: polygon(0 -100%, 200% 100%, 0 100%); }
.btn:hover { border-color: var(--red); }
.btn--solid { background: var(--red); border-color: var(--red); }
.btn--solid::before { background: var(--cream); }
.btn--solid:hover { color: var(--ink); border-color: var(--cream); }
.arrow { display: inline-block; transition: transform 0.5s var(--ease); }
a:hover .arrow, button:hover .arrow { transform: translate(3px, 3px); }
.arrow--ne { transform: none; }
a:hover .arrow--ne { transform: translate(3px, -3px); }

.link-u {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease), color var(--t-fast);
}
.link-u:hover { background-size: 100% 1px; color: var(--red-hot); }

/* ---------- Secciones ---------- */
.section { position: relative; padding-block: var(--section); }
.section-head {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
  align-items: end; margin-bottom: clamp(3rem, 6vw, 6rem);
}
.section-head__label { grid-column: 1 / span 3; align-self: start; padding-top: 0.6em; }
.section-head__title { grid-column: 4 / span 9; font-size: var(--fs-h2); }

/* ---------- Footer ---------- */
.site-footer { position: relative; padding-top: clamp(4rem, 8vw, 8rem); overflow: hidden; border-top: 1px solid var(--line); }
.footer-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.footer-col { grid-column: span 3; display: grid; gap: 0.6rem; align-content: start; }
.footer-col .label { margin-bottom: 0.75rem; }
.footer-col a { color: var(--cream-2); width: fit-content; }
.footer-col a:hover { color: var(--cream); }
.footer-col--lead { grid-column: span 6; }
.footer-col--lead p { font-family: var(--f-display); font-weight: 400; font-size: var(--fs-h3); line-height: 1.16; max-width: 18ch; }

.footer-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-block: 1.25rem 2rem; border-top: 1px solid var(--line);
  color: var(--cream-3);
}
/* Volver arriba: píldora con flecha en círculo rojo */
.to-top {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.4rem 0.45rem 0.4rem 1.1rem;
  border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--cream);
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease), scale 0.16s var(--ease);
}
.to-top::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red);
  transform: translateY(101%); transition: transform 0.55s var(--ease);
}
.to-top > span:last-child {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--red); color: var(--cream); font-size: 0.95rem; letter-spacing: 0;
  transition: transform 0.55s var(--ease), background-color 0.4s;
}
.to-top:hover, .to-top:focus-visible { border-color: var(--red); }
.to-top:hover::before, .to-top:focus-visible::before { transform: none; }
.to-top:hover > span:last-child, .to-top:focus-visible > span:last-child { background: var(--ink); transform: translateY(-2px); animation: to-top-nudge 1.2s var(--ease-io) infinite; }
@keyframes to-top-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .to-top:hover > span:last-child { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .section-head__label { grid-column: 1 / -1; }
  .section-head__title{ grid-column: 1 / -1; }
  .footer-col { grid-column: span 6; }
  .footer-col--lead { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .nav { display: none; }
  .menu-btn { display: block; }

  .footer-col { grid-column: 1 / -1; }
  .footer-bar { flex-direction: column; }
}

/* ---------- Movimiento reducido ----------
   Se desactiva lo intrusivo (parallax, desplazamientos largos, autoplay).
   Las microinteracciones de hover se mantienen. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition-duration: 0.4s; }
  .js [data-split]:not(.is-in) .line-mask > span { transform: none; }
  .js .img-reveal img { clip-path: none; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.01s; }
}

/* Firma del footer: texto + imagotipo centrados */
.footer-made { display: inline-flex; flex-direction: column; align-items: center; gap: 0.7rem; text-align: center; }
.footer-made img { height: 18px; width: auto; opacity: 0.92; }
.footer-bar { align-items: center; }
@media (max-width: 760px) { .footer-bar { align-items: center; text-align: center; } }

/* ---------- Títulos que se escriben ---------- */
.js [data-type]:not(.type-ready) { animation: type-safety 0s 4s forwards; visibility: hidden; }
@keyframes type-safety { to { visibility: visible; } }
.type-ready:not(.is-typed) .tc:not(.on) { visibility: hidden; }
.type-caret {
  display: inline-block; width: 0.06em; height: 0.78em; margin: 0 -0.1em 0 0.04em;
  background: var(--red-hot); vertical-align: -0.02em;
  animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* Títulos con escritura: sin máscara, para que ninguna letra quede recortada */
[data-type] .line-mask { overflow: visible; }

/* ---------- Botón de sonido (barras de ecualizador) ---------- */
.sound-toggle {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  color: var(--cream-2);
  transition: border-color 0.3s, color 0.3s;
}
.sound-toggle:hover { border-color: var(--cream-3); color: var(--cream); }
.sound-toggle__bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-toggle__bars i {
  display: block; width: 2px; height: 3px; border-radius: 1px; background: currentColor;
  transition: height 0.3s var(--ease);
}
.sound-toggle.is-on { color: var(--cream); }
.sound-toggle.is-on .sound-toggle__bars i { background: var(--red-hot); animation: eq 1.1s var(--ease-io) infinite alternate; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(1) { animation-delay: -0.2s; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(2) { animation-delay: -0.7s; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(3) { animation-delay: -0.4s; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(4) { animation-delay: -0.9s; }
@keyframes eq { 0% { height: 3px; } 100% { height: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .sound-toggle.is-on .sound-toggle__bars i { animation: none; height: 8px; }
}
@media (max-width: 760px) { .sound-toggle { width: 44px; height: 44px; } .lang__opt { min-height: 38px; } }

/* Botón de sonido apagado: los puntos ondulan suavemente, como una invitación */
.sound-toggle:not(.is-on) .sound-toggle__bars { align-items: center; }
.sound-toggle:not(.is-on) .sound-toggle__bars i {
  width: 3px; height: 3px; border-radius: 50%;
  animation: dot-wave 4.2s var(--ease-io) infinite;
}
.sound-toggle:not(.is-on) .sound-toggle__bars i:nth-child(2) { animation-delay: 0.22s; }
.sound-toggle:not(.is-on) .sound-toggle__bars i:nth-child(3) { animation-delay: 0.44s; }
.sound-toggle:not(.is-on) .sound-toggle__bars i:nth-child(4) { animation-delay: 0.66s; }
.sound-toggle:not(.is-on):hover .sound-toggle__bars i { opacity: 0.9; }
@keyframes dot-wave {
  0%, 35%, 100% { transform: translateY(0); opacity: 0.5; }
  17% { transform: translateY(-1.5px); opacity: 0.8; }
}
@media (prefers-reduced-motion: reduce) {
  .sound-toggle:not(.is-on) .sound-toggle__bars i { animation: none; }
}

/* ---------- Smooth scroll (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Móvil en horizontal: aviso para volver a vertical (core.js) ----------
   No aparece en tablets ni ordenadores (altura pequeña + táctil) ni mientras
   se está en la vista completa de imágenes, que sí se puede usar en horizontal. */
.rotate-lock { display: none; }
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  html:not(.lb-open) .rotate-lock {
    position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center;
    gap: 0.75rem; padding: 1.5rem; text-align: center; background: var(--ink); color: var(--cream);
  }
  html:not(.lb-open) body { overflow: hidden; }
}
.rotate-lock__ico { width: 64px; height: 64px; fill: none; stroke: var(--cream); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rotate-lock__phone { transform-origin: 24px 21px; animation: rot-phone 2.6s var(--ease-io) infinite; }
.rotate-lock__arrow { stroke: var(--red-hot); }
.rotate-lock__t { font-family: var(--f-display); font-weight: 500; font-size: 1.6rem; line-height: 1; }
.rotate-lock__s { color: var(--cream-2); font-size: var(--fs-small); max-width: 34ch; }
@keyframes rot-phone { 0%, 20% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-lock__phone { animation: none; } }

/* ==========================================================================
   PULIDO — auditoría de detalle (Impeccable · principios de Emil Kowalski)
   ========================================================================== */
/* Respuesta al pulsar: los controles confirman el clic con una leve compresión.
   Se usa la propiedad «scale» (independiente de transform) para no pisar
   ninguna animación existente. */
.btn { transition: color 0.4s var(--ease), border-color 0.4s var(--ease), scale 0.16s var(--ease); }
.btn:active { scale: 0.97; }
.sound-toggle { transition: border-color 0.3s, color 0.3s, scale 0.16s var(--ease); }
.sound-toggle:active, .menu-btn:active { scale: 0.92; }
.menu-btn, .lang { transition: scale 0.16s var(--ease); }
.lang:active { scale: 0.96; }
.to-top:active { scale: 0.96; }

/* Superficies del navegador con la paleta de la marca */
html { scrollbar-color: rgba(239, 238, 228, 0.2) var(--ink); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: rgba(239, 238, 228, 0.18); border: 3px solid var(--ink); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }
input, textarea, select { caret-color: var(--red-hot); accent-color: var(--red); }

/* Pantallas táctiles: el «hover» se queda pegado tras tocar; los
   desplazamientos de hover solo existen con ratón */
@media (hover: none) {
  .wa:hover { transform: none; }
  .tools__list li:hover { transform: none; }
  .pillar:hover .pillar__title, .gitem__link:hover .gitem__title, .rp-li__btn:hover .rp-li__title { transform: none; }
  .gcard__link:hover .gcard__info { transform: none; }
  .skills__list li:hover > span:first-child, a.channel:hover > :not(.arrow), .cs-anatomy li:hover > * { translate: none; }
  a:hover .arrow, button:hover .arrow { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .sound-toggle:active, .menu-btn:active, .lang:active, .to-top:active { scale: none; }
}

/* ---------- Botón compacto (hero) y Contacto destacado en la cabecera ---------- */
.btn--sm { padding: 0.8rem 1.15rem; gap: 0.7rem; border-radius: 12px; }
.nav__link--cta {
  padding: 0.55rem 0.95rem; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--cream);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast), scale 0.16s var(--ease);
}
.nav__link--cta::after { display: none; }
.nav__link--cta:hover { background: var(--red); border-color: var(--red); }
.nav__link--cta:active { scale: 0.96; }
@media (prefers-reduced-motion: reduce) { .nav__link--cta:active { scale: none; } }
