/* Headword Games. The page is a shop window for the daily games: each game gets a panel in its
   own colors and its own typeface, with a small picture of how it plays. The parent brand stays
   quiet around them: warm paper, near-black ink, one red dot. */

:root {
  --paper: #f3f1ea;
  --ink: #191816;
  --muted: #5e5b54;
  --hair: #d6d2c7;
  --red: #b02a1d;
  --brand: "Besley", "Rockwell", Georgia, serif;
  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #121211; --ink: #eeebe3; --muted: #a5a299; --hair: #2e2d2a; --red: #ff8f7d; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.top, main, .foot { max-width: 1240px; margin: 0 auto; padding-inline: 20px; }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 6px; }
.logo { display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none; }
.logo-word { font: 900 27px/1 var(--brand); letter-spacing: -0.035em; white-space: nowrap; }
.logo-games { font: 500 15px/1 var(--ui); letter-spacing: .01em; color: var(--muted); }
.dot { display: inline-block; width: .15em; height: .15em; margin: 0 .05em; border-radius: 50%; background: var(--red); vertical-align: .26em; }
.today { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; white-space: nowrap; }
.today .extra { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 30px 0 26px; }
.hero h1 { font: 900 clamp(27px, 8.1vw, 62px)/1.08 var(--brand); letter-spacing: -0.038em; text-wrap: balance; }
.hero h1 span { color: var(--muted); }
.hero-sub { margin-top: 14px; font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); }

