/* ============================================================
   SISTEMA NEO-BRUTALISTA — papel, tinta y bloques de acento
   Día (hueso) por defecto; noche (tinta) como override.
   Sin glows, sin grano, sin esquinas redondeadas.
   El movimiento vive en motion.css.
   ============================================================ */

:root {
  color-scheme: light;

  /* --- Color: día (por defecto) ----------------------------- */
  --paper:     #f1ebdf;   /* hueso */
  --paper-2:   #e6ddcc;
  --paper-3:   #faf6ec;
  --ink:       #121110;   /* tinta */
  --muted:     #5f574c;
  --line:      #121110;
  --line-soft: #c8bca9;

  --teal:      #0d7c71;
  --magenta:   #e53a7d;
  --yellow:    #f4c518;
  --on-accent: #101010;   /* texto sobre rellenos vivos */

  --shadow:    #121110;
  --overlay:   rgba(241, 235, 223, 0.94);

  /* --- Tipografía ------------------------------------------- */
  --font-sans:    "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Anton", "Arial Narrow", Impact, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --h1:   clamp(3.4rem, 9.2vw, 9.4rem);
  --h2:   clamp(2.6rem, 5.4vw, 5.4rem);
  --h3:   clamp(1.4rem, 2.6vw, 2.2rem);
  --lead: clamp(1rem, 1.3vw, 1.16rem);
  --mini: 0.58rem;

  /* --- Layout ----------------------------------------------- */
  --max:    1440px;
  --gutter: clamp(1.1rem, 4vw, 3.5rem);
  --nav-h:  76px;   /* alto real, lo sincroniza motion.js */
  --nav-min: 76px;  /* alto mínimo de diseño */

  /* --- Movimiento ------------------------------------------- */
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1:   140ms;
  --dur-2:   260ms;
  --dur-3:   620ms;
}

/* --- Color: noche (tinta clara sobre papel oscuro) ---------- */
html[data-theme="night"] {
  color-scheme: dark;

  --paper:     #101010;
  --paper-2:   #1a1917;
  --paper-3:   #0b0b0a;
  --ink:       #f0e9dd;
  --muted:     #a79e8f;
  --line:      #f0e9dd;
  --line-soft: #3b3833;

  --teal:      #1aa89c;
  --magenta:   #ff4f92;
  --yellow:    #ffd21f;
  --on-accent: #101010;

  --shadow:    #000;
  --overlay:   rgba(16, 16, 16, 0.95);
}

/* --- Paletas de los juguetes --------------------------------
   El juguete de color rota los tres acentos sin tocar papel ni
   tinta. Cada paleta tiene su versión de día y de noche. */
html[data-palette="b"] {
  --teal:    #e53a7d;
  --magenta: #0d7c71;
}
html[data-palette="b"][data-theme="night"] {
  --teal:    #ff4f92;
  --magenta: #1aa89c;
}
html[data-palette="c"] {
  --teal:    #f4c518;
  --magenta: #0d7c71;
  --yellow:  #e53a7d;
}
html[data-palette="c"][data-theme="night"] {
  --teal:    #ffd21f;
  --magenta: #1aa89c;
  --yellow:  #ff4f92;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.01em;
}
::selection { background: var(--yellow); color: var(--on-accent); }
::-moz-selection { background: var(--yellow); color: var(--on-accent); }

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

/* Los enlaces internos no quedan bajo la cabecera fija */
#proyectos,
#sobre-mi,
#contacto { scroll-margin-top: calc(var(--nav-h) + 10px); }

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

/* Auto layout: cualquier texto editable puede crecer y envolver
   sin recortarse ni empujar el resto de la composición. */
:where(p, li, dd, dt, h1, h2, h3, h4, blockquote, figcaption) {
  overflow-wrap: break-word;
}

/* Piezas repetidas */
.barcode {
  display: block;
  width: 100%;
  height: 26px;
  color: var(--ink);
  border: 1px solid currentColor;
  background-image: repeating-linear-gradient(
    90deg,
    currentColor 0 2px,
    transparent 2px 4px,
    currentColor 4px 5px,
    transparent 5px 9px,
    currentColor 9px 12px,
    transparent 12px 14px
  );
  background-color: var(--paper-3);
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.4rem;
  background: var(--yellow);
  border: 1px solid var(--line);
  vertical-align: 0.02em;
}

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  min-height: var(--nav-min);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  padding-inline: var(--gutter);
  background: var(--paper);
  border-bottom: 2px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.brand__mark {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  background: var(--yellow);
  border: 2px solid var(--line);
}
.brand__name {
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.brand__role {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.nav a {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.38rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 0;
  text-align: center;
  color: var(--ink);
  border: 1.5px solid transparent;
  overflow-wrap: anywhere;
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.nav a span { color: var(--magenta); }
.nav a:hover,
.nav a:focus-visible {
  background: var(--yellow);
  border-color: var(--line);
  color: var(--on-accent);
}
.nav a:hover span,
.nav a:focus-visible span { color: var(--on-accent); }

.header-controls { display: flex; align-items: center; gap: 0.35rem; }
.motion-toggle,
.theme-toggle,
.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 0;
  padding: 0.32rem 0.5rem;
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1);
}
.motion-toggle:hover,
.theme-toggle:hover,
.audio-toggle:hover { background: var(--yellow); color: var(--on-accent); }
.motion-toggle:disabled {
  opacity: 0.55;
  cursor: default;
  background: transparent;
  color: var(--ink);
}
.motion-toggle [data-state] { color: var(--magenta); }
.theme-toggle [data-theme-state] { color: var(--teal); }
.motion-toggle:hover [data-state],
.theme-toggle:hover [data-theme-state] { color: var(--on-accent); }
.audio-toggle {
  width: 32px;
  justify-content: center;
  padding: 0.3rem;
}
.audio-toggle__icon {
  position: relative;
  display: inline-block;
  width: 0.92rem;
  height: 0.92rem;
}
.audio-toggle__icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.audio-toggle__icon .icon-audio-off { display: none; }
.audio-toggle[aria-pressed="false"] .icon-audio-on { display: none; }
.audio-toggle[aria-pressed="false"] .icon-audio-off { display: block; }
.audio-toggle[aria-pressed="false"] { opacity: 0.62; }
.audio-toggle[aria-pressed="false"]:hover { opacity: 1; }
.theme-toggle__icon {
  position: relative;
  display: inline-block;
  width: 0.82rem;
  height: 0.82rem;
  color: currentColor;
}
.theme-toggle__icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle__icon .icon-moon { display: none; }
html[data-theme="night"] .theme-toggle__icon .icon-sun { display: none; }
html[data-theme="night"] .theme-toggle__icon .icon-moon { display: block; }

.progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 4px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--yellow);
  border-bottom: 1px solid var(--line);
  z-index: 81;
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-h);
}
.hero__grid {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: start;
  padding-top: clamp(0.8rem, 2.2vh, 1.6rem);
}
.hero__grid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, var(--line-soft) 0 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  opacity: 0.75;
}
.hero__grid > * { position: relative; z-index: 1; }

