/* ox-oxide.css — dark editorial theme for org-publish (org-html output).
   Generic & unbranded: cool slate-black paper, mint accent, mono labels.
   Design system: productivity/oxide-artifacts skill (templates/rfd.html).
   Palette is locked — do not change token values; derived tokens are extra.
   Fonts: nixpkgs `inter` (InterVariable.ttf / InterVariable-Italic.ttf)
   and `ibm-plex` (IBMPlexMono-*.ttf) — basenames per FONTS.md buildPhase;
   the flake copies them into $out/fonts/. src URLs are relative to the
   site's fonts/ directory. No external fetches.

   Layout (matches the artifact/RFD reader):
     - full-width sticky top bar (.sitebar, brand + breadcrumb)
     - centered shell: #content is a 1240px grid (240px sticky TOC + content)
       when the page has a table of contents; otherwise a centered 780px
       single column (legal pages etc.)
     - hero title (h1.title) with a strong hairline rule below it
     - footer (#postamble) aligned under the content column                */

:root {
  /* locked palette */
  --surface: #0b0d12;
  --surface-raise: #12151d;
  --surface-hover: #1a1e28;
  --stroke: rgba(226, 232, 240, .08);
  --stroke-strong: rgba(226, 232, 240, .16);
  --text: #dde3ec;
  --text-strong: #f1f5f9;
  --text-secondary: #8a94a6;
  --text-tertiary: #5c6574;
  --accent: #48d597;
  --accent-hover: #6ee0ab;
  --accent-soft: rgba(72, 213, 151, .08);
  --accent-soft-2: rgba(72, 213, 151, .16);
  --amber: #e6b84d;
  --red: #e06c5e;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --toc-width: 240px;
  --shell-max: 1240px;
  --content-max: 780px;
  --content-max-ch: 70ch;

  color-scheme: dark;
}

/* ---------- fonts (nixpkgs inter + ibm-plex; relative fonts/ paths) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/InterVariable.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("fonts/InterVariable-Italic.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-Italic.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype"); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--surface); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: rgba(226, 232, 240, .18); border-radius: 999px; border: 2px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: rgba(226, 232, 240, .3); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

/* ---------- top bar: full-width sticky, brand + mono breadcrumb ---------- */
#preamble {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
}
.sitebar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
}
.sitebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--text-strong);
  white-space: nowrap;
}
.sitebar .brand-mark { width: 10px; height: 10px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.sitebar .brand a { color: inherit; }
.sitebar .breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sitebar .breadcrumb a { color: var(--text-secondary); }
.sitebar .breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.sitebar .breadcrumb .current { color: var(--text-secondary); }

/* ---------- layout: centered shell (RFD style) ---------- */
/* Pages WITHOUT a TOC (legal pages, short pages): centered single column. */
#content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 40px 64px;
}
/* Pages WITH a TOC: the shell becomes a centered 1240px grid — sticky
   TOC column left, article column right. org-html emits the TOC inside
   #content, after the <header> with h1.title; direct children only. */
#content:has(#table-of-contents) {
  max-width: var(--shell-max);
  display: grid;
  grid-template-columns: var(--toc-width) minmax(0, 1fr);
  column-gap: 48px;
  align-items: start;
}
#content:has(#table-of-contents) > header { grid-column: 2; }
#content:has(#table-of-contents) > #table-of-contents {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding: 0 16px 40px 0;
}
#content:has(#table-of-contents) > .outline-2,
#content:has(#table-of-contents) > .outline-3,
#content:has(#table-of-contents) > .outline-4,
#content:has(#table-of-contents) > .outline-5,
#content:has(#table-of-contents) > .outline-6 {
  grid-column: 2;
  min-width: 0;
}

/* ---------- TOC: mono label + mono links ---------- */
#table-of-contents { margin: 0; }
#table-of-contents h2 {
  margin: 0 0 14px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-tertiary);
}
#table-of-contents ul { list-style: none; margin: 0; padding: 0; }
#table-of-contents li { margin-bottom: 7px; }
#table-of-contents ul ul { margin-left: .9rem; }
#table-of-contents a {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 6px;
}
#table-of-contents a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ---------- hero title (doc-header rule) ---------- */
h1.title, h1#title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-strong);
  line-height: 1.25;
  margin: 0 0 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--stroke-strong);
}

/* ---------- headings; mint mono section numbers ---------- */
h1, h2, h3, h4, h5, h6 { color: var(--text-strong); font-weight: 600; line-height: 1.25; }
.outline-2, .outline-3, .outline-4, .outline-5, .outline-6 { margin-bottom: 40px; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 0 0 14px; }
h3 { font-size: 16px; margin: 28px 0 10px; }
h4 { font-size: 1rem; margin-top: 1.5rem; }
.section-number-2, .section-number-3, .section-number-4, .section-number-5, .section-number-6 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-right: .45em;
}

/* ---------- body copy ---------- */
p { margin: 0 0 14px; max-width: var(--content-max-ch); }
ul, ol { padding-left: 1.5rem; max-width: var(--content-max-ch); }
blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}
blockquote p { margin: 0; }
hr { border: none; border-top: 1px solid var(--stroke); margin: 2rem 0; }
.org-center { text-align: center; }

/* ---------- tables: hairline frame, uppercase mono headers ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
  margin: 6px 0 18px;
}
th {
  background: var(--surface-raise);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--stroke);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--accent-soft); }
caption { caption-side: bottom; color: var(--text-secondary); font-size: .8rem; margin-top: .5rem; }

/* ---------- code ---------- */
code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--surface-raise);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: .15em .35em;
}
pre.src, pre.example {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--surface-raise);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 6px 0 18px;
}
pre.src code, pre.example code { background: none; border: none; padding: 0; font: inherit; }

/* ---------- footer: aligned under the article column ---------- */
#postamble {
  margin-top: 64px;
  border-top: 1px solid var(--stroke);
}
.sitefooter {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 40px 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
}
.sitefooter p { margin: 0; max-width: none; }
.sitefooter a { color: var(--text-secondary); }
.sitefooter a:hover { color: var(--accent); }
/* with a TOC the article column sits right of the 240px sidebar:
   content column left edge = shell-left + 40 (shell padding) + 240 + 48 (gap)
   = calc(50% - 620px) + 328px = calc(50% - 292px) */
#content:has(#table-of-contents) ~ #postamble .sitefooter {
  margin-left: calc(50% - 292px);
  margin-right: auto;
}

/* ---------- responsive: TOC collapses, shell goes single-column ---------- */
@media (max-width: 960px) {
  #content, #content:has(#table-of-contents) {
    display: block;
    max-width: none;
    padding: 32px 20px 56px;
  }
  #table-of-contents { display: none; }
  .sitebar { padding: 0 20px; }
  #content:has(#table-of-contents) ~ #postamble .sitefooter,
  .sitefooter { margin: 0 auto; max-width: none; padding: 20px 20px 32px; }
  h1.title, h1#title { font-size: 24px; }
}

/* ---------- winkelmann.ac minimal landing (2026-08-08 redesign) ---------- */
/* Single-link landing: the brand title reads as a small muted label above
   one large, prominent link.  Only the apex site uses these overrides. */
body { min-height: 100vh; }
#content {
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  text-align: center;
}
#content h1.title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: none;
  padding-bottom: 0;
  margin: 0 0 22px;
}
#content > p {
  max-width: none;
  margin: 0;
}
#content > p a {
  font-size: clamp(1.9rem, 5.5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-strong);
}
#content > p a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 960px) {
  #content { min-height: 88vh; }
}
