/* ============================================================
   madtea.lol - Wonderland design system
   Ported from design/Madtea Home - Wonderland.dc.html.
   Dark tea-green ink alternating with parchment chapbook
   sections; brass + plum accents; IM Fell / Garamond / Bodoni.
   ============================================================ */

/* --- fonts (self-hosted, latin subset, SIL OFL 1.1) -------- */
@font-face { font-family: "IM Fell English"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/im-fell-english-400.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/im-fell-english-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English SC"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/im-fell-english-sc-400.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/eb-garamond-400-700.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/fonts/eb-garamond-400-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/fonts/bodoni-moda-400-900.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 900; font-display: swap; src: url("/fonts/bodoni-moda-400-900-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --ink: #10201c;
  --ink-deep: #0a1613;
  --ink-raised: #15291f;
  --parchment: #f1e7d0;
  --parchment-ink: #241c14;
  --parchment-muted: #5a4a38;
  --cream: #e8dcc0;
  --body-dark: #b9c2b4;
  --muted-dark: #9aa8a0;
  --brass: #c8933f;
  --brass-bright: #e3ad5c;
  --plum: #7c3f6d;
  --plum-light: #b678a5;
  --sage: #6d9186;
  --teal: #2a5248;
  --red-aside: #8a3030;
  --line-dark: rgba(232, 220, 192, 0.15);
  --line-dark-mid: rgba(232, 220, 192, 0.2);
  --line-dark-strong: rgba(232, 220, 192, 0.35);
  --line-parch: rgba(36, 28, 20, 0.35);
  --cream-wash: rgba(232, 220, 192, 0.08);
  --parch-wash: rgba(36, 28, 20, 0.06);
  --plum-wash: rgba(109, 56, 98, 0.05);
  --brass-a35: rgba(200, 147, 63, 0.35);
  --brass-a55: rgba(200, 147, 63, 0.55);
  --shadow-card: 4px 5px 0 rgba(0, 0, 0, 0.4);
  --shadow-lift: 6px 8px 0 rgba(0, 0, 0, 0.45);
  --font-fell: "IM Fell English", serif;
  --font-fell-sc: "IM Fell English SC", serif;
  --font-garamond: "EB Garamond", Georgia, serif;
  --font-bodoni: "Bodoni Moda", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

/* dark reading surfaces: the ink shell is already dark; the bright
   parchment swaps to aged leather so OLED readers aren't flashlighted.
   All pairs re-checked >= 4.5:1. --plum lightens globally (its parchment
   uses need it; its one dark-shell use is a shadow).
   Applied two ways - KEEP THE TWO TOKEN BLOCKS IN SYNC:
   (a) system prefers dark and no explicit light choice, (b) explicit
   dark choice via the header toggle (html[data-theme], localStorage). */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --parchment: #1b1610;
    --parchment-ink: #ddd2bc;
    --parchment-muted: #a3937a;
    --line-parch: rgba(221, 210, 188, 0.3);
    --parch-wash: rgba(221, 210, 188, 0.07);
    --plum: #b678a5;
    --teal: #86b3a2;
    --red-aside: #cf7a6e;
  }
}
html[data-theme="dark"] {
  --parchment: #1b1610;
  --parchment-ink: #ddd2bc;
  --parchment-muted: #a3937a;
  --line-parch: rgba(221, 210, 188, 0.3);
  --parch-wash: rgba(221, 210, 188, 0.07);
  --plum: #b678a5;
  --teal: #86b3a2;
  --red-aside: #cf7a6e;
}

/* the design is tuned in absolute px around laptop widths; on big
   high-res screens at 100% scaling it renders physically small. Scale
   the whole page wholesale so proportions (and the 1120px wrap) hold. */
@media (min-width: 1800px) { html { zoom: 1.15; } }
@media (min-width: 2600px) { html { zoom: 1.3; } }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-garamond);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brass); }
a:hover { color: var(--brass-bright); }
/* inline-code standard: mono at 0.82em, 1px/5px padding, square corners,
   color inherited from surroundings; surface tint flips per ground
   (cream tint on ink, ink tint on parchment); pre blocks opt out */