.hero__eyebrow {
  grid-column: 1 / 9;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  padding: 0 0 0.7rem;
  border-bottom: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--mini);
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__eyebrow span { color: var(--magenta); }
.hero__loc {
  grid-column: 9 / 13;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 0 0.7rem 1rem;
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__title {
  grid-column: 1 / 10;
  align-self: center;
  padding-block: clamp(2rem, 5vh, 4.5rem);
  font-size: var(--h1);
  line-height: 0.86;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
.hero__line { display: block; }
.hero__line--2 { padding-left: 0.08em; }
.hero__line--3 { padding-left: 0.16em; }
.hero__line--outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.hero__title em {
  display: inline-block;
  padding: 0.02em 0.08em 0.05em;
  margin-right: 0.04em;
  font-style: normal;
  line-height: 0.9;
  color: var(--on-accent);
  background: var(--teal);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
}

.hero__spec {
  grid-column: 10 / 13;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-self: stretch;
  padding: 0.9rem 1rem 1.1rem;
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: var(--paper-2);
}
.hero__spec-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__spec-mark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 4.6rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--teal);
}
.hero__spec-body {
  display: grid;
  gap: 0.7rem;
  margin-block: auto;
}
.hero__spec-rule {
  display: block;
  width: 100%;
  height: 6px;
  background: var(--magenta);
  border: 1px solid var(--line);
}
.hero__spec .barcode { margin-top: 0; }
.hero__spec p {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  line-height: 1.75;
  text-transform: uppercase;
  color: var(--ink);
}
.hero__spec-note {
  font-size: 0.48rem !important;
  letter-spacing: 0.08em !important;
  color: var(--muted) !important;
}

.hero__intro {
  grid-column: 1 / 7;
  padding: 2rem 2rem 2rem 0;
}
.hero__lead {
  max-width: 46ch;
  font-size: var(--lead);
  line-height: 1.65;
  text-wrap: pretty;
  color: var(--muted);
}
.hero__lead strong { color: var(--ink); font-weight: 600; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.hero__data {
  grid-column: 7 / 10;
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 2rem 1.2rem;
  border-left: 2px solid var(--line);
}
.hero__data div {
  display: grid;
  grid-template-columns: minmax(54px, max-content) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-soft);
}
.hero__data dt {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__data dd { font-size: 0.78rem; line-height: 1.4; }

.hero__sticker {
  grid-column: 10 / 13;
  align-self: start;
  display: grid;
  gap: 0.15rem;
  margin: 1.1rem 0.6rem 0;
  padding: 1.3rem 0.9rem 1.1rem;
  text-align: center;
  color: var(--on-accent);
  background: var(--yellow);
  border: 2px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
  transform: rotate(-2.5deg);
}
.hero__sticker span {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero__sticker strong {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  background: #111;
  color: #f4eee3;
  border-block: 2px solid var(--line);
}
.hero__scroll {
  display: grid;
  place-items: center;
  padding-inline: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--yellow);
  border-left: 2px solid #111;
  text-align: center;
  transition: background var(--dur-1), color var(--dur-1);
}
.hero__scroll:hover { background: #f4eee3; color: #111; }

/* ---------- Marquesina ---------- */
.marquee {
  overflow: hidden;
  display: flex;
  align-items: center;
  user-select: none;
}
.marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-right: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__group b { font-weight: 400; }
.marquee__group i {
  font-style: normal;
  font-size: 0.55em;
  color: var(--yellow);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform var(--dur-1), box-shadow var(--dur-1), background var(--dur-1), color var(--dur-1);
}
.btn:hover,
.btn:focus-visible {
  color: var(--on-accent);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--line);
  transform: translate(-2px, -2px);
}
.btn--ghost {
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--on-accent);
  background: var(--magenta);
}