/* On a phone only one panel fits the first screen, so all three games get a shortcut up here. */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.quick a { display: flex; align-items: center; justify-content: center; gap: 5px; height: 48px; border-radius: 12px; font-size: 16px; text-decoration: none; white-space: nowrap; transition: transform .15s ease; }
.quick a span { font: 600 14px/1 var(--ui); opacity: .8; }
.quick a:active { transform: translateY(1px); }
.q-seldom { background: #fbf8f2; color: #b87d08; box-shadow: inset 0 0 0 1px #e8e2d9; font-family: "Bricolage Grotesque", var(--ui); font-weight: 800; }
.q-whither { background: #0f131c; color: #f2b33d; font-family: "Fraunces", Georgia, serif; font-weight: 700; }
.q-nigh { background: #2f5d45; color: #fff; font-family: "Fraunces", Georgia, serif; font-weight: 600; }
@media (prefers-color-scheme: dark) { .q-whither { box-shadow: inset 0 0 0 1px #2c3548; } }

/* ---------- The games ---------- */
.games { display: grid; gap: 14px; }

.game { position: relative; display: flex; flex-direction: column; gap: 22px; padding: 24px 22px 22px; border-radius: 22px; overflow: hidden; }
.game h2 { font-size: clamp(40px, 11vw, 52px); line-height: 1; }
.pitch { margin-top: 10px; font-size: 17px; line-height: 1.38; max-width: 21em; }
.demo { flex: 1; display: grid; place-items: center; min-height: 210px; }
.go { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 18px; border-radius: 13px; font-weight: 700; font-size: 17px; text-decoration: none; transition: transform .15s ease, filter .15s ease; }
.go span { transition: transform .15s ease; }
.go:hover { filter: brightness(1.06); }
.go:hover span { transform: translateX(4px); }
.go:active { transform: translateY(1px); }

/* Seldom: cream, amber, a rounded grotesque. The picture is a board where the rare answer wins. */
.g-seldom { background: #fbf8f2; color: #2c2825; box-shadow: inset 0 0 0 1px #e8e2d9; }
.g-seldom h2 { font-family: "Bricolage Grotesque", var(--ui); font-weight: 800; letter-spacing: -0.03em; color: #d4940a; }
.g-seldom .pitch { color: #5b554f; }
.g-seldom .go { background: #d4940a; color: #fff; font-family: "Bricolage Grotesque", var(--ui); letter-spacing: .01em; }
.demo-q { font: 700 15px/1 "Bricolage Grotesque", var(--ui); color: #2c2825; margin-bottom: 12px; }
.g-seldom .demo { display: flex; flex-direction: column; justify-content: center; align-items: stretch; }
.demo-q, .rows { width: min(100%, 300px); margin-inline: auto; }
.rows { display: grid; gap: 7px; }
.rows li { justify-self: start; width: 100%; display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 14px; border-radius: 11px; background: #fff; box-shadow: inset 0 0 0 1px #e8e2d9; font-weight: 600; font-size: 15px; }
.rows b { font: 800 16px/1 "Bricolage Grotesque", var(--ui); font-variant-numeric: tabular-nums; color: #9c958e; }
.rows li:nth-child(2) { width: 92%; }
.rows li:nth-child(3) { width: 84%; }
.rows .zero { width: 76%; background: linear-gradient(100deg, #f5b800, #ffd54f 55%, #f5b800); box-shadow: 0 6px 16px -8px #c8920a; color: #3a2a00; }
.rows .zero b { color: #3a2a00; font-size: 19px; }

/* Whither: night navy, gold, Fraunces. The picture is a path of lit hexes running down the board. */
.g-whither { background: #0f131c; color: #f3eee4; }
@media (prefers-color-scheme: dark) { .g-whither { box-shadow: inset 0 0 0 1px #2c3548; } }
.g-whither h2 { font-family: "Fraunces", Georgia, serif; font-weight: 700; letter-spacing: -0.02em; }
.g-whither .pitch { color: #9aa3b5; }
.g-whither .go { background: #f2b33d; color: #2a1a00; }
.hexes { width: min(100%, 250px); height: auto; overflow: visible; }
.hx { fill: #2a3346; }
.hx.on { fill: #f2b33d; }
.hl { fill: #9aa3b5; font: 800 13px "Instrument Sans", sans-serif; text-anchor: middle; }
.hl.on { fill: #2a1a00; }

/* Nigh: deep green, Fraunces. The picture is the gauge, filled to just under the line. */
.g-nigh { background: #2f5d45; color: #fff; }
.g-nigh h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -0.02em; text-transform: lowercase; }
.g-nigh .pitch { color: #cfe3d6; }
.g-nigh .go { background: #f5f2ea; color: #1f3d2e; }
.gauge { display: grid; grid-template-columns: auto 34px; grid-template-rows: auto 1fr; column-gap: 16px; align-items: end; }
.limit { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; padding-bottom: 7px; margin-bottom: 8px; border-bottom: 3px solid #fff; }
.limit small { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #cfe3d6; }
.limit b { font: 600 22px/1 "Fraunces", Georgia, serif; }
.cells { grid-column: 2; grid-row: 2; display: grid; gap: 4px; }
.cells li { height: 15px; border-radius: 4px; background: rgba(255, 255, 255, .16); }
.cells .lit { background: #a9d8ba; }
.cells .top { background: transparent; box-shadow: inset 0 0 0 1.5px #e0b55c; }
.guess { grid-column: 1; grid-row: 2; align-self: start; margin-top: 15px; display: grid; justify-items: end; gap: 2px; text-align: right; }
.guess span { font: 600 21px/1.1 "Fraunces", Georgia, serif; }
.guess b { font-size: 14px; font-weight: 600; color: #cfe3d6; }
.guess i { margin-top: 5px; font-style: normal; font-weight: 700; font-size: 13px; padding: 4px 9px; border-radius: 999px; background: #a9d8ba; color: #17382a; }

.more { margin-top: 22px; font-size: 15px; font-weight: 600; color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; gap: 26px; margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--hair); }
.about h2 { font: 800 19px/1.2 var(--brand); letter-spacing: -0.015em; margin-bottom: 8px; }
.about p { color: var(--muted); max-width: 30em; }
.about a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.about a:hover { color: var(--red); }

/* ---------- Footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-top: 46px; padding-top: 20px; padding-bottom: calc(34px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); }
.foot-links { display: flex; gap: 20px; font-weight: 700; }
.foot-links a { text-decoration: none; padding: 6px 0; }
.foot-links a:hover { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; }
.foot-note { font-size: 13px; color: var(--muted); }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  .top, main, .foot { padding-inline: 36px; }
  .top { padding-top: 28px; }
  .logo-word { font-size: 31px; }
  .hero { padding: 40px 0 32px; }
  .today .extra { display: inline; }
  .about { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
}
@media (min-width: 940px) {
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .quick { display: none; }
  .game { min-height: 520px; padding: 30px 28px 28px; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
  .game:hover { transform: translateY(-5px); }
  .game h2 { font-size: 54px; }
}
@media (prefers-reduced-motion: reduce) { .game, .go, .go span { transition: none; } .game:hover { transform: none; } }