code { font-family: var(--font-mono); font-style: normal; font-weight: 400; font-size: 0.78em; padding: 1px 5px; background: var(--cream-wash); }
.section-parchment code, .docs-page code, .cup-card code { background: var(--parch-wash); }
pre code, .section-parchment pre code, .docs-page pre code, .cup-card pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
::selection { background: var(--brass-a35); }
:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 2px; }
.section-parchment :focus-visible, .docs-page :focus-visible { outline-color: var(--plum); }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10; font-family: var(--font-mono); font-size: 14px; background: var(--brass); color: var(--ink); padding: 10px 18px; text-decoration: none; }
.skip-link:focus { left: 12px; top: 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* --- chrome ------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--line-dark); }
.site-header .wrap { padding-top: 14px; padding-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--cream); text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand-name { font-size: 23px; letter-spacing: 0.02em; }
.brand-name .tld { color: var(--plum-light); font-weight: 400; }
.site-nav { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; font-family: var(--font-mono); font-size: 14px; }
@media (max-width: 700px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav { gap: 14px 18px; font-size: 13px; }
}
.site-nav a { color: var(--muted-dark); text-decoration: none; }
.site-nav a:hover { color: var(--cream); }
.theme-toggle { background: none; border: 1px solid var(--line-dark-strong); color: var(--muted-dark); width: 30px; height: 30px; padding: 0; cursor: pointer; font-size: 14px; line-height: 1; }
.theme-toggle:hover { color: var(--brass-bright); border-color: var(--brass); }
.theme-toggle::before { content: "\263E"; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .theme-toggle::before { content: "\2600"; } }
html[data-theme="dark"] .theme-toggle::before { content: "\2600"; }
.site-footer { border-top: 1px solid var(--line-dark); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.site-footer .quote { font-family: var(--font-fell); font-style: italic; font-size: 16.5px; color: var(--muted-dark); margin: 0; }
.site-footer .links { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 12px; }
.site-footer .links a { color: var(--sage); text-decoration: none; }
.site-footer .links a:hover { color: var(--cream); }
.site-footer .colophon { width: 100%; text-align: center; font-family: var(--font-mono); font-size: 11.5px; color: var(--sage); margin: 14px 0 0; }
.site-footer .colophon a { color: var(--sage); }
.site-footer .colophon a:hover { color: var(--brass-bright); }

/* --- shared furniture -------------------------------------- */
/* the small-bodoni display family: every sub-30px Bodoni use shares one
   treatment - italic, 800, optical size pinned to the sturdy small-print
   design so didone hairlines hold. The big hero/404 headlines stay on
   auto optical sizing where the thin strokes belong. */
.brand-name, .plate-name, .wordmark, .cup-title, .refusal-title, .docs-prose h3, .docs-toc li a, .blog-entry h2 { font-family: var(--font-bodoni); font-style: italic; font-weight: 800; font-variation-settings: "opsz" 8; }

/* the whole IM Fell family cuts digits at x-height (old-style text
   figures) - digit runs inside SC text get Bodoni, whose figures are
   full-height lining only, at the sturdy small optical size */
.fell-num { font-family: var(--font-bodoni); font-style: normal; font-weight: 500; font-variation-settings: "opsz" 8; font-size: 0.95em; letter-spacing: 0.08em; }

.flourish { display: flex; justify-content: center; margin: 0 0 10px; }
.flourish-brass { color: var(--brass); }
.flourish-plum { color: var(--plum); }
.eyebrow { font-family: var(--font-fell-sc); letter-spacing: 0.24em; font-size: 15px; margin: 0 0 4px; text-align: center; }
.chapter-title { text-align: center; font-family: var(--font-fell); font-weight: 400; font-size: 36px; margin: 0 0 14px; }
.epigraph { text-align: center; font-family: var(--font-fell); font-style: italic; font-size: 18px; max-width: 52ch; margin: 0 auto 22px; line-height: 1.5; color: var(--parchment-muted); }
.epigraph .attrib { font-style: normal; font-family: var(--font-fell-sc); font-size: 13px; letter-spacing: 0.14em; }
.btn { font-family: var(--font-mono); font-size: 14px; padding: 13px 22px; display: inline-block; text-decoration: none; }
.btn-brass { background: var(--brass); color: var(--ink); transform: rotate(-1.2deg); box-shadow: 3px 3px 0 var(--plum); }
.btn-brass:hover { background: var(--brass-bright); color: var(--ink); transform: rotate(0deg); }
.btn-ghost { border: 1px solid var(--line-dark-strong); color: var(--cream); transform: rotate(0.8deg); }
.btn-ghost:hover { border-color: var(--brass); color: var(--brass-bright); transform: rotate(-0.6deg); }
.section-dark { border-top: 3px double var(--ink-deep); }
.section-parchment { background: var(--parchment); color: var(--parchment-ink); border-top: 3px double var(--ink-deep); }
pre.command-block { background: var(--ink-deep); border: 1px solid var(--line-dark-mid); padding: 14px 18px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--cream); }

