@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #f6f7fb;
  --surface: #ffffff;
  --surface-raised: #eef0f7;
  --text: #0e0f14;
  --text-muted: #484d61;
  --border: #dfe3ee;
  --rule: #c9cfdd;
  --radar: #0a7281;
  --descarte: #a54c03;
  --precision: #0761d1;
  --ritmo: #c30f6d;
  --radar-fill: #22d3ee;
  --descarte-fill: #fb923c;
  --precision-fill: #60a5fa;
  --ritmo-fill: #f472b6;
  --radar-edge: #1597a8;
  --descarte-edge: #c4631b;
  --precision-edge: #3373c9;
  --ritmo-edge: #c24a8c;
  --ink: #0e0f14;
  --paper: #fdfdfb;
  --paper-ink: #2f6fd0;
  --graphite: #23252d;
  --wrong: #c21b2f;
  --tint: transparent;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --gutter: max(1.25rem, env(safe-area-inset-left));
  --gutter-right: max(1.25rem, env(safe-area-inset-right));
  --max: 74rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #0e0f14;
    --surface: #171923;
    --surface-raised: #1f2230;
    --text: #f5f7ff;
    --text-muted: #b6bcce;
    --border: #2b2f3e;
    --rule: #333849;
    --radar: #22d3ee;
    --descarte: #fb923c;
    --precision: #60a5fa;
    --ritmo: #f472b6;
    --paper: #e6e8ee;
    --wrong: #ff6b7a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: clip;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--precision);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  z-index: 20;
}

.skip:focus {
  top: 1rem;
}

kbd {
  font-family: var(--font-display);
  font-weight: 800;
  padding: 0.05rem 0.4rem;
  border: 1.5px solid var(--rule);
  border-bottom-width: 3px;
  border-radius: 6px;
}

/* Backdrop: a field of answer bubbles, tinted by the section in view */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--background);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(110% 70% at 75% 35%, var(--tint), transparent 72%);
  transition: background 0.9s ease;
}

.bubbles {
  position: absolute;
  inset: -30% -15%;
  display: grid;
  grid-template-columns: repeat(auto-fill, 3.2rem);
  grid-auto-rows: 3.2rem;
  justify-content: center;
  align-content: start;
  transform: translate3d(0, calc(var(--scroll, 0) * -0.06px), 0) rotate(-8deg);
  opacity: 0.6;
}

.bubbles i {
  width: 1.05rem;
  height: 1.05rem;
  margin: auto;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--paper-ink) 13%, transparent);
  transition:
    background 1.4s ease,
    border-color 1.4s ease;
}

.bubbles i.on {
  background: color-mix(in srgb, var(--graphite) 15%, transparent);
  border-color: transparent;
}

@media (prefers-color-scheme: dark) {
  .bubbles i {
    border-color: #ffffff10;
  }

  .bubbles i.on {
    background: #ffffff1a;
  }
}

body[data-tint="radar"] {
  --tint: color-mix(in srgb, var(--radar-fill) 24%, transparent);
}

body[data-tint="descarte"] {
  --tint: color-mix(in srgb, var(--descarte-fill) 24%, transparent);
}

body[data-tint="precision"] {
  --tint: color-mix(in srgb, var(--precision-fill) 26%, transparent);
}

body[data-tint="ritmo"] {
  --tint: color-mix(in srgb, var(--ritmo-fill) 24%, transparent);
}

/* A pencil line that draws itself as you scroll */

.progress-line {
  position: fixed;
  z-index: 15;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--radar-fill) 0 25%, var(--descarte-fill) 25% 50%, var(--precision-fill) 50% 75%, var(--ritmo-fill) 75%);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}

/* Top bar */

.topbar,
main > section,
.footer {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-right);
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: 0.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  user-select: none;
}

.wordmark-tiles {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  transition: transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.wordmark:hover .wordmark-tiles {
  transform: rotate(90deg);
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  font-weight: 700;
  color: var(--text-muted);
}

.topbar-link:hover {
  color: var(--text);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0 1.4rem;
  border-radius: 14px;
  background: var(--precision-fill);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--precision-edge);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
  touch-action: manipulation;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--precision-edge);
}