/* ---------- Cabecera de sección ---------- */
.sec-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0.8rem 0 1.15rem;
  border-top: 3px solid var(--line);
  border-bottom: 2px solid var(--line);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.sec-head__num {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 6vw, 6.4rem);
  line-height: 0.78;
  letter-spacing: -0.03em;
  color: var(--teal);
}
.sec-head--magenta .sec-head__num { color: var(--magenta); }
.sec-head--teal .sec-head__num { color: var(--teal); }
.sec-head__kicker {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.sec-head h2 {
  font-size: var(--h2);
  line-height: 0.82;
  letter-spacing: -0.02em;
}
.sec-head__note {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  line-height: 1.65;
  text-transform: uppercase;
  text-align: right;
  color: var(--muted);
}

/* ---------- Proyectos ---------- */
.proyectos { padding-block: clamp(4rem, 9vh, 7rem); }

.projects {
  --wheel-r: clamp(180px, 26vh, 290px);
  --wheel-card: clamp(158px, calc(var(--wheel-r) * 0.76), 230px);
  --wheel-lift: clamp(3rem, 6vh, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

/* ---------- Rueda de proyectos ----------
   C vertical en espejo: el arco queda a la derecha y la abertura
   mira a la izquierda. Las tarjetas viven dentro del arco, horizontales,
   inclinadas hacia el centro como si miraran al buje. */
.wheel { position: relative; min-width: 0; }
.projects__list {
  position: relative;
  height: calc(var(--wheel-r) * 2 + var(--wheel-lift));
  /* Recorta arriba y abajo, pero deja que las tarjetas más lejanas
     sangren unos píxeles en el margen en vez de cortarse en seco. */
  overflow: hidden;
  overflow: clip;
  overflow-clip-margin: 18px;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.projects__list.is-dragging { cursor: grabbing; }
/* Marco invisible: conserva el tamaño exacto del círculo para que
   motion.js mida el radio. No dibuja arco ni línea. */
.wheel__frame {
  position: absolute;
  top: 50%;
  left: calc(50% - var(--wheel-r) / 2 + var(--wheel-nudge, 0px));
  width: calc(var(--wheel-r) * 2);
  height: calc(var(--wheel-r) * 2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  visibility: hidden;
}
.wheel__hub {
  position: absolute;
  top: 50%;
  left: calc(50% - var(--wheel-r) / 2 - var(--wheel-r) * 0.16 + var(--wheel-nudge, 0px));
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.wheel__count {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.4vw, 5rem);
  line-height: 0.78;
  letter-spacing: -0.03em;
  color: var(--wheel-accent, var(--teal));
  text-shadow: 3px 3px 0 var(--line);
}
.wheel__of {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.wheel__word {
  font-family: var(--font-mono);
  font-size: 0.46rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.wheel[data-accent="teal"]    { --wheel-accent: var(--teal); }
.wheel[data-accent="magenta"] { --wheel-accent: var(--magenta); }
.wheel[data-accent="yellow"]  { --wheel-accent: var(--yellow); }

.project {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: var(--wheel-card);
  transform-origin: 100% 50%;
  transition: transform 480ms var(--ease), opacity 260ms linear;
  will-change: transform, opacity;
}
.projects__list.is-dragging .project { transition: none; }
.project[data-accent="teal"]    { --project-accent: var(--teal); }
.project[data-accent="magenta"] { --project-accent: var(--magenta); }
.project[data-accent="yellow"]  { --project-accent: var(--yellow); }

.project__open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 4.2rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--paper-3);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  cursor: pointer;
  transition: background var(--dur-2), color var(--dur-2),
    box-shadow var(--dur-2);
}
.projects__list.is-dragging .project__open { transition: none; }
.project__open:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
.project.is-active .project__open {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 7px 7px 0 var(--project-accent);
}
.project__num {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--line-soft);
  transition: color var(--dur-2);
}
.project.is-active .project__num { color: var(--project-accent); }
.project__info { display: grid; gap: 0.1rem; min-width: 0; }
.project__title {
  font-family: var(--font-display);
  overflow-wrap: anywhere;
  font-size: clamp(0.95rem, calc(var(--wheel-r) * 0.072), 1.18rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}
.project__meta {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  font-size: 0.43rem;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--dur-2);
}
/* Las tarjetas en órbita muestran solo número y título: así no se
   pisan entre sí y la ficha activa gana jerarquía. */
.project:not(.is-active) .project__meta { display: none; }
.project.is-active .project__meta { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.project__tags,
.project__go { display: none; }

.wheel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 0.9rem;
}
.wheel__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
  color: var(--ink);
  background: var(--paper-3);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1),
    box-shadow var(--dur-1);
}
.wheel__arrow:hover { color: var(--paper); background: var(--ink); }
.wheel__arrow:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}
.wheel__arrow:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.wheel__hint {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}
.wheel__hint--touch { display: none; }
.project__thumb { display: none; }

.projects__preview {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  align-self: start;
}
/* Monitor de Mac antiguo, pasado a la retícula y la paleta del sitio:
   caja de papel con trazo de tinta, sombra dura del acento y pantalla
   enmarcada. El pie lleva la ranura de disquete y una etiqueta mono. */
.monitor {
  --project-accent: var(--teal);
  position: relative;
  padding: 13px 13px 0;
  background: var(--paper-2);
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 var(--project-accent);
  transition: box-shadow var(--dur-2);
  margin-bottom: 30px;
}
.monitor[data-accent="teal"]    { --project-accent: var(--teal); }
.monitor[data-accent="magenta"] { --project-accent: var(--magenta); }
.monitor[data-accent="yellow"]  { --project-accent: var(--yellow); }
.monitor__chin {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.1rem 0.5rem;
}
.monitor__led {
  width: 6px;
  height: 6px;
  background: var(--project-accent);
  border: 1px solid var(--line);
}
.monitor__brand {
  font-family: var(--font-mono);
  font-size: 0.44rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.monitor__stripes {
  width: 24px;
  height: 8px;
  margin-left: auto;
  background: linear-gradient(
    to bottom,
    var(--teal) 0 33.33%,
    var(--magenta) 33.33% 66.66%,
    var(--yellow) 66.66% 100%
  );
  border: 1px solid var(--line);
}
.monitor__slot {
  width: 40px;
  height: 6px;
  background: var(--line);
}
.monitor__stand {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 38%;
  height: 12px;
  transform: translateX(-50%);
  background: var(--paper-2);
  border: 3px solid var(--line);
  border-top: 0;
}
/* Toda la caja es un botón: abre la ficha del proyecto activo. */
.monitor__hit {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 0;
  font: inherit;
  color: transparent;
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.monitor__hit:focus-visible {
  outline: 3px solid var(--project-accent);
  outline-offset: 4px;
}
.preview {
  border: 3px solid var(--line);
  background: var(--paper-3);
}
.preview[data-accent="teal"]    { --project-accent: var(--teal); }
.preview[data-accent="magenta"] { --project-accent: var(--magenta); }
.preview[data-accent="yellow"]  { --project-accent: var(--yellow); }
.preview__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  padding: 0.48rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border-bottom: 2px solid var(--line);
}
.preview__bar span:first-child { color: var(--project-accent); }
.preview__bar span:last-child {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.preview__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-2);
  border-bottom: 2px solid var(--line);
}
/* Textura de TV antigua: grano, líneas de barrido y una banda que baja.
   La animación vive en motion.css y se apaga con movimiento reducido. */
.preview__crt {
  --crt-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 38px rgba(8, 8, 7, 0.5);
}
.preview__crt::before,
.preview__crt::after {
  content: "";
  position: absolute;
  inset: 0;
}
.preview__crt::before {
  background-image: var(--crt-noise);
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: 0.42;
}
.preview__crt::after {
  background-image:
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(241, 235, 223, 0.08) 43%,
      rgba(241, 235, 223, 0.22) 50%,
      rgba(241, 235, 223, 0.08) 57%,
      transparent 100%
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(8, 8, 7, 0.36) 0 1px,
      transparent 1px 3px
    );
  background-size: 100% 240%, 100% 3px;
  background-repeat: no-repeat, repeat;
  opacity: 0.9;
}
/* Pantalla apagada: negro y una línea blanca que se recoge en un punto. */
.preview__off {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #0b0b0a;
  opacity: 0;
  pointer-events: none;
}
.preview__off::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 2px;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 0 14px #fff;
  opacity: 0;
}
.preview__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.04);
  transition: transform var(--dur-3) var(--ease), filter var(--dur-2);
}
.monitor:hover .preview__frame img {
  transform: scale(1.02);
  filter: saturate(1) contrast(1.02);
}
.monitor:hover { box-shadow: 12px 12px 0 var(--project-accent); }
.preview__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.7rem 0.7rem 0.8rem;
}
.preview__foot strong {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.preview__foot span {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.projects__hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Dossier ---------- */
.dossier { padding-block: clamp(4rem, 9vh, 7rem); }
.dossier__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.75rem);
}
.dossier__intro { grid-column: 1 / 7; }
.dossier__lead {
  max-width: 24ch;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.dossier__intro p + p {
  max-width: 56ch;
  margin-top: 0.95rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}
.dossier__intro strong { color: var(--ink); font-weight: 600; }
.dossier__sign {
  margin-top: 1.4rem !important;
  font-family: var(--font-mono);
  font-size: 0.55rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal) !important;
}