/* ============================================================
   Homepage components (design/Madtea Home - Wonderland.dc.html
   lines 49-167). Values ported 1:1 from the mockup.
   ============================================================ */

/* --- color / accent utilities ------------------------------ */
.plum { color: var(--plum); }
.plum-light { color: var(--plum-light); }
.plum-em { color: var(--plum); }
.sage { color: var(--sage); }
.brass { color: var(--brass); }
.cream { color: var(--cream); }
.muted { color: var(--muted-dark); }
.no-room { color: var(--plum); font-size: 44px; }

/* --- hero -------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-inner { position: relative; display: flex; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 56px; }
.hero-plate { flex: none; margin: 0; text-align: center; transform: rotate(-2deg); }
.plate-ring { display: inline-block; padding: 16px; border: 1.5px solid var(--brass-a55); border-radius: 50%; box-shadow: 0 0 0 5px var(--ink), 0 0 0 6.5px var(--brass-a35), var(--shadow-lift); }
.plate-ring img { width: 300px; height: 300px; display: block; border-radius: 50%; }
.hero-plate figcaption { margin-top: 18px; }
.plate-name { font-size: 30px; color: var(--cream); }
.plate-sub { display: block; font-family: var(--font-fell-sc); font-size: 13px; letter-spacing: 0.22em; color: var(--brass); margin-top: 4px; }
.hero-copy { flex: 1; min-width: 0; }
.hero-clock-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.clock { width: 46px; height: 46px; border: 1.5px solid var(--brass); border-radius: 50%; position: relative; display: inline-block; flex: none; }
.clock .hand { position: absolute; left: 50%; top: 50%; width: 1.5px; margin-left: -0.75px; background: var(--brass); transform-origin: top center; }
/* hub dot masks the hands' slight off-center meeting */
.clock::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3.5px; height: 3.5px; margin: -1.75px 0 0 -1.75px; background: var(--brass); border-radius: 50%; }
/* the Hatter quarreled with Time: the hands drift on anyway, 12:1 like a
   real clock, starting from six o'clock. Minute hand is the LONG one
   (up at 12, lap every 60s); hour hand is the SHORT one (down at 6). */
.clock .hand-min { height: 15px; transform: rotate(180deg); animation: clock-spin-min 20s linear infinite; }
.clock .hand-hour { height: 11px; transform: rotate(0deg); animation: clock-spin-hour 240s linear infinite; }
@keyframes clock-spin-min { from { transform: rotate(180deg); } to { transform: rotate(540deg); } }
@keyframes clock-spin-hour { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .clock .hand { animation: none; }
}
.clock-caption { font-family: var(--font-mono); font-size: 13px; color: var(--brass); letter-spacing: 0.08em; }
.hero h1 { font-family: var(--font-bodoni); font-weight: 800; font-style: italic; font-size: clamp(52px, 7vw, 84px); line-height: 0.98; margin: 0 0 24px; max-width: 12ch; letter-spacing: -0.01em; }
.hero .lede { font-size: 21px; line-height: 1.55; color: var(--body-dark); max-width: 52ch; margin: 0 0 30px; }
.hero-ctas { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.install-block { margin-top: 34px; max-width: 640px; }
.install-label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-fell-sc); font-size: 12.5px; letter-spacing: 0.24em; color: var(--sage); margin: 0 0 8px; }
.install-more { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--sage); text-decoration: none; }
.install-more:hover { color: var(--brass-bright); }

/* --- chapter I: why this tea-party (parchment) ------------- */
.chapter-head { padding-top: 64px; padding-bottom: 20px; }
.chapter-one .prose { font-size: 19.5px; line-height: 1.6; margin: 0 0 15px; }
.dropcap { float: left; font-family: var(--font-fell); font-size: 66px; line-height: 0.83; padding: 6px 10px 0 0; color: var(--plum); }
.brass-code { color: var(--brass-bright); }
/* small Bodoni display text: pin the optical-size axis to its sturdy
   small-print design (opsz 8) so the didone hairlines don't drop out */