.button:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 transparent;
}

/* Hero */

.hero {
  display: grid;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
  min-height: min(54rem, 100svh);
  align-content: center;
  perspective: 1400px;
}

.hero h1 {
  font-size: clamp(3rem, 13vw, 6.5rem);
  line-height: 0.92;
  max-width: 10ch;
  perspective: 600px;
}

.hero h1 .word {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: rise 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: calc(var(--i) * 90ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.3em) rotateX(-70deg);
  }
}

.hero-note {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 26rem;
}

.actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.countdown {
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.countdown strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Answer sheet, in 3D */

.sheet-wrap {
  margin: 0;
  justify-self: center;
  width: min(100%, 23rem);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 10deg)) rotateY(var(--ry, -16deg)) rotateZ(-2deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet {
  --line: color-mix(in srgb, var(--paper-ink) 55%, transparent);
  position: relative;
  background: var(--paper);
  color: #1b1d24;
  border-radius: 6px;
  padding: 1.1rem 1.1rem 0.9rem;
  border-top: 10px solid var(--paper-ink);
  box-shadow:
    0 1px 0 #0000000d,
    30px 40px 60px -30px #0e0f1466;
  transform-style: preserve-3d;
}

@media (prefers-color-scheme: dark) {
  .sheet {
    box-shadow: 30px 40px 70px -30px #000;
  }
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1.5px solid var(--line);
}

.sheet-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--paper-ink);
}

.sheet-fields {
  margin: 0;
  display: grid;
  gap: 0.1rem;
  font-size: 0.8rem;
  text-align: right;
}

.sheet-fields div {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.sheet-fields dt {
  color: var(--paper-ink);
}

.sheet-fields dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.sheet-rows {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: repeat(10, auto);
  column-gap: 1.1rem;
  row-gap: 0.28rem;
}

.row {
  display: grid;
  grid-template-columns: 1.6rem repeat(4, 1fr);
  align-items: center;
  gap: 0.2rem;
  position: relative;
}

.row-no {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--paper-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 0.3rem;
}

.bubble {
  position: relative;
  width: 1.3rem;
  height: 1.3rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--line);
  justify-self: center;
}

.bubble svg {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  overflow: visible;
  fill: none;
  stroke: var(--graphite);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}

.bubble.is-filled svg {
  opacity: 0.92;
  animation: scribble 0.42s ease-out forwards;
}

.row.is-skipped .row-no::after {
  content: "?";
  position: absolute;
  left: -0.55rem;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ritmo-edge);
}

.row.is-returned .row-no::after {
  content: "";
}

.row.is-current {
  background: color-mix(in srgb, var(--precision-fill) 16%, transparent);
  border-radius: 999px;
}

.sheet-status {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1.5px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: #50556a;
  min-height: 1.95rem;
}

.stamp {
  position: absolute;
  right: 0.8rem;
  bottom: 2.6rem;
  padding: 0.2rem 0.7rem;
  border: 3px solid var(--ritmo-edge);
  border-radius: 10px;
  color: var(--ritmo-edge);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.1;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  transform: rotate(-12deg) translateZ(30px);
  animation: stamp 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.stamp small {
  display: block;
  font-size: 0.7rem;
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-12deg) translateZ(30px) scale(2.2);
  }
}

.pencil {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.35rem;
  height: auto;
  transform-origin: 50% 97.3%;
  transform: translate(var(--px, 110%), var(--py, 70%)) translate(-50%, -97.3%) rotate(26deg);
  transition: transform 0.24s cubic-bezier(0.3, 0.7, 0.3, 1);
  filter: drop-shadow(6px 10px 4px #0e0f1430);
  pointer-events: none;
  opacity: 0;
}

.pencil.is-on {
  opacity: 1;
}

.pencil.is-writing {
  animation: write 0.14s linear 3;
}

.pencil.is-resting {
  transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.3, 1);
}

