/* reasonrelay.com, hand-written. Colour tokens are checked by check.py (WCAG AA). */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #f3eee5;
  --ink: #1c1a16;
  --muted: #5a544a;
  --accent: #a8401f;
  --on-accent: #ffffff;
  --line: #d8cfbf;
  --card: #fbf8f2;
  --radius: 22px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --ink: #f1ece2;
    --muted: #b8b0a2;
    --accent: #f08a62;
    --on-accent: #1c0e06;
    --line: #34302a;
    --card: #1d1b16;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f; --ink: #f1ece2; --muted: #b8b0a2; --accent: #f08a62; --on-accent: #1c0e06; --line: #34302a; --card: #1d1b16;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
img, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
ul { padding-left: 1.2em; }
li + li { margin-top: .35em; }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: .95rem; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Home hero: one line, then the games */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(24px, 4vw, 48px); }
.wordmark { font-size: clamp(3rem, 11vw, 8.5rem); letter-spacing: -0.035em; margin: 0 0 .2em; line-height: .95; }
.line { font-family: var(--serif); font-style: italic; font-size: clamp(1.35rem, 3vw, 2.1rem); line-height: 1.25; margin: 0 0 .4em; max-width: 28ch; }
.sub { color: var(--muted); margin: 0 0 1.2em; max-width: 52ch; }
.hero-art { display: none; }
@media (min-width: 900px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  .hero .wordmark { font-size: clamp(3rem, 7.4vw, 6.4rem); }
  .hero-art { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 18px 40px rgb(0 0 0 / .22); }
}

/* Shelf of full-width tiles */
.shelf { padding-bottom: 72px; }
.group { font-family: var(--sans); font-weight: 600; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 48px 0 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tile { background: var(--g-bg); color: var(--g-text); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; display: grid; }
.tile a { color: inherit; }
.tile-media { display: block; overflow: hidden; }
.tile-media picture { display: block; height: 100%; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.tile-body p { margin: 0; }
.tile h3 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); margin: 0; }
.tile h3 a { text-decoration: none; }
.tile h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.kind, .age { color: var(--g-muted); font-size: .92rem; }
.kind { font-weight: 600; letter-spacing: .02em; }
.short { font-size: 1.05rem; max-width: 46ch; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .92rem; }
.play-badge { display: inline-block; line-height: 0; margin-left: -10px; }
.play-badge img { height: 62px; width: auto; }
.status-note { display: inline-flex; align-items: center; gap: 8px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-accent) 30%, transparent); }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tile .links { margin-top: 8px; }
.tile .links a { font-weight: 600; }

.tile--landscape .tile-media { aspect-ratio: 16 / 10; }
@media (min-width: 820px) { .tile--landscape .tile-media { aspect-ratio: 16 / 7; } }
.tile--portrait { grid-template-columns: 1fr; }
.tile--portrait .tile-media { padding: 24px 24px 0; display: flex; justify-content: center; }
.tile--portrait .tile-media img { width: min(260px, 70vw); height: auto; aspect-ratio: 3 / 5; border-radius: 18px; box-shadow: 0 18px 40px rgb(0 0 0 / .28); }
.tile--portrait .tile-body { order: 2; }

@media (min-width: 820px) {
  .tile--landscape { grid-template-columns: 1fr; }
  .tile--landscape .tile-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: auto auto 1fr; column-gap: 40px; padding: 26px 32px 30px; }
  .tile--landscape .kind { grid-column: 1; grid-row: 1; }
  .tile--landscape h3 { grid-column: 1; grid-row: 2 / 4; }
  .tile--landscape .short, .tile--landscape .age, .tile--landscape .status, .tile--landscape .links { grid-column: 2; }
  .tile--portrait { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; min-height: 520px; }
  .tile--portrait .tile-body { order: 0; padding: 40px 44px; gap: 10px; }
  .tile--portrait .tile-media { padding: 36px 44px 0; align-self: end; }
  .tile--portrait .tile-media img { width: 300px; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / .22); }
}

/* Game page */
.game .top { background: var(--g-bg); color: var(--g-text); border-color: transparent; }
.game .brand, .game .nav a { color: var(--g-text); }
.game-hero { background: var(--g-bg); color: var(--g-text); padding: 12px 0 44px; }
.game-hero a { color: var(--g-text); }
.game-hero-in { display: grid; gap: 28px; align-items: center; }
.game-clip img { width: 100%; border-radius: var(--radius); }
.game-hero--portrait .game-clip { justify-self: center; }
.game-hero--portrait .game-clip img { width: min(300px, 74vw); aspect-ratio: 3 / 5; box-shadow: 0 18px 40px rgb(0 0 0 / .28); }
.game-head { display: flex; flex-direction: column; gap: 6px; }
.game-head p { margin: 0; }
.game-head h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); margin: 4px 0; }
.icon { border-radius: 22px; margin-bottom: 8px; }
@media (min-width: 900px) {
  .game-hero--landscape { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .game-hero--portrait { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .game-hero--portrait .game-clip { order: 2; }
}
.shots, .about, .grownups, .privacy-box { padding-top: 48px; }
.shot-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-auto-flow: column; grid-auto-columns: min(78%, 360px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.shots--landscape .shot-list { grid-auto-columns: min(86%, 520px); }
.shot-list li { margin: 0; scroll-snap-align: start; }
.shot-list img { border-radius: 16px; width: 100%; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
@media (min-width: 900px) {
  .shot-list { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; }
}
.about p { max-width: 64ch; font-size: 1.08rem; }
.features { max-width: 70ch; }
.grownups > *, .privacy-box > * { max-width: 820px; }
.grownups ul, .privacy-box ul { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px 18px 40px; }
.game main { padding-bottom: 72px; }

/* Privacy, grown-ups, press, contact */
.plain main, .policy-page main { padding: 40px 0 72px; }
.plain h1, .policy-page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.lede { font-size: 1.15rem; max-width: 60ch; }
.crumbs { font-size: .95rem; margin-bottom: 18px; }
.short-version { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--g-accent, var(--accent)); border-radius: 16px; padding: 18px 22px; margin-bottom: 32px; }
.short-version h2 { font-size: 1.3rem; }
.short-version ul { margin: 0; }
.policy h2 { font-size: 1.35rem; margin-top: 1.6em; }
.ticks { list-style: none; padding: 0; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.parent-game { background: var(--g-bg); color: var(--g-text); border-radius: var(--radius); padding: 24px 26px; margin-top: 24px; }
.parent-game a { color: var(--g-text); font-weight: 600; }
.facts { border-collapse: collapse; width: 100%; max-width: 820px; margin: 24px 0 40px; }
.facts caption { text-align: left; font-family: var(--serif); font-weight: 600; font-size: 1.4rem; margin-bottom: 10px; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.facts th { width: 34%; font-weight: 600; }
.press-game { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 32px; }
.press-shots { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 760px; }
.press-shots--portrait { max-width: 520px; }
.press-shots li { margin: 0; }
.press-shots img { border-radius: 10px; }
.big-mail { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 5vw, 2.4rem); overflow-wrap: anywhere; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: .92rem; color: var(--muted); }
.foot-in { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 0 0 6px; }
.foot a { color: var(--ink); }
.brand-line { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); margin: 0; }
.foot-note { grid-column: 1 / -1; margin: 0; }

/* Motion: only when the reader allows it */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .tile-media img { transition: transform .6s ease; }
  .tile:hover .tile-media img { transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
