/* Snoutbook site. Tokens are copied from app/lib/core/theme/snout_tokens.dart
   and notebook_type.dart; keep them in step with the app. */

@font-face { font-family: "Instrument Serif"; src: url(/fonts/InstrumentSerif-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/fonts/InstrumentSerif-Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light dark;
  --paper: #EDF0E4; --grid: #D7DCCB; --raised: #F7F8F1; --rule: #B9BFAA;
  --ink: #1E2944; --ink-muted: #586078; --on-ink: #EDF0E4;
  --highlighter: #F5C542; --on-highlighter: #1E2944;
  --red-pencil: #B43A2A; --green-ink: #2F6B4F;
  --mount: #FBFBF6; --tape: rgb(245 197 66 / .55); --skeleton: #D5D9C8; --bezel: #1E2944;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --s-xs: 6px; --s-s: 10px; --s-m: 16px; --s-l: 22px; --s-xl: 30px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161F; --grid: #1B2130; --raised: #1A2030; --rule: #2B3346;
    --ink: #E6E9DB; --ink-muted: #9AA2B5; --on-ink: #12161F;
    --red-pencil: #F0806E; --green-ink: #7CC4A0;
    --mount: #232A3A; --tape: rgb(245 197 66 / .40); --skeleton: #1C2232; --bezel: #05070B;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 14px 14px;
  font: 400 16px/1.45 var(--sans);
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--s-m); }
.prose { max-width: 680px; }

/* --- type ------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
h1 { font-size: clamp(40px, 9vw, 68px); line-height: 1; letter-spacing: -.01em; }
h2 { font-size: 28px; line-height: 1.05; margin: var(--s-xl) 0 var(--s-s); }
h3 { font-size: 22px; line-height: 1.1; margin: var(--s-l) 0 var(--s-xs); }
p, ul, ol { margin: 0 0 var(--s-m); }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: var(--s-xs); }
.label {
  font: 500 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-muted);
}
.entry { font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); margin-bottom: var(--s-s); }
.note { font: italic 400 20px/1.3 var(--serif); color: var(--ink-muted); }
.lede { font-size: 18px; max-width: 34em; }
.muted { color: var(--ink-muted); }
code, .data { font: 400 14px var(--mono); }

/* the highlighter: a band over the lower ~45% of the text, one per screen */
.hl { background: linear-gradient(transparent 55%, var(--highlighter) 55%, var(--highlighter) 96%, transparent 96%); color: inherit; padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (prefers-color-scheme: dark) { .hl { color: var(--ink); background: linear-gradient(transparent 55%, rgb(245 197 66 / .45) 55%, rgb(245 197 66 / .45) 96%, transparent 96%); } }

.tag { display: inline-block; font: 500 12px/1 var(--mono); background: var(--highlighter); color: var(--on-highlighter); padding: 3px 6px; border-radius: 2px; letter-spacing: .04em; }

/* --- header / footer -------------------------------------------------- */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-m); min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: var(--s-s); text-decoration: none; font: 400 26px/1 var(--serif); }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav { display: flex; gap: var(--s-m); flex-wrap: wrap; }
.nav a { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; padding: 8px 0; color: var(--ink-muted); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: underline; }

.foot { border-top: 1.5px solid var(--ink); margin-top: 56px; padding: var(--s-xl) 0 40px; background: var(--paper); }
.foot .cols { display: grid; gap: var(--s-l); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.foot ul { list-style: none; padding: 0; margin: var(--s-xs) 0 0; }
.foot li { margin: 0 0 4px; }
.foot p { font-size: 14px; }
.small { font-size: 14px; color: var(--ink-muted); }

/* --- buttons ---------------------------------------------------------- */
.btns { display: flex; gap: var(--s-s); flex-wrap: wrap; margin: var(--s-l) 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 4px; font: 600 15px/1 var(--sans); text-decoration: none; border: 1.5px solid var(--ink); }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

/* --- sections --------------------------------------------------------- */
section { padding: 40px 0 0; }
.hero { padding: 48px 0 8px; display: grid; gap: var(--s-xl); align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr .85fr; padding-top: 72px; } }
.card { background: var(--raised); border: 1px solid var(--rule); border-radius: 2px; padding: var(--s-m); }
.steps { display: grid; gap: var(--s-m); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: step; margin-top: var(--s-m); }
.steps .card h3 { margin-top: var(--s-xs); }
.steps .card p { margin: 0; }
.split { display: grid; gap: var(--s-xl); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split.flip > :first-child { order: 2; } }

