/* Hearthbook: yellow and white. Headings in Literata (a reading face made for books, SIL Open Font Licence,
   hosted here), everything else in the system sans so controls feel native. */

@font-face { font-family: "Literata"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/fonts/literata-normal-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: "Literata"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/fonts/literata-normal-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 { font-family: "Literata"; font-style: italic; font-weight: 300 800; font-display: swap; src: url(/fonts/literata-italic-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: "Literata"; font-style: italic; font-weight: 300 800; font-display: swap; src: url(/fonts/literata-italic-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; }

:root {
  color-scheme: light dark;
  --serif: "Literata", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;

  --page: #FFFFFF;
  --surface: #FFFDF3;
  --surface-2: #F8F1D2;
  --paper: #FFFFFF;
  --text: #1A1608;
  --muted: #5A4F2C;
  --faint: #675B36;
  --rule: #EFE6BE;
  --field: #F8F3DD;
  --field-line: #8A7B3F;
  --ink: #F5C400;
  --ink-pressed: #DDAE00;
  --on-ink: #1F1700;
  --wash: #FFF1B8;
  --wash-pressed: #FFE68A;
  --link: #7A5A00;
  --alert: #9A2718;
  --glass: rgba(255, 255, 255, .78);
  --glass-line: rgba(90, 70, 0, .12);

  /* Depth: 3 steps, each a short close shadow plus a long soft one, always falling downwards. */
  --e1: 0 1px 2px rgba(60, 45, 0, .06), 0 1px 1px rgba(60, 45, 0, .04);
  --e2: 0 2px 6px rgba(60, 45, 0, .07), 0 10px 28px rgba(60, 45, 0, .09);
  --e3: 0 6px 14px rgba(60, 45, 0, .08), 0 30px 60px -14px rgba(60, 45, 0, .30);

  --radius: 18px;
  --radius-s: 12px;
  --gutter: 40px;
  --max: 1160px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #13110A;
    --surface: #1D1A10;
    --surface-2: #292415;
    --paper: #FFFDF3;
    --text: #F7F1DC;
    --muted: #C9BE98;
    --faint: #B5AA84;
    --rule: #342E1A;
    --field: #292415;
    --field-line: #938651;
    --ink: #FFD43B;
    --ink-pressed: #F0C400;
    --wash: #3B3212;
    --wash-pressed: #4A3F15;
    --link: #FFD966;
    --alert: #F08A75;
    --glass: rgba(29, 26, 16, .76);
    --glass-line: rgba(255, 240, 180, .12);
    --on-ink: #1A1400;
    --e1: 0 1px 2px rgba(0, 0, 0, .40);
    --e2: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .40);
    --e3: 0 6px 14px rgba(0, 0, 0, .40), 0 30px 60px -14px rgba(0, 0, 0, .70);
  }
}
:root[data-theme="dark"] {
  --page: #13110A;
  --surface: #1D1A10;
  --surface-2: #292415;
  --paper: #FFFDF3;
  --text: #F7F1DC;
  --muted: #C9BE98;
  --faint: #B5AA84;
  --rule: #342E1A;
  --field: #292415;
  --field-line: #938651;
  --ink: #FFD43B;
  --ink-pressed: #F0C400;
  --wash: #3B3212;
  --wash-pressed: #4A3F15;
  --link: #FFD966;
  --alert: #F08A75;
  --glass: rgba(29, 26, 16, .76);
  --glass-line: rgba(255, 240, 180, .12);
  --on-ink: #1A1400;
  --e1: 0 1px 2px rgba(0, 0, 0, .40);
  --e2: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .40);
  --e3: 0 6px 14px rgba(0, 0, 0, .40), 0 30px 60px -14px rgba(0, 0, 0, .70);
}

@media (prefers-contrast: more) {
  :root { --muted: #3F3517; --faint: #4A3F1C; --rule: #CDBE80; --field-line: #5A4D1C; --glass: rgba(255, 255, 255, .97); --glass-line: rgba(60, 45, 0, .35); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --muted: #E3DAB8; --faint: #D8CEA6; --rule: #5C5230; --field-line: #BDB07A; --glass: rgba(29, 26, 16, .97); --glass-line: rgba(255, 240, 180, .35); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--page); color: var(--text);
  font: 400 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: var(--wash-pressed); color: var(--text); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-optical-sizing: auto; color: var(--text); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(42px, 5.6vw, 72px); line-height: 1.04; font-weight: 500; letter-spacing: -.022em; }
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; font-weight: 500; letter-spacing: -.016em; }
h3 { font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0; }
.lead { font-size: 20px; line-height: 1.45; color: var(--muted); max-width: 34ch; text-wrap: pretty; }
.small { font-size: 14px; line-height: 1.45; color: var(--faint); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 16px; }