.dossier__monogram {
  grid-column: 7 / 10;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  min-height: 260px;
  margin-top: 0.75rem;
  padding: 1rem;
  color: var(--on-accent);
  background-color: var(--teal);
  background-image: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(0, 0, 0, 0.06) 10px 12px);
  border: 2px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
}
.dossier__mono {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 6.2vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: none;
}
.dossier__mono-label {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  line-height: 1.7;
  text-transform: uppercase;
}
.dossier__monogram .barcode {
  height: 30px;
  color: var(--on-accent);
  background-color: transparent;
}

.dossier__facts {
  grid-column: 10 / 13;
  align-self: start;
  border-top: 2px solid var(--line);
}
.dossier__facts div {
  display: grid;
  grid-template-columns: minmax(68px, max-content) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.dossier__facts dt {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.dossier__facts dd { font-size: 0.78rem; line-height: 1.4; }

.dossier__skills {
  grid-column: 4 / 13;
  margin-top: 2.25rem;
  border-top: 3px solid var(--line);
}
.dossier__skills li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--dur-1), color var(--dur-1), padding-left var(--dur-1);
}
.dossier__skills li span {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color var(--dur-1);
}
.dossier__skills li b { font-weight: 500; font-size: 0.92rem; }
.dossier__skills li:hover {
  padding-left: 1rem;
  background: var(--yellow);
  color: var(--on-accent);
}
.dossier__skills li:hover span { color: var(--on-accent); }

/* ---------- Manifiesto ---------- */
.manifesto {
  overflow: hidden;
  padding-block: 0.35rem;
  border-block: 3px solid var(--line);
  background: var(--paper);
  user-select: none;
}
.manifesto__track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.manifesto__track + .manifesto__track {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 2px solid var(--line);
}
.manifesto__group {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.manifesto__group b { font-weight: 400; }
.manifesto__group i {
  font-style: normal;
  font-size: 0.3em;
  line-height: 1;
  color: var(--yellow);
  -webkit-text-stroke: 0;
}

/* ---------- Contacto ---------- */
.contacto {
  padding-bottom: clamp(3rem, 7vh, 6rem);
  color: var(--on-accent);
  background: var(--yellow);
  border-top: 3px solid var(--line);
}
.contacto__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.7rem;
  border-bottom: 2px solid var(--on-accent);
  font-family: var(--font-mono);
  font-size: 0.53rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contacto__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  padding-top: clamp(3rem, 8vh, 6rem);
}
.contacto h2 {
  font-size: clamp(3.4rem, 9vw, 8.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.contacto h2 span {
  color: transparent;
  -webkit-text-stroke: 2.5px var(--on-accent);
}
.contacto__text p {
  max-width: 42ch;
  margin-top: 1.2rem;
  font-size: 1rem;
  line-height: 1.6;
  color: color-mix(in srgb, var(--on-accent) 76%, transparent);
}
.contacto__card {
  position: relative;
  display: grid;
  gap: 0.7rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--on-accent);
  box-shadow: 10px 10px 0 var(--on-accent);
}
.contacto__label {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--magenta);
}
.mail {
  justify-self: start;
  padding-bottom: 0.12em;
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
  word-break: break-word;
  transition: background var(--dur-1), color var(--dur-1), padding var(--dur-1);
}
.mail:hover,
.mail:focus-visible {
  padding-inline: 0.2em;
  background: var(--ink);
  color: var(--paper);
}
.contacto__meta {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.contacto__stamp {
  position: absolute;
  top: -0.9rem;
  right: 1rem;
  padding: 0.3rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--on-accent);
  background: var(--teal);
  border: 2px solid var(--on-accent);
  box-shadow: 3px 3px 0 var(--on-accent);
  transform: rotate(2deg);
}

/* ---------- Juguetes sueltos ----------
   Botones sin etiqueta repartidos por la composición. En escritorio
   viven en los márgenes y huecos de cada sección; en móvil pasan a
   una fila discreta al final de cada bloque. */
:root { --toy-size: 46px; }

.proyectos,
.dossier,
.contacto { position: relative; }

