/* =========================================================
   brendanchalifour.ca · redesign
   Rules, written once and used everywhere:
   - Type: Apple Garamond for headlines; Inter for everything else.
     Accents, used sparingly: Manus = handwritten notes (things scribbled in the margin);
     Manthoels = signatures (who said it, the sign-off). Nothing else uses them.
     Accents are never small: Manus is 1.6rem or larger, Manthoels 2.4rem or larger (it is a thin script).
   - Layers: main content sits above the footer, so anything that pops out (book card, menus) is never covered.
   - Accent colour: set in colors.css (site accent + page accents), nowhere else.
     --accent for big or decorative things; --accent-text (a deeper shade, worked out
     automatically) for filled shapes only (--accent-fill); all text uses the accent itself.
   - The four C9 bulb colours (green, blue, yellow, red) and warm white appear only in neon.
   - Text is 14px or larger; contrast is 4.5:1 or better.
   ========================================================= */

/* ---------- Fonts ---------- */
/* Fonts are preloaded in <head> and shown only once loaded (font-display: block), so text never swaps and jumps */
@font-face { font-family: "Apple Garamond"; src: url("fonts/AppleGaramond-Light.woff2") format("woff2"); font-weight: 300; font-display: block; }
@font-face { font-family: "Apple Garamond"; src: url("fonts/AppleGaramond.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Apple Garamond"; src: url("fonts/AppleGaramond-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: "Apple Garamond"; src: url("fonts/AppleGaramond-Bold.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Manus"; src: url("fonts/Manus.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Manthoels"; src: url("fonts/Manthoels.woff2") format("woff2"); font-display: block; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f5f1ea;
  --bg-2: #ece6db;
  --card: #fffdf8;
  --ink: #1d2320;
  --ink-2: #48514c;
  --ink-3: #5c655f;
  --line: rgba(29, 35, 32, 0.12);
  --cream: #fffaf2;
  --shadow: 0 1px 2px rgba(25, 35, 30, 0.06), 0 12px 40px -12px rgba(25, 35, 30, 0.2);
  --radius: 28px;
  --serif: "Apple Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hand: "Manus", "Bradley Hand", cursive;
  --sig: "Manthoels", "Snell Roundhand", cursive;
  --wrap: 1120px;
  /* side padding for the footer: its lines run full width, its content lines up with the page width */
  --edge: max(16px, env(safe-area-inset-left), calc((100% - var(--wrap)) / 2 + 16px));
  --read: 44rem;
  --tb-h: 0px;
  --nav-h: 64px;
  /* neon only */
  --n-green: #39ff88; --n-blue: #2fb8ff; --n-yellow: #ffdd3c; --n-red: #ff3b4e; --n-warm: #ffb347;
  --wall: #07090f;
  color-scheme: light;
}
/* dark mode lives at the end of this file (html[data-theme="dark"]) */

/* Accent: from colors.css. The page's own accent if it has one, otherwise the site's.
   Set on <body> so the whole page follows it: menu, masthead, content and footer. */
body {
  --accent: var(--page-accent, var(--site-accent));
  --accent-text: var(--accent);   /* text uses the chosen accent itself (one green, no darker copy) */
  --accent-fill: color-mix(in oklab, var(--accent) 78%, #000);   /* only filled boxes (green panels, buttons) use this deeper shade */
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
}
html[data-theme="dark"] body {
  --accent: var(--page-accent-night, var(--site-accent-night));
  --accent-text: var(--accent);
  --accent-fill: color-mix(in oklab, var(--accent) 78%, #fff);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--tb-h) + var(--nav-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  padding-top: var(--tb-h);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .nav, .foot, .legal { position: relative; z-index: 1; }
main { z-index: 2; }
a { color: inherit; text-decoration: none; }   /* no underlined links anywhere; links fade a little on hover instead */
@media (hover: hover) and (pointer: fine) { main p a:hover, main li a:hover, .contact-row dd a:hover, .legal a:hover { opacity: 0.7; } }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: clamp(2.2rem, 5.6vw, 3.9rem); line-height: 1.04; }
h1 em, h2 em, h3 em, .foot-vision em { font-style: italic; color: var(--accent); }
p { margin: 0; }
ul, ol { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, .lede, .hero-sub, .foot-vision, .big-quote { text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hand { font-family: var(--hand); font-weight: 400; letter-spacing: 0; }
/* Test panel "Notes": the handwriting font used for notes, numbers and labels */
html[data-hand="caveat"] { --hand: "Caveat", "Bradley Hand", cursive; }
html[data-hand="kalam"] { --hand: "Kalam", "Bradley Hand", cursive; }
html[data-hand="patrick"] { --hand: "Patrick Hand", "Bradley Hand", cursive; }
html[data-hand="serif"] { --hand: "Apple Garamond", Garamond, serif; }
html[data-hand="serif"] .note, html[data-hand="serif"] .q-pcard .q-label, html[data-hand="serif"] .q-deck .q-label { font-style: italic; }
html[data-hand="kalam"] .note, html[data-hand="patrick"] .note { font-size: 1.45rem; }
.sig { font-family: var(--sig); font-weight: 400; letter-spacing: 0; font-style: normal; }

.eyebrow {
  font-size: 0.875rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-text); font-weight: 600; margin-bottom: 1rem;
}
.eyebrow a { text-decoration: none; }
.eyebrow a { transition: opacity 0.2s; }
@media (hover: hover) and (pointer: fine) { .eyebrow a:hover { opacity: 0.7; } }   /* no underline: a gentle fade instead */
.lede { color: var(--ink-2); max-width: 38rem; margin-top: 1.1rem; font-size: 1.12rem; }
.section { padding: clamp(4.5rem, 10vw, 7.5rem) 16px; max-width: var(--wrap); margin: 0 auto; }
.section.tight { padding-top: clamp(2rem, 5vw, 3rem); }
.section-head { margin-bottom: clamp(2.2rem, 5vw, 3.2rem); }
.more-link { display: inline-block; margin-top: 2rem; font-weight: 600; color: var(--accent-text); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .more-link:hover { opacity: 0.7; } }
.num { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.1em; color: var(--accent-text); }
.note { font-family: var(--hand); color: var(--accent-text); font-size: 1.75rem; line-height: 1.15; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Test panel (Brendan's preview bar; not part of the site) ---------- */
.tb {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px;
  padding: 5px 12px; min-height: 40px;
  background: #fff; color: #555; border-bottom: 1px solid #ddd;
  font: 500 12px/1 system-ui, -apple-system, sans-serif;
}
.tb .grp { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.tb .lbl { color: #8a8a8a; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; margin-right: 5px; }
.tb button { border: 0; background: none; padding: 6px 8px; border-radius: 6px; color: #333; cursor: pointer; font: inherit; }
.tb button:hover { background: #f0f0f0; }
.tb button[aria-pressed="true"] { background: #1a1a1a; color: #fff; }
.tb .tb-hide { margin-left: auto; color: #8a8a8a; }
.tb-tab {
  position: fixed; top: 0; right: 12px; z-index: 60; display: none;
  font: 600 11px/1 system-ui, sans-serif; background: #1a1a1a; color: #fff; border: 0;
  border-radius: 0 0 8px 8px; padding: 7px 10px; cursor: pointer;
}
html.tb-closed .tb { display: none; }
html.tb-closed .tb-tab { display: block; }
@media (max-width: 767px) {
  .tb { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .tb::-webkit-scrollbar { display: none; }
  .tb .grp { flex-wrap: nowrap; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: var(--tb-h); z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 10px max(16px, env(safe-area-inset-left));   /* the menu bar runs edge to edge */
  background: transparent;   /* blends with the page at the top; the bar appears once you scroll */
  border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: var(--line);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.icon-link { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; flex: none; }
.icon-link img { width: 46px; height: 46px; object-fit: contain; }
.nav nav { display: flex; gap: clamp(0.9rem, 1.7vw, 1.6rem); margin-left: auto; }
.nav nav a { text-decoration: none; font-size: 0.92rem; color: var(--ink-2); padding: 2px 0; border-bottom: 1px solid transparent; white-space: nowrap; transition: color 0.2s; }
.nav nav a:hover { color: var(--accent-text); }
.nav nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.search-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; flex: none;
  height: 40px; padding: 0 0.9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); cursor: pointer; font-size: 0.9rem;
}
.search-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-btn kbd { font: 600 0.75rem/1 var(--sans); color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; }
@media (hover: hover) and (pointer: fine) { .search-btn:hover { border-color: var(--accent); color: var(--ink); } }

/* ---------- Wordmark ---------- */
.wordmark { display: block; width: 100%; height: auto; overflow: visible; }
.wordmark use { fill: currentColor; }

/* ---------- Home hero ---------- */
.hero { text-align: center; padding: clamp(2.6rem, 7vw, 5rem) 16px 0; max-width: var(--wrap); margin: 0 auto; }
.hero-mark { display: block; width: min(440px, 78vw); margin: 0 auto clamp(1.6rem, 4vw, 2.6rem); color: var(--ink); }
.hero-title {
  /* Normal size, one line. A long line may run wider than the page column, out to the screen
     edges; only if it still doesn't fit does the script shrink it (font-size and height are set
     inline), and it wraps only where one line would be too small to read. */
  font-size: clamp(3.4rem, 12.5vw, 9.5rem); line-height: 1.12; font-weight: 300; letter-spacing: -0.025em;
  display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; align-content: center; column-gap: 0.22em;
  min-height: 1.15em; user-select: none; -webkit-user-select: none; position: relative;
  --gut: max(16px, 4vw);
  width: calc(var(--vw, 100vw) - 2 * var(--gut));
  margin-left: calc((100% - var(--vw, 100vw)) / 2 + var(--gut));
}
.hero-title.wrap { flex-wrap: wrap; }
.js .hero-title:not(.ready) { visibility: hidden; }   /* the script shows it once its font has loaded and it is sized */
.hero-title.probe { position: absolute; visibility: hidden; pointer-events: none; left: 0; top: 0; height: auto !important; min-height: 0; margin: 0; }
.hero-title.probe.measure { width: max-content; }
.hero-title .word { display: inline-block; white-space: nowrap; }
.hero-title .slot { display: inline-block; }
.hero-title .ch {
  display: inline-block; position: relative; --f: 0;
  transition: none;   /* typing and backspacing are instant, like a typewriter; cursor movement is eased by the script */
  padding: 0.12em 0.2em 0.18em; margin: -0.12em -0.2em -0.18em;   /* room for italic overhang */
}
.hero-title .ch.drop { animation: drop 0.9s cubic-bezier(.2,.9,.25,1.2) both; }
.hero-title .ch.typed-out { opacity: 0; }
.hero-title .ch.caret::after {
  content: ""; position: absolute; right: 0.12em; top: 0.22em; bottom: 0.26em; width: max(2px, 0.04em);
  background: var(--accent); border-radius: 2px; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-0.6em) rotate(-8deg); } }
.hero-title em { font-style: italic; }
.hero-title em .ch { color: var(--accent); }
.hero-sub { margin: 1.4rem auto 0; font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--ink-2); max-width: 30rem; }

/* ---------- Daily quote: one controller, several looks (test panel) ---------- */
.qmode { display: none; }
html[data-quote="pcard"] .q-pcard, html[data-quote="split"] .q-split, html[data-quote="colour"] .q-colour, .qmode.q-show { display: block; }
.q-text { margin: 0; }
.q-by:empty { display: none; }
.q-nav { display: flex; justify-content: center; align-items: center; gap: 1rem; }
.q-arrow {
  width: 48px; height: 48px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.q-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.q-arrow:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .q-arrow:hover { border-color: var(--accent); } }
.q-count { min-width: 4.5em; text-align: center; font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.q-swap .q-text, .q-swap .q-by { transition: opacity 0.4s ease, transform 0.4s ease; }
.q-out .q-text, .q-out .q-by { opacity: 0; transform: translateY(8px); }


/* shared: the photo slowly drifts and zooms, so something is always happening */
.q-img { position: absolute; inset: 0; overflow: hidden; }
.q-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; animation: drift 38s ease-in-out infinite alternate; transform-origin: 40% 60%; }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.16) translate(-2%, -3%); } }
.pc, .sp, .co { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.q-pcard, .q-split, .q-colour { margin-top: clamp(2.5rem, 6vw, 4rem); }
.q-pcard .q-label, .q-deck .q-label { font-family: var(--hand); color: var(--accent-text); font-size: 1.8rem; margin-bottom: 1rem; }
.q-split .q-label, .q-colour .q-label { font-size: 0.875rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; margin-bottom: 1rem; }
.q-split .q-text, .q-colour .q-text, .q-pcard .q-text { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2.1rem); line-height: 1.22; text-wrap: pretty; }
.qmode.q-long .q-text { font-size: clamp(1.25rem, 2.1vw, 1.75rem); }
.q-split .q-by, .q-colour .q-by, .q-pcard .q-by { font-family: var(--sig); font-size: clamp(2.9rem, 4.6vw, 3.7rem); line-height: 1; margin-top: 1.2rem; }

/* 1. card on photo: the paper card floats on a full-colour photo */
.q-pcard .pc { padding: clamp(3rem, 8vw, 6rem) clamp(16px, 7vw, 6rem); }
.q-pcard .card-q {
  position: relative; z-index: 1; max-width: 700px; margin: 0 auto; background: var(--card); border-radius: 22px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 30px 60px -20px rgba(0,0,0,.45);
  padding: clamp(1.8rem, 5vw, 3rem) clamp(1.4rem, 5vw, 3rem); min-height: clamp(260px, 28vw, 320px);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; transform: rotate(-1.2deg);
  transition: transform 0.45s cubic-bezier(.2,.7,.2,1), opacity 0.45s ease;
}
.q-pcard .q-by { color: var(--accent-text); }
.q-pcard.q-out .card-q { transform: translateX(-30px) rotate(-5deg); opacity: 0; }
.q-pcard > .q-nav { margin-top: 1.6rem; }

/* 2. split: photo on one side, quote on a colour panel */
.q-split .sp { display: grid; grid-template-columns: 2fr 3fr; min-height: clamp(420px, 42vw, 520px); }
.q-split .sp > .q-img { position: relative; }
.q-split .q-img img { position: absolute; inset: 0; }
.q-split .sp-body { background: var(--accent-fill); color: #fffaf2; padding: clamp(2rem, 5vw, 3.6rem); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }

.q-split .q-label { opacity: 0.85; }
.q-split .q-nav { justify-content: flex-start; }
.q-split .q-arrow, .q-colour .q-arrow { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: inherit; }
.q-split .q-count, .q-colour .q-count { color: inherit; opacity: 0.9; }
@media (max-width: 720px) { .q-split .sp { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; } }   /* photo row fixed, the green panel takes any spare height (no gap) */

/* 3. colour: no photo, slow-moving colour in the site's accent */
.q-colour .co { min-height: clamp(420px, 42vw, 520px); background: var(--accent-fill); color: #fffaf2; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 3rem clamp(1.4rem, 8vw, 7rem); }
.q-colour .blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.5; animation: blob 22s ease-in-out infinite alternate; }
.q-colour .b1 { width: 55%; aspect-ratio: 1; left: -10%; top: -20%; background: color-mix(in srgb, var(--accent) 80%, #b8e0a0); }
.q-colour .b2 { width: 45%; aspect-ratio: 1; right: -8%; bottom: -25%; background: color-mix(in srgb, var(--accent) 70%, #d9a85a); animation-duration: 28s; animation-delay: -8s; }
.q-colour .b3 { width: 35%; aspect-ratio: 1; left: 40%; top: 30%; background: color-mix(in srgb, var(--accent) 60%, #0b3a2a); animation-duration: 19s; animation-delay: -4s; }
@keyframes blob { from { transform: translate(0, 0) scale(1); } to { transform: translate(12%, 10%) scale(1.25); } }
.q-colour .co-body { position: relative; z-index: 1; width: min(100%, 46rem); }
.q-colour .q-text, .q-colour .q-by, .q-colour .q-label { text-shadow: 0 1px 14px rgba(0,0,0,.28); }
.q-colour .q-nav { position: absolute; z-index: 2; left: 0; right: 0; bottom: 1.4rem; }

@media (prefers-reduced-motion: reduce) { .q-img img, .q-colour .blob { animation: none; } }

/* dark mode: same ideas, night colours */
html[data-theme="dark"] .q-split .sp-body, html[data-theme="dark"] .q-colour .co { background: #121a2a; color: #eef1f6; }
html[data-theme="dark"] .q-split .q-label, html[data-theme="dark"] .q-colour .q-label { color: var(--accent); opacity: 1; }
html[data-theme="dark"] .q-colour .b1 { background: color-mix(in srgb, var(--accent) 45%, #121a2a); }
html[data-theme="dark"] .q-colour .b2 { background: color-mix(in srgb, #2fb8ff 35%, #121a2a); }
html[data-theme="dark"] .q-colour .b3 { background: color-mix(in srgb, #39ff88 20%, #121a2a); }

/* Quotes page: the card deck sits above the full list */
.page-quotes .q-deck { margin: 0 0 clamp(3.5rem, 8vw, 5rem); }
.posters-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 1.4rem; }

/* 3. deck: a stack of cards you flip through */
.q-deck { margin-top: clamp(3rem, 7vw, 5rem); }
.q-deck .deck { position: relative; max-width: 720px; margin: 0 auto; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.q-deck .deck::before, .q-deck .deck::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.q-deck .deck::before { transform: rotate(-3.2deg) translateY(10px); opacity: 0.6; }
.q-deck .deck::after { transform: rotate(2.2deg) translateY(5px); opacity: 0.8; }
.q-deck .card-q {
  position: relative; z-index: 1; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(2rem, 5vw, 3.4rem) clamp(1.4rem, 5vw, 3.4rem); min-height: clamp(300px, 34vw, 360px);
  display: flex; flex-direction: column; justify-content: center; text-align: left;
  transition: transform 0.45s cubic-bezier(.2,.7,.2,1), opacity 0.45s ease;
}
.q-deck.q-out .card-q { transform: translateX(-30px) rotate(-4deg); opacity: 0; }
.q-deck .q-label { font-family: var(--hand); color: var(--accent-text); font-size: 1.8rem; margin-bottom: 1rem; }
.q-deck .q-text { font-family: var(--serif); font-size: clamp(1.45rem, 3vw, 2.2rem); line-height: 1.22; }
.q-deck .q-by { font-family: var(--sig); font-size: clamp(2.5rem, 4vw, 3rem); line-height: 1; color: var(--accent-text); margin-top: 1.2rem; align-self: flex-end; }
.q-deck .q-nav { margin-top: 2rem; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; border-block: 1px solid var(--line); padding: 1.1rem 0; margin-top: clamp(4rem, 9vw, 6rem);
  position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 195s linear infinite; }   /* 16 topics; same gentle speed as before */
@media (hover: hover) and (pointer: fine) { .marquee:hover .marquee-track { animation-play-state: paused; } }
.marquee-track a { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); padding: 0 1.4rem; white-space: nowrap; color: var(--ink-2); text-decoration: none; }
.marquee-track a:hover { color: var(--accent-text); }
.marquee-track a::after { content: "·"; padding-left: 2.8rem; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Building blocks ---------- */
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.6rem, 4vw, 2.4rem); }
.panel h3 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); line-height: 1.1; }
.panel p { color: var(--ink-2); margin-top: 0.7rem; }
.tile { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 1.5rem 1.4rem 1.6rem; }
.tile h3 { font-size: 1.55rem; line-height: 1.12; margin: 0.45rem 0 0.5rem; }
.tile p { color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; }
.tile .ex { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px dashed var(--line); font-size: 0.92rem; color: var(--ink-3); }
.tile .ex b { color: var(--ink-2); font-weight: 600; }
.feature { background: var(--accent-fill); color: var(--cream); }
.feature .tag, .feature p, .feature li { color: var(--cream); opacity: 0.94; }
.feature h2, .feature h3 { color: var(--cream); }
.feature a { color: var(--cream); }
.tag { font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.pill { padding: 0.45rem 1rem; border-radius: 999px; background: var(--accent-fill); color: var(--cream); font-weight: 700; font-size: 0.92rem; }
.btn {
  display: inline-block; margin-top: 1.6rem; padding: 0.8rem 1.6rem; border-radius: 999px;
  background: var(--cream); color: var(--accent-text); font-weight: 700; text-decoration: none; border: 0; cursor: pointer;
  transition: transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-line { background: transparent; color: var(--accent-text); border: 1px solid var(--line); }
.btn-fill { background: var(--accent-fill); color: var(--cream); }
.feature .btn { color: var(--accent-text); }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2.5rem, 7vw, 6rem); align-items: start; }

/* numbered ideas, big */
.ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.4rem, 4vw, 3rem); counter-reset: idea; }
.idea { border-top: 2px solid var(--ink); padding-top: 1.2rem; }
.idea .hand { display: block; font-size: 2.6rem; line-height: 1; color: var(--accent); margin-bottom: 0.6rem; }
.idea h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.12; }
.idea p { color: var(--ink-2); margin-top: 0.6rem; }

/* link lists */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.85rem 0; text-decoration: none; }
.link-list a span:first-child { overflow-wrap: anywhere; }
.link-list a span:last-child { color: var(--accent-text); font-weight: 600; flex: none; }
.link-list a:hover span:first-child { color: var(--accent-text); }
/* on a filled panel the accent colour matches the background, so hover underlines instead */
.feature .link-list a:hover span:first-child { color: var(--cream); opacity: 0.75; }
html[data-theme="dark"] .feature .link-list a:hover span:first-child { color: var(--accent-text); }
.link-list small { color: var(--ink-3); font-size: 0.9rem; margin-left: 0.4rem; }
/* link lists inside a filled green panel: arrows, notes and dividers in cream so they show */
.feature .link-list a span:last-child, .feature .link-list small { color: var(--cream); opacity: 0.85; }
.feature .link-list li + li { border-top-color: rgba(255, 250, 242, 0.2); }
html[data-theme="dark"] .feature .link-list a span:last-child, html[data-theme="dark"] .feature .link-list small { color: var(--accent-text); opacity: 1; }
html[data-theme="dark"] .feature .link-list li + li { border-top-color: var(--line); }
.list-label { font-size: 0.875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 2rem 0 0.2rem; }
.list-label:first-child { margin-top: 0; }
.link-groups { columns: 3 300px; column-gap: 1rem; }
.link-group { break-inside: avoid; margin-bottom: 1rem; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 1.3rem 1.4rem 0.6rem; }
.link-group h3 { font-size: 1.45rem; line-height: 1.15; margin-bottom: 0.3rem; }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 0.5rem 1rem;
  font-size: 0.92rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all 0.2s;
}
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--accent); color: var(--accent-text); } }
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--cream); }
[data-filter-item][hidden] { display: none !important; }

/* cards with photos */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(.2,.7,.2,1);
}
@media (hover: hover) and (pointer: fine) { .card:hover { transform: translateY(-4px); } }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card h3 { font-size: 1.45rem; line-height: 1.15; }
.card p { color: var(--ink-2); font-size: 0.97rem; }
.card-go { margin-top: auto; padding-top: 0.4rem; font-weight: 600; color: var(--accent-text); font-size: 0.95rem; }

/* doors: the six areas of the site */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.door { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 1.5rem 1.5rem 1.4rem; text-decoration: none; display: flex; flex-direction: column; gap: 0.35rem; min-height: 11rem; transition: transform 0.3s cubic-bezier(.2,.7,.2,1); }
@media (hover: hover) and (pointer: fine) { .door:hover { transform: translateY(-4px); } }
.door .hand { font-size: 2.4rem; line-height: 1; color: var(--accent); }
.door h3 { font-size: 1.8rem; line-height: 1.1; }
.door p { color: var(--ink-2); font-size: 0.97rem; }
.door .card-go { margin-top: auto; }

/* sticky notes (Manus) */
.notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
.sticky {
  background: #fbf3c8; color: #2b2a1e; padding: 1.3rem 1.2rem 1.5rem; min-height: 9.5rem;
  box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 10px 22px -12px rgba(60,50,10,.35);
  font-family: var(--hand); font-size: 1.75rem; line-height: 1.15; transform: rotate(var(--r, -1deg));
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s ease;   /* same soft lift as the book covers */
}
.sticky:nth-child(4n+2) { --r: 1.2deg; background: #e7f0e3; }
.sticky:nth-child(4n+3) { --r: -0.6deg; background: #f6e3d8; }
.sticky:nth-child(4n) { --r: 0.8deg; background: #e3ecf3; }

/* big stat */
.stat { display: flex; align-items: baseline; gap: 0.6rem 1.2rem; flex-wrap: wrap; }
.stat .big { font-family: var(--hand); font-size: clamp(4.5rem, 12vw, 8rem); line-height: 0.9; color: var(--accent); }
.stat p { max-width: 26rem; color: var(--ink-2); font-size: 1.1rem; }

/* a workday timeline */
.day { margin-top: 1.6rem; }
.day-track { position: relative; height: 64px; border-radius: 16px; background: var(--bg-2); overflow: hidden; }
.day-block { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.9rem; font-weight: 600; padding: 0 4px; line-height: 1.2; }
.day-block.focus { background: var(--accent-fill); color: var(--cream); }
.day-block.meet { background: #d9c7a8; color: #3a2e1a; }
.day-pin { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #c25a35; border-radius: 2px; }
.day-hours { position: relative; height: 1.6rem; margin-top: 0.5rem; font-size: 0.875rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.day-hours span { position: absolute; transform: translateX(-50%); }
.day-key { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 1rem; font-size: 0.95rem; color: var(--ink-2); }
.day-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.45rem; vertical-align: -1px; }

/* steps (numbered flow) */
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 0.7rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.6rem 1fr; gap: 0.8rem; align-items: baseline; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 0.95rem 1.2rem; color: var(--ink); }
.steps li::before { content: counter(s); font-family: var(--hand); font-size: 2rem; line-height: 1; color: var(--accent); text-align: center; }

/* big pull quote */
.big-quote { font-family: var(--serif); font-size: clamp(1.9rem, 4.8vw, 3.4rem); line-height: 1.13; max-width: 24ch; }
.big-quote.long { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; max-width: 38ch; }   /* long quotes read better smaller */
.big-quote::before { content: "“"; display: block; color: var(--accent); font-size: 1.8em; line-height: 0.6; height: 0.5em; }
.quote-block { border-left: 2px solid var(--accent); padding: 0.2rem 0 0.2rem 1.4rem; font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.65rem); line-height: 1.35; color: var(--ink); }
.quote-block .sig { display: block; font-style: normal; margin-top: 0.5rem; font-size: 2.6rem; color: var(--accent-text); }

/* question bank */
.qbank-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.qbank-list li { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1rem 1.2rem; font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; }

/* notebook chapters */
.chapters { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.toc { position: sticky; top: calc(var(--tb-h) + var(--nav-h) + 24px); display: grid; gap: 0.2rem; }
.toc a { text-decoration: none; color: var(--ink-3); font-size: 0.95rem; padding: 0.35rem 0 0.35rem 0.9rem; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.chapter { padding-bottom: clamp(3.5rem, 8vw, 5.5rem); }
.chapter + .chapter { border-top: 1px solid var(--line); padding-top: clamp(3rem, 7vw, 4.5rem); }
.chapter > h2 { margin-bottom: 1.4rem; }
.chapter > * + * { margin-top: 1.4rem; }
.prose-p { color: var(--ink-2); font-size: 1.08rem; max-width: var(--read); }
.prose-p + .prose-p { margin-top: 1rem; }

/* Eisenhower matrix */
.matrix { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 1rem; }
.matrix .axis { font-weight: 700; font-size: 1rem; color: var(--ink); text-align: center; }
.matrix .axis.side { writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; }
.quad { border-radius: 22px; padding: 1.5rem 1.4rem; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.25s, box-shadow 0.25s; text-align: left; border: 0; color: #22261f; font: inherit; }
.quad h3 { font-family: var(--hand); font-size: 1.9rem; line-height: 1; letter-spacing: 0.02em; }
.quad p { margin-top: 0.7rem; font-size: 1rem; }
.quad ul { margin-top: 0.8rem; padding-left: 1.1rem; font-size: 0.97rem; }
.quad .ex-h { margin-top: 0.9rem; font-weight: 700; font-size: 0.95rem; }
.quad.do { background: #f6dcd9; } .quad.schedule { background: #dde8de; } .quad.delegate { background: #f5e6d6; } .quad.delete { background: #f6efcf; }
.matrix.focus .quad { opacity: 0.45; }
.matrix.focus .quad.on { opacity: 1; transform: scale(1.02); box-shadow: 0 20px 50px -18px rgba(0,0,0,.35); }

/* bookshelf */
/* Books: every cover keeps its real shape (a square book stays square) and stands on a line */
.shelf { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 2.4rem 1.2rem; align-items: end; padding: 0 0.4rem; }
.shelf .book { position: relative; z-index: 1; display: block; width: 100%; padding: 0 0 10px; border: 0; background: none; cursor: pointer; }
.shelf img, .books .book img {
  display: block; width: 100%; height: auto; border-radius: 4px 8px 8px 4px;
  box-shadow: 0 10px 18px -10px rgba(0,0,0,.5), inset 3px 0 0 rgba(255,255,255,.2);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), opacity 0.3s ease, filter 0.3s ease;
}
@media (hover: hover) and (pointer: fine) { .shelf .book:hover img { transform: translateY(-8px) rotate(-1.5deg); } }
/* one plank per row, wall to wall (placed by script under each row) */
.plank { position: absolute; left: 0; right: 0; height: 12px; border-radius: 3px; z-index: 0; pointer-events: none;
  background: linear-gradient(#d6c3a5, #b39a75 60%, #9c845f); box-shadow: 0 8px 14px -8px rgba(60,40,20,.55), inset 0 1px 0 rgba(255,255,255,.35); }
/* tap a book: the rest dim, that one lifts, its details appear underneath */
.shelf.focus .book:not(.on) img { opacity: 0.35; filter: saturate(0.6); }
.shelf .book.on { z-index: 3; }
.shelf .book.on img { transform: translateY(-12px) scale(1.06); box-shadow: 0 24px 40px -16px rgba(0,0,0,.55); }
.book-info {
  position: absolute; z-index: 4; width: min(280px, calc(100% - 8px)); background: var(--card); border-radius: 18px;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.4); padding: 1rem 1.2rem 1.1rem; text-align: left;
  animation: pop 0.3s cubic-bezier(.2,.9,.25,1.2);
}
.book-info::before { content: ""; position: absolute; top: -7px; left: var(--arrow, 50%); width: 14px; height: 14px; margin-left: -7px; background: var(--card); transform: rotate(45deg); border-radius: 3px 0 0 0; }
.bi-title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.15; color: var(--ink); }
.bi-author { margin-top: 0.3rem; color: var(--ink-2); font-size: 1rem; }
.bi-year { margin-top: 0.15rem; color: var(--accent-text); font-weight: 600; font-size: 0.95rem; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.books { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(0.8rem, 2vw, 1.4rem); align-items: end; }
.books .book { display: block; }
.books.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.books.three .book { display: block !important; }   /* the three investing books always show */
@media (hover: hover) and (pointer: fine) { .books .book:hover img { transform: translateY(-6px) rotate(-1deg); } }

/* quote posters */
.posters { columns: 3 300px; column-gap: 1rem; }
.poster { break-inside: avoid; margin: 0 0 1rem; border-radius: 22px; padding: clamp(1.6rem, 3vw, 2.2rem); box-shadow: var(--shadow); background: var(--card); }
.poster blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.25; }
.poster figcaption { margin-top: 1rem; font-family: var(--sig); font-size: 2.6rem; line-height: 1; color: var(--accent-text); }
.poster.ink { background: #1d2320; color: #f5f1ea; }
.poster.ink figcaption { color: #b6dcc6; }
.poster.green { background: var(--accent-fill); color: var(--cream); }
.poster.green figcaption { color: #e9f3ec; }
.poster.big blockquote { font-size: clamp(1.7rem, 3vw, 2.2rem); }

/* poems */
.poem { max-width: 40rem; margin: 0 auto; }
.poem p { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.55rem); line-height: 1.5; color: var(--ink); }
.poem p + p { margin-top: 1.3rem; }
.poem p:first-child::first-letter { float: left; font-size: 4.2em; line-height: 0.8; padding: 0.06em 0.08em 0 0; color: var(--accent); }
.poem.lines p:first-child::first-letter { font-size: 3.1em; line-height: 0.82; }   /* short lines: the letter spans exactly two of them */
.poem.lines p { margin: 0; }
.poem.lines p + p { margin-top: 0.2rem; }
.poem .sig { display: block; text-align: right; font-size: clamp(2.8rem, 5vw, 3.4rem); color: var(--accent-text); margin-top: 2rem; }

/* recipes */
.recipe { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.recipe-photo { position: sticky; top: calc(var(--tb-h) + var(--nav-h) + 24px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.recipe > div:last-child { align-self: stretch; }   /* the photo's column runs the full height of the steps, so the photo can stay pinned while you scroll */
.recipe-photo:not(:only-child) { position: static; }   /* with the recipe card below it, nothing stays pinned (the card used to slide under the photo) */
.recipe-photo img { display: block; width: 100%; height: auto; }
.recipe .note { margin-bottom: 1.2rem; }
.method { list-style: none; padding: 0; counter-reset: m; display: grid; gap: 0.7rem; }
.method > li {
  counter-increment: m; position: relative; background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 1rem 1.2rem 1rem 3.6rem; cursor: pointer; transition: opacity 0.25s, background 0.25s; user-select: none; -webkit-user-select: none;
}
.method > li::before { content: counter(m); position: absolute; left: 1.1rem; top: 1.05rem;   /* number sits on the same baseline as the step's first line */ font-family: var(--hand); font-size: 1.9rem; color: var(--accent); line-height: 1; }
.method > li.done { opacity: 0.5; }
.method > li.done::before { content: "✓"; font-family: var(--sans); font-size: 1.2rem; top: 1.15rem; }
.method > li.done > .step { text-decoration: line-through; text-decoration-color: var(--accent); }
.method .step { font-size: 1.05rem; }
.method ul { list-style: none; padding: 0; margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.method ul li { background: var(--bg-2); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.95rem; color: var(--ink); }
.ingredients { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.ingredients li { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 0.75rem 1rem; }
.tap-hint { font-size: 0.95rem; color: var(--ink-3); margin-bottom: 0.8rem; }

/* YouTube: a still image until someone presses play (no YouTube cookies before that) */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.6rem 1.2rem; }
.video h3 { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; margin: 0.8rem 0 0; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: 18px; overflow: hidden; background: #000; cursor: pointer; box-shadow: var(--shadow); }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.88; transition: opacity 0.2s; }
.yt::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: rgba(255,255,255,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%232f5c47'/%3E%3C/svg%3E") center / 30px no-repeat;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); transition: transform 0.2s;
}
@media (hover: hover) and (pointer: fine) { .yt:hover img { opacity: 1; } .yt:hover::after { transform: scale(1.06); } }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt.playing { cursor: auto; }
.yt.playing::after { display: none; }
.film video { width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: #000; display: block; box-shadow: var(--shadow); }
.film h3 { font-family: var(--serif); font-size: 1.5rem; margin-top: 0.8rem; }

/* compare: batch vs one piece flow */
.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.flow .tile { padding-bottom: 1.4rem; }
.dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 1rem; max-width: 300px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.dots.bad i { background: #c25a35; }
.dots.one { grid-template-columns: repeat(10, 1fr); }
.dots.one i { background: var(--line); }
.dots.one i:first-child { background: var(--accent); }

/* ---------- Inner page header ---------- */
/* masthead: the site name on every inner page, like the top of a magazine page */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1.1rem; margin-bottom: clamp(2rem, 5vw, 3rem); border-bottom: 1px solid var(--line); }
.masthead a { display: block; width: clamp(170px, 22vw, 240px); color: var(--ink); }
.masthead p { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ink-2); white-space: nowrap; }
.masthead p em { color: var(--accent); }
.page-head { max-width: var(--wrap); margin: 0 auto; padding: clamp(1.6rem, 4vw, 2.6rem) 16px clamp(2rem, 5vw, 3rem); }
.page-head h1 { font-size: clamp(2.9rem, 8.5vw, 6rem); line-height: 1; font-weight: 300; letter-spacing: -0.02em; }
.page-head .note { margin-top: 1.2rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crumbs span[aria-hidden] { color: var(--ink-3); }
.page-body { max-width: var(--wrap); margin: 0 auto; padding: 0 16px clamp(4rem, 9vw, 6rem); }
.page-body > section + section { margin-top: clamp(3.5rem, 8vw, 5.5rem); }
.sub-head { margin-bottom: 1.6rem; }
.sub-head h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); }
.sub-head p { color: var(--ink-2); margin-top: 0.6rem; max-width: 38rem; }

/* ---------- Contact ---------- */
.two-up { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; }
.contact-links .btn { margin-top: 0; }
.contact-rows { display: grid; gap: 1.4rem; margin-top: 1.4rem; }
.contact-row dt { font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.feature .contact-row dt { color: var(--cream); opacity: 0.85; }
.contact-row dd { margin: 0.3rem 0 0; font-family: var(--serif); font-size: clamp(1.05rem, 4.2vw, 1.25rem); line-height: 1.3; word-break: break-word; }
.contact-row dd a { text-decoration: none; }
.reveal-btn { font: inherit; font-family: var(--sans); font-size: 0.95rem; font-weight: 600; background: none; border: 1px dashed currentColor; border-radius: 999px; padding: 0.35rem 0.9rem; cursor: pointer; color: inherit; }
.contact-photo { display: block; width: 100%; max-height: 380px; object-fit: cover; margin-top: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.logo-on-green { display: block; width: 200px; max-width: 70%; height: auto; margin-bottom: 1.2rem; background: #fff; border-radius: 12px; padding: 10px 14px; }

/* ---------- Search ---------- */
.search { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(20, 24, 22, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: calc(var(--tb-h) + 8vh) 16px 16px; }
.search.open { display: block; }
.search-box { max-width: 640px; margin: 0 auto; background: var(--card); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.search-field svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; flex: none; }
.search-field input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font: 400 1.15rem/1.4 var(--sans); color: var(--ink); }
.search-field button { border: 1px solid var(--line); background: none; border-radius: 8px; padding: 0.3rem 0.6rem; font-size: 0.875rem; color: var(--ink-3); cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 0.4rem; max-height: min(60vh, 520px); overflow-y: auto; }
.search-results a { display: block; padding: 0.75rem 0.9rem; border-radius: 14px; text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); }
.search-results .r-t { font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; }
.search-results .r-s { display: block; font-size: 0.875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; margin-top: 0.15rem; }
.search-results .r-x { display: block; font-size: 0.95rem; color: var(--ink-2); margin-top: 0.25rem; }
.search-results mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 1.2rem 1.1rem 1.4rem; color: var(--ink-3); font-size: 0.97rem; }

/* ---------- Neon (dark mode wordmark) ---------- */
@keyframes hum { 0%,100% { opacity: 1; } 50% { opacity: .92; } }
@keyframes flicker { 0%, 88%, 100% { opacity: 1; } 89% { opacity: .25; } 90% { opacity: 1; } 92% { opacity: .4; } 93.5% { opacity: 1; } }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 4rem 16px 3rem; border-top: 1px solid var(--line); }
.foot-vision { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1; letter-spacing: -0.02em; margin-top: 1rem; }   /* under the name, like the homepage */
.foot-mark { display: block; width: min(300px, 70vw); margin: 0 auto; color: var(--ink); }
.foot-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.6rem 2rem; max-width: 52rem; margin: clamp(3rem, 7vw, 5rem) auto 0; text-align: left; }   /* lots of room between the tagline and the links */
.foot-col { display: flex; flex-direction: column; gap: 0.55rem; }
.foot-h { font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); margin-bottom: 0.2rem; }
@media (max-width: 760px) { .foot-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 22rem; } }
.foot-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.foot-nav a:hover { color: var(--accent-text); }
.legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem 1.5rem;
  padding: 1rem var(--edge) calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--ink-2);
}
.legal a { color: var(--ink-2); text-decoration: none; }
.legal a:hover { color: var(--accent-text); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { flex-wrap: wrap; row-gap: 0.3rem; }
  .nav nav { order: 3; width: 100%; justify-content: space-between; margin-left: 0; gap: 0.6rem; }
  .search-btn { margin-left: auto; }
  :root { --nav-h: 104px; }
}
@media (max-width: 960px) {
  .g4, .cards, .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .doors, .ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .books .book:nth-child(n+9) { display: none; }
  .split, .two-up, .recipe, .chapters, .flow { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .toc a { border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; }
  .toc a.on { border-color: var(--accent); }
  .recipe-photo { position: static; }
  .qbank-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .books .book:nth-child(n+7) { display: none; }
  .legal { justify-content: center; text-align: center; }
  .marquee { padding: 0.9rem 0; }
  .marquee-track a { font-size: 1.25rem; padding: 0 0.9rem; }
  .marquee-track a::after { padding-left: 1.8rem; }
  .search-btn kbd { display: none; }
  .matrix { grid-template-columns: minmax(0, 1fr); }
  .matrix .axis { display: none; }
  .quad::before { content: attr(data-axis); display: block; font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: #4b4a3a; margin-bottom: 0.4rem; }
}
/* phones: the menu sits in two even rows of four */
@media (max-width: 600px) {
  .nav nav { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; row-gap: 0.3rem; column-gap: 0.4rem; }
  .nav nav a { font-size: 0.875rem; }
  :root { --nav-h: 132px; }
}
@media (max-width: 480px) {
  .g4, .g3, .g2, .cards, .cards.three, .doors, .ideas, .notes { grid-template-columns: minmax(0, 1fr); }
  .search-btn span { display: none; }
  .search-btn { width: 44px; justify-content: center; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .marquee-track { animation: none; }
  .marquee { overflow-x: auto; scrollbar-width: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Light / dark switch: small and quiet, in the bottom line ---------- */
.theme-btn { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; border: 0; background: none; color: var(--ink-3); cursor: pointer; margin: -6px 0; }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .sun { display: none; }
@media (hover: hover) and (pointer: fine) { .theme-btn:hover { color: var(--accent-text); } }

/* ---------- Dark mode: night colours, and the wordmark lit like the neon sign ----------
   Follows the device setting until someone uses the switch. One rule everywhere:
   warm white neon for the wordmark, warm amber for accents, the four C9 colours only in neon. */
html[data-theme="dark"] {
  --bg: #0a0e17; --bg-2: #121a2a; --card: #121a2a; --ink: #eef1f6; --ink-2: #c3cad8; --ink-3: #9aa4b8;
  --line: rgba(233, 236, 242, 0.12); --cream: #1a1206;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 50px -18px rgba(0,0,0,.8);
  color-scheme: dark;
}
html[data-theme="dark"] body { background: radial-gradient(120% 60% at 50% 0%, #18233a 0%, #0d1422 45%, #0a0e17 100%) fixed; }
html[data-theme="dark"] body::before { opacity: 0.12; }
html[data-theme="dark"] .nav.scrolled { background: color-mix(in srgb, #0d1422 85%, transparent); }
html[data-theme="dark"] .theme-btn .sun { display: block; }
html[data-theme="dark"] .theme-btn .moon { display: none; }
html[data-theme="dark"] .search-btn { background: rgba(255,255,255,.04); }
/* the wordmark becomes the neon sign: warm white tube, and the f flickers now and then */
/* stacked soft shadows (works in every browser, phones included) rather than an SVG filter */
/* Neon, copied from the C9 neon file (sign 2, Colour bar): white letters with the warm glow,
   the four-colour tube with its own glow, a gentle hum, and the f flickers now and then */
html[data-theme="dark"] .neon-sign { color: #fff; animation: hum 3.4s ease-in-out infinite; }
html[data-theme="dark"] .neon-sign .lit { filter: url(#neon-warm-wm); }
.neon-bar { display: none; width: 100%; height: auto; overflow: visible; margin-top: 4.5%; }
html[data-theme="dark"] .neon-bar { display: block; }
html[data-theme="dark"] .neon-bar .tube { filter: url(#neon-tube-wm); }
/* Lights on: with every bulb off nothing shows, then the script switches the sign on in sections */
html.neon-off .neon-ignite { visibility: hidden; }
html[data-theme="dark"] .wordmark .flick { animation: flicker 6s linear infinite; }
html[data-theme="dark"] .masthead p em, html[data-theme="dark"] .hero-title em .ch { text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent); }
html[data-theme="dark"] .feature { background: #16203a; color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
html[data-theme="dark"] .feature .tag { color: var(--accent-text); opacity: 1; }
html[data-theme="dark"] .feature p, html[data-theme="dark"] .feature li, html[data-theme="dark"] .feature .contact-row dt { color: var(--ink-2); opacity: 1; }
html[data-theme="dark"] .feature h2, html[data-theme="dark"] .feature h3, html[data-theme="dark"] .feature a:not(.btn) { color: var(--ink); }
html[data-theme="dark"] .feature .btn { background: var(--accent-fill); color: #1a1206; }
html[data-theme="dark"] .sticky { filter: brightness(0.9); }
html[data-theme="dark"] .film video, html[data-theme="dark"] .yt { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px -20px rgba(0,0,0,.9), 0 0 40px -10px rgba(255,179,71,.15); }
html[data-theme="dark"] .day-block.meet { background: #6b5a3c; color: #fff4e2; }
html[data-theme="dark"] .poster.ink { background: #05070c; }
html[data-theme="dark"] .poster.green { background: #1d3b2e; color: #eef1f6; }
html[data-theme="dark"] .tb { color-scheme: light; }
@media (max-width: 480px) { .masthead p { display: none; } }
/* five ideas (Decisions): one row on desktop instead of 3 + 2 */
.ideas.five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(1rem, 2.4vw, 2rem); }
.ideas.five .idea h3 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
@media (max-width: 960px) { .ideas.five { grid-template-columns: minmax(0, 1fr); } }
/* 10-10-10 (Decisions): the numbers in the script font */
.stat .big.script { font-family: var(--sig); line-height: 1.05; }

/* ---------- Chalifour Solutions page ----------
   Laid out like the Contact page. Its blue comes from colors.css (.page-solutions). */
.cs-square { display: block; width: 88px; height: 88px; border-radius: 20px; background: #fff; margin-bottom: 1.4rem; box-shadow: 0 10px 24px -12px rgba(0,0,0,.35); }
.cs-desc { font-size: clamp(1.1rem, 2vw, 1.25rem); line-height: 1.55; margin-top: 0.7rem; }
/* Email / phone reveal: the button and the address take the same height, and the address
   stays on one line, so nothing jumps when it appears */
[data-reveal] { display: inline-flex; align-items: center; min-height: 2.3rem; max-width: 100%; vertical-align: middle; }
[data-reveal] a { font-size: inherit; line-height: 1.3; white-space: nowrap; }   /* same size as the other contact details */
.reveal-btn { white-space: nowrap; }
.reveal-btn { line-height: 1.3; }   /* fits inside the slot, same as the address that replaces it */

.search-results .r-s:empty { display: none; }

/* A page title with a box under it (Investing: the Mark Twain quote in a green box, like Contact) */
.head-split { display: grid; gap: 1.2rem; }
.head-quote { margin: 0; container-type: inline-size; }
.head-quote blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.32; color: inherit; text-wrap: pretty; }
.head-quote blockquote span { display: block; }
.head-quote blockquote span + span { margin-top: 0.35em; }
/* Each sentence on its own line. Where the box is wide enough, the text is sized so the long month
   list fits on one line (it measures about 40 letters-widths); on narrower screens it wraps normally. */
@container (min-width: 650px) {
  .head-quote blockquote { font-size: min(1.6rem, calc(100cqi / 40.5)); }
  .head-quote blockquote span { white-space: nowrap; }
}
.head-quote .sig { display: block; margin-top: 1rem; text-align: right; font-size: clamp(2.3rem, 4vw, 2.7rem); line-height: 1; color: var(--cream); }
html[data-theme="dark"] .head-quote .sig { color: var(--accent-text); }

/* Investing favourites: a star and a light green background, in their usual place */
.fav { color: var(--accent); margin-left: 0.15rem; }
.link-group .is-fav { background: var(--accent-soft); border-radius: 12px; border-top-color: transparent; padding: 0 0.8rem; margin: 0 -0.8rem 3px; }
.link-group .is-fav + li { border-top-color: transparent; }
.fav-key { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; color: var(--ink-2); }
.fav-swatch { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }

/* Short pages (Contact, Solutions…): the footer keeps its mini site map but drops the name and tagline */
.short-page .foot-mark, .short-page .foot-vision { display: none; }
.short-page .foot { padding-top: 2.6rem; }
.short-page .foot-nav { margin-top: 0; }

/* Tap a recipe card to see it large */
img[data-zoom] { cursor: zoom-in; }
.zoom { padding: 0; border: 0; background: none; max-width: 100vw; max-height: 100vh; }
.zoom::backdrop { background: rgba(10, 12, 11, 0.82); }
.zoom img { display: block; max-width: 94vw; max-height: 92vh; border-radius: 12px; cursor: zoom-out; }

/* Homepage: the Lean tiles and the sticky notes are links */
a.tile-link { display: block; color: inherit; text-decoration: none; }
a.sticky { display: block; text-decoration: none; }   /* keeps the note's own dark ink in both modes */
@media (hover: hover) and (pointer: fine) {
  a.tile-link { transition: transform 0.25s; } a.tile-link:hover { transform: translateY(-4px); }
  a.sticky:hover { transform: rotate(calc(var(--r, -1deg) - 1deg)) translateY(-6px); box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 22px 30px -14px rgba(60,50,10,.45); }
}

/* Switching light / dark fades softly (browsers that support view transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.7s; animation-timing-function: ease; }

/* Site map: groups in rows of three, so headings in a row line up */
.map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.6rem clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 760px) { .map-grid { grid-template-columns: 1fr; } }

/* Homepage section headings link to their page; they look the same until you hover */
a.h-link { color: inherit; text-decoration: none; }
a.h-link { transition: opacity 0.2s; }
@media (hover: hover) and (pointer: fine) { a.h-link:hover { opacity: 0.7; } }   /* no underline: a gentle fade instead */

.print-only { display: none; }

/* =========================================================
   Print: simple, black and white. Name and tagline as a header,
   standard sizes (24 / 18 / 14px), no menus, buttons or photos.
   Links in lists print their web address so they work on paper.
   ========================================================= */
@media print {
  @page { margin: 16mm 16mm 18mm; }
  :root, html[data-theme="dark"] {
    --bg: #fff; --bg-2: #fff; --card: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --line: #bbb; --cream: #fff;
    --site-accent: #000; --site-accent-night: #000; --shadow: none; color-scheme: light;
  }
  body, html[data-theme="dark"] body { --accent: #000; --accent-text: #000; --accent-fill: #000; --accent-soft: transparent;
    background: #fff !important; color: #000; font-size: 14px; line-height: 1.5; padding-top: 0; }
  body::before { display: none !important; }
  * { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }

  /* hidden on paper */
  .nav, .tb, .tb-tab, .search, .marquee, .foot, .legal, .theme-btn, .btn, .more-link, .card-go, .recipe-photo,
  .neon-bar, .hero, .zoom, .fav-key ~ .nothing, video, .yt, .q-nav, .page-head .eyebrow.crumbs { display: none !important; }
  .recipe figure:not(.recipe-photo) { display: none !important; }   /* the recipe card image */
  .more-section { display: none !important; }   /* "More recipes" at the bottom of a recipe */
  .reveal { opacity: 1 !important; transform: none !important; }

  /* header: your name and the tagline */
  .masthead { border-bottom: 1px solid #000; padding-bottom: 6px; margin-bottom: 18px; }
  .masthead a { width: 230px; color: #000; }   /* the name is the one prominent thing */
  .masthead .wordmark .lit, .neon-sign .lit { filter: none !important; }
  .neon-sign { animation: none !important; color: #000 !important; }
  .masthead p { display: block !important; font-size: 20px; color: #000; }
  .masthead p em { color: #000; }

  /* standard sizes */
  .page-head { padding: 0; margin: 0 0 14px; }
  .page-head h1, h1 { font-size: 24px; line-height: 1.2; font-weight: 400; }
  h2 { font-size: 18px; line-height: 1.25; }
  h3, .link-group h3 { font-size: 14px; font-weight: 700; font-family: var(--sans); }
  .lede, p, li { font-size: 14px; color: #000; }
  .note { font-size: 18px; color: #000; margin-top: 2px; }
  .list-label, .eyebrow { font-size: 11px; color: #000; letter-spacing: 0.12em; }
  em { color: inherit !important; }
  a { color: #000 !important; }

  /* recipes: two columns, plain lists, steps numbered */
  .recipe { display: block; }
  .ingredients { display: block; margin: 0 0 12px; }
  .ingredients li { background: none; border-radius: 0; padding: 1px 0; }
  .ingredients li::before { content: "☐  "; }
  .method { display: block; }
  .method > li { background: none; border-radius: 0; padding: 0 0 8px 26px; break-inside: avoid; cursor: auto; opacity: 1 !important; }
  .method > li::before { font-family: var(--sans); font-size: 14px; font-weight: 700; color: #000; top: 0; left: 0; content: counter(m) "." !important; }
  .method > li.done > .step { text-decoration: none; }
  .method .step { font-size: 14px; }
  .method ul { display: block; margin: 2px 0 0; }
  .method ul li { display: inline; background: none; padding: 0; border-radius: 0; font-size: 14px; }
  .method ul li:not(:last-child)::after { content: ", "; }
  .tap-hint { display: none !important; }   /* "Tap a step to tick it off" */
  /* book covers print, in black and white, in a tidy grid */
  .book-info, .plank { display: none !important; }
  .shelf, .books, .books.three { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 14px 12px !important; padding: 0 !important; background: none !important; align-items: end; }
  .shelf .book, .books .book { display: block !important; padding: 0; break-inside: avoid; }
  .shelf img, .books img { filter: grayscale(1) !important; opacity: 1 !important; transform: none !important; border-radius: 2px; }
  .shelf.focus .book:not(.on) img { opacity: 1 !important; }

  /* link lists (Investing, Bookmarks, Travel…): print the address */
  .link-groups, .posters { columns: 2; column-gap: 24px; }
  .link-group, .panel, .poster, .card, .tile, .feature { background: none !important; border-radius: 0; padding: 0; color: #000 !important; }
  .link-group { margin-bottom: 14px; }
  .link-list li, .link-list li + li { border-top: 0; }
  .link-list a { display: block; padding: 2px 0; }
  .link-list a span:last-child { display: none; }
  .link-list a[href^="http"]::after { content: attr(href); display: block; font-size: 11px; color: #444; word-break: break-all; }
  .link-group .is-fav { background: none; padding: 0; margin: 0; }
  .fav, .fav-swatch { color: #000; background: none; }

  /* quote boxes become an outline */
  .head-quote { border: 1px solid #000; padding: 10px 12px; }
  .head-quote blockquote { font-size: 18px !important; line-height: 1.4; white-space: normal !important; }
  .head-quote blockquote span { white-space: normal !important; }
  .head-quote .sig { color: #000 !important; font-size: 22px; }
  .qmode { display: none !important; }   /* the flip-through card */
  img { filter: grayscale(1) !important; }   /* every picture prints in black and white */
  .print-only { display: block !important; font-size: 11px; color: #444; margin-top: 2px; word-break: break-all; }
  .chips, .reveal-btn { display: none !important; }   /* filter buttons don't work on paper */
  .quad { background: none !important; border: 1px solid #000; border-radius: 0; }
  .day, .day-block { filter: grayscale(1); }
  .card-img { background: none; }
  .contact-photo { display: none !important; }   /* decorative photo, saves a page */

  /* One plain standard for every page, including any new one: headings, text and simple boxes.
     Decorative pieces (sticky notes, tiles, cards, panels) become plain outlined boxes. */
  .sticky, .tile, .door, .card, .panel, .idea, .link-group, .poster, .quad, .head-quote {
    background: none !important; color: #000 !important; transform: none !important; border-radius: 0 !important;
    border: 1px solid #999 !important; padding: 10px 12px !important; break-inside: avoid; min-height: 0 !important;
  }
  .sticky { font-family: var(--sans) !important; font-size: 14px !important; line-height: 1.4 !important; }
  .feature, .feature *, .tag { color: #000 !important; opacity: 1 !important; }   /* text from the coloured boxes, which is light on screen */
  /* print follows each page's own layout (same columns as on a computer screen), just plainer */
  .masthead.print-only { display: flex !important; }
  .masthead.print-only .wordmark { width: 230px; color: #000; }
  .two-up { display: grid !important; grid-template-columns: 1.4fr 1fr !important; gap: 12px !important; }
  .split { display: grid !important; grid-template-columns: 1fr 1.1fr !important; gap: 16px !important; }
  .doors, .grid.g3, .g3, .ideas { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
  .ideas.five { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .cards, .notes, .grid.g4, .g4 { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px !important; }
  .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .g2, .grid.g2, .map-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .section, .page-body > section { padding: 0 !important; margin: 0 0 18px !important; }
  .section-head, .sub-head { margin-bottom: 8px !important; }
  h2 { break-after: avoid; }
  .tile .num, .door .hand, .idea .hand { font-size: 14px !important; color: #000 !important; }
  .tile h3, .door h3, .idea h3, .card h3 { font-size: 14px !important; line-height: 1.3 !important; }
  /* small pictures */
  .card { display: block !important; }
  .card-img { aspect-ratio: auto !important; height: 90px; }
  .card-img img { height: 90px !important; object-fit: cover; }
  .card-body { padding: 6px 0 0 !important; }
  .books img, .shelf img { max-height: 120px; width: auto !important; }
  .posters-title { font-size: 18px; margin: 0 0 10px; }
  .poster { break-inside: avoid; margin: 0 0 14px; }
  .poster, .poster * { color: #000 !important; background: none !important; }
  .poster blockquote { font-size: 14px !important; line-height: 1.45; }
  .poster figcaption { font-size: 22px !important; margin-top: 4px; }
  .sig { color: #000 !important; }
}
