/* ═══ Guess Alex's Personality ═══════════════════════════════════════
   Palette pulled from the source photographs: his washed-denim tee,
   warm lamplight, and the tomato red of an Artichoke Basille's slice.
   Board light/dark squares carry the chess motif.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --denim:       #6B93B8;
  --denim-deep:  #2E4A63;
  --bone:        #F2EDE3;
  --bone-dim:    #E4DCCB;
  --crust:       #D9A76A;
  --tomato:      #C8452F;
  --moss:        #7A8C5A;
  --ink:         #1E2A33;

  --display: "Avenir Next Condensed", "Futura", "Helvetica Neue", sans-serif;
  --serif:   Georgia, "Iowan Old Style", "Times New Roman", serif;
  --note:    "American Typewriter", "Courier New", ui-monospace, monospace;

  --edge: 2px solid var(--ink);
  --pad: clamp(1.25rem, 5vw, 2.5rem);
}

* { box-sizing: border-box; }

/* class-based display rules below would otherwise outrank the UA's [hidden] */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* faint board grid, barely there */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-conic-gradient(var(--ink) 0% 25%, transparent 25% 50%) 0 0 / 96px 96px;
  opacity: .03;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + 3.25rem); /* clears the fixed sound pill */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; flex-direction: column; }
.screen.is-active { display: flex; }

.eyebrow {
  margin: 0;
  font-family: var(--note);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--denim-deep);
  opacity: .75;
}

/* ─── intro ────────────────────────────────────────────────────────── */

.screen--intro { position: relative; justify-content: flex-start; }

.hero { padding-top: clamp(1rem, 6vh, 4rem); }

.hero__title {
  margin: .5rem 0 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 17vw, 7.5rem);
  font-weight: 600;
  line-height: .84;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero__sub {
  margin: 1.25rem 0 0;
  font-family: var(--note);
  font-size: .95rem;
  max-width: 22ch;
  color: var(--denim-deep);
}

/* the road: one rank of a chessboard, scrolling */
.road {
  position: relative;
  height: clamp(10rem, 34vw, 13rem);
  margin-top: auto;
  margin-bottom: 2.75rem;
}

.road__rank {
  position: absolute;
  inset: auto calc(var(--pad) * -1) 0;
  height: 2.25rem;
  border-top: var(--edge);
  border-bottom: var(--edge);
  background: repeating-linear-gradient(
    90deg,
    var(--bone-dim) 0 2.25rem,
    var(--denim-deep) 2.25rem 4.5rem
  );
  animation: rank-scroll 1.1s linear infinite;
}
@keyframes rank-scroll { to { background-position-x: -4.5rem; } }

.cyclist {
  position: absolute;
  bottom: 1.9rem;
  left: 0;
  width: clamp(9.5rem, 42vw, 14rem);
  aspect-ratio: 200 / 152;
  animation: ride 5s linear forwards;
}
@keyframes ride {
  from { transform: translateX(-140%); }
  to   { transform: translateX(calc(100vw + 40%)); }
}

.cyclist__bike { width: 100%; height: 100%; overflow: visible; }

.wheel { animation: spin .45s linear infinite; }
.wheel--rear  { transform-origin: 40px 115px; }
.wheel--front { transform-origin: 150px 115px; }
@keyframes spin { to { transform: rotate(360deg); } }

.leg { animation: pedal .45s ease-in-out infinite alternate; }
.leg--near { transform-origin: 84px 66px; }
.leg--far  { transform-origin: 84px 66px; animation-direction: alternate-reverse; }
@keyframes pedal { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }

/* his actual face, doing the work */
.cyclist__face {
  position: absolute;
  left: 51%;
  top: 11%;
  width: 30%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(8deg);
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
  background: var(--crust);
}

.skip {
  position: absolute;
  top: 0;
  right: 0;
  padding: .5rem .9rem;
  border: var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--note);
  font-size: .8rem;
  letter-spacing: .08em;
  cursor: pointer;
}
.skip:hover { background: var(--ink); color: var(--bone); }

/* ─── file strip: eight questions, eight files ─────────────────────── */

.files {
  display: flex;
  gap: .3rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.files li {
  flex: 1;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  background: transparent;
  font-family: var(--note);
  font-size: .7rem;
  color: var(--ink);
  opacity: .3;
  transition: background .25s, opacity .25s, color .25s;
}
.files li.is-now  { opacity: 1; background: var(--crust); }
.files li.is-hit  { opacity: 1; background: var(--moss); color: var(--bone); }
.files li.is-miss { opacity: 1; background: var(--tomato); color: var(--bone); }
.files li.is-trap { opacity: 1; background: var(--denim); color: var(--bone); }

/* ─── question card ────────────────────────────────────────────────── */

.screen--quiz { justify-content: center; }

.card {
  border: var(--edge);
  background: #FBF8F1;
  padding: var(--pad);
  box-shadow: 8px 8px 0 var(--denim-deep);
  animation: settle .35s ease-out;
}
@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.4rem;
}

.move {
  margin: 0;
  font-family: var(--note);
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--denim-deep);
}