.toys {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.toys .toy { position: absolute; }

.toy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--toy-size);
  height: var(--toy-size);
  padding: 0;
  color: var(--ink);
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
  pointer-events: auto;
  transform: rotate(var(--toy-rot, 0deg));
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease),
    background var(--dur-2), color var(--dur-2);
}
.toy:hover {
  transform: rotate(var(--toy-rot, 0deg)) translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--line);
}
.toy:active {
  transform: rotate(var(--toy-rot, 0deg)) translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--line);
}
.toy:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
.toy--teal { background: var(--teal); color: var(--on-accent); }
.toy--yellow { background: var(--yellow); color: var(--on-accent); }
.toy--magenta { background: var(--magenta); color: var(--on-accent); }
.toy--ink { background: #111; color: #f4eee3; }
.toy__glyph {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-0.04em);
}
.toy__cat { display: block; width: 27px; height: auto; overflow: visible; }
.toy__cat .toy-cat__fur {
  fill: #faf6ec;
  stroke: #121110;
  stroke-width: 1.1;
  stroke-linejoin: miter;
  paint-order: stroke fill;
}
.toy__cat .toy-cat__tail,
.toy__cat .toy-cat__dark { fill: #121110; }
.toy__cat .toy-cat__collar { fill: var(--magenta); }

/* Posiciones de escritorio: márgenes, bordes y huecos libres. */
.toys--hero .toy--cat { left: 38%; bottom: 2.4rem; --toy-rot: -5deg; }
.toys--hero .toy--stamp { right: 6%; bottom: 2.4rem; --toy-rot: 4deg; }

.toys--proyectos .toy--sound { right: 10px; top: 14px; --toy-rot: 3deg; }
.toys--proyectos .toy--palette { right: 10px; bottom: 18px; --toy-rot: -3deg; }

.toys--dossier .toy--layout { left: 10px; top: 14px; --toy-rot: -3deg; }
.toys--dossier .toy--confetti { left: 10px; bottom: 18px; --toy-rot: 4deg; }

.toys--contacto .toy--shake { left: 12px; bottom: 12px; --toy-rot: -6deg; }
.toys--contacto .toy--scramble { right: 12px; bottom: 12px; --toy-rot: 6deg; }

.toys--footer .toy--random { left: 7%; bottom: 22%; --toy-rot: -7deg; }
.toys--footer .toy--reset { right: 6%; bottom: 40%; --toy-rot: 5deg; }

/* Efectos: confeti, sellos y texto revuelto. */
.fx {
  position: fixed;
  inset: 0;
  z-index: 96;
  overflow: hidden;
  pointer-events: none;
}
.fx__piece {
  position: absolute;
  top: -4vh;
  width: var(--s, 10px);
  height: var(--s, 10px);
  background: var(--c, var(--yellow));
  border: 2px solid var(--line);
  animation: confetti-fall var(--d, 1.6s) linear forwards;
  animation-delay: var(--delay, 0s);
}
.stamp {
  position: absolute;
  z-index: 93;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  transform: rotate(var(--stamp-rot, -6deg));
  pointer-events: none;
  animation: stamp-in 0.18s steps(2) both;
}
.stamp--paper { color: var(--ink); background: var(--paper-3); }
.stamp--yellow { color: var(--on-accent); background: var(--yellow); }
.stamp--teal { color: var(--on-accent); background: var(--teal); }
.stamp--magenta { color: var(--on-accent); background: var(--magenta); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  padding-top: 1.2rem;
  color: #f4eee3;
  background: #111;
  border-top: 3px solid var(--line);
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.53rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 238, 227, 0.72);
}
.site-footer__row p { margin: 0; }
.links { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.links a { color: #f4eee3; }
.links a:hover { color: var(--yellow); }
.site-footer__mark {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11.5vw, 12rem);
  line-height: 0.68;
  letter-spacing: -0.04em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
  color: var(--yellow);
  transform: translateY(12%);
  user-select: none;
}

/* ---------- Página de proyecto ---------- */
html.case-open { overflow: hidden; }

.case {
  width: 100%;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.case:not([open]) { display: none; }
.case[open] { display: block; }
.case::backdrop { background: var(--paper); }

.case__scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  background: var(--paper);
}
.case__scroll:focus { outline: none; }
.case.is-zoomed .case__scroll { overflow: hidden; }

.case__top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: calc(var(--nav-h) - 8px);
  padding-inline: var(--gutter);
  color: #f4eee3;
  background: #111;
  border-bottom: 2px solid var(--line);
}
.case__back,
.case__count,
.case__brand {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.case__back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--dur-1);
}
.case__back:hover { color: var(--yellow); }
.case__back:focus-visible,
.case__all:focus-visible,
.case__next-link:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.case__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #f4eee3;
}
.case__count { color: rgba(244, 238, 227, 0.7); }
.case__count span:first-child { color: var(--yellow); }

.case__page { padding-bottom: clamp(3rem, 8vh, 7rem); }

.case__hero { padding-top: clamp(3rem, 8vh, 6rem); }
.case__kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}
.case__kicker {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--magenta);
}
.case__meta {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.case__title {
  max-width: 15ch;
  overflow-wrap: break-word;
  margin-top: 0.8rem;
  font-size: clamp(3.4rem, 9.5vw, 9rem);
  line-height: 0.82;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.case__hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(2rem, 4vh, 3rem);
  padding-top: clamp(1.2rem, 2.5vh, 1.8rem);
  border-top: 2px solid var(--line);
}
.case__intro {
  max-width: 60ch;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}
.case__facts { display: grid; }
.case__facts div {
  display: grid;
  grid-template-columns: minmax(78px, max-content) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.case__facts div:first-child { padding-top: 0; }
.case__facts dt {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}
.case__facts dd { font-size: 0.8rem; line-height: 1.45; }

.case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}
.case__tags li {
  padding: 0.28rem 0.48rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1.5px solid var(--line);
}

/* ---------- Carpeta de proyecto ----------
   Las fotos viven dentro de una carpeta inclinada: se apilan como
   copias y, al pasar el ratón, la carpeta se abre y cada foto se
   endereza y sale a la superficie. */
.sheet {
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
  border-top: 3px solid var(--line);
}
.sheet__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.7rem;
  border-bottom: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet__head > span:first-child { color: var(--magenta); }
.sheet__head > span:last-child { color: var(--teal); }
.sheet__hint--touch { display: none; }

.sheet__stage {
  position: relative;
  padding-block: clamp(2.6rem, 5vw, 4rem) clamp(2.4rem, 5vw, 3.6rem);
}
.sheet__folder {
  position: absolute;
  inset: 9% 3% 11%;
  z-index: 0;
  background: var(--teal);
  border: 3px solid var(--line);
  box-shadow: 14px 14px 0 var(--line);
  transform: rotate(-2.4deg) skewY(1.2deg);
  transform-origin: 50% 100%;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.sheet__folder::after {
  content: "carpeta / jont_x";
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-accent) 62%, transparent);
}
.sheet__pocket::after {
  content: "archivo";
  position: absolute;
  right: 1.3rem;
  bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.8;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--on-accent);
  opacity: 0.86;
}
.sheet__tab {
  position: absolute;
  left: 4%;
  bottom: 100%;
  display: block;
  max-width: 82%;
  margin-bottom: -3px;
  padding: 0.55rem 0.8rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--on-accent);
  background: var(--magenta);
  border: 3px solid var(--line);
  border-bottom: 0;
}
.sheet__pocket {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 11%;
  z-index: 10;
  height: 21%;
  overflow: hidden;
  pointer-events: none;
  background: var(--yellow);
  border: 3px solid var(--line);
  transform: rotate(-2.4deg) skewY(1.2deg);
  transform-origin: 50% 100%;
  transition: transform var(--dur-2) var(--ease);
}
/* La carpeta respira cuando entra el ratón o el foco. */
.sheet__stage:focus-within .sheet__folder {
  transform: rotate(-1.2deg) skewY(0.5deg) translateY(-4px);
  box-shadow: 20px 20px 0 var(--line);
}
.sheet__stage:focus-within .sheet__pocket {
  transform: rotate(-1.2deg) skewY(0.5deg) translateY(18px);
}
.sheet__stage:hover .sheet__folder {
  transform: rotate(-1.2deg) skewY(0.5deg) translateY(-4px);
  box-shadow: 20px 20px 0 var(--line);
}
.sheet__stage:hover .sheet__pocket {
  transform: rotate(-1.2deg) skewY(0.5deg) translateY(18px);
}