@keyframes write {
  25% {
    translate: 3px -2px;
  }
  75% {
    translate: -3px 2px;
  }
}

@keyframes scribble {
  to {
    stroke-dashoffset: 0;
  }
}

.sheet-caption {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.replay {
  min-height: 2.75rem;
  margin-left: 0.35rem;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
  font-weight: 700;
  font-size: inherit;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Statements: one idea per screen */

.statement {
  font-size: clamp(2.8rem, 11vw, 7rem);
  line-height: 0.95;
  max-width: 12ch;
}

.statement.small {
  font-size: clamp(2.1rem, 7vw, 4.25rem);
  max-width: 16ch;
}

.reveal-words .word {
  display: inline-block;
  filter: blur(12px);
  transform: translateY(0.25em) scale(0.96);
  transition:
    filter 0.7s ease,
    transform 0.8s cubic-bezier(0.2, 0.9, 0.2, 1);
  transition-delay: calc(var(--i) * 90ms);
}

.reveal-words.is-visible .word {
  filter: none;
  transform: none;
}

.idea,
.evidence,
.school,
.finale {
  padding-top: clamp(5rem, 14vh, 9rem);
  padding-bottom: clamp(5rem, 14vh, 9rem);
}

.idea {
  min-height: 90svh;
  display: grid;
  align-content: center;
  gap: 2.5rem;
}

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 3.4vw, 1.9rem);
  perspective: 800px;
}

.term {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  border-radius: 16px;
  border: 2px solid var(--rule);
  background: var(--surface);
}

.term.render {
  border-color: transparent;
  background: var(--text);
  color: var(--background);
}

.term.score {
  border-style: dashed;
}

.op {
  color: var(--text-muted);
}

.mini-tiles {
  display: grid;
  grid-template-columns: repeat(2, 0.8em);
  gap: 0.12em;
  transform-style: preserve-3d;
}

.mini-tiles .t {
  width: 0.8em;
  height: 0.8em;
  border-radius: 0.2em;
  background: var(--fill);
}

.equation .term,
.equation .op {
  opacity: 0;
  transform: translateY(24px) rotateX(-40deg);
  transition:
    opacity 0.6s ease,
    transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 140ms);
}

.equation.is-visible .term,
.equation.is-visible .op {
  opacity: 1;
  transform: none;
}

.equation .mini-tiles .t {
  opacity: 0;
  transform: translateZ(140px) rotateY(180deg);
  transition:
    transform 0.9s cubic-bezier(0.3, 1.3, 0.5, 1),
    opacity 0.3s ease;
  transition-delay: calc(0.7s + var(--j, 0) * 120ms);
}

.equation.is-visible .mini-tiles .t {
  transform: none;
  opacity: 1;
}

.equation.is-visible .score {
  animation: glow-score 1.2s ease 1.6s both;
}

@keyframes glow-score {
  50% {
    border-color: var(--precision-fill);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--precision-fill) 30%, transparent);
  }
}

.idea-note {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 30rem;
}

/* Skills: a sticky 3D cube turns to the skill in view */

.radar {
  --fill: var(--radar-fill);
  --edge: var(--radar-edge);
  --accent: var(--radar);
}

.descarte {
  --fill: var(--descarte-fill);
  --edge: var(--descarte-edge);
  --accent: var(--descarte);
}

.precision {
  --fill: var(--precision-fill);
  --edge: var(--precision-edge);
  --accent: var(--precision);
}

.ritmo {
  --fill: var(--ritmo-fill);
  --edge: var(--ritmo-edge);
  --accent: var(--ritmo);
}

