/* Bear Cub Reading public site: tokens, type, layout, controls.
   The owner-approved paper design (2026-11-04): cut-paper cards on a paper texture, buttons with an
   under-edge, path stones, a torn-edge night sky and needle-felted guides. Mobile first. Contrast
   ratios are WCAG 2.x, on --paper then --card. */
/* Self-hosted OFL fonts (site/type/FONTS.md, with their sha256 sums and licences), so nothing ever
   loads from another host. Georgia and the system face stand in while they load. */
@font-face { font-family: "Fraunces"; src: url("../type/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../type/nunito-latin-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
:root {
  color-scheme: light;
  --paper: #f3e7cf;
  --card: #fbf4e4;
  --page: #ffffff;         /* what prints sits on white */
  --ink: #3a2a1c;          /* 11.22:1, 12.54:1 */
  --muted: #6b5642;        /* 5.65:1, 6.31:1 */
  --clay: #a9512a;         /* buttons: #fffdf7 text 5.30:1 */
  --clay-edge: #7d3a1c;    /* the button's under-edge */
  --clay-ink: #8a4322;     /* links and eyebrows: 5.90:1, 6.59:1 */
  --honey: #e2a04a;        /* decoration and the "now" stone, never text */
  --honey-edge: #c98a35;
  --sage: #5e8a7e;         /* decoration only (3.17:1) */
  --sage-ink: #2f5a4e;     /* sage text: 6.36:1, 7.11:1 */
  --sage-wash: #e3eee9;
  --leaf: #4f7a3e;         /* decoration only */
  --line: #e2c99a;
  --line-deep: #cdb48a;
  --night: #1f3b44;
  --focus: #1f56c4;        /* the one cool color, for keyboard focus only */
  --display: "Fraunces", Georgia, "Iowan Old Style", serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --book: "Helvetica Neue", Helvetica, Arial, sans-serif;  /* the printed books' face */
  --cut: 22px 26px 20px 24px;  /* a cut-paper card's uneven corners */
  --lift: 0 0 0 1px rgba(120, 90, 50, .14), 5px 6px 0 -1px #e6d3ae, 0 18px 26px -14px rgba(58, 42, 28, .45);
  --gutter: 16px;
  --space: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 600 17px/1.6 var(--sans);
  background: var(--paper) url("../art/felt/paper.jpg") repeat; background-size: 420px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 7.6vw, 3.7rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--clay-ink); text-underline-offset: 3px; font-weight: 800; }
ul, ol { padding: 0; margin: 0; list-style: none; }
b, strong { font-weight: 800; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
main > .wrap { margin-top: var(--space); }
main:focus { outline: none; }
.section-lede { font-size: 1.12rem; color: var(--muted); max-width: 40em; }
.eyebrow { font-weight: 800; color: var(--clay-ink); letter-spacing: .02em; margin-bottom: .6em; }
.fine { font-size: 1rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* A cut-paper card: cream paper, uneven corners, a paper edge below and a soft lift. */
.card {
  background: var(--card) url("../art/felt/paper.jpg") repeat; background-size: 300px;
  border-radius: var(--cut); box-shadow: var(--lift);
}

/* Focus is always visible and never color alone. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 10px; font-weight: 800;
}
.skip:focus { top: 12px; }

/* Buttons: one clear next action, at least 48px tall, with the paper under-edge. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 12px 26px; border: 0; border-radius: 16px 18px 15px 17px;
  background: var(--clay); color: #fffdf7; font: 800 1.08rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--clay-edge);
  transition: background-color .2s, box-shadow .2s, transform .2s;
}
.button:hover { background: #9a4925; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--clay-edge); }
/* Disabled keeps readable text (ink on --line) instead of fading the clay. */
.button:disabled { background: var(--line); color: var(--ink); box-shadow: none; cursor: default; transform: none; }
.button.small { min-height: 44px; padding: 8px 18px; font-size: .98rem; box-shadow: 0 3px 0 var(--clay-edge); }
.text-link { font-weight: 800; display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; }

/* Header: the brand and Sign in on phones; Print a sample from 560px; section links from 960px. */
.site-header {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 14px var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font: 800 1.12rem/1.1 var(--display); color: var(--ink); text-decoration: none;
}
.site-header .brand { min-height: 44px; min-width: 0; }
.site-header .brand img { flex-shrink: 0; }
.site-header .brand span { min-width: 0; }
.brand img { width: 44px; height: auto; }
.site-header .button { min-height: 46px; white-space: nowrap; }
.site-header nav { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.nav-link {
  display: none; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink); font-weight: 700; text-decoration: none; border-radius: 12px;
}
.nav-link:hover { background: var(--card); }

/* A white padded card means "this is what prints". Motion draws its line art in; without motion
   the finished picture is simply there. */
.art-frame { margin: 0; background: var(--page); border-radius: 14px; box-shadow: var(--lift); padding: 12px; overflow: hidden; }
.art-frame svg { width: 100%; height: auto; }
.motion .art-frame[data-art] > img { visibility: hidden; }
/* Approved guide pictures (rasters, never data-art) wait for their reveal scene only while motion
   runs; boot.js shows them after 3 s if motion never starts. */
.motion [data-reveal=settle]:not([data-revealed]),
.motion [data-reveal=fade]:not([data-revealed]) { opacity: 0; }

/* A phone frame around a screen of the app. */
.phone { margin: 0; width: min(100%, 250px); }
.phone img {
  width: 100%; height: auto; aspect-ratio: 390 / 844; border-radius: 30px; background: var(--card);
  border: 7px solid #2a1f15; box-shadow: 0 0 0 1px #00000022, 0 22px 30px -18px rgba(58, 42, 28, .6);
}
.phone figcaption { margin-top: 10px; text-align: center; font: 800 1rem/1.3 var(--sans); color: var(--muted); }

.site-footer {
  margin-top: var(--space); padding-top: 22px; padding-bottom: 28px;
  border-top: 2px dashed var(--line-deep); color: var(--muted); font-size: 1rem;
}
.site-footer .brand { font-size: 1.05rem; margin-bottom: 8px; }
.site-footer .brand img { width: 38px; }
.site-footer a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; }
/* The footer's page links wrap as whole links with space between, no separator dots. */
.site-footer .foot-links { display: flex; flex-wrap: wrap; column-gap: 6px; margin-left: -10px; }

/* The privacy notice: one readable column on a paper card. */
main.notice { max-width: 800px; margin-top: 12px; }
.notice-card { padding: 26px 20px 30px; }
.notice h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); }
.notice h2 { margin-top: 1.6em; }
.notice h3 { margin-top: 1.3em; }
.notice ul { display: grid; gap: 8px; margin-bottom: 1em; }
.notice li { position: relative; padding-left: 24px; }
.notice li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 10px; height: 10px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2.5px var(--sage), 0 2px 0 2.5px #4a7064; }
.draft { border: 2px dashed var(--line-deep); border-radius: 14px; padding: 10px 14px; font-weight: 800; color: var(--muted); }

@media (max-width: 399px) {
  .site-header .button.small { padding: 8px 14px; font-size: .92rem; }
  .site-header .brand { font-size: 1rem; gap: 8px; }
  .site-header .brand img { width: 38px; }
}
@media (min-width: 560px) {
  :root { --gutter: 28px; }
  .notice-card { padding: 36px 40px 40px; }
}
@media (min-width: 760px) {
  :root { --space: 96px; }
  .art-frame { padding: 16px; }
}
/* Sign in is a quiet text link at every width, a full 44px tap target. */
.nav-link { white-space: nowrap; }
.site-header .nav-family { display: inline-flex; color: var(--muted); text-decoration: underline; font-weight: 700; }
.site-header .nav-try { display: none; }
@media (min-width: 560px) {
  .site-header .nav-try { display: inline-flex; margin-left: 6px; }
}
@media (min-width: 960px) {
  .nav-link { display: inline-flex; }
}
.nav-link[aria-current=page] { color: var(--clay-ink); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
