:root {
  --paper: #f6f1e4;
  --paper-hi: #fbf8ee;
  --ink: #201c14;
  --ink-muted: #6b6252;
  --rule: #ddd3ba;
  --accent-gb: #a8631b;
  --accent-hq: #2b7a6f;
  --accent-rwo: #8b263e;
  --accent-ajsj: #3d3a8b;

  --f-display: 'Source Serif 4', Georgia, serif;
  --f-body: 'Inter', -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.6;
}

a { color: inherit; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-hi);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand span { font-weight: 400; font-style: italic; color: var(--ink-muted); }

.tabs {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tabs .tab {
  text-decoration: none;
  color: var(--ink-muted);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.tabs .tab[data-accent="gb"]:hover, .tabs .tab[data-accent="gb"].active { color: var(--accent-gb); border-color: var(--accent-gb); }
.tabs .tab[data-accent="hq"]:hover, .tabs .tab[data-accent="hq"].active { color: var(--accent-hq); border-color: var(--accent-hq); }
.tabs .tab[data-accent="rwo"]:hover, .tabs .tab[data-accent="rwo"].active { color: var(--accent-rwo); border-color: var(--accent-rwo); }
.tabs .tab[data-accent="ajsj"]:hover, .tabs .tab[data-accent="ajsj"].active { color: var(--accent-ajsj); border-color: var(--accent-ajsj); }

main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; min-height: 60vh; }

.blog-intro { margin-bottom: 2rem; }

.blog-intro h1 {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
}

.blog-intro .count {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}

.ref-pages {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.ref-pages-label {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.ref-page-link {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.3rem 0.6rem;
}

.ref-page-link:hover { border-color: var(--accent-gb); color: var(--accent-gb); }

.post-grid { display: flex; flex-direction: column; }

.post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-card-link { text-decoration: none; display: block; }

.source-tag {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 0.4rem;
}

.post-card h2 {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-card .excerpt {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.post-meta {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-meta .date {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
}

.post-meta .label {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.15rem 0.4rem;
}

.empty { color: var(--ink-muted); padding: 2rem 0; }

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-hi);
}

.site-footer .wrap {
  padding: 1.5rem 1.25rem;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  text-align: center;
}

.site-footer a { text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ==========================================================================
   Theme + responsive scale — 2026-08-25

   Dark is the default. The original cream palette is retained exactly and
   returns under [data-theme="light"], so the light theme is the one that was
   already designed rather than a wash of the dark one. Accents are lifted for
   legibility on a dark ground; hue and role are unchanged.
   ========================================================================== */

:root {
  --paper: #14120e;
  --paper-hi: #1d1a15;
  --ink: #ece5d6;
  --ink-muted: #9b9284;
  --rule: #35302f;
  --accent-gb: #d18b3f;
  --accent-hq: #4fb0a2;
  --accent-rwo: #c9637c;
  --accent-ajsj: #8380dd;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --paper: #f6f1e4;
  --paper-hi: #fbf8ee;
  --ink: #201c14;
  --ink-muted: #6b6252;
  --rule: #ddd3ba;
  --accent-gb: #a8631b;
  --accent-hq: #2b7a6f;
  --accent-rwo: #8b263e;
  --accent-ajsj: #3d3a8b;
  color-scheme: light;
}

/* The theme control. Sits with the tabs, set in the same mono face so it reads
   as navigation furniture rather than a widget. */
.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-muted);
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-muted); }
.theme-toggle .lbl-light { display: none; }
:root[data-theme="light"] .theme-toggle .lbl-dark { display: none; }
:root[data-theme="light"] .theme-toggle .lbl-light { display: inline; }

/* --------------------------------------------------------------------------
   Reading column. Same correction as the orientation pages: constrain the
   COLUMN, not the text inside it. Capping paragraphs while leaving their
   container full width left ~590px of dead card to the right of every line.
   -------------------------------------------------------------------------- */

/* Full page. Excerpts are short summaries rather than running prose, so the
   wide measure costs less here than it would in an essay. */
.wrap, .site-header .wrap { max-width: 1440px; }
.blog-intro, .post-card-link p, .post-meta { max-width: none; }

/* Elements that genuinely gain from width break out past the column. */
.post-card img, .ref-pages, table, pre { max-width: 1180px; }

@media (min-width: 1600px) { .wrap, .site-header .wrap { max-width: 1560px; } }
@media (max-width: 1240px) { .post-card img, .ref-pages, table, pre { max-width: 100%; } }
@media (max-width: 900px)  { .wrap, .site-header .wrap { max-width: 100%; padding: 0 1.5rem; } }

/* Four tabs, a brand and a toggle stop fitting on one line here. A single
   scrollable row keeps the header one line tall instead of growing to three. */
@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: nowrap; gap: 0.9rem; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 1rem; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 560px) {
  .wrap, .site-header .wrap { padding: 0 1rem; }
  .tabs { font-size: 0.64rem; gap: 0.85rem; }
  .post-card { padding: 1rem 0; }
  .theme-toggle { font-size: 0.58rem; padding: 0.28rem 0.45rem; }
}

/* Quality floor. Reduced motion is handled above. */
a:focus-visible, .tab:focus-visible, .post-card-link:focus-visible, .theme-toggle:focus-visible {
  outline: 2px solid var(--accent-gb);
  outline-offset: 3px;
  border-radius: 2px;
}
img, video, iframe, table, pre { max-width: 100%; }
html, body { overflow-x: hidden; }

/* --------------------------------------------------------------------------
   Index type scale — 2026-08-25
   Index pages only; individual posts keep their own bespoke styling and are
   deliberately untouched. The excerpt drove this: at 0.95rem it set 112
   characters to the line in the 820px column. At 1.28rem it sets ~83, which is
   both the readable measure and the larger text asked for. Everything else is
   lifted with it so the scale stays coherent rather than one element jumping.
   -------------------------------------------------------------------------- */

.post-card .excerpt   { font-size: 1.28rem; line-height: 1.58; }
.post-card h2         { font-size: 1.62rem; line-height: 1.28; margin-bottom: 0.6rem; }
.post-card            { padding: 1.9rem 0; }
.source-tag           { font-size: 0.68rem; }
.post-meta .date      { font-size: 0.76rem; }
.post-meta .label     { font-size: 0.68rem; padding: 0.32rem 0.62rem; }
.post-meta            { margin-top: 0.95rem; gap: 0.7rem; }
.blog-intro           { font-size: 1.12rem; line-height: 1.6; margin-bottom: 2.4rem; }
.ref-pages a          { font-size: 0.85rem; }
.ref-pages-label      { font-size: 0.68rem; }

@media (max-width: 900px) {
  .post-card .excerpt { font-size: 1.16rem; }
  .post-card h2       { font-size: 1.46rem; }
}
@media (max-width: 560px) {
  .post-card .excerpt { font-size: 1.06rem; line-height: 1.55; }
  .post-card h2       { font-size: 1.3rem; }
  .blog-intro         { font-size: 1.02rem; }
}