.wordmark { font-size: 0.95em; }
.chapter-one .epigraph { max-width: 46ch; margin-bottom: 26px; }

.tenniel { max-width: 860px; margin: 16px auto 8px; padding: 0 32px; text-align: center; }
.tenniel img { width: 100%; max-width: 640px; mix-blend-mode: multiply; filter: sepia(0.25) contrast(1.05); }
/* dark mode: the engraving keeps its printed look (dark strokes on paper)
   but the paper dims from white to muted aged cream - a tipped-in plate
   on the leather, neither a flashlight nor a negative */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tenniel img { mix-blend-mode: normal; filter: sepia(0.35) brightness(0.75) contrast(1.02); }
}
html[data-theme="dark"] .tenniel img { mix-blend-mode: normal; filter: sepia(0.35) brightness(0.75) contrast(1.02); }
.tenniel figcaption { font-family: var(--font-fell); font-style: italic; font-size: 15px; color: var(--parchment-muted); margin-top: 6px; }

.scene-table-wrap { max-width: 960px; margin: 0 auto; padding: 28px 32px 24px; }
.fleuron-rule { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; color: var(--plum); }
.fleuron-rule > span { flex: 1; height: 1px; background: var(--line-parch); }
.fleuron-rule .fleuron { flex: none; height: auto; background: none; font-size: 20px; }
.scene-table { display: grid; grid-template-columns: 220px 1fr 1fr; border: 1.5px solid var(--parchment-ink); }
.st-head { padding: 12px 18px; border-bottom: 1.5px solid var(--parchment-ink); background: var(--parch-wash); font-family: var(--font-fell-sc); letter-spacing: 0.14em; font-size: 16.5px; }
.st-head.st-old { color: var(--red-aside); }
.st-head.st-mad { color: var(--teal); }
.st-head.st-old, .st-head.st-mad, .st-old-cell, .st-mad-cell { border-left: 1px solid var(--line-parch); }
.st-scene { padding: 14px 18px; border-bottom: 1px solid var(--line-parch); font-size: 16.5px; line-height: 1.45; font-style: italic; font-weight: 500; }
.st-old-cell { padding: 14px 18px; border-bottom: 1px solid var(--line-parch); font-size: 16px; line-height: 1.45; color: var(--parchment-muted); }
.st-mad-cell { padding: 14px 18px; border-bottom: 1px solid var(--line-parch); font-size: 16px; line-height: 1.45; }

/* --- chapter II: the four cups (dark) ---------------------- */
.chapter-two .wrap { padding-top: 64px; padding-bottom: 72px; }
.chapter-lede { text-align: center; font-size: 19px; color: var(--body-dark); max-width: 56ch; margin: 0 auto 44px; line-height: 1.5; }
.chapter-lede.dark-on-parch { color: var(--parchment-ink); max-width: 54ch; margin-bottom: 40px; }
.cups-grid { display: grid; gap: 20px; align-items: start; grid-template-columns: repeat(4, 1fr); }
.cup-card { display: block; background: var(--parchment); color: var(--parchment-ink); padding: 22px 20px 24px; box-shadow: var(--shadow-card); text-decoration: none; transform: var(--tilt); }
.cup-card:hover { color: var(--parchment-ink); transform: none; box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.45); }
.cup-more { font-family: var(--font-fell-sc); font-size: 12.5px; letter-spacing: 0.18em; color: var(--plum); margin: 10px 0 0; opacity: 0; }
.cup-card:hover .cup-more { opacity: 1; }
.cup-label { font-family: var(--font-fell-sc); font-size: 12.5px; letter-spacing: 0.18em; color: var(--plum); margin: 0 0 8px; }
.cup-title { font-size: 20px; margin: 0 0 8px; }
.cup-body { font-size: 15.5px; line-height: 1.5; margin: 0 0 12px; }
.cup-command { font-family: var(--font-mono); font-size: 11px; margin: 0; color: var(--teal); overflow-wrap: break-word; }