.skills {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.cube-stage {
  --size: 3.6rem;
  position: sticky;
  top: 0.75rem;
  z-index: 3;
  height: 0;
  justify-self: end;
  perspective: 700px;
}

.cube {
  position: relative;
  width: var(--size);
  height: var(--size);
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(calc(var(--turn, 0) * -90deg + 28deg));
  transition: transform 0.9s cubic-bezier(0.3, 1.25, 0.5, 1);
  cursor: pointer;
}

.cube.is-spinning {
  transition: transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18%;
  background: var(--fill);
  box-shadow: inset 0 calc(var(--size) * -0.08) 0 var(--edge);
}

.face svg {
  width: 58%;
  height: 58%;
  fill: var(--ink);
}

.face .cut {
  fill: none;
  stroke: var(--descarte-fill);
  stroke-width: 4.5;
}

.face .ring-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4.5;
}

.f1 {
  transform: translateZ(calc(var(--size) / 2));
}

.f2 {
  transform: rotateY(90deg) translateZ(calc(var(--size) / 2));
}

.f3 {
  transform: rotateY(180deg) translateZ(calc(var(--size) / 2));
}

.f4 {
  transform: rotateY(270deg) translateZ(calc(var(--size) / 2));
}

.f-top,
.f-bottom {
  background: #2b2f3e;
  box-shadow: none;
}

.f-top {
  transform: rotateX(90deg) translateZ(calc(var(--size) / 2));
}

.f-bottom {
  transform: rotateX(-90deg) translateZ(calc(var(--size) / 2));
}

.cube-shadow {
  width: var(--size);
  height: calc(var(--size) * 0.18);
  margin-top: calc(var(--size) * 0.3);
  border-radius: 50%;
  background: radial-gradient(closest-side, #0e0f1440, transparent);
}

.skill {
  display: grid;
  gap: 2.5rem;
  align-content: center;
  min-height: 92svh;
  padding: 5rem 0;
}

.skill-no {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
}

.skill-copy .tile {
  display: none;
}

.skill h2 {
  margin-top: 0.3rem;
  font-size: clamp(3.2rem, 15vw, 5.4rem);
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 0.9;
  color: var(--accent);
}

.skill-line {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 4.4vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.skill h2,
.skill .skill-line,
.skill .skill-no {
  transition:
    opacity 0.7s ease,
    transform 0.8s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.js .skill:not(.is-visible) h2,
.js .skill:not(.is-visible) .skill-line,
.js .skill:not(.is-visible) .skill-no {
  opacity: 0;
  transform: translateY(30px) rotateX(-30deg);
}

.skill .skill-line {
  transition-delay: 0.12s;
}

.visual {
  position: relative;
  margin: 0;
  width: min(100%, 26rem);
}

.source {
  margin-top: 0.9rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Radar visual: ¿De qué es? A question flashes, you pick the eje */

.radar-visual {
  position: relative;
  aspect-ratio: 1;
}

.radar-svg {
  position: absolute;
  inset: 12%;
  width: 76%;
  height: 76%;
  overflow: visible;
}

.radar-rings circle,
.radar-rings path {
  fill: none;
  stroke: color-mix(in srgb, var(--radar-edge) 40%, transparent);
  stroke-width: 1.5;
}

.radar-sweep {
  transform-origin: 160px 160px;
  animation: sweep 3.2s linear infinite;
  animation-play-state: paused;
}

.radar-sweep path {
  fill: color-mix(in srgb, var(--radar-fill) 30%, transparent);
}

.radar-visual.is-visible .radar-sweep {
  animation-play-state: running;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.blip {
  fill: var(--radar-fill);
  stroke: var(--radar-edge);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.3s ease;
}

.blip.is-lit {
  opacity: 1;
  animation: blink 1.4s ease-in-out infinite;
}

.blip.is-wrong {
  fill: var(--descarte-fill);
  stroke: var(--descarte-edge);
  opacity: 1;
}

@keyframes blink {
  50% {
    transform: scale(1.6);
  }
}

.flash {
  border: 0;
  cursor: pointer;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80%, 16rem);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--paper);
  color: #1b1d24;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 16px 30px -16px #0e0f1466;
  transform: translate(-50%, -50%) translateZ(0);
  transition:
    opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1),
    filter 0.4s ease;
}

.flash.is-gone {
  opacity: 0;
  filter: blur(6px);
  transform: translate(-50%, -50%) scale(0.85);
}

.flash-timer {
  display: block;
  height: 4px;
  margin-top: 0.6rem;
  border-radius: 4px;
  background: var(--radar-fill);
  transform-origin: left;
}

.flash.is-timing .flash-timer {
  animation: timer 3s linear forwards;
}

@keyframes timer {
  to {
    transform: scaleX(0);
  }
}

.axis {
  position: absolute;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--radar-edge) 40%, var(--border));
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.axis:active {
  transform: translateY(3px);
}

.axis.is-right {
  background: var(--radar-fill);
  color: var(--ink);
}

.axis.is-wrong {
  background: var(--descarte-fill);
  color: var(--ink);
}

.a-top {
  top: 0;
  left: 50%;
  translate: -50% 0;
}

.a-bottom {
  bottom: 0;
  left: 50%;
  translate: -50% 0;
}

.a-left {
  left: 0;
  top: 50%;
  translate: 0 -50%;
}

.a-right {
  right: 0;
  top: 50%;
  translate: 0 -50%;
}

.radar-result {
  margin-top: 1rem;
  min-height: 1.5em;
  font-weight: 700;
  text-align: center;
}

/* Descarte visual */

.question {
  font-weight: 700;
  font-size: 1.2rem;
  text-wrap: balance;
}

.options {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  perspective: 600px;
}

.options button {
  position: relative;
  width: 100%;
  min-height: 3.6rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--descarte-edge) 35%, var(--border));
  cursor: pointer;
  text-align: left;
  font-size: 1.15rem;
  font-weight: 600;
  transition:
    transform 0.45s cubic-bezier(0.3, 1.3, 0.5, 1),
    box-shadow 0.12s ease,
    opacity 0.3s ease;
  touch-action: manipulation;
}