/* Glass menu, as on Flyteller. */
.nav { position: fixed; z-index: 20; top: 16px; left: 24px; right: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.nav > * { pointer-events: auto; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); border-radius: 999px; box-shadow: var(--e2), inset 0 0 0 .5px var(--glass-line); }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; color: var(--text); text-decoration: none; font: 600 17px/1 var(--serif); letter-spacing: -.01em; }
.brand .mark { width: 24px; height: 24px; flex: none; }
.mark .flame { fill: #F2B600; }
.mark .page-l { fill: #D49A00; }
.mark .page-r { fill: #F5C400; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark .flame { fill: #FFD43B; } :root:not([data-theme="light"]) .mark .page-l { fill: #E6AF00; } :root:not([data-theme="light"]) .mark .page-r { fill: #FFD43B; } }
:root[data-theme="dark"] .mark .flame { fill: #FFD43B; } :root[data-theme="dark"] .mark .page-l { fill: #E6AF00; } :root[data-theme="dark"] .mark .page-r { fill: #FFD43B; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.links { display: flex; gap: 2px; padding: 4px; }
.links a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .2s var(--ease); }
.links a:hover { background: var(--wash); }
.links a[aria-current] { background: var(--surface); box-shadow: var(--e1); }
.nav .cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; }

/* Buttons and fields: pills, 44px or taller. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px; border: 0; border-radius: 999px;
  font: 600 17px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--ink-pressed); }
.btn.second { background: var(--wash); color: var(--link); }
.btn.second:hover { background: var(--wash-pressed); }
.btn.plain { background: transparent; color: var(--link); padding: 0 14px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn.busy { cursor: progress; }
.btn svg { width: 19px; height: 19px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

input[type=text], input[type=password], select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid transparent; border-radius: 999px;
  background: var(--field); color: var(--text); font: 400 17px/1.4 var(--sans); -webkit-appearance: none; appearance: none;
  transition: border-color .15s, background .15s;
}
textarea { border-radius: var(--radius-s); resize: vertical; line-height: 1.55; padding: 14px 16px; }
select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A7B3F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--field-line); background-color: var(--surface); }
::placeholder { color: var(--faint); opacity: 1; }
@media (prefers-contrast: more) { input[type=text], input[type=password], select, textarea { border-color: var(--field-line); } }

/* Footer, shared by every page. */
.foot { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 56px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; color: var(--faint); font-size: 14px; }
.foot p { max-width: 62ch; }
.foot nav { display: flex; gap: 20px; }
.foot a { color: var(--muted); }

/* Legal pages. */
.legal { max-width: 720px; margin: 0 auto; padding: 128px var(--gutter) 64px; }
.legal h1 { font-size: clamp(36px, 4.6vw, 52px); margin-bottom: 8px; }
.legal h2 { font-size: 24px; margin: 36px 0 8px; letter-spacing: -.008em; }
.legal p { color: var(--muted); max-width: 66ch; }
.legal p + p { margin-top: 12px; }
.legal .small { margin-bottom: 8px; }

@media (max-width: 820px) {
  :root { --gutter: 16px; }
  .nav { top: 10px; left: 12px; right: 12px; }
  .nav .links { display: none; }
  .lead { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* Theme switch in the menu. */
.theme { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; color: var(--text); cursor: pointer; }
.theme svg { width: 20px; height: 20px; }
.nav .nav-end { display: flex; gap: 8px; align-items: center; }

/* Dictation button. */
.mic { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--wash); color: var(--link); font: 600 15px/1 var(--sans); cursor: pointer; transition: background .2s var(--ease); }
.mic:hover { background: var(--wash-pressed); }
.mic svg { width: 18px; height: 18px; flex: none; }
.mic.icon { width: 44px; height: 44px; padding: 0; justify-content: center; background: var(--field); color: var(--text); margin-left: auto; margin-right: 8px; }
.mic.live { background: var(--ink); color: var(--on-ink); }
.mic.live svg { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .mic.live svg { animation: none; } }
