:root {
  color-scheme: light dark;
  --paper: #faf9f6;
  --ink: #20221f;
  --muted: #6d7069;
  --accent: #345c48;
  --surface: #fff;
  --border: #e4e4dd;
  --back-border: #b8bcb4;
  --back-hover: #eeefe9;
  --button-text: #fff;
  --button-hover: #264835;
  --shadow: #242a2110;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
button:disabled { cursor: default; }
.page-shell { width: min(728px, 100%); min-height: 100vh; min-height: 100svh; margin: 0 auto; padding: 36px 44px; display: flex; flex-direction: column; }
.wordmark { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 500; letter-spacing: -.2px; color: var(--muted); }
.main-content { width: 100%; margin: auto 0; padding: 44px 0; }
.counter { margin: 0 0 14px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.problem-card { --card-padding: 40px; --card-min-height: 348px; min-height: max(var(--card-min-height), calc(var(--problem-height, 0px) + var(--card-padding) * 2 + 2px)); display: flex; align-items: center; padding: var(--card-padding); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 3px 12px var(--shadow); touch-action: pan-y pinch-zoom; overscroll-behavior-x: contain; }
.problem-copy { width: 100%; }
.problem-statement { margin: 0; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.3; font-weight: 500; letter-spacing: -1.15px; overflow-wrap: anywhere; text-wrap: balance; }
.problem-statement.is-status { font-size: 24px; letter-spacing: -.4px; }
.problem-statement.is-entering { animation: appear 180ms ease-out; }
.navigation { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.back-button { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid var(--back-border); border-radius: 50%; color: var(--ink); background: transparent; font-size: 25px; line-height: 1; cursor: pointer; transition: background 150ms, opacity 150ms; }
.back-button:disabled { opacity: .3; }
.next-button { min-height: 48px; padding: 0 25px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: var(--button-text); font-size: 14px; font-weight: 550; cursor: pointer; transition: background 150ms; }
.next-button:disabled { opacity: .4; }
.hint { margin: 28px 0 0; text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); }
.site-footer { display: flex; justify-content: center; gap: 20px; margin-top: auto; padding-top: 24px; font-size: 13px; line-height: 1.5; }
.site-footer a { color: var(--muted); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--accent); }
.touch-hint { display: none; }
.noscript-message { font-size: 18px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes appear { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
  .back-button:not(:disabled):hover { background: var(--back-hover); }
  .next-button:not(:disabled):hover { background: var(--button-hover); }
}
@media (hover: none) { .desktop-hint { display: none; } .touch-hint { display: inline; } }
@media (max-width: 600px) {
  .page-shell { padding: 24px 20px; }
  .main-content { padding: 30px 0; }
  .problem-card { --card-min-height: 390px; --card-padding: 28px; border-radius: 12px; }
  .problem-statement { font-size: 28px; letter-spacing: -.65px; }
  .problem-statement.is-status { font-size: 23px; }
  .navigation { margin-top: 22px; }
  .hint { margin-top: 25px; }
}
@media (max-width: 360px) {
  .page-shell { padding-top: 20px; padding-bottom: 20px; }
  .main-content { padding: 24px 0; }
  .problem-card { --card-padding: 24px; }
  .problem-statement { font-size: 26px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111111;
    --ink: #f2f2f2;
    --muted: #b0b0a8;
    --surface: #1c1c1c;
    --border: #484a43;
    --back-border: #74786f;
    --back-hover: #2b2d28;
    --accent: #a5d6b6;
    --button-text: #16241b;
    --button-hover: #b6e4c5;
    --shadow: #00000033;
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
