/* nomethod shared look: the start page's two styles (Fraktur, Gothic) × light/dark.
   Tokens are copied from the start page's template.html; keep them in step. */

/* ---- FRAKTUR: printed almanac — paper, ink, oxblood ---- */
:root[data-style="fraktur"] {
  --bg: #f1ebdf; --surface: #f7f2e8; --surface-2: #e9e1d1;
  --line: #d3c7b1; --line-strong: #1c1712;
  --text: #1c1712; --muted: #6e6253; --faint: #9b8f7e;
  --accent: #8e1f1a; --accent-soft: rgba(142, 31, 26, .09); --on-accent: #f7f2e8;
  --danger: #a3241c;
  --font: "EB Garamond", "Iowan Old Style", "Palatino", Georgia, serif;
  --label: "EB Garamond", Georgia, serif;
  --display: var(--label);
  --radius: 2px; --shadow-lg: 0 18px 50px rgba(40, 28, 15, .18);
  --grain: .5;
}
:root[data-style="fraktur"][data-theme="dark"] {
  --bg: #14110e; --surface: #1b1713; --surface-2: #26201a;
  --line: #3a3128; --line-strong: #e6dccb;
  --text: #e6dccb; --muted: #a8998a; --faint: #74685b;
  --accent: #d0533f; --accent-soft: rgba(208, 83, 63, .13); --on-accent: #14110e;
  --danger: #e0614c; --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55); --grain: .35;
}
@media (prefers-color-scheme: dark) {
  :root[data-style="fraktur"]:not([data-theme="light"]) {
    --bg: #14110e; --surface: #1b1713; --surface-2: #26201a;
    --line: #3a3128; --line-strong: #e6dccb;
    --text: #e6dccb; --muted: #a8998a; --faint: #74685b;
    --accent: #d0533f; --accent-soft: rgba(208, 83, 63, .13); --on-accent: #14110e;
    --danger: #e0614c; --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55); --grain: .35;
  }
}

/* ---- GOTHIC: condensed grotesk, hard grid, signal orange ---- */
:root[data-style="gothic"] {
  --bg: #ebebe8; --surface: #f6f6f4; --surface-2: #dcdcd8;
  --line: #111111; --line-strong: #111111;
  --text: #111111; --muted: #5e5e5b; --faint: #8d8d89;
  --accent: #ff4a12; --accent-soft: rgba(255, 74, 18, .12); --on-accent: #111111;
  --danger: #d8300a;
  --font: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --display: var(--label);
  --radius: 0px; --shadow-lg: 8px 8px 0 var(--line-strong);
  --grain: 0;
}
:root[data-style="gothic"][data-theme="dark"] {
  --bg: #0b0b0b; --surface: #111111; --surface-2: #1c1c1c;
  --line: #2c2c2c; --line-strong: #f0f0ec;
  --text: #f0f0ec; --muted: #9a9a95; --faint: #5f5f5b;
  --accent: #ff5a24; --on-accent: #0b0b0b; --danger: #ff6a3d; --shadow-lg: 8px 8px 0 var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root[data-style="gothic"]:not([data-theme="light"]) {
    --bg: #0b0b0b; --surface: #111111; --surface-2: #1c1c1c;
    --line: #2c2c2c; --line-strong: #f0f0ec;
    --text: #f0f0ec; --muted: #9a9a95; --faint: #5f5f5b;
    --accent: #ff5a24; --on-accent: #0b0b0b; --danger: #ff6a3d; --shadow-lg: 8px 8px 0 var(--accent);
  }
}

/* ---- base ---- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 18px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; padding: 0 16px 56px; transition: background .25s, color .25s; }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain);
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* logos are drawn with CSS masks so they take the text colour */
.logo { display: block; background: currentColor; -webkit-mask: var(--logo) no-repeat center / contain; mask: var(--logo) no-repeat center / contain; }
:root[data-style="fraktur"] .logo { --logo: url("/shared/logo-fraktur.svg"); aspect-ratio: 4000 / 1010; }
:root[data-style="gothic"] .logo { --logo: url("/shared/logo-gothic.svg"); aspect-ratio: 3810 / 1185; }

/* ---- header: brand, tool nav, appearance ---- */
.top { display: flex; align-items: center; gap: 12px 20px; padding: 18px 0 0; flex-wrap: wrap; }
.brand { display: block; color: var(--text); }
.brand .logo { height: 24px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-right: auto; }
.nav a, .icon-btn {
  height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font: 15px var(--label); text-decoration: none;
}
.nav a:hover, .icon-btn:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.rel { position: relative; }
.menu {
  position: absolute; right: 0; top: 40px; z-index: 20; width: 260px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px;
}
.menu[hidden] { display: none; }
.menu h3 { font: 600 12px var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 4px 4px 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg button { border: 0; background: transparent; padding: 6px 0; cursor: pointer; color: var(--muted); font: 14px var(--label); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--text); color: var(--bg); }
.menu .note { font-size: 13px; color: var(--faint); margin: 0 4px; font-style: italic; }