.options button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 transparent;
}

.options b {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--descarte-fill) 25%, var(--surface));
  font-size: 0.9rem;
  flex: none;
}

.options button::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: 50%;
  height: 3px;
  border-radius: 3px;
  background: var(--descarte);
  transform: scaleX(0) rotate(-4deg);
  transform-origin: left center;
  transition: transform 0.28s ease-out;
}

.options button[aria-pressed="true"] {
  opacity: 0.4;
  transform: rotateX(35deg) translateZ(-40px);
}

.options button[aria-pressed="true"]::after {
  transform: scaleX(1) rotate(-4deg);
}

.options button.is-right {
  opacity: 1;
  background: var(--radar-fill);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--radar-edge);
  transform: translateZ(30px) scale(1.05);
}

.options button.is-right b {
  background: #ffffffaa;
}

.options button.is-lost::after {
  background: var(--wrong);
}

.options button.is-hinted {
  animation: hint 1.6s ease-in-out 2;
}

@keyframes hint {
  0%,
  60%,
  100% {
    transform: none;
  }
  20% {
    transform: translateY(4px);
  }
  30% {
    transform: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--descarte-fill) 60%, transparent);
  }
}

.odds {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.odds-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 14vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--descarte);
  font-variant-numeric: tabular-nums;
  min-width: 2.2ch;
}

.odds-value.is-lost {
  color: var(--wrong);
}

.odds-value.bump {
  animation: bump 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes bump {
  40% {
    transform: scale(1.25) rotate(-4deg);
  }
}

.odds-label {
  font-weight: 700;
  max-width: 15rem;
}

.reset {
  margin-top: 0.75rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

/* Toggles */

.toggle {
  margin-top: 1rem;
  display: inline-flex;
  flex-wrap: wrap;
  padding: 0.25rem;
  gap: 0.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fill) 22%, var(--surface));
}

.toggle button {
  min-height: 2.75rem;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--edge) 45%, transparent);
}

.toggle button.is-hinted {
  animation: glow 1.4s ease-in-out 3;
}

@keyframes glow {
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fill) 70%, transparent);
    color: var(--text);
  }
}

/* Precisión visual: marks land wide or tight on a target */

