/* lathieff.com — the shared sheet. Every page links this first, then its app's own sheet.
   Holds: fonts, reset, studio tokens, the site header/footer, buttons, and the .doc layout used by
   every privacy and support page. App sheets override the tokens under their body class
   (body.app-tapejournal, body.app-<slug>) and never restyle the shared parts by selector. */

@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/assets/fonts/barlow-condensed-500.woff2") format("woff2");
  font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/assets/fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/assets/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/assets/fonts/kalam-400.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/assets/fonts/kalam-700.woff2") format("woff2");
  font-weight: 700; font-display: swap; }
@font-face { font-family: "Doto"; src: url("/assets/fonts/doto-700.woff2") format("woff2");
  font-weight: 700; font-display: swap; }

:root {
  /* Type roles (shared by every app). */
  --f-read: "Newsreader", "Iowan Old Style", Georgia, serif;   /* reading, headlines */
  --f-print: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif; /* labels, caps */
  --f-hand: "Kalam", "Bradley Hand", "Segoe Print", cursive;    /* handwriting */
  --f-dot: "Doto", ui-monospace, "SF Mono", monospace;          /* dot-matrix displays */

  /* Studio palette (the home page and anything without an app theme). */
  --bg: #f3eee5;
  --ink: #1d1a16;
  --soft: #6b6257;
  --rule: #dcd2c2;
  --sheet: #fbf8f1;      /* paper: the .doc page, cards */
  --sheet-ink: #1d1a16;  /* text on paper (stays dark even on a dark page) */
  --sheet-soft: #6b6257;
  --sheet-rule: #dcd2c2;
  --accent: #1d1a16;
  --shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 18px 40px -24px rgb(40 30 20 / .35);

  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171512; --ink: #ede6d8; --soft: #a69c8d; --rule: #322d27; --sheet: #1f1c18; --sheet-ink: #ede6d8; --sheet-soft: #a69c8d; --sheet-rule: #322d27; --accent: #ede6d8;
    --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 18px 40px -24px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 18px/1.6 var(--f-read); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-weight: 500; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Printed caps label: what the factory printed. */
.label {
  font: 600 13px/1.2 var(--f-print); letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
}
.hand { font-family: var(--f-hand); font-weight: 400; }

/* Site header: the app (icon + name) on the left, its support and privacy links on the right.
   There is no site-wide name: each app is its own name. */
.site-head { padding: 22px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark { font: 500 22px/1 var(--f-read); letter-spacing: -.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 11px; }
.wordmark img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px rgb(0 0 0 / .25), 0 6px 12px -6px rgb(0 0 0 / .6); }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font: 600 14px/1 var(--f-print); letter-spacing: .14em; text-transform: uppercase; }
.site-nav a { text-decoration: none; color: var(--soft); padding: 8px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* Buttons: a moulded key, not a pill. */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px 12px;
  font: 700 15px/1 var(--f-print); letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  color: var(--sheet-ink); background: var(--sheet); border: 1px solid var(--sheet-rule); border-radius: 10px;
  box-shadow: 0 2px 0 var(--sheet-rule), var(--shadow); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--sheet-rule); }

/* Site footer. */
.site-foot { padding: 48px 0 56px; color: var(--soft); font-size: 15px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--rule); padding-top: 22px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font: 600 13px/1.4 var(--f-print); letter-spacing: .14em; text-transform: uppercase; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* .doc: privacy and support pages. A sheet of paper on the app's background. */
.doc {
  width: min(760px, 100% - 2 * var(--gutter)); margin: 8px auto 0; padding: clamp(28px, 6vw, 64px) clamp(22px, 6vw, 72px) clamp(36px, 6vw, 64px);
  background: var(--sheet); color: var(--sheet-ink); border-radius: 6px; box-shadow: var(--shadow);
}
.doc h1 { font-size: clamp(36px, 6vw, 52px); margin: 12px 0 10px; letter-spacing: -.015em; }
.doc .lede { font-size: 20px; color: var(--sheet-soft); font-style: italic; }
.doc .label { color: var(--sheet-soft); }
.doc h2 { font: 700 14px/1.3 var(--f-print); letter-spacing: .16em; text-transform: uppercase; color: var(--sheet-ink);
  margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--sheet-rule); }
.doc h3 { font-size: 21px; font-weight: 600; margin: 26px 0 6px; }
.doc ul { padding-left: 1.1em; margin: 0 0 1em; }
.doc li { margin: 0 0 .6em; }
.doc li::marker { color: var(--sheet-soft); }
.doc .meta { margin-top: 2px; }
.doc .contact { margin: 6px 0 4px; }
.doc .btn { text-transform: none; letter-spacing: .02em; font-size: 17px; background: #fffaf0; }

/* Skip link: hidden until focused. */
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 8px;
  background: var(--sheet); color: var(--sheet-ink); font: 600 14px/1 var(--f-print); letter-spacing: .12em; text-transform: uppercase; }
.skip:focus { top: 12px; }

/* Each page and component handles prefers-reduced-motion itself (the recorder's reels keep turning). */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Home (and 404): an index of the apps, nothing else ──────────────────────────
   No header or footer: a heading, then one row per app with its support and privacy keys. */
.page-home { background-image: radial-gradient(90% 60% at 80% -10%, rgb(255 255 255 / .55), transparent 60%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .page-home { background-image: radial-gradient(90% 60% at 80% -10%, rgb(255 240 215 / .05), transparent 60%); } }
.home {
  width: min(820px, 100% - 2 * var(--gutter)); min-height: 100vh; min-height: 100svh; margin-inline: auto;
  display: flex; flex-direction: column; justify-content: center; padding: clamp(56px, 12vh, 120px) 0;
}
.home-head h1 { max-width: 12em; margin: 16px 0 18px; font-size: clamp(40px, 7vw, 76px); letter-spacing: -.03em; line-height: 1.02; }
.home-head h1 em { font-style: italic; font-weight: 400; color: var(--soft); }
.home-lede { max-width: 30em; margin: 0; font-size: 19px; color: var(--soft); }
.home-lede a:not(.btn) { color: var(--ink); }
.home-lede .btn { margin-top: 12px; }
.app-list { list-style: none; margin: clamp(40px, 7vw, 72px) 0 0; padding: 0; border-top: 1.5px solid var(--ink); }
.app-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px clamp(16px, 3vw, 28px);
  padding: clamp(18px, 3vw, 26px) 0; border-bottom: 1px solid var(--rule);
}
.app-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 12px 22px -12px rgb(0 0 0 / .55);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.app-row:hover .app-icon { transform: translateY(-2px) rotate(-2deg); }
.app-about h2 { font-size: 30px; letter-spacing: -.015em; }
.app-about h2 a { text-decoration: none; }
.app-about h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.app-about p { margin: 4px 0 0; color: var(--soft); font-size: 17px; line-height: 1.4; }
.app-about .label { margin-top: 8px; font-size: 12px; }
.app-links { display: flex; gap: 10px; }
.app-links .btn { padding: 11px 16px 10px; font-size: 13px; }
@media (max-width: 600px) {
  .app-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .app-icon { width: 60px; height: 60px; border-radius: 14px; }
  .app-about h2 { font-size: 26px; }
  .app-links { grid-column: 2; margin-top: 10px; }
}

strong, b { font-weight: 600; }
