/* Bear Cub Reading public site: tokens, type, layout, controls.
   Mobile first. Warm cream, honey and sage, tuned to the approved Bear Cub
   pack (honey-cinnamon fur, sage satchel). What prints sits on white cards;
   Bear Cub stands on the paper itself. Contrast ratios are WCAG 2.x. */
:root {
  color-scheme: light;
  --paper: #f8f2e4;
  --paper-deep: #efe5cf;
  --page: #ffffff;
  --ink: #2b2622;          /* 13.41:1 on paper */
  --ink-soft: #5a5149;     /* 6.95:1 on paper, 5.88:1 on --art-ground */
  --line: #e0d4bd;
  --sage: #4a6845;         /* the satchel's green, deepened: white text 6.26:1 */
  --sage-deep: #3f5c3a;    /* hover and links: 6.71:1 on paper, 7.49:1 on white */
  --sage-soft: #e7ecdf;    /* panels and chips: --sage-deep text 6.23:1 */
  --honey: #f3e2bf;
  --art-ground: #ecdfc5;   /* the pack's ground, behind painted art and loading images */
  --ground-shade: #e3ceb3; /* contact shadow under a standing Bear Cub */
  --cinnamon: #8a5a32;     /* eyebrow text only: 5.24:1 on paper */
  --fur: #a8703f;          /* decoration only, never text (3.72:1) */
  --satchel: #8fa382;      /* decoration only, never text (2.43:1) */
  --focus: #1f56c4;        /* the one cool color, for keyboard focus only: 5.90:1 */
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --book: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 20px;
  --shadow: 0 1px 0 #e6dcc7, 0 14px 30px -22px #5a4a3266;
  --gutter: 20px;
  --space: 64px;
}

*, *::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: 17px/1.6 var(--sans);
  background-color: var(--paper);
  /* A faint paper grain, drawn by the browser: no image request. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .34 0 0 0 0 .24 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--round); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 7.4vw, 3.5rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.75rem, 5vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--sage-deep); text-underline-offset: 3px; }
ul, ol { padding: 0; margin: 0; list-style: none; }

.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.1rem; color: var(--ink-soft); max-width: 40em; }
.eyebrow { font-weight: 700; color: var(--cinnamon); letter-spacing: .02em; margin-bottom: .6em; }
.fine { font-size: .92rem; color: var(--ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

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

/* Buttons: one clear next action, at least 48px tall. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px; border: 0; border-radius: 999px;
  background: var(--sage); color: #fff; font: 700 1.05rem/1.2 var(--round);
  text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 var(--sage-deep);
  transition: background-color .2s, box-shadow .2s, transform .2s;
}
.button:hover { background: var(--sage-deep); }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sage-deep); }
.button:disabled { opacity: .55; cursor: default; }
.button.small { min-height: 44px; padding: 8px 18px; font-size: .98rem; }
.text-link { font-weight: 700; display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; }

/* Header: brand plus the one action on phones; section links from tablets up. */
.site-header {
  display: flex; 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.05rem/1.1 var(--round); color: var(--ink); text-decoration: none;
}
.site-header .brand { min-height: 44px; }
.brand img { width: 36px; height: 36px; }
.site-header .button { white-space: nowrap; }
.site-header nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: none; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink); font-weight: 600; text-decoration: none; border-radius: 10px;
}
.nav-link:hover { background: var(--paper-deep); }

/* 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: var(--radius);
  box-shadow: var(--shadow); padding: 12px; overflow: hidden;
}
.art-frame svg { width: 100%; height: auto; }
.motion .art-frame[data-art] > img { visibility: hidden; }
/* Approved Bear Cub drawings (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; }
/* Bear Cub stands on the page: a soft contact shadow, no frame. */
.cub-shade {
  position: absolute; z-index: 0; height: 14px; border-radius: 50%;
  background: var(--ground-shade); pointer-events: none;
}

.site-footer {
  margin-top: var(--space); padding-top: 28px; padding-bottom: 40px;
  border-top: 2px dashed var(--line); color: var(--ink-soft); font-size: .95rem;
}
.site-footer .brand { font-size: 1rem; margin-bottom: 8px; }
.site-footer .brand img { width: 32px; height: 32px; }
.site-footer a { display: inline-block; padding: 10px 2px; }

@media (max-width: 399px) {
  .site-header .button.small { padding: 8px 14px; font-size: .92rem; }
  .site-header .brand { font-size: .98rem; gap: 8px; }
}
@media (min-width: 560px) {
  :root { --gutter: 28px; }
  .brand img { width: 40px; height: 40px; }
}
@media (min-width: 760px) {
  :root { --space: 96px; }
  .nav-link { display: inline-flex; }
  .art-frame { padding: 16px; }
}
/* The family sign-in is quiet: in the header only where it fits beside the section links,
   and always in the footer. */
.nav-link { white-space: nowrap; }
.site-header .nav-family { display: none; }
@media (min-width: 960px) {
  .site-header .nav-family { display: inline-flex; color: var(--ink-soft); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
