/* Colors, fonts and tiles match the app: docs/design/visual-design.md. Light is the app's Slate paper theme. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/static/fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/static/fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/BricolageGrotesque-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #edf1f6;
  --surface: #ffffff;
  --raised: #dfe6ef;
  --line: #66758c;
  --ink: #0f172a;
  --muted: #44516a;
  --sun: #ffc93c;
  --sun-lip: #a87a00;
  --on-sun: #231a00;
  --sun-text: #765600;
  --sky-fill: #1458c8;
  --sky-lip: #0c3d8f;
  --on-sky: #ffffff;
  --sky-text: #1458c8;
  --ember-fill: #b4420a;
  --ember-lip: #7c2c04;
  --on-ember: #ffffff;
  --mint-text: #0b7148;
  --tile: #f6e7c6;
  --tile-ink: #1d1b2f;
  --tile-edge: #8a7347;
  --glow: rgba(20, 88, 200, 0.10);

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1024;
    --surface: #171b38;
    --raised: #222850;
    --line: #6a75ae;
    --ink: #f5f2ea;
    --muted: #b3b8d9;
    --sun-lip: #c99400;
    --sun-text: #ffc93c;
    --sky-fill: #4cc3ff;
    --sky-lip: #1f8fcc;
    --on-sky: #061a2b;
    --sky-text: #4cc3ff;
    --ember-fill: #ff9147;
    --ember-lip: #d0661d;
    --on-ember: #2a1000;
    --mint-text: #52e0a8;
    --tile-edge: #b89a62;
    --glow: rgba(76, 195, 255, 0.10);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 var(--body);
}
a { color: var(--sky-text); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 700; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { padding: 1.25rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font: 800 1.35rem/1 var(--display); letter-spacing: 0.04em;
}
.logo .tile { --size: 2.1rem; background: var(--sun); box-shadow: 0 3px 0 var(--sun-lip); }
.logo .word span { color: var(--sun-text); }
.site-header nav { display: flex; gap: 1.25rem; font-weight: 700; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }

/* Tiles, drawn like the app's LetterTile */
.tile {
  --size: 2.75rem;
  position: relative;
  display: inline-grid; place-items: center;
  width: var(--size); height: calc(var(--size) + 0.25rem);
  margin-bottom: 3px;
  border-radius: calc(var(--size) / 4);
  background: var(--tile);
  box-shadow: 0 3px 0 var(--tile-edge);
  padding: 0 calc(var(--size) * 0.1) calc(var(--size) * 0.06) 0;
  color: var(--tile-ink);
  font: 800 calc(var(--size) * 0.58)/1 var(--display);
}
.tile sub {
  position: absolute; right: calc(var(--size) / 12); bottom: calc(var(--size) / 14);
  font: 700 calc(var(--size) * 0.26)/1 var(--body);
}
.tiles { display: inline-flex; gap: 0.3rem; }

/* Operator chips, + in sky and − in ember as in the round */
.op {
  display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  font: 700 1.7rem/1 var(--body);
}
.op.plus { background: var(--sky-fill); color: var(--on-sky); box-shadow: 0 3px 0 var(--sky-lip); }
.op.minus { background: var(--ember-fill); color: var(--on-ember); box-shadow: 0 3px 0 var(--ember-lip); }

/* Home: hero */
.hero { padding: 2.5rem 0 4rem; }
.hero .wrap { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr 1fr; } }
.eyebrow { margin: 0 0 1rem; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; }
.hero h1 {
  margin: 0 0 1.25rem;
  font: 800 clamp(2.6rem, 7vw, 4.4rem)/1.02 var(--display); letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--sun-text); }