.sheet__grid {
  position: relative;
  height: auto;
  aspect-ratio: 2.37;
}
.sheet__item {
  position: absolute;
  left: var(--l, 33%);
  top: var(--t, 12%);
  z-index: var(--z, 2);
  width: var(--w, 34%);
  height: auto;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  background: var(--paper-3);
  border: 3px solid var(--line);
  box-shadow: 7px 7px 0 var(--line);
  cursor: pointer;
  transform: rotate(var(--r, 0deg));
  transform-origin: 50% 60%;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  animation: sheet-deal 540ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.sheet__item:nth-child(1) { --l: 33%; --t: 13%; --w: 34%; --r: -3deg; --z: 5; --sheet-accent: var(--magenta); }
.sheet__item:nth-child(2) { --l: 12%; --t: 24%; --w: 25%; --r: -11deg; --z: 3; --sheet-accent: var(--teal); }
.sheet__item:nth-child(3) { --l: 59%; --t: 22%; --w: 26%; --r: 9deg; --z: 4; --sheet-accent: var(--yellow); }
.sheet__item:nth-child(4) { --l: 19%; --t: 40%; --w: 24%; --r: -7deg; --z: 6; --sheet-accent: var(--teal); }
.sheet__item:nth-child(5) { --l: 52%; --t: 41%; --w: 25%; --r: 5deg; --z: 7; --sheet-accent: var(--magenta); }

.sheet__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  transform: scale(var(--zoom, 1));
  transform-origin: var(--px, 50%) var(--py, 50%);
  filter: saturate(0.85) contrast(1.08);
  transition: transform var(--dur-3) var(--ease), filter var(--dur-2);
}
.sheet__item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  z-index: 2;
  background: var(--sheet-accent);
  pointer-events: none;
}
/* Marcas de encuadre: refuerzan la lectura de copia fotográfica. */
.sheet__item::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 2;
  pointer-events: none;
  opacity: 0.8;
  color: var(--sheet-accent);
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 14px 2px,
    linear-gradient(currentColor, currentColor) 0 0 / 2px 14px,
    linear-gradient(currentColor, currentColor) 100% 0 / 14px 2px,
    linear-gradient(currentColor, currentColor) 100% 0 / 2px 14px,
    linear-gradient(currentColor, currentColor) 0 100% / 14px 2px,
    linear-gradient(currentColor, currentColor) 0 100% / 2px 14px,
    linear-gradient(currentColor, currentColor) 100% 100% / 14px 2px,
    linear-gradient(currentColor, currentColor) 100% 100% / 2px 14px;
  background-repeat: no-repeat;
}
/* La foto elegida se endereza y sale de la carpeta. */
.sheet__grid .sheet__item:focus-visible {
  z-index: 30;
  transform: rotate(0deg) translateY(-18px) scale(1.055);
  box-shadow: 12px 12px 0 var(--sheet-accent);
}
.sheet__item:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
.sheet__grid .sheet__item:focus-visible img {
  transform: scale(calc(var(--zoom, 1) + 0.04));
  filter: saturate(1) contrast(1);
}
.sheet__grid .sheet__item:hover {
  z-index: 30;
  transform: rotate(0deg) translateY(-18px) scale(1.055);
  box-shadow: 12px 12px 0 var(--sheet-accent);
}
.sheet__grid .sheet__item:hover img {
  transform: scale(calc(var(--zoom, 1) + 0.04));
  filter: saturate(1) contrast(1);
}
.sheet__num {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 3;
  padding: 0.15rem 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  color: #f4eee3;
  background: #111;
  border: 1px solid #f4eee3;
}

/* ---------- Caso: texto y cierre ---------- */
.case__story {
  padding-block: clamp(3.5rem, 8vh, 6.5rem);
  border-top: 3px solid var(--line);
}
.case__story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.case__story-grid > div {
  padding-left: clamp(0.75rem, 1.5vw, 1.25rem);
  border-left: 3px solid var(--line-soft);
}
.case__story-num {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--magenta);
}
.case__story h2 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  line-height: 0.95;
}
.case__story p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--muted);
  text-wrap: pretty;
}
.case__quote {
  max-width: 34ch;
  margin-top: clamp(3rem, 7vh, 5rem);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: none;
  text-wrap: balance;
  color: var(--on-accent);
  background: var(--yellow);
  border: 2px solid var(--on-accent);
  box-shadow: 10px 10px 0 var(--line);
}
.case__quote:empty { display: none; }

.case__next {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-block: clamp(2.5rem, 6vh, 4rem);
  border-top: 3px solid var(--line);
}
.case__next-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}
.case__next-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.88;
  letter-spacing: -0.01em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--dur-1);
}
.case__next-link:hover { color: var(--magenta); }
.case__next-link span:last-child { color: var(--magenta); }
.case__all {
  padding: 0.55rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1);
}
.case__all:hover { color: var(--paper); background: var(--ink); }

/* ---------- Zoom de imagen ---------- */
.case__zoom {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(2.5rem, 5vw, 4rem);
  background: var(--overlay);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.case__zoom[hidden] { display: none; }
.case__zoom.is-open { opacity: 1; }
.case__zoom-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(1100px, 100%);
  margin: 0;
}
.case__zoom-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  background: var(--paper-2);
  border: 3px solid var(--line);
  box-shadow: 12px 12px 0 var(--yellow);
}
.case__zoom-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72svh;
  margin-inline: auto;
}
.case__zoom-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.case__zoom-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
  padding: 0.5rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1);
}
.case__zoom-close:hover { color: var(--on-accent); background: var(--yellow); }
.case__zoom-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1);
}
.case__zoom-nav:hover { color: var(--on-accent); background: var(--teal); }
.case__zoom-nav--prev { left: clamp(1rem, 3vw, 2rem); }
.case__zoom-nav--next { right: clamp(1rem, 3vw, 2rem); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .brand__role { display: none; }

  .hero__title { grid-column: 1 / 10; }

  .projects {
    grid-template-columns: 1fr;
    gap: 2rem;
    --wheel-r: clamp(160px, min(36vh, 52vw), 260px);
    --wheel-card: clamp(118px, calc(var(--wheel-r) * 0.72), 200px);
    --wheel-lift: clamp(3rem, 8vh, 5rem);
  }
  .projects__preview { display: none; }

  .dossier__intro { grid-column: 1 / 13; }
  .dossier__monogram { grid-column: 1 / 5; }
  .dossier__facts { grid-column: 5 / 13; }
  .dossier__skills { grid-column: 1 / 13; }
}