/* --- chapter III: no room (parchment) ---------------------- */
.chapter-three .wrap { padding-top: 64px; padding-bottom: 64px; }
.refusals-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.refusal-card { display: block; border: 1.5px solid var(--parchment-ink); padding: 18px 22px; background: var(--plum-wash); color: var(--parchment-ink); text-decoration: none; }
.refusal-card:hover { color: var(--parchment-ink); border-color: var(--plum); }
.refusal-more { font-family: var(--font-fell-sc); font-size: 12.5px; letter-spacing: 0.18em; color: var(--plum); margin: 8px 0 0; opacity: 0; }
.refusal-card:hover .refusal-more { opacity: 1; }
.refusal-title svg { color: var(--plum); }
.refusal-title { font-size: 19px; margin: 0 0 6px; display: flex; align-items: center; gap: 9px; }
.refusal-title svg { flex: none; }
.refusal-body { font-size: 16px; line-height: 1.5; margin: 0; }
.safety-link { text-align: center; margin: 30px 0 0; font-size: 17px; }

/* --- the table is laid (dark CTA) -------------------------- */
.cta-final { background: var(--ink-raised); }
.cta-final .wrap-narrow { padding-top: 56px; padding-bottom: 64px; text-align: center; }
.cta-copy { font-size: 18px; color: var(--body-dark); margin: 0 0 24px; }