/* the signature: a chess annotation, stamped */
.stamp {
  margin: 0;
  text-align: right;
  animation: stamp-in .28s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes stamp-in {
  from { opacity: 0; transform: scale(2.1) rotate(-14deg); }
  to   { opacity: 1; transform: scale(1) rotate(-4deg); }
}
.stamp__glyph {
  display: block;
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: .8;
  letter-spacing: -.04em;
}
.stamp__label {
  display: block;
  font-family: var(--note);
  font-style: normal;
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.stamp.is-hit  .stamp__glyph, .stamp.is-hit  .stamp__label { color: var(--moss); }
.stamp.is-miss .stamp__glyph, .stamp.is-miss .stamp__label { color: var(--tomato); }
.stamp.is-trap .stamp__glyph, .stamp.is-trap .stamp__label { color: var(--denim); }

.ask {
  margin: .75rem 0 1.75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 8.5vw, 3.4rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.choice {
  padding: 1.4rem .75rem;
  border: var(--edge);
  background: var(--bone);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .12s, background .12s, color .12s;
}
.choice:hover { background: var(--crust); transform: translateY(-2px); }
.choice:active { transform: translateY(0); }
.choice.is-picked { background: var(--ink); color: var(--bone); }
.choice[disabled] { cursor: default; }
.choice[disabled]:not(.is-picked) { opacity: .3; }
.choice[disabled]:hover { transform: none; }
.choice[disabled]:not(.is-picked):hover { background: var(--bone); }

/* ─── the evidence ─────────────────────────────────────────────────── */

.evidence { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 34rem) {
  .evidence { grid-template-columns: minmax(0, 17rem) 1fr; align-items: center; }
}

.evidence__media { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }

/* the evidence is a mix of portraits, a square board and a wide headline —
   cap both dimensions and let each keep its own proportions */
.evidence__media img {
  max-height: clamp(6.5rem, 30vw, 9.5rem);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: var(--edge);
  background: var(--bone);
  display: block;
}

.evidence__media .glyph {
  display: grid;
  place-items: center;
  height: clamp(6.5rem, 30vw, 9.5rem);
  aspect-ratio: 3 / 4;
  border: var(--edge);
  background: var(--bone);
  font-size: clamp(2.75rem, 12vw, 3.75rem);
  line-height: 1;
}
.evidence__media .glyph.is-struck { position: relative; }
.evidence__media .glyph.is-struck::after {
  content: "";
  position: absolute;
  inset: 12% 6%;
  border-top: 4px solid var(--tomato);
  transform: rotate(-34deg);
  transform-origin: center;
}

.evidence__note { margin: 0; font-size: 1.02rem; line-height: 1.5; }
.evidence__note b { font-family: var(--note); font-weight: normal; font-size: .95em; }

.next {
  margin: 1.75rem 0 0;
  padding: .85rem 1.4rem;
  align-self: flex-start;
  border: var(--edge);
  background: var(--ink);
  color: var(--bone);
  font-family: var(--note);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.next:hover { background: var(--tomato); }

/* ─── score sheet ──────────────────────────────────────────────────── */

.screen--result { justify-content: center; }

.sheet {
  border: var(--edge);
  background: #FBF8F1;
  padding: var(--pad);
  box-shadow: 8px 8px 0 var(--tomato);
  animation: settle .4s ease-out;
}

.score {
  margin: .25rem 0 0;
  font-family: var(--display);
  line-height: .8;
  letter-spacing: -.03em;
}
.score b { font-size: clamp(5rem, 24vw, 8rem); font-weight: 600; }
.score span { font-size: clamp(1.75rem, 8vw, 2.75rem); color: var(--denim); }

.rank {
  margin: 1rem 0 1.5rem;
  font-family: var(--display);
  font-size: clamp(1.65rem, 7vw, 2.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--tomato);
  text-wrap: balance;
}

.verdict { font-size: 1.06rem; line-height: 1.6; }
.verdict p { margin: 0 0 1rem; }
.verdict p:last-child { margin-bottom: 0; }

.trap {
  margin: 1.5rem 0 0;
  padding: .9rem 1rem;
  border-left: 4px solid var(--denim);
  background: var(--bone);
  font-family: var(--note);
  font-size: .84rem;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: .1rem .75rem;
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--ink);
  font-family: var(--note);
  font-size: .8rem;
}
.stats div { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; }
.stats dt { color: var(--denim-deep); }
.stats dd { margin: 0; font-weight: bold; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }

.btn {
  padding: .85rem 1.4rem;
  border: var(--edge);
  background: transparent;
  color: var(--ink);
  font-family: var(--note);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--crust); }
.btn--solid { background: var(--ink); color: var(--bone); }
.btn--solid:hover { background: var(--tomato); color: var(--bone); }

/* ─── the trap modal ───────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__box {
  max-width: 22rem;
  border: var(--edge);
  background: var(--bone);
  padding: var(--pad);
  box-shadow: 10px 10px 0 var(--denim);
  animation: stamp-in .3s cubic-bezier(.2, 1.5, .4, 1);
  text-align: center;
}

.modal__glyph { font-size: 2.5rem; line-height: 1; margin: 0; }

.modal__title {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-size: clamp(2.5rem, 12vw, 3.75rem);
  font-weight: 600;
  line-height: .9;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--tomato);
}

/* ─── soundtrack toggle ────────────────────────────────────────────── */

.sound {
  position: fixed;
  right: .9rem;
  bottom: .9rem;
  z-index: 20;
  padding: .5rem .8rem;
  border: var(--edge);
  border-radius: 999px;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--note);
  font-size: .75rem;
  letter-spacing: .1em;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--denim-deep);
}
.sound:hover { background: var(--crust); }
.sound.is-off { opacity: .6; }

/* ─── quality floor ────────────────────────────────────────────────── */

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

@media (prefers-reduced-motion: reduce) {
  .cyclist { animation: none; transform: translateX(30vw); }
  .wheel, .leg, .road__rank { animation: none; }
  .card, .sheet, .stamp, .modal, .modal__box { animation: none; }
}