@media (max-width: 900px) {
  .wheel__hint--desk { display: none; }
  .wheel__hint--touch { display: inline; }

  .hero__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding-top: 0.7rem;
  }
  .hero__grid::before { display: none; }
  .hero__eyebrow { grid-column: 1 / 5; }
  .hero__loc { grid-column: 5 / 7; }
  .hero__title {
    grid-column: 1 / 7;
    padding-block: clamp(1.8rem, 4vh, 3rem);
    font-size: clamp(3rem, 12vw, 7rem);
  }
  .hero__intro { grid-column: 1 / 5; padding-right: 1.5rem; }
  .hero__data { grid-column: 5 / 7; }
  .hero__spec {
    grid-column: 1 / 4;
    margin-top: 1rem;
    border-top: 2px solid var(--line);
    border-bottom: 0;
    border-left: 0;
  }
  .hero__spec .barcode { margin-top: 0.4rem; }
  .hero__sticker { grid-column: 4 / 7; margin-top: 1.6rem; }

  /* La ficha y el sello comparten fila; el texto y los datos, la siguiente */
  @media (min-width: 641px) {
    .hero__spec,
    .hero__sticker { grid-row: 3; }
    .hero__intro,
    .hero__data { grid-row: 4; }
  }

  .contacto__grid { grid-template-columns: 1fr; align-items: start; }
  .contacto h2 { font-size: clamp(3.2rem, 12vw, 6.5rem); }

  .case__hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .case__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
  .case__facts div { grid-template-columns: minmax(64px, max-content) minmax(0, 1fr); }
  .case__facts div:first-child { padding-top: 0.62rem; }
  .sheet__folder { inset: 8% 4% 10%; box-shadow: 10px 10px 0 var(--line); }
  .sheet__tab { max-width: 84%; padding: 0.48rem 0.65rem 0.44rem; font-size: 0.48rem; }
  .sheet__pocket { left: 4%; right: 4%; bottom: 10%; height: 27%; }
  .sheet__grid { height: clamp(300px, 74vw, 520px); aspect-ratio: auto; }
  .sheet__item { border-width: 2px; box-shadow: 5px 5px 0 var(--line); }
  .sheet__item:nth-child(1) { --l: 27%; --t: 8%; --w: 46%; --r: -3deg; }
  .sheet__item:nth-child(2) { --l: 3%; --t: 24%; --w: 35%; --r: -10deg; }
  .sheet__item:nth-child(3) { --l: 63%; --t: 21%; --w: 34%; --r: 8deg; }
  .sheet__item:nth-child(4) { --l: 8%; --t: 43%; --w: 35%; --r: -7deg; }
  .sheet__item:nth-child(5) { --l: 55%; --t: 41%; --w: 36%; --r: 6deg; }
  .case__story-grid { grid-template-columns: 1fr; }
  .case__story-grid > div { border-left-width: 2px; }
  .case__next { flex-direction: column; align-items: flex-start; }
  .case__zoom { padding: 1rem; }
  .case__zoom-frame img { max-height: 64svh; }
  .case__zoom-nav { top: auto; bottom: 1rem; margin-top: 0; }
}

