/* Shared look for every page: the app's tokens (Theme.swift) on its QuietGarden sky (scene.js). */
@font-face { font-family: Figtree; src: url(/fonts/Figtree-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Figtree; src: url(/fonts/Figtree-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Figtree; src: url(/fonts/Figtree-ExtraBold.ttf) format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --sky: #8EA3D2; --ink: #23304A; --ink-2: #2E3854;
  --paper: #FFFCF5; --panel: #F6EFE1; --paper-line: #E6DCCB; --paper-ink: #23304A; --paper-ink-2: #5B5F6B;
  --teal: #0F5148; --link: #237A6F; --navy: #23304A; --navy-lip: #111A2C; --on-navy: #FFFCF5; --focus: #3D63B8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  /* Dusk, as the course's last sections are. Paper stays paper. */
  :root { --sky: #26305C; --ink: #FFF6EA; --ink-2: #F3EEF6; --focus: #A9C2FF; color-scheme: dark; }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--sky); }
body {
  font-family: Figtree, ui-rounded, -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--ink); font-size: 17px; line-height: 1.55; font-weight: 600;
  -webkit-font-smoothing: antialiased;
}
/* Sized by scene.js and pinned to the bottom: if a phone toolbar hides, the gap opens at the top, where the sky is this same colour. */
#sky { position: fixed; left: 0; bottom: 0; z-index: -1; display: block; }

/* Every page except Privacy and Support: one centred stack in the sky, so it reads at a glance on a phone. */
.splash {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.hero { width: 100%; max-width: 24rem; margin-top: clamp(24px, 9vh, 120px); display: flex; flex-direction: column; align-items: center; }
.icon { width: clamp(76px, 11vh, 104px); height: auto; aspect-ratio: 1; border-radius: 22.5%; box-shadow: 0 10px 24px rgba(30, 35, 60, 0.28); }
.hero h1 { margin-top: 14px; font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.tag { margin-top: 6px; font-size: 21px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.sub { margin-top: 8px; font-size: 16px; color: var(--ink-2); text-wrap: balance; }
.actions { margin-top: clamp(20px, 4vh, 36px); display: flex; flex-direction: column; align-items: center; width: 100%; }
.hint { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.quiet { margin-top: 20px; font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.fade { animation: fade 0.7s ease-out both 0.25s; }
@keyframes fade { from { opacity: 0; } }

/* Privacy and Support */
main {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  max-width: 1120px; margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
@media (min-width: 760px) { main { padding-left: 56px; padding-right: 56px; padding-top: 40px; } }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 22.5%; box-shadow: 0 4px 12px rgba(30, 35, 60, 0.22); }
.brand span { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }

/* The app's tab bar: an ivory strip, the current page in navy. */
nav { display: flex; gap: 2px; padding: 4px; border-radius: 16px; background: var(--paper); box-shadow: 0 8px 20px rgba(30, 35, 60, 0.2); }
nav a { padding: 7px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; color: #5D6475; text-decoration: none; }
nav a[aria-current] { background: var(--navy); color: var(--on-navy); font-weight: 800; }
nav a:not([aria-current]):hover { color: var(--navy); }

/* Buttons: navy shelf for the main action, ivory for the quiet one. */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 800; font-size: 17px;
  cursor: pointer; border: 0; text-decoration: none;
  padding: 14px 20px; border-radius: 14px; background: var(--navy); color: var(--on-navy);
  box-shadow: 0 4px 0 var(--navy-lip); transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.btn:active, button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy-lip); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* A paper card, as the app's section cards sit on the garden. */
.card {
  background: var(--paper); color: var(--paper-ink); border-radius: 22px; padding: 18px 20px 20px;
  box-shadow: 0 4px 0 rgba(35, 48, 74, 0.14), 0 18px 36px rgba(40, 30, 60, 0.2);
}

form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
input[type=email] {
  width: 100%; font: inherit; font-size: 17px; text-align: center; font-weight: 600; color: var(--paper-ink);
  background: #FFFFFF; border: 1.5px solid var(--paper-line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 6px 16px rgba(30, 35, 60, 0.14);
}
input[type=email]::placeholder { color: #9A968C; }
.hp, .sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

footer { margin-top: auto; padding-top: 32px; }
.pill {
  display: inline-flex; gap: 14px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 252, 245, 0.9); box-shadow: 0 4px 12px rgba(20, 30, 20, 0.18);
  font-size: 14px; font-weight: 700; color: var(--paper-ink-2);
}
.pill a { color: var(--paper-ink); text-decoration: none; }
.pill a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .fade { animation: none; } .btn, button, .badge { transition: none; } }

/* Privacy and Support: the text on one paper card, scrolling over the garden. */
.doc { max-width: 46rem; margin-top: clamp(28px, 6vh, 56px); padding: clamp(24px, 4vw, 44px); }
.doc h1 { margin-top: 0; font-size: clamp(34px, 5vw, 46px); }
.doc .date { margin-top: 8px; color: var(--paper-ink-2); font-size: 14px; font-weight: 700; }
.doc .summary { margin-top: 28px; padding: 18px 22px; border-radius: 16px; background: var(--panel); }
.doc .summary h2 { font-size: 17px; font-weight: 800; color: var(--paper-ink); margin-bottom: 6px; }
.doc section { border-top: 1.5px solid var(--paper-line); margin-top: 32px; padding-top: 28px; }
.doc h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 10px; }
.doc p, .doc li { color: #3A4256; }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: 12px; }
.doc ul { padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc strong { font-weight: 800; color: var(--paper-ink); }
.doc a { color: var(--link); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
form.actions { align-items: stretch; }
form.actions .hint { text-align: center; }
/* Larger screens: the same stack, a size up. */
@media (min-width: 900px) and (min-height: 700px) {
  .hero { max-width: 30rem; }
  .icon { width: 120px; }
  .hero h1 { font-size: 42px; }
  .tag { font-size: 26px; }
  .sub { font-size: 18px; }
}
