/* lettersagainstnumbers.com: the game's notebook page (bone, ash, a faint grid), with plain readable text for reading. */
@font-face {
  font-family: 'Silkscreen';
  src: url('/fonts/silkscreen-700.5741b7f01a.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ash: #2c2a27;
  --ink: #3a3732;
  --muted: #6b665c;
  --bone: #e8e2d2;
  --paper: #f3efe4;
  --grid: #dcd4c1;
  --triptong: #6a4a98;
  --red: #b3261e;
  --pixel: 'Silkscreen', ui-monospace, monospace;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --measure: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font: 1.0625rem/1.65 var(--text);
  background-color: var(--bone);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

img { max-width: 100%; height: auto; }

a { color: var(--triptong); text-underline-offset: 0.15em; }
a:hover { color: var(--ash); }

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

.skip { position: absolute; left: -999px; top: 0; background: var(--ash); color: var(--bone); padding: 0.5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }

h1, h2, h3 { color: var(--ash); line-height: 1.25; }
h1 { font-family: var(--pixel); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: 0.04em; margin: 0 0 1rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }

.label { font-family: var(--pixel); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }

/* ---- Header and footer ---- */
.site-header {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'brand nav cta'; align-items: center; gap: 0.6rem 1.5rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: var(--ash); color: var(--bone);
}
.site-header .brand { grid-area: brand; }
.site-header nav { grid-area: nav; justify-content: flex-end; }
.site-header .cta { grid-area: cta; }
/* Phones: the logo and the play button share the first line, the links go under them. */
@media (max-width: 40rem) {
  .site-header { grid-template-columns: 1fr auto; grid-template-areas: 'brand cta' 'nav nav'; padding-block: 0.7rem; }
  .site-header nav { justify-content: flex-start; gap: 0.3rem 1.1rem; font-size: 0.9rem; }
}
.site-header a { color: var(--bone); text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--pixel); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.1em; }
.brand img { image-rendering: pixelated; }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; font-size: 0.95rem; }