@media (max-width: 820px) {
  :root { --nav-h: 94px; --nav-min: 94px; }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 1rem;
    row-gap: 0.35rem;
    padding-block: 0.5rem;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .header-controls { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav { grid-column: 1 / -1; grid-row: 2; gap: 0.25rem; }
  .nav a { padding: 0.3rem 0.4rem; font-size: 0.52rem; }
  .theme-toggle__label { display: none; }
  .theme-toggle { width: 32px; justify-content: center; padding: 0.3rem; }

  .sec-head {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem 1rem;
  }
  .sec-head__note {
    grid-column: 2;
    text-align: left;
    line-height: 1.5;
  }
}

@media (max-width: 640px) {
  .hero { min-height: auto; }
  .hero__grid { grid-template-columns: 1fr; }

  .hero__eyebrow,
  .hero__loc,
  .hero__title,
  .hero__spec,
  .hero__intro,
  .hero__data,
  .hero__sticker { grid-column: 1 / -1; }

  /* En móvil el titular y la llamada van antes que la ficha técnica */
  .hero__title { order: 1; }
  .hero__intro { order: 2; }
  .hero__data { order: 3; }
  .hero__spec { order: 4; }
  .hero__sticker { order: 5; }

  .hero__eyebrow { border-bottom: 0; padding-bottom: 0.45rem; }
  .hero__loc {
    justify-content: space-between;
    padding: 0 0 0.6rem;
    border-left: 0;
    border-bottom: 2px solid var(--line);
  }
  .hero__title {
    padding-block: 1.6rem 1.8rem;
    font-size: clamp(3rem, 15vw, 5rem);
  }
  .hero__line--2,
  .hero__line--3 { padding-left: 0; }
  .hero__title em { box-shadow: 4px 4px 0 var(--line); }

  .hero__intro { padding: 1.6rem 0; border-bottom: 2px solid var(--line); }
  .hero__data {
    grid-template-columns: 1fr;
    padding: 1.2rem 0;
    border-left: 0;
    border-bottom: 2px solid var(--line);
  }
  .hero__spec {
    margin-top: 1.2rem;
    padding: 0.8rem 0;
    border-top: 0;
    border-bottom: 2px solid var(--line);
    background: transparent;
  }
  .hero__spec-body { display: none; }
  .hero__spec .barcode { max-width: 240px; }
  .hero__sticker {
    justify-self: start;
    max-width: 280px;
    margin: 1.4rem 0 1.4rem;
  }
  .hero__foot { min-height: 48px; }
  .hero__scroll { padding-inline: 0.9rem; font-size: 0.5rem; }
  .marquee__group { gap: 1rem; padding-right: 1rem; font-size: 1rem; }

  .dossier__monogram,
  .dossier__facts { grid-column: 1 / -1; }
  .dossier__monogram { min-height: 220px; }
  .dossier__skills { margin-top: 1.5rem; }
  .dossier__skills li { grid-template-columns: 2rem minmax(0, 1fr) auto; }

  .contacto__grid { padding-top: 2.5rem; }
  .contacto h2 { line-height: 0.98; }
  .contacto__card { box-shadow: 7px 7px 0 var(--on-accent); }
  .contacto__bar { font-size: 0.48rem; }

  .wheel__controls { gap: 0.6rem; margin-top: 0.7rem; }
  .project__meta { display: none; }

  .case__top { min-height: 56px; }
  .case__brand { display: none; }
  .case__title { max-width: 100%; font-size: clamp(3rem, 14vw, 5.5rem); }
  .case__kicker-row { flex-direction: column; }
  .case__meta { text-align: left; }
  .case__facts { grid-template-columns: 1fr; }
  .case__story { padding-block: 3rem; }
  .case__quote { box-shadow: 7px 7px 0 var(--line); }
  .sheet__head { font-size: 0.46rem; }
  .sheet__hint--desk { display: none; }
  .sheet__hint--touch { display: inline; }
  .sheet__stage { padding-block: 4.2rem 1.8rem; }
  .sheet__folder { inset: 13% 7% 9%; }
  .sheet__tab { font-size: 0.44rem; }
  .sheet__pocket { left: 7%; right: 7%; bottom: 9%; height: 28%; }
  .sheet__grid { height: clamp(280px, 86vw, 360px); aspect-ratio: auto; }
}

@media (max-width: 560px) {
  .projects {
    --wheel-nudge: 30px;
    --wheel-card: clamp(116px, calc(var(--wheel-r) * 0.68), 150px);
  }
}

@media (max-width: 480px) {
  .brand__name { font-size: 1rem; }
  .brand__mark { width: 11px; height: 11px; }
  .motion-toggle { font-size: 0.48rem; padding-inline: 0.4rem; }
  .motion-toggle__label { display: none; }
  .nav a { font-size: 0.5rem; letter-spacing: 0.04em; }
  .nav a span { display: none; }

  .sec-head__num { font-size: 3rem; }

  .wheel__arrow { width: 34px; height: 30px; }
  .wheel__hint { font-size: 0.44rem; }
  .wheel__count { font-size: 2.3rem; text-shadow: 2px 2px 0 var(--line); }
  .project__open { gap: 0.35rem; padding: 0.45rem; }
  .project__num { font-size: 1rem; }
  .project__title { font-size: 0.78rem; }

  .contacto__bar span:last-child { display: none; }
  .mail { font-size: 1rem; }
  .contacto__stamp { right: 0.5rem; }

  .site-footer__row { font-size: 0.48rem; }
  .links { gap: 0.7rem; }
}

/* ---------- Juguetes sueltos: responsive ----------
   En pantallas estrechas dejan de flotar y se colocan en una fila
   corta al final del bloque, sin etiquetas ni explicaciones. */
@media (max-width: 900px) {
  .toys {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .toys .toy { position: static; }

  /* El botón de cambio de diagramación no se muestra en móviles ni tablets */
  .toy--layout { display: none !important; }

  .toys--hero {
    grid-column: 1 / -1;
    order: 9;
    margin-block: 1rem 0.6rem;
    padding-inline: 0;
  }
  .toys--proyectos,
  .toys--dossier { margin-top: 2rem; }
  .toys--dossier { justify-content: flex-end; }
  .toys--contacto { padding-top: 1.4rem; }
  .toys--footer { padding-block: 1.2rem 0.5rem; }
}

/* ---------- Diagrama B (juguete de desorden) ----------
   Solo cambia la composición visual; el orden del DOM y la
   lectura con tecnologías de asistencia no se alteran. */
@media (min-width: 1101px) {
  html[data-layout="b"] .hero__eyebrow,
  html[data-layout="b"] .hero__loc { grid-row: 1; }
  html[data-layout="b"] .hero__title,
  html[data-layout="b"] .hero__spec { grid-row: 2; }
  html[data-layout="b"] .hero__intro,
  html[data-layout="b"] .hero__data,
  html[data-layout="b"] .hero__sticker { grid-row: 3; }

  html[data-layout="b"] .hero__eyebrow { grid-column: 4 / 13; }
  html[data-layout="b"] .hero__loc {
    grid-column: 1 / 4;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0 1rem 0.7rem 0;
    border-left: 0;
    border-right: 2px solid var(--line);
  }
  html[data-layout="b"] .hero__title {
    grid-column: 4 / 13;
    text-align: right;
  }
  html[data-layout="b"] .hero__line--2 {
    padding-left: 0;
    padding-right: 0.08em;
  }
  html[data-layout="b"] .hero__line--3 {
    padding-left: 0;
    padding-right: 0.16em;
  }
  html[data-layout="b"] .hero__title em { box-shadow: -6px -6px 0 var(--line); }
  html[data-layout="b"] .hero__spec {
    grid-column: 1 / 4;
    border-left: 0;
    border-right: 2px solid var(--line);
  }
  html[data-layout="b"] .hero__data {
    grid-column: 1 / 4;
    border-left: 0;
    border-right: 2px solid var(--line);
  }
  html[data-layout="b"] .hero__intro { grid-column: 4 / 10; }
  html[data-layout="b"] .hero__sticker {
    transform: rotate(2.5deg);
    box-shadow: -8px 8px 0 var(--line);
  }

  html[data-layout="b"] .projects {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  }
  html[data-layout="b"] .projects__preview { order: -1; }

  html[data-layout="b"] .dossier__intro,
  html[data-layout="b"] .dossier__monogram,
  html[data-layout="b"] .dossier__facts { grid-row: 1; }
  html[data-layout="b"] .dossier__skills { grid-row: 2; }
  html[data-layout="b"] .dossier__intro { grid-column: 4 / 10; }
  html[data-layout="b"] .dossier__monogram { grid-column: 10 / 13; }
  html[data-layout="b"] .dossier__facts { grid-column: 1 / 4; }

  html[data-layout="b"] .contacto__grid {
    grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  }
  html[data-layout="b"] .contacto__card { order: -1; }
}

@media (min-width: 641px) and (max-width: 1100px) {
  html[data-layout="b"] .hero__title {
    text-align: right;
  }
  html[data-layout="b"] .hero__line--2,
  html[data-layout="b"] .hero__line--3 {
    padding-left: 0;
    padding-right: 0.12em;
  }
  html[data-layout="b"] .hero__sticker { transform: rotate(2.5deg); }
}

@media (max-width: 640px) {
  html[data-layout="b"] .hero__title { text-align: right; }
  html[data-layout="b"] .hero__line--2,
  html[data-layout="b"] .hero__line--3 {
    padding-left: 0;
    padding-right: 0.12em;
  }
  html[data-layout="b"] .hero__sticker {
    justify-self: end;
    transform: rotate(2.5deg);
    box-shadow: -7px 7px 0 var(--line);
  }
}