/* ledger: mono label | value, ink rule on top, hairlines between */
.ledger { border-top: 1.5px solid var(--ink); margin: var(--s-m) 0 var(--s-l); }
.ledger > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-s); padding: var(--s-s) 0; border-bottom: 1px solid var(--rule); }
.ledger dt { font: 500 11px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); padding-top: 2px; }
.ledger dd { margin: 0; }
.ledger dd p:last-child, .ledger dd ul:last-child { margin-bottom: 0; }
@media (min-width: 640px) { .ledger > div { grid-template-columns: 150px 1fr; } }

.callout { border-left: 3px solid var(--ink); padding: var(--s-xs) 0 var(--s-xs) var(--s-m); margin: var(--s-l) 0; }
.callout.warn { border-color: var(--red-pencil); }

/* FAQ */
details { border-bottom: 1px solid var(--rule); padding: var(--s-s) 0; }
details:first-of-type { border-top: 1.5px solid var(--ink); }
summary { cursor: pointer; font-weight: 600; list-style: none; padding: 6px 28px 6px 0; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 4px; font: 400 20px/1 var(--mono); color: var(--ink-muted); }
details[open] summary::after { content: "−"; }
details > :not(summary) { margin: var(--s-xs) 0 var(--s-s); }

/* --- the phone illustrations (drawn from the design, not screenshots) -- */
.phones { display: flex; gap: var(--s-l); justify-content: center; flex-wrap: wrap; }
.phone {
  width: 260px; aspect-ratio: 9 / 17.5; border: 2px solid var(--rule); border-radius: 36px; padding: 9px;
  background: var(--bezel); flex: none;
}
.screen {
  height: 100%; border-radius: 28px; overflow: hidden; position: relative; color: var(--ink); background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 10px 10px; padding: 34px 14px 14px; font-size: 12px; line-height: 1.35;
}
.screen::before { content: ""; position: absolute; top: 9px; left: 50%; width: 70px; height: 18px; margin-left: -35px; border-radius: 10px; background: var(--bezel); }
.screen .label { font-size: 8px; }
.screen .t { font: 400 24px/1 var(--serif); margin: 4px 0 8px; }
.screen .tag { font-size: 9px; padding: 2px 4px; }
.screen .b { display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 4px; font: 600 11px var(--sans); margin-top: 8px; }
.screen .b.p { background: var(--ink); color: var(--paper); }
.screen .b.s { border: 1.5px solid var(--ink); }
.mini-ledger { border-top: 1px solid var(--ink); margin-top: 8px; }
.mini-ledger div { display: grid; grid-template-columns: 62px 1fr; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 11px; }
.mini-ledger span:first-child { font: 500 8px/1.7 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.tabs { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; border-top: 1px solid var(--rule); background: var(--paper); padding: 8px 6px 14px; }
.tabs span { font: 500 7px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.tabs span.on { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.taped { position: relative; background: var(--mount); padding: 6px; transform: rotate(-1.5deg); box-shadow: 0 2px 6px rgb(30 41 68 / .25); margin: 10px 6px 12px; }
.taped::before { content: ""; position: absolute; top: -8px; left: 50%; width: 56px; height: 16px; margin-left: -28px; background: var(--tape); transform: rotate(3deg); }
.photo { aspect-ratio: 4 / 3; background: var(--skeleton); display: grid; place-items: center; color: var(--ink-muted); }
.photo svg { width: 58%; }

.viewfinder { position: relative; aspect-ratio: 3 / 4; margin: 6px 0 10px; background: #1E2944; display: grid; place-items: center; border-radius: 2px; }
.viewfinder svg { width: 70%; color: #F6F2D8; }
.match { background: var(--raised); border: 1px solid var(--rule); border-radius: 2px; padding: 8px; }

.board-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 11px; }
.board-row .n { font: 500 10px var(--mono); color: var(--ink-muted); }
.board-row .pts { font: 500 11px var(--mono); }
.board-row.me { background: var(--raised); }

.map { position: relative; height: 230px; margin: 6px -14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--raised); overflow: hidden; }
.map svg { width: 100%; height: 100%; }
.pin { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--paper); background: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.pin.pet { background: var(--green-ink); }

figcaption { font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); text-align: center; margin-top: var(--s-s); max-width: 260px; }
figure { margin: 0; display: flex; flex-direction: column; align-items: center; }

/* legal pages */
.legal h2 { border-top: 1.5px solid var(--ink); padding-top: var(--s-m); }
.legal .meta { margin: var(--s-m) 0 var(--s-l); }
.toc { columns: 2 220px; font-size: 15px; margin-bottom: var(--s-l); padding-left: 1.2em; }
.grievance { margin-top: var(--s-xl); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s-m); top: var(--s-s); background: var(--paper); padding: 6px 10px; z-index: 5; }
.legal h2 + .ledger { border-top: 1px solid var(--rule); }