.target {
  position: relative;
  width: min(100%, 17rem);
  aspect-ratio: 1;
  transform: perspective(700px) rotateX(38deg);
  transform-style: preserve-3d;
}

.target-svg {
  width: 100%;
  height: 100%;
}

.target-svg circle {
  fill: none;
  stroke: color-mix(in srgb, var(--precision-edge) 45%, transparent);
  stroke-width: 2;
}

.target-svg circle:last-child {
  fill: color-mix(in srgb, var(--precision-fill) 22%, transparent);
}

.hits i {
  position: absolute;
  left: calc(50% + var(--x) * 1%);
  top: calc(50% + var(--y) * 1%);
  width: 0.8rem;
  height: 0.8rem;
  margin: -0.4rem 0 0 -0.4rem;
  border-radius: 50%;
  background: var(--graphite);
  animation: land 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  animation-delay: calc(var(--d) * 45ms);
}

@media (prefers-color-scheme: dark) {
  .hits i {
    background: var(--text);
  }
}

.hits i.miss {
  background: var(--wrong);
}

@keyframes land {
  from {
    opacity: 0;
    transform: translateZ(120px) scale(2);
  }
}

.gauge {
  margin-top: 1rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.gauge-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 12vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--precision);
  font-variant-numeric: tabular-nums;
}

/* Ritmo visual: a 140-minute clock of question ticks */

.clock {
  position: relative;
  width: min(100%, 18rem);
  aspect-ratio: 1;
}

.clock-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.clock-svg .tick {
  fill: none;
  stroke: color-mix(in srgb, var(--ritmo-edge) 25%, transparent);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke 0.25s ease;
}

.clock-svg .tick.done {
  stroke: var(--ritmo-fill);
}

.clock-svg .tick.skip {
  stroke: color-mix(in srgb, var(--ritmo-edge) 60%, transparent);
  stroke-dasharray: 1.5 3;
}

.clock-svg .tick.late {
  stroke: var(--ink);
}

@media (prefers-color-scheme: dark) {
  .clock-svg .tick.late {
    stroke: var(--text);
  }
}

.clock-svg .hand {
  stroke: var(--ritmo-edge);
  stroke-width: 4;
  stroke-linecap: round;
}

.clock-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.clock-center span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ritmo);
  font-variant-numeric: tabular-nums;
}

.clock-center small {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Evidence */

.effect {
  margin: 2.5rem 0 0;
  display: grid;
  gap: 1.1rem;
  max-width: 40rem;
}

.effect-row {
  display: grid;
  gap: 0.4rem;
}

.effect-name {
  font-weight: 700;
}

.effect-bar {
  display: block;
  height: 1.6rem;
  background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
  border-radius: 8px;
  overflow: hidden;
}

.effect-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rule);
  border-radius: 8px;
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.effect-bar.strong i {
  background: var(--precision-fill);
}

.effect.is-visible .effect-bar i {
  width: calc(var(--g) / 0.4 * 100%);
}

.effect figcaption {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* School */

.code-pair {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  perspective: 900px;
}

.code {
  display: inline-grid;
  gap: 0.35rem;
  padding: 0.9rem 1.1rem 1rem;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--border);
  transform: rotateY(14deg) rotateX(6deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.code:hover {
  transform: none;
}

.code-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.code-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 6.4vw, 2.8rem);
  letter-spacing: 0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}

.code-value.typing::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.85em;
  margin-left: 4px;
  background: var(--precision);
  vertical-align: -0.05em;
  animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.code-or {
  font-weight: 700;
  color: var(--text-muted);
}

.qr {
  width: clamp(4rem, 18vw, 5.6rem);
  height: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 0 var(--border);
  transform: rotateY(-16deg) rotateX(6deg);
}

.school-note {
  margin-top: 2rem;
  color: var(--text-muted);
  max-width: 34rem;
}

/* Finale */