.lede { margin: 0 0 2rem; font-size: 1.2rem; color: var(--muted); max-width: 32rem; }
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0; padding: 0; list-style: none; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 10.5rem; padding: 0.6rem 1.1rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  line-height: 1.2;
}
.store small { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.store b { font: 800 1.15rem/1.2 var(--display); }

/* Home: the example round */
.board {
  margin: 0;
  padding: 1.5rem;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  box-shadow: 0 30px 80px -30px var(--glow), 0 0 0 12px var(--glow);
}
.board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.target { display: flex; flex-direction: column; line-height: 1; }
.target small { color: var(--muted); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.35rem; }
.target b { font: 800 2.75rem/1 var(--display); }
.medals { display: flex; gap: 0.4rem; }
.medal {
  padding: 0.3rem 0.6rem; border-radius: 999px;
  border: 2px solid var(--line); color: var(--muted);
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em;
}
.medal.on { border-color: transparent; background: #c9cedb; color: var(--tile-ink); }
.rows { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.row {
  display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: var(--radius); background: var(--raised);
}
.row .op.none { visibility: hidden; }
.row .value { font: 800 1.5rem/1 var(--display); min-width: 2.5ch; text-align: right; }
.total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 2px dashed color-mix(in srgb, var(--line) 50%, transparent);
}
.total span { color: var(--muted); font-weight: 700; }
.hit {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.45rem 0.6rem; border-radius: 999px;
  background: var(--on-sun); color: var(--sun);
  font: 800 1.6rem/1 var(--display);
}
.bullseye {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: radial-gradient(circle, var(--sun) 0 22%, var(--on-sun) 23% 42%, var(--sun) 43% 62%, var(--on-sun) 63% 80%, var(--sun) 81%);
}
.board figcaption { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }

/* Home: sections */
.section { padding: 3.5rem 0; }
.section.alt { background: var(--surface); }
.section h2 {
  margin: 0 0 0.5rem;
  font: 800 clamp(1.8rem, 4vw, 2.5rem)/1.1 var(--display); letter-spacing: -0.01em;
}
.section .intro { margin: 0 0 2rem; color: var(--muted); max-width: 36rem; }
.cards { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  padding: 1.5rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
}
.section.alt .card { background: var(--bg); }
.card h3 { margin: 1rem 0 0.4rem; font: 800 1.3rem/1.2 var(--display); }
.card p { margin: 0; color: var(--muted); }
.step {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px;
  background: var(--sun); color: var(--on-sun); box-shadow: 0 3px 0 var(--sun-lip);
  font: 800 1.3rem/1 var(--display);
}
/* Raised badges like the app's helper art: a fill, a darker lip and a dark glyph */
.badge {
  display: inline-grid; place-items: center; min-width: 3rem; height: 2.75rem; padding: 0 0.6rem;
  border-radius: 12px; color: #10162b;
  font: 800 1.05rem/1 var(--display);
}
.badge.mint { background: #52e0a8; box-shadow: 0 3px 0 #2a9e72; }
.badge.sky { background: #4cc3ff; box-shadow: 0 3px 0 #1f8fcc; }
.badge.sun { background: var(--sun); box-shadow: 0 3px 0 var(--sun-lip); }
.cta { text-align: center; }
.cta .intro { margin-left: auto; margin-right: auto; }
.cta .stores { justify-content: center; }

/* Reading pages */
.prose { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.prose h1 { margin: 1rem 0 0.5rem; font: 800 clamp(2rem, 5vw, 2.75rem)/1.1 var(--display); letter-spacing: -0.01em; }
.prose h2 { margin: 2.5rem 0 0.5rem; font: 800 1.4rem/1.25 var(--display); }
.prose li { margin: 0.35rem 0; }
.prose table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 45%, transparent); border-radius: 14px;
  overflow: hidden; font-size: 0.95rem;
}
.prose th, .prose td { text-align: left; padding: 0.65rem 0.85rem; vertical-align: top; }
.prose th { background: var(--raised); font-weight: 700; }
.prose tr + tr td { border-top: 1px solid color-mix(in srgb, var(--line) 30%, transparent); }
.updated { display: inline-block; margin: 0; padding: 0.2rem 0.7rem; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 0.85rem; }
.callout {
  margin: 1.5rem 0; padding: 1.25rem 1.5rem; border-radius: var(--radius);
  background: var(--surface); border-left: 6px solid var(--sun);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

/* Footer */
.site-footer { padding: 2.5rem 0 3rem; border-top: 1px solid color-mix(in srgb, var(--line) 35%, transparent); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.site-footer p { margin: 0; color: var(--muted); }
.site-footer p a { color: inherit; }
.site-footer p a:hover { color: var(--ink); }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .tile { --size: 2.3rem; }
  .board { padding: 1rem; border-radius: 22px; box-shadow: 0 0 0 8px var(--glow); }
  .row { gap: 0.5rem; padding: 0.5rem; }
  .site-header nav { display: none; }
}