.btn { height: 36px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; cursor: pointer; font: 15px var(--label); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---- page title ---- */
.page { max-width: 720px; margin: 0 auto; padding: 8vh 0 0; }
.page.wide { max-width: 1200px; }
.title { margin: 0; font: 400 44px/1.1 var(--display); font-style: italic; text-align: center; }
.title::after { content: ""; display: block; width: 140px; margin: 18px auto 0; border-top: 3px double var(--line-strong); }
.lede { text-align: center; color: var(--muted); font-style: italic; margin: 14px 0 0; }

/* ---- prose (now page) ---- */
.prose { margin-top: 36px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 1.1em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose code { font: 15px ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 1px 4px; border-radius: var(--radius); }
.stamp { color: var(--faint); font-style: italic; text-align: center; margin: 0 0 22px !important; }
.now-current { font-size: 20px; }
.now-earlier { margin-top: 48px; }
.now-earlier h2 { margin: 0 0 18px; padding-top: 8px; border-top: 3px double var(--line-strong); font: 600 15px/1.3 var(--display); font-variant: small-caps; letter-spacing: .08em; text-transform: lowercase; }
.now-earlier article { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 24px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 17px; }
.now-earlier article h3 { margin: 0; font: italic 400 16px/1.6 var(--display); color: var(--faint); }
.now-earlier article :last-child { margin-bottom: 0; }

/* ---- tools hub ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 44px; margin-top: 44px; counter-reset: tool; }
.card { display: block; padding: 10px 0 18px; border-top: 3px double var(--line-strong); text-decoration: none; color: var(--text); }
.card h2 { margin: 0 0 4px; font: 600 15px/1.3 var(--display); font-variant: small-caps; letter-spacing: .08em; text-transform: lowercase; display: flex; gap: 6px; }
.card h2::before { counter-increment: tool; content: counter(tool, upper-roman) "."; color: var(--accent); font-variant: normal; text-transform: none; min-width: 1.6em; }
.card p { margin: 0 0 0 calc(1.6em + 6px); color: var(--muted); font-size: 16px; }
a.card:hover h2 span { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.card.soon { opacity: .55; }
.card .tag { font-style: italic; color: var(--faint); font-weight: 400; font-variant: normal; text-transform: none; letter-spacing: 0; margin-left: auto; }

/* ---- placeholder note ---- */
.notice { margin: 36px auto 0; max-width: 560px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.notice code { color: var(--accent); }

/* =====================================================================
   GOTHIC OVERRIDES — structure, not just colour
   ===================================================================== */
:root[data-style="gothic"] body { font-size: 20px; line-height: 1.3; }
:root[data-style="gothic"] .top { border-bottom: 1px solid var(--line-strong); padding-bottom: 14px; }
:root[data-style="gothic"] .brand .logo { height: 22px; }
:root[data-style="gothic"] .nav a, :root[data-style="gothic"] .icon-btn { text-transform: uppercase; letter-spacing: .08em; font-size: 14px; font-weight: 500; }
:root[data-style="gothic"] .nav a:hover, :root[data-style="gothic"] .icon-btn:hover { background: var(--text); color: var(--bg); }
:root[data-style="gothic"] .menu h3 { letter-spacing: .14em; }
:root[data-style="gothic"] .seg button { text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
:root[data-style="gothic"] .btn { text-transform: uppercase; letter-spacing: .1em; font-weight: 500; }

:root[data-style="gothic"] .page { max-width: 900px; padding-top: 5vh; }
:root[data-style="gothic"] .page.wide { max-width: 1200px; }
:root[data-style="gothic"] .title { font: 500 clamp(48px, 7vw, 88px)/.95 var(--display); text-transform: uppercase; letter-spacing: -.01em; text-align: left; padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); }
:root[data-style="gothic"] .title::after { content: none; }
:root[data-style="gothic"] .lede { text-align: left; font-style: normal; text-transform: uppercase; letter-spacing: .12em; font-size: 14px; }
:root[data-style="gothic"] .stamp { text-align: left; font-style: normal; text-transform: uppercase; letter-spacing: .12em; font-size: 14px; color: var(--accent); }
:root[data-style="gothic"] .now-current { font-size: 26px; line-height: 1.2; }
:root[data-style="gothic"] .prose ul { list-style: none; padding: 0; }
:root[data-style="gothic"] .now-current li { border-left: 4px solid var(--accent); padding: 2px 0 2px 16px; margin: 0 0 12px; }
:root[data-style="gothic"] .now-earlier h2 { border-top: 1px solid var(--line-strong); font-variant: normal; text-transform: uppercase; letter-spacing: .14em; font-size: 14px; padding-top: 14px; }
:root[data-style="gothic"] .now-earlier article { border-bottom-color: var(--line); font-size: 18px; }
:root[data-style="gothic"] .now-earlier article h3 { font: 500 14px/1.6 var(--label); font-style: normal; text-transform: uppercase; letter-spacing: .1em; }

:root[data-style="gothic"] .cards { gap: 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); margin-top: 28px; }
:root[data-style="gothic"] .card { border: 0; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: var(--surface); padding: 14px 16px 18px; }
:root[data-style="gothic"] .card h2 { font-variant: normal; text-transform: uppercase; letter-spacing: .14em; font-size: 14px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
:root[data-style="gothic"] .card h2::before { content: counter(tool, decimal-leading-zero); min-width: 1.8em; }
:root[data-style="gothic"] .card p { margin-left: 0; font-size: 17px; }
:root[data-style="gothic"] a.card:hover { background: var(--text); color: var(--bg); }
:root[data-style="gothic"] a.card:hover p { color: var(--bg); }
:root[data-style="gothic"] a.card:hover h2 span { color: var(--bg); text-decoration: none; }
:root[data-style="gothic"] .card .tag { font-style: normal; }

@media (max-width: 640px) {
  .nav .lbl-long { display: none; }
  .title { font-size: 36px; }
  .now-earlier article { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