.finale {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.finale-note {
  margin-top: 1.25rem;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.month-card {
  margin: 0;
  width: min(100%, 21rem);
  padding: 1rem 1rem 1.6rem;
  background: var(--paper);
  color: #1b1d24;
  border-radius: 12px;
  box-shadow: 30px 40px 60px -30px #0e0f1455;
  transform: perspective(900px) rotateY(-18deg) rotateX(8deg);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.month-card:hover {
  transform: perspective(900px);
}

.month-card figcaption {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
  color: #a02a66;
}

.weekdays,
.days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.weekdays li {
  font-size: 0.8rem;
  font-weight: 700;
  color: #595e71;
  padding-bottom: 0.35rem;
}

.days li {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.days li:nth-child(7n) {
  color: #62677a;
}

.days .exam span {
  font-weight: 800;
}

.days .exam small {
  position: absolute;
  top: calc(100% + 0.05rem);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1;
  color: #a02a66;
}

.days .ring {
  position: absolute;
  inset: -2% -14%;
  width: 128%;
  height: 104%;
  fill: none;
  stroke: var(--ritmo-edge);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  overflow: visible;
}

.month-card.is-visible .ring {
  animation: scribble 0.7s ease-out forwards;
}

.month-card.is-visible li.exam ~ li.exam .ring {
  animation-delay: 0.6s;
}

/* Footer */

.footer {
  position: relative;
  padding-top: 2rem;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter-right);
  height: 1px;
  background: var(--rule);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.footer-brand .wordmark-tiles {
  width: 1.2rem;
  height: 1.2rem;
}

/* Easter eggs: toast and confetti of answer bubbles */

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(90vw, 26rem);
  padding: 0.8rem 1.1rem;
  border-radius: 14px;
  background: var(--text);
  color: var(--background);
  font-weight: 700;
  box-shadow: 0 5px 0 var(--ritmo-edge);
  transform: translateX(-50%);
  animation: toast-in 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 1.5rem) scale(0.9);
  }
}

.confetti {
  position: fixed;
  z-index: 25;
  top: -2rem;
  left: var(--x);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 -3px 0 #0000002a;
  pointer-events: none;
  animation: fall var(--t) cubic-bezier(0.3, 0.2, 0.6, 1) forwards;
}

@keyframes fall {
  to {
    transform: translate3d(var(--dx), 110vh, 0) rotate(720deg);
  }
}

/* Not found page */

.missing {
  padding-top: 4rem;
  padding-bottom: 6rem;
}

.missing h1 {
  margin-top: 0.75rem;
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  max-width: 14ch;
}

.missing-code {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ritmo);
}

.missing .lead {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.missing .actions {
  margin-top: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Wider screens */

@media (min-width: 48rem) {
  :root {
    --gutter: max(2rem, env(safe-area-inset-left));
    --gutter-right: max(2rem, env(safe-area-inset-right));
  }

  .skill {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
  }

  .skill h2 {
    font-size: clamp(3rem, 6.4vw, 5.4rem);
  }

  .visual {
    justify-self: center;
  }

  .finale {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

@media (min-width: 64rem) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
  }

  .sheet-wrap {
    width: min(100%, 30rem);
  }

  .sheet {
    padding: 1.5rem 1.5rem 1.1rem;
  }

  .sheet-title {
    font-size: 1.3rem;
  }

  .sheet-rows {
    row-gap: 0.42rem;
    column-gap: 1.6rem;
  }

  .bubble {
    width: 1.55rem;
    height: 1.55rem;
    font-size: 0.7rem;
  }

  .row-no {
    font-size: 0.88rem;
  }

  .skills {
    grid-template-columns: 11rem minmax(0, 1fr);
    column-gap: 2.5rem;
  }

  .cube-stage {
    --size: 7rem;
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: stretch;
    justify-self: center;
    height: auto;
    position: relative;
    top: auto;
  }

  .cube-stage .cube-sticky {
    position: sticky;
    top: calc(50vh - 4.5rem);
    margin-top: calc(46svh - 4.5rem);
  }

  .skill {
    grid-column: 2;
  }
}
