/* Baby Monitor's pages on ylon.dev, in the app's own "Warm Night" look: a dark warm ink, cream text, amber for the
   parent's viewer and violet for the camera. Tokens from the app's DesignTokens.kt. One font, self-hosted, so these
   pages ask nothing of any other server: Nunito, rounded like the app's buttons, camera and moon, calm for parents and
   sturdy at bold weights (the same as the store graphics). Latin Extended loads only for a page that needs it.
   The page never moves when the font arrives: each page preloads it, and font-display: optional uses Nunito only if
   it is there for the first paint (a refresh, or any page after the first) and otherwise stays with "Nunito
   Fallback", Arial reshaped to Nunito's width and line height, without swapping later. */
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: optional;
  src: url("nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: optional;
  src: url("nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  /* Nunito's metrics (ascender 1011, descender 353 of 1000, no line gap; ~1.5% wider than Arial) on a local font */
  font-family: "Nunito Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Roboto");
  size-adjust: 101.5%; ascent-override: 99.6%; descent-override: 34.8%; line-gap-override: 0%;
}

:root {
  color-scheme: dark;
  --ink: #0a0610;
  --ink-2: #1a0f1a;
  --ink-3: #2a1a2a;
  --cream: rgba(255, 240, 220, .92);
  --cream-muted: rgba(255, 240, 220, .68);
  --cream-caption: rgba(255, 240, 220, .58);  /* the app's .45, raised to keep small captions at AA contrast */
  --line: rgba(255, 240, 220, .14);
  --amber: #e89866;
  --amber-deep: #c4744a;
  --violet: #8b7bd8;
  --violet-deep: #5e4ab8;
  --sage: #8aa888;
  --ember: #ff5444;
  --cocoa: #3d2820;
  --glass: rgba(40, 24, 40, .55);
  --font: "Nunito", "Nunito Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 66ch;
  --gutter: clamp(16px, 5vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink); color: var(--cream);
  font: 400 17px/1.6 var(--font);
}
/* The app's night sky behind every page, layer for layer (ModeSelectionScreen): the ink gradient, a soft amber bloom
   near the top, and its sparse starfield in the upper half; plus the moon from its brand mark. Fixed, so the content
   scrolls over a still sky. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("moon.svg") right 9% top 64px / 132px 132px no-repeat,
    url("stars.svg") center top / 1600px 900px repeat-x,
    radial-gradient(circle at 50% 30%, rgba(232, 152, 102, .12), transparent 90vmax),
    linear-gradient(180deg, var(--ink), var(--ink-2));
}
@media (max-width: 820px) {
  /* below the menu, beside the short caption line */
  body::before { background-position: right 2% top 188px, center top, 0 0, 0 0; background-size: 76px 76px, 1600px 900px, auto, auto; }
}
a { color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #f2b48b; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 700; color: rgba(255, 240, 220, .98); }
h1, h2 { font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -.005em; }
h3 { font-weight: 700; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(30px, 5.4vw, 46px); }
h2 { font-size: clamp(23px, 3.4vw, 29px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .3em 0; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: .9em; color: var(--cream-muted); }

/* The app's uppercase, letter-spaced captions over sentence-case titles */
.caption {
  display: block; margin: 0 0 .7em;
  font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-caption);
}
.caption--camera { color: var(--violet); }
.caption--viewer { color: var(--amber); }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top__inner {
  max-width: 1080px; margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 800; font-size: 18px; }
.brand img { width: 34px; height: 34px; }
.top nav { margin-left: auto; display: flex; gap: 4px 20px; flex-wrap: wrap; font-size: 15px; }
.top nav a { color: var(--cream-muted); text-decoration: none; padding: 4px 0; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--cream); }
.top nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--amber); }

main { display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }

/* Footer */
.foot { margin-top: 96px; border-top: 1px solid var(--line); background: var(--ink-2); }
.foot__inner {
  max-width: 1080px; margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; font-size: 14.5px; color: var(--cream-muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot nav a, .foot p a { color: var(--cream-muted); }
.foot nav a:hover { color: var(--cream); }
.foot p { margin: 0; }

/* Legal pages: summary, contents, numbered sections with anchors */
.doc { padding-top: 56px; }
.doc h1 { margin-bottom: 10px; }
.doc .updated { color: var(--cream-caption); font-size: 15px; margin-bottom: 32px; }
.summary {
  max-width: var(--measure); margin: 0 0 40px; padding: 20px 22px;
  background: var(--glass); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px;
}
.summary p:last-child { margin: 0; }
.toc { max-width: var(--measure); margin: 0 0 48px; }
.toc ol { columns: 2 260px; column-gap: 32px; margin: 0; padding-left: 1.4em; font-size: 15.5px; }
.toc li { break-inside: avoid; }
.toc a { color: var(--cream-muted); text-decoration: none; }
.toc a:hover { color: var(--cream); text-decoration: underline; }
.doc section { max-width: var(--measure); margin: 0 0 40px; scroll-margin-top: 24px; }
.doc section h2 { font-size: 22px; margin-bottom: 14px; }
.doc section h2 a.anchor { color: var(--cream-caption); text-decoration: none; font-weight: 400; margin-left: .35em; opacity: 0; }
.doc section h2:hover a.anchor, .doc section h2 a.anchor:focus-visible { opacity: 1; }
.history { font-size: 15px; color: var(--cream-muted); }
.history table { border-collapse: collapse; width: 100%; }
.history th, .history td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.history th { font-weight: 600; color: var(--cream-caption); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.notice {
  max-width: var(--measure); padding: 16px 20px; margin: 0 0 1.2em; border-radius: 10px;
  background: rgba(255, 84, 68, .08); border: 1px solid rgba(255, 84, 68, .35);
}
.notice p:last-child { margin: 0; }