.site-footer {
  display: grid; gap: 1.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-top: 4rem; padding: 2.5rem clamp(1rem, 4vw, 2.5rem);
  background: var(--ash); color: #cfc8b6; font-size: 0.92rem;
}
.site-footer .label { color: #a39d8e; }
.site-footer a { color: var(--bone); display: block; margin: 0.25rem 0; }
.footer-note p { margin: 0 0 0.6rem; }
.footer-note a { display: inline; }

.breadcrumbs { max-width: var(--measure); margin: 1.2rem auto 0; padding: 0 1rem; font-size: 0.88rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '›'; margin-right: 0.3rem; }

/* ---- Buttons ---- */
.button {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1.3rem; border: 3px solid var(--ash); background: var(--paper); color: var(--ash);
  font-family: var(--pixel); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  box-shadow: 4px 4px 0 var(--ash);
}
.button:hover { color: var(--ash); transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--ash); }
.button.primary { background: var(--triptong); border-color: var(--ash); color: #fff; }
.button.primary:hover { color: #fff; }
.button.small { padding: 0.35rem 0.8rem; font-size: 0.78rem; box-shadow: 3px 3px 0 #000; }
.pixel-icon { flex: none; image-rendering: pixelated; }
.button.primary .pixel-icon { color: #fff; }

/* The header's call to play: no outline on the dark bar, a pixel shadow and a shine that sweeps across now and then. */
.site-header a.cta { position: relative; overflow: hidden; border-color: #000; box-shadow: 3px 3px 0 #000; transition: transform 0.12s, box-shadow 0.12s; }
.site-header a.cta:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #000; }
.site-header a.cta::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine { 0%, 65% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .site-header a.cta::after { animation: none; } }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }

/* ---- Prose pages (articles, legal) ---- */
.prose { max-width: var(--measure); margin: 0 auto; padding: 2rem 1rem 0; }
.sheet { background: var(--paper); border: 2px solid var(--ash); box-shadow: 6px 6px 0 var(--ash); padding: clamp(1.2rem, 4vw, 2.5rem); }
.prose p, .prose li { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.3rem 0; }
.prose blockquote { margin: 1.2rem 0; padding: 0.6rem 1rem; border-left: 4px solid var(--triptong); background: #ebe5d6; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid #cbc3ae; padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
.prose th { background: #e3dccb; }
.prose code { font-size: 0.9em; background: #e3dccb; padding: 0.05em 0.3em; }
.prose h1 { font-size: clamp(1.3rem, 3.6vw, 1.85rem); }
.prose figure { margin: 1.5rem 0; }
.prose figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.4rem; }
.prose details { margin: 1.2rem 0; border: 2px dashed var(--muted); padding: 0.4rem 1rem; background: #efe9db; }
.prose summary { cursor: pointer; font-weight: 700; color: var(--ash); padding: 0.4rem 0; }
.meta { color: var(--muted); font-size: 0.9rem; margin: -0.4rem 0 1.4rem; }
.note { color: var(--muted); font-size: 0.92rem; }

/* ---- Home ---- */
.hero {
  display: grid; gap: 2rem; align-items: center; grid-template-columns: minmax(0, 1fr);
  max-width: 68rem; margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) 1rem;
}
@media (min-width: 52rem) { .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.hero .tagline { font-family: var(--pixel); font-weight: 700; color: var(--triptong); text-transform: uppercase; letter-spacing: 0.05em; font-size: clamp(1rem, 2.6vw, 1.3rem); margin: 0 0 1rem; }
.hero p.lead { font-size: 1.2rem; max-width: 36rem; }
/* At least 356 px inside, so the board draws its pixels at 2× even on a screen at 1× (a phone's board is that wide). */
.demo { justify-self: center; margin: 0; width: min(23.5rem, 92vw); }
.demo figcaption { margin-top: 0.9rem; font-size: 0.92rem; color: var(--muted); text-align: center; }
.demo-frame { position: relative; aspect-ratio: 5 / 6; border: 4px solid var(--ash); box-shadow: 8px 8px 0 var(--ash); background: var(--ash); overflow: hidden; }
.demo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.demo-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 0.4s; }
.demo-frame.ready iframe { opacity: 1; }

/* Sections that alternate text and a picture of the game, so the page never reads as a wall of text. */
.split { display: grid; gap: 1.5rem 3rem; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) {
  .split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .split.flip .split-text { order: 2; }
}
.split-text > h2 { font-family: var(--pixel); font-size: clamp(1.15rem, 3vw, 1.5rem); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0; }
.shot { justify-self: center; margin: 0; width: min(15rem, 70vw); }
.shot img { display: block; border: 3px solid var(--ash); box-shadow: 6px 6px 0 var(--ash); image-rendering: pixelated; }
.shot figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; text-align: center; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; margin: 1rem 0 0; list-style: none; font-size: 0.95rem; color: var(--muted); }
.facts li::before { content: '■ '; color: var(--triptong); }

.band { max-width: 68rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 0; }
.band > h2 { font-family: var(--pixel); font-size: clamp(1.15rem, 3vw, 1.5rem); text-transform: uppercase; letter-spacing: 0.05em; }
.band > p { max-width: 46rem; }
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card { background: var(--paper); border: 2px solid var(--ash); box-shadow: 5px 5px 0 var(--ash); padding: 1.2rem 1.3rem; }
.card h3 { margin-top: 0; }
.card img { display: block; margin: -0.2rem 0 0.8rem; border: 2px solid var(--ash); image-rendering: pixelated; }
.card p { margin: 0.4rem 0 0; }
.card ol { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.card li { margin: 0.3rem 0; }
.steps { counter-reset: step; }
.steps .card h3::before { counter-increment: step; content: counter(step) '. '; color: var(--triptong); font-family: var(--pixel); }
.shots { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.shots figure { margin: 0; }
.shots img { display: block; border: 3px solid var(--ash); box-shadow: 4px 4px 0 var(--ash); image-rendering: pixelated; }
.shots figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.currencies { width: 100%; border-collapse: collapse; background: var(--paper); border: 2px solid var(--ash); font-size: 0.97rem; }
.currencies th, .currencies td { border: 1px solid #cbc3ae; padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
.currencies thead th { background: var(--ash); color: var(--bone); font-family: var(--pixel); font-size: 0.8rem; letter-spacing: 0.06em; }
.table-wrap { overflow-x: auto; }
.faq details { background: var(--paper); border: 2px solid var(--ash); margin: 0 0 0.8rem; padding: 0.2rem 1.2rem; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ash); padding: 0.75rem 0; }
.faq details p { margin-top: 0; }
.guide-list { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.guide-list li { background: var(--paper); border: 2px solid var(--ash); padding: 1rem 1.2rem; box-shadow: 4px 4px 0 var(--ash); }
.guide-list a { font-weight: 700; font-size: 1.08rem; color: var(--ash); }
.guide-list p { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--muted); }

/* ---- Google Analytics consent (src/consent.ts): both answers look the same, so neither is nudged. ---- */
.consent-layer { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem; background: rgba(44, 42, 39, 0.62); }
.consent-layer.passive { background: none; pointer-events: none; place-items: end center; padding: 0.75rem; }
.consent-layer.passive .consent { pointer-events: auto; }
html.consent-open { overflow: hidden; }
.consent:focus { outline: none; }
.consent {
  width: 100%; max-width: 34rem;
  background: var(--paper); border: 3px solid var(--ash); box-shadow: 6px 6px 0 var(--ash); padding: 1rem 1.1rem; font-size: 0.93rem; line-height: 1.5;
}
.consent p { margin: 0 0 0.5rem; }
.consent-title { font-weight: 700; color: var(--ash); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.8rem; }
.consent-actions .button { justify-content: center; cursor: pointer; }
[hidden] { display: none !important; }

/* The pixel font is wide: on a narrow phone the buttons take the whole width with slightly smaller letters, on one line. */
@media (max-width: 30rem) {
  .actions .button { width: 100%; justify-content: center; font-size: 0.74rem; letter-spacing: 0.03em; padding: 0.85rem 0.8rem; }
  .prose { padding: 1.5rem 0.75rem 0; }
  .sheet { padding: 1.1rem 0.9rem; box-shadow: 4px 4px 0 var(--ash); }
  .prose h1 { letter-spacing: 0.02em; }
  .prose table { font-size: 0.85rem; }
  .prose th, .prose td { padding: 0.35rem 0.45rem; }
}