/* --- homepage responsive (mockup helmet lines 23-27) ------- */
@media (max-width: 980px) {
  .cups-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .refusals-grid { grid-template-columns: 1fr; }
  .hero-inner { flex-direction: column; }
  /* scene table becomes stacked cards: the scene line is the card
     heading, old/mad cells carry their column label via ::before,
     and a strong rule separates one scene from the next */
  .scene-table { display: block; }
  .st-head { display: none; }
  .st-scene, .st-old-cell, .st-mad-cell { border-left: none; border-bottom: none; }
  .st-scene { background: var(--parch-wash); padding-bottom: 10px; }
  .st-mad-cell + .st-scene { border-top: 1.5px solid var(--parchment-ink); }
  .st-old-cell { padding-bottom: 6px; }
  .st-old-cell::before, .st-mad-cell::before { display: block; font-family: var(--font-fell-sc); letter-spacing: 0.14em; font-size: 14.5px; margin-bottom: 2px; }
  .st-old-cell::before { content: "THE OLD WAY"; color: var(--red-aside); }
  .st-mad-cell::before { content: "THE MADTEA WAY"; color: var(--teal); }
}
@media (max-width: 600px) {
  .cups-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   404 page (design/Madtea 404.dc.html lines 42-54)
   ============================================================ */
.notfound { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 60px 32px; text-align: center; }
.notfound-inner { max-width: 640px; }
.notfound h1 { font-family: var(--font-bodoni); font-weight: 800; font-style: italic; font-size: clamp(38px, 5.5vw, 58px); line-height: 1.08; margin: 0 0 22px; }
.notfound .riddle { font-size: 20px; line-height: 1.55; color: var(--body-dark); margin: 0 0 10px; }
.notfound .aside { font-family: var(--font-fell); font-style: italic; font-size: 16.5px; color: var(--muted-dark); margin: 0 0 34px; }
.notfound-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   Docs chapbook (parchment reading page in the dark frame;
   generated reference tables held legible). Task 9.
   ============================================================ */
.docs-shell { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding-top: 40px; padding-bottom: 72px; align-items: start; }
/* phones: article first, nav becomes a normal block below it (a sticky
   translucent sidebar overlays the prose in a single column) */
@media (max-width: 860px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-nav { order: 2; position: static; max-height: none; overflow: visible; border-top: 1px solid var(--line-dark); padding-top: 18px; }
  .docs-page { order: 1; }
}
/* page zoom magnifies the resolved 100vh - divide it back out so the
   sticky sidebar still fits the real viewport */
@media (min-width: 1800px) { .docs-nav { max-height: calc((100vh - 48px) / 1.15); } }
@media (min-width: 2600px) { .docs-nav { max-height: calc((100vh - 48px) / 1.3); } }
@media (max-width: 360px) { .plate-ring img { width: 230px; } }
.docs-nav { font-family: var(--font-mono); font-size: 13px; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.docs-nav-section.current > summary { color: var(--brass-bright); }
.docs-nav-home { margin: 0 0 14px; }
.docs-nav-home a { font-family: var(--font-fell-sc); font-size: 17px; letter-spacing: 0.12em; color: var(--brass); text-decoration: none; }
/* IM Fell English SC sets much smaller than its nominal size - the section
   headings need ~17px to visually match the 13px mono page links */
.docs-nav-section summary { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-fell-sc); font-size: 17px; letter-spacing: 0.14em; color: var(--sage); cursor: pointer; padding: 6px 0; list-style: none; }
.docs-nav-section summary::before { content: "\2767"; color: var(--plum-light); }
.docs-nav-section summary a { flex: 1; color: inherit; text-decoration: none; }
.docs-nav-section summary a:hover { color: var(--cream); }
/* expanded/collapsed indicator - the heading text navigates, so the
   chevron is the visible state of the fold */
.docs-nav-section summary::after { content: "\25B8"; font-size: 24px; line-height: 1; color: var(--muted-dark); padding: 0 2px 0 10px; align-self: center; }
.docs-nav-section[open] > summary::after { content: "\25BE"; }
.docs-nav ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 18px; }
.docs-nav li { margin: 0; }
.docs-nav li a { display: block; padding: 3px 0; color: var(--muted-dark); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-nav li a:hover { color: var(--cream); }
.docs-nav li.active a { color: var(--brass-bright); }
.docs-page { background: var(--parchment); color: var(--parchment-ink); padding: 44px 48px 52px; border: 1px solid var(--line-dark-mid); box-shadow: var(--shadow-lift); min-width: 0; }
.docs-page .chapter-title { font-size: 34px; margin-bottom: 20px; }
.breadcrumbs { margin: 0 0 6px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-family: var(--font-fell-sc); font-size: 14px; letter-spacing: 0.12em; color: var(--parchment-muted); }
.breadcrumbs li + li::before { content: "\203A"; margin-right: 4px; color: var(--parchment-muted); }
.breadcrumbs a { color: var(--plum); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.generated-note { font-family: var(--font-fell); font-style: italic; font-size: 15px; color: var(--parchment-muted); border: 1px solid var(--line-parch); background: var(--plum-wash); padding: 10px 14px; margin: 0 0 22px; }
.generated-note a, .docs-source a { color: var(--plum); }
.docs-prose { font-size: 17.5px; line-height: 1.6; }
.docs-prose h2 { font-family: var(--font-fell); font-weight: 400; font-size: 26px; margin: 34px 0 12px; border-bottom: 1px solid var(--line-parch); padding-bottom: 6px; }
.docs-prose h3 { font-size: 19px; margin: 26px 0 8px; }
.docs-prose a { color: var(--plum); }
.docs-prose pre { background: var(--ink-deep); color: var(--cream); padding: 14px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.65; }
.docs-prose table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14.5px; }
.docs-prose th { font-family: var(--font-fell-sc); font-size: 13px; letter-spacing: 0.1em; text-align: left; border-bottom: 1.5px solid var(--parchment-ink); padding: 6px 10px; }
.docs-prose td { border-bottom: 1px solid var(--line-parch); padding: 6px 10px; vertical-align: top; }
.docs-prose td code { overflow-wrap: anywhere; }
.docs-prose .table-wrap { overflow-x: auto; }
.docs-source { font-family: var(--font-fell); font-style: italic; font-size: 14.5px; color: var(--parchment-muted); border-top: 1px solid var(--line-parch); margin-top: 36px; padding-top: 12px; }
.docs-toc { list-style: none; padding: 0; }
.docs-toc li { padding: 10px 0; border-bottom: 1px solid var(--line-parch); font-size: 18px; }
.docs-toc li a { color: var(--plum); text-decoration: none; }
.toc-desc { display: block; font-size: 15.5px; color: var(--parchment-muted); }

/* ============================================================
   Blog re-theme. Task 10.
   ============================================================ */
.blog-list { padding-top: 48px; padding-bottom: 72px; }
.blog-entry { border-bottom: 1px solid var(--line-dark); padding: 22px 0; }
.blog-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--sage); margin: 0 0 4px; }
.blog-entry h2 { font-size: 24px; margin: 0 0 6px; }
.blog-entry h2 a { color: var(--cream); text-decoration: none; }
.blog-entry h2 a:hover { color: var(--brass-bright); }
.blog-summary { color: var(--body-dark); margin: 0; }
.blog-page { margin-top: 48px; margin-bottom: 72px; }
.standalone-page { margin-top: 48px; margin-bottom: 72px; }
