:root {
  color-scheme: light;
  --paper: #f4f2ec;
  --ink: #20211f;
  --muted: #74746d;
  --faint: #d8d5cc;
  --accent: #d94d35;
  --correct: #19736a;
  --focus: #275fce;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 76% 24%, rgb(255 255 255 / 72%), transparent 25rem),
    var(--paper);
}

button, input { font: inherit; }

button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.app-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
}

.brand {
  height: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__wordmark {
  color: var(--ink);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand__wordmark span { color: var(--accent); }

.brand__byline {
  padding-left: 12px;
  border-left: 1px solid var(--faint);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.screen { min-height: calc(100svh - 92px); }

.screen[hidden] { display: none; }

.screen--intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  align-items: center;
  gap: clamp(40px, 9vw, 140px);
  padding: 4vh 4vw 12vh;
}

.eyebrow, .progress {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(60px, 8.4vw, 124px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .87;
}

.lede {
  margin: 32px 0;
  color: #53534e;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
}

.button {
  min-height: 54px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); background: #000; }
.button:active { transform: translateY(0); }

.duration {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.intro-mark {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 470px);
  justify-self: center;
}

.intro-mark__orbit {
  position: absolute;
  inset: 8%;
  border: 1px solid #bbb8af;
  border-radius: 50%;
}

.intro-mark__line {
  position: absolute;
  left: 12%;
  top: 50%;
  width: 76%;
  height: 1px;
  background: var(--ink);
  transform-origin: center;
}

.intro-mark__line--a { transform: rotate(26deg); }
.intro-mark__line--b { transform: rotate(-38deg); }

.intro-mark__point {
  position: absolute;
  left: 48.5%;
  top: 48.5%;
  width: 3%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 10px rgb(217 77 53 / 10%);
}

.screen--game {
  display: grid;
  grid-template-rows: auto minmax(310px, 1fr) auto;
  padding: 3vh 0 32px;
}

.game-head { text-align: center; }
.game-head .progress { margin-bottom: 13px; }

.instruction {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 45px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.stage-wrap {
  min-height: 0;
  padding: 24px 0 16px;
  display: grid;
  place-items: center;
}

.stage {
  width: 100%;
  height: min(60vh, 590px);
  min-height: 330px;
  overflow: visible;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.shape-outline,
.shape-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.endpoint { fill: var(--ink); }

.movable-line {
  stroke: var(--accent);
  stroke-width: 4;
}

.hit-line {
  stroke: transparent;
  stroke-width: 48;
  cursor: grab;
}

.drag-handle {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 5;
  cursor: grab;
}

.drag-handle::after { content: ''; }

.center-point {
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 4;
}

.reference-point {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 4;
}

.point-label {
  fill: var(--muted);
  font-size: 14px;
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 750;
  letter-spacing: .12em;
}

.answer-mark--guess circle {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 3;
}

.answer-mark--guess .marker-stroke {
  stroke: var(--accent);
  stroke-width: 2;
}

.answer-mark--correct circle {
  fill: var(--paper);
  stroke: var(--correct);
  stroke-width: 3;
}

.answer-mark--correct .marker-stroke {
  stroke: var(--correct);
  stroke-width: 2;
}

.error-line {
  stroke: #9f9c93;
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
}

.correct-line {
  stroke: var(--correct);
  stroke-width: 3;
  stroke-dasharray: 7 8;
}

.solution-reveal {
  opacity: 0;
  transition: opacity 260ms ease;
}

.solution-reveal.is-visible { opacity: 1; }

.game-foot {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.feedback {
  min-width: 220px;
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.feedback strong,
.feedback span { display: block; }

.feedback strong { font-weight: 400; }

.feedback span {
  margin-top: 5px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.button--next { min-width: 130px; }

.screen--result {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: center;
  gap: clamp(55px, 10vw, 150px);
  padding: 5vh 4vw 11vh;
}

.result-main .eyebrow { margin-bottom: 18px; }

.result-score {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: clamp(110px, 15vw, 210px);
  line-height: .82;
}

.result-score small {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: clamp(18px, 2vw, 27px);
  font-weight: 500;
  letter-spacing: -.03em;
}

.result-rating {
  margin: 28px 0 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 2.2vw, 32px);
}

.result-detail { max-width: 560px; }

.profile { display: grid; gap: 21px; }

.profile-row {
  display: grid;
  grid-template-columns: 110px minmax(100px, 1fr) 34px;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.profile-row > span { color: #51514c; }
.profile-row > strong { text-align: right; font-variant-numeric: tabular-nums; }

.profile-track {
  height: 3px;
  background: var(--faint);
}

.profile-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  animation: grow-bar 650ms ease-out both;
  transform-origin: left;
}

@keyframes grow-bar { from { transform: scaleX(0); } }

.highlights {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--faint);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.highlights span,
.highlights strong { display: block; }

.highlights span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.highlights strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.35;
}

.about {
  margin: 38px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 30px, 580px); }
  .brand { height: 72px; }
  .brand__byline { display: none; }
  .screen { min-height: calc(100svh - 72px); }
  .screen--intro { grid-template-columns: 1fr; padding: 6vh 1vw 8vh; }
  .intro-copy { text-align: center; }
  .intro-mark { grid-row: 1; width: min(50vw, 220px); }
  h1 { font-size: clamp(54px, 18vw, 85px); }
  .lede { margin: 24px 0; }
  .button { width: min(100%, 330px); }
  .screen--game { padding-top: 2vh; }
  .stage { height: min(55vh, 510px); min-height: 300px; }
  .game-foot { flex-direction: column; gap: 12px; }
  .screen--result { grid-template-columns: 1fr; align-content: center; gap: 58px; padding: 5vh 2vw 10vh; }
  .result-main { text-align: center; }
  .result-score { justify-content: center; }
  .result-main .button { width: min(100%, 300px); }
  .profile-row { grid-template-columns: 94px minmax(90px, 1fr) 32px; gap: 12px; }
  .highlights { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
