/* Design tokens. See DESIGN.md for what each one is for. */
:root {
  --navy-950: #0a1628;
  --navy-900: #10213b;
  --navy-800: #1a2f50;
  --primary: #1f4e8c;
  --primary-hover: #173c6c;
  --on-primary: #ffffff;
  --brass: #c29a3b;
  --brass-soft: rgb(194 154 59 / .16);
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #d9dfe8;
  --text: #0f1a2b;
  --text-muted: #55627a;
  --paper: #ffffff;
  --success: #1d7a46;
  --warning-bg: #fff4dc;
  --warning: #7a5300;
  --error: #b42318;

  --font-serif: "IBM Plex Serif", Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-memo: "Times New Roman", Times, serif;

  --fs-display: clamp(40px, 6vw, 68px);
  --fs-h2: clamp(30px, 4vw, 44px);
  --fs-h3: 22px;
  --fs-lead: 19px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-micro: 12px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --shadow-1: 0 1px 2px rgb(10 22 40 / .06), 0 1px 1px rgb(10 22 40 / .04);
  --shadow-paper: 0 24px 60px -20px rgb(10 22 40 / .35), 0 2px 6px rgb(10 22 40 / .08);

  --content: 1160px;
  --gutter: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #7aa7e6;
    --primary-hover: #9cbdee;
    --on-primary: #0a1628;
    --brass: #d4ae55;
    --brass-soft: rgb(212 174 85 / .16);
    --bg: #0b1220;
    --surface: #131c2e;
    --surface-2: #1a2438;
    --border: #2a3650;
    --text: #e8edf5;
    --text-muted: #9aa8c0;
    --success: #5cc58a;
    --warning-bg: #3a2e12;
    --warning: #f1c96b;
    --error: #ff8a80;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-paper: 0 24px 60px -20px rgb(0 0 0 / .7), 0 2px 6px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
@media (max-width: 640px) { :root { --gutter: 16px; } }

/* ---- shared base ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s-4); top: var(--s-4); z-index: 100; background: var(--surface); padding: var(--s-2) var(--s-4); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 44px; padding: 0 var(--s-5);
  border-radius: var(--r-md); border: 1px solid transparent;
  font: 600 15px/1 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-lg { height: 52px; padding: 0 var(--s-6); font-size: 16px; }
.btn svg { width: 18px; height: 18px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font: 600 var(--fs-micro)/1.4 var(--font-sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--brass);
}

/* ---- motion (motion.js) ---- */
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -2px; background: currentColor; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* full-screen "typing a memo" transition into the tool */
.type-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-5);
  background: var(--navy-950); color: rgb(255 255 255 / .6);
  opacity: 0; transition: opacity .25s ease;
}
.type-screen.show { opacity: 1; }
.type-paper {
  width: min(440px, calc(100% - 40px)); min-height: 190px; padding: 28px 32px;
  background: var(--paper); color: #111; border-radius: 4px; box-shadow: var(--shadow-paper);
  font: 15px/1.5 var(--font-memo);
  transform: translateY(12px) scale(.98); transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.type-screen.show .type-paper { transform: none; }
.type-screen.done .type-paper { transform: scale(1.04); transition-duration: .22s; }
.type-lines p { margin: 0 0 10px; white-space: pre-wrap; }
.type-label { margin: 0; font-size: var(--fs-small); letter-spacing: .04em; }

/* fade-up as sections scroll into view */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* pages fade in on arrival */
body { animation: page-in .45s ease both; }
@keyframes page-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  body, .caret { animation: none; }
}
