/* IT Mode: public site and shared components.
   Design language: Apple-inspired. One blue accent, pill actions, no chrome shadows,
   weights 400 / 600 / 700 only, hairlines, alternating light / parchment / dark surfaces. */

:root {
  --bg: #ffffff;            /* canvas */
  --parchment: #f5f5f7;     /* alternating surface */
  --surface: #ffffff;
  --tile: #272729;          /* dark tile */
  --ink: #1d1d1f;
  --ink-2: #333333;
  --muted: #6e6e73;
  --line: #e0e0e0;          /* hairline */
  --line-soft: #f0f0f0;
  --soft: #f5f5f7;
  --accent: #0066cc;        /* Action Blue: the only interactive colour */
  --accent-hover: #0058b0;
  --accent-focus: #0071e3;
  --accent-soft: #e8f1fb;
  --on-accent: #ffffff;
  --btn-bg: #0066cc;
  --btn-hover: #0071e3;
  --header-bg: rgba(0, 0, 0, 0.8);
  --code-inline: #f5f5f7;
  --danger: #d70015;
  --danger-soft: #fff0f0;
  --ok: #248a3d;
  --ok-soft: #eaf7ee;
  --info-soft: #f5f5f7;
  --scrim: rgba(0, 0, 0, 0.45);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --parchment: #111113;
  --surface: #1d1d1f;
  --tile: #272729;
  --ink: #f5f5f7;
  --ink-2: #d2d2d7;
  --muted: #a1a1a6;
  --line: #333336;
  --line-soft: #262628;
  --soft: #2a2a2c;
  --accent: #2997ff;
  --accent-hover: #5ab3ff;
  --accent-focus: #2997ff;
  --accent-soft: #0b2a47;
  --on-accent: #ffffff;
  --btn-bg: #0071e3;
  --btn-hover: #2997ff;
  --header-bg: rgba(22, 22, 23, 0.8);
  --code-inline: #2a2a2c;
  --danger: #ff453a;
  --danger-soft: #3a1714;
  --ok: #30d158;
  --ok-soft: #12301f;
  --info-soft: #1d1d1f;
  color-scheme: dark;
}

/* Admin pages sit on the parchment surface with white panels */
body.admin { --bg: #f5f5f7; }
:root[data-theme="dark"] body.admin { --bg: #000000; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.47 var(--sans);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.15; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--accent-focus); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--bg); padding: 0.6rem 1.1rem; border-radius: 999px; }
.skip:focus { top: 0.75rem; }
.wrap { width: 100%; max-width: var(--wrap, 72rem); margin-inline: auto; padding-inline: 1.5rem; }
.muted { color: var(--muted); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: inline-flex; }
:root[data-theme="dark"] .only-light { display: none; }

/* ---------- Buttons and form controls (shared with admin) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.35rem; border-radius: 999px; border: 1px solid var(--btn-bg);
  background: var(--btn-bg); color: var(--on-accent); font-weight: 600; font-size: 0.97rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; letter-spacing: -0.01em;
  transition: background-color 0.18s ease-out, border-color 0.18s ease-out, transform 0.18s ease-out;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--on-accent); text-decoration: none; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 0.42rem 0.95rem; font-size: 0.875rem; }
.btn.block { display: flex; width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none;
  border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); cursor: pointer;
  transition: background-color 0.18s ease-out, transform 0.18s ease-out;
}
.icon-btn:hover { background: var(--line); }
.icon-btn:active { transform: scale(0.94); }

.field { margin-bottom: 1.2rem; }
.field label, .field .label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
.field small { display: block; color: var(--muted); margin-top: 0.3rem; font-size: 0.85rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="file"], select, textarea {
  width: 100%; padding: 0.7rem 0.9rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-focus); outline-offset: 0; border-color: var(--accent-focus); }
textarea { resize: vertical; line-height: 1.5; }

.alert { padding: 0.85rem 1.1rem; border-radius: var(--r-md); margin-bottom: 1.2rem; border: 1px solid transparent; font-size: 0.95rem; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.alert.err { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert.info { background: var(--info-soft); color: var(--ink); border-color: var(--line); }

/* ---------- Header: the dark global nav ---------- */
.site-header {
  --ink: #f5f5f7; --ink-2: #d2d2d7; --muted: #a1a1a6; --line: rgba(255, 255, 255, 0.2);
  --surface: rgba(255, 255, 255, 0.14); --soft: rgba(255, 255, 255, 0.14); --bg: #000000;
  --accent: #2997ff; --accent-hover: #5ab3ff;
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); color: var(--ink);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
}
.site-header .icon-btn:hover { background: rgba(255, 255, 255, 0.24); }
.bar { display: flex; align-items: center; gap: 0.6rem; min-height: 3.25rem; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; margin-right: auto; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { flex: none; }
.bm-bg { fill: var(--ink); }
.bm-fg { stroke: var(--bg); }
.bm-led { fill: var(--accent); }
.site-footer .bm-bg, .admin-bar .bm-bg { fill: #1d1d1f; }
.site-footer .bm-fg, .admin-bar .bm-fg { stroke: #f5f5f7; }
:root[data-theme="dark"] .site-footer .bm-bg, :root[data-theme="dark"] .admin-bar .bm-bg { fill: #f5f5f7; }
:root[data-theme="dark"] .site-footer .bm-fg, :root[data-theme="dark"] .admin-bar .bm-fg { stroke: #000000; }
.nav { display: none; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 400; font-size: 0.9rem; padding: 0.5rem 0.8rem; border-radius: 999px; opacity: 0.88; }
.nav a:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.nav-search { display: flex; align-items: center; position: relative; }
.nav-search input { padding: 0.4rem 2.4rem 0.4rem 1rem; font-size: 0.9rem; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #f5f5f7; }
.nav-search input::placeholder { color: #a1a1a6; }
.nav-search input:focus { border: 0; outline: 2px solid #2997ff; }
.nav-search button { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #a1a1a6; padding: 0.4rem; cursor: pointer; border-radius: 50%; }
.nav.open {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem;
  position: absolute; left: 0; right: 0; top: 100%; background: #1d1d1f;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 0.6rem; margin-inline: 0.75rem;
}
.nav.open a { padding: 0.85rem 1rem; font-size: 1rem; }
.nav.open .nav-search { margin-top: 0.4rem; }
.nav.open .nav-search input { width: 100%; padding-block: 0.65rem; font-size: 1rem; }
@media (min-width: 880px) {
  .menu-btn { display: none; }
  .nav { display: flex; align-items: center; gap: 0.15rem; }
  .nav-search { margin-left: 0.5rem; }
  .nav-search input { width: 11rem; }
}

/* ---------- Home: hero and category pills ---------- */
.hero { padding-block: 4.5rem 1.5rem; display: grid; gap: 1.6rem; justify-items: center; text-align: center; }
.hero h1 { font-size: clamp(2.6rem, 9vw, 5rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.hero-sub { margin: 0 auto 1.6rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); line-height: 1.35; color: var(--muted); max-width: 34rem; letter-spacing: -0.015em; }
.hero.compact { padding-block: 3rem 0.75rem; gap: 0.9rem; }
.hero.compact h1 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -0.03em; }
.hero.compact .hero-sub { font-size: 1.05rem; margin: 0.5rem auto 0; }
.hero-side { width: 100%; display: flex; flex-direction: column; align-items: center; }
.search-bar {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; max-width: 32rem;
  background: var(--parchment); border: 1px solid transparent; border-radius: 999px; padding: 0.3rem 0.3rem 0.3rem 1.1rem; color: var(--muted);
  text-align: left;
}
.search-bar:focus-within { outline: 2px solid var(--accent-focus); outline-offset: 2px; }
.search-bar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.55rem 0.2rem; outline: none; color: var(--ink); border-radius: 0; }
.search-bar input:focus { outline: none; }

.ports { display: flex; justify-content: safe center; gap: 0.5rem; overflow-x: auto; padding-block: 1.5rem 1.75rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ports::-webkit-scrollbar { display: none; }
.port {
  display: inline-flex; align-items: center; gap: 0.45rem; flex: none; white-space: nowrap;
  padding: 0.5rem 1.05rem; border: 0; border-radius: 999px; background: var(--parchment);
  color: var(--ink); font-size: 0.93rem; font-weight: 400; text-decoration: none;
  transition: background-color 0.18s ease-out, transform 0.18s ease-out;
}
.port:hover { background: var(--line); color: var(--ink); text-decoration: none; }
.port:active { transform: scale(0.96); }
.port.on { background: var(--btn-bg); color: #ffffff; font-weight: 600; }
.port .count { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.port.on .count { color: inherit; opacity: 0.8; }
.led { display: none; }

/* ---------- Listing: a parchment band ---------- */
.band { background: var(--parchment); }
.listing { padding-block: 3rem 5rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.9rem; margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--muted); letter-spacing: -0.01em; }
.cat { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.cat:hover { text-decoration: underline; }
.sum { color: var(--ink-2); font-size: 1rem; line-height: 1.45; margin: 0; }
.section-title { font-size: 1.75rem; font-weight: 700; margin: 4rem 0 1.5rem; letter-spacing: -0.025em; }
.band .section-title:first-child { margin-top: 0; }

.feature {
  --ink: #f5f5f7; --ink-2: #d2d2d7; --muted: #a1a1a6; --soft: #323235; --accent: #2997ff; --accent-hover: #5ab3ff;
  display: grid; gap: 0; margin-bottom: 0.5rem; background: var(--tile); color: var(--ink);
  border-radius: var(--r-lg); overflow: hidden;
}
.feature-media, .tile-media { display: block; position: relative; overflow: hidden; background: var(--soft); aspect-ratio: 16 / 10; }
.feature-media img, .tile-media img, .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph {
  display: block; background-color: var(--soft);
  background-image: radial-gradient(circle, rgba(128, 128, 134, 0.45) 0 1.8px, transparent 2.4px);
  background-size: 22px 22px; background-position: 11px 11px;
}
.feature-body { padding: 1.75rem 1.5rem 2rem; }
.feature h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.07; letter-spacing: -0.03em; font-weight: 700; margin: 0.15rem 0 0.9rem; text-wrap: balance; }
.feature h2 a, .tile h3 a { color: var(--ink); text-decoration: none; }
.feature h2 a:hover, .tile h3 a:hover { color: var(--accent); text-decoration: none; }
.feature .sum { font-size: 1.1rem; }
.read-more { display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 1.1rem; font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.read-more:hover { text-decoration: underline; }
@media (min-width: 860px) {
  .feature { grid-template-columns: 1.2fr 1fr; align-items: stretch; }
  .feature-media { aspect-ratio: auto; min-height: 22rem; }
  .feature-body { padding: 3rem 2.75rem; align-self: center; }
}

.tiles { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; padding-bottom: 1.6rem; transition: transform 0.24s ease-out; }
.tile:hover { transform: scale(1.012); }
.tile > :not(.tile-media) { margin-inline: 1.5rem; }
.tile-media { margin-bottom: 1.2rem; }
.tile h3 { font-size: 1.3rem; line-height: 1.22; font-weight: 700; letter-spacing: -0.02em; margin: 0 1.5rem 0.5rem; }
.related .tile { padding-top: 1.6rem; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 3.5rem 0 0; }
.pager-info { color: var(--muted); font-size: 0.92rem; }
.empty { text-align: center; padding: 3.5rem 1.5rem; background: var(--surface); border-radius: var(--r-lg); color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 1.5rem; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.empty-page { padding-block: 5rem; --wrap: 40rem; text-align: center; }
.empty-page h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -0.03em; margin-bottom: 0.8rem; }

/* ---------- Around the web ---------- */
.news { padding-block: 1rem 4.5rem; }
.news .section-title { margin-top: 3.5rem; margin-bottom: 0.4rem; }
.news-note { color: var(--muted); margin-bottom: 1.75rem; font-size: 0.95rem; }
.news-grid { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .news-grid { grid-template-columns: 1fr 1fr; } }
.news-col { background: var(--parchment); border-radius: var(--r-lg); padding: 1.5rem 1.6rem 0.8rem; }
.news-col h3 { font-size: 1.15rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.news-col ul { list-style: none; margin: 0; padding: 0; }
.news-col li { padding: 0.85rem 0; border-top: 1px solid var(--line); }
.news-col li:first-child { border-top: 0; }
.news-col a { color: var(--ink); font-weight: 600; line-height: 1.3; display: block; }
.news-col a:hover { color: var(--accent); text-decoration: none; }
.news-src { display: block; margin-top: 0.2rem; font-size: 0.8rem; color: var(--muted); }

/* ---------- Article ---------- */
.progress { position: fixed; z-index: 60; left: 0; right: 0; top: 0; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.post-head { --wrap: 47.5rem; padding-block: 3.5rem 1rem; }
.crumbs { display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); margin-bottom: 1.1rem; }
.crumbs a:not(.cat) { color: var(--muted); }
.post-head h1 { font-size: clamp(2.2rem, 6vw, 3.75rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; margin-bottom: 1rem; text-wrap: balance; }
.lead { font-size: clamp(1.2rem, 2.6vw, 1.5rem); line-height: 1.35; font-weight: 400; color: var(--muted); letter-spacing: -0.015em; margin: 0 0 1.4rem; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1.1rem; color: var(--muted); font-size: 0.9rem; margin: 0; }
.byline .by { color: var(--ink); font-weight: 600; }
.copy-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.8rem; background: var(--parchment); border: 0; border-radius: 999px; color: var(--accent); cursor: pointer; font-size: 0.88rem; font-weight: 600; transition: transform 0.18s ease-out; }
.copy-link:hover { background: var(--line); }
.copy-link:active { transform: scale(0.95); }
.post-cover { --wrap: 62rem; margin-block: 1.75rem 0.75rem; }
/* The one soft drop shadow in the system: it sits under hero imagery */
.post-cover img { width: 100%; border-radius: var(--r-lg); max-height: 34rem; object-fit: cover; box-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0; }
.draft-banner { --wrap: 47.5rem; margin-top: 1.4rem; background: var(--accent-soft); border-radius: var(--r-md); padding-block: 0.7rem; }

.post-body { --wrap: 47.5rem; padding-block: 1.75rem 2.5rem; }
.prose { font-size: 1.1875rem; line-height: 1.65; letter-spacing: -0.016em; color: var(--ink); overflow-wrap: break-word; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.3em; }
.prose h2, .prose h3, .prose h4 { font-weight: 700; letter-spacing: -0.025em; scroll-margin-top: 5rem; text-wrap: balance; }
.prose h2 { font-size: 1.9rem; line-height: 1.15; margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 1.45rem; line-height: 1.2; margin: 1.9em 0 0.5em; }
.prose h4 { font-size: 1.15rem; margin: 1.6em 0 0.4em; }
.prose a { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1.3em; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose blockquote { margin: 1.8em 0; padding: 0.1em 0 0.1em 1.4em; border-left: 3px solid var(--line); color: var(--muted); font-size: 1.1em; line-height: 1.5; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code, .prose kbd { font-family: var(--mono); font-size: 0.85em; letter-spacing: 0; background: var(--code-inline); padding: 0.15em 0.4em; border-radius: 6px; }
.prose kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 0.2em; border-radius: 4px; }
.prose pre {
  position: relative; margin: 1.8em 0; padding: 1.2rem 1.35rem; background: var(--tile); color: #f5f5f7;
  border-radius: var(--r-lg); overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; line-height: 1.65; letter-spacing: 0; tab-size: 4;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy-code { position: absolute; top: 0.6rem; right: 0.6rem; padding: 0.22rem 0.7rem; font: 600 0.78rem var(--sans); color: #f5f5f7; background: rgba(255, 255, 255, 0.12); border: 0; border-radius: 999px; cursor: pointer; }
.copy-code:hover { background: rgba(255, 255, 255, 0.22); }
.prose img { border-radius: var(--r-md); margin: 1.7em auto; }
.prose hr { margin: 2.6em 0; }
.table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.5; letter-spacing: -0.01em; }
.prose th, .prose td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--parchment); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose details { margin: 1.4em 0; padding: 0.85rem 1.1rem; background: var(--parchment); border-radius: var(--r-md); }
.prose summary { cursor: pointer; font-weight: 600; }

.toc { margin: 0 0 1.5rem; }
.toc details { border-radius: var(--r-md); background: var(--parchment); padding: 0.2rem 1.1rem; }
.toc summary { cursor: pointer; font-weight: 600; padding: 0.75rem 0; font-size: 0.95rem; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0.8rem; }
.toc li { margin: 0; }
.toc li.l3 { padding-left: 1rem; }
.toc a { display: block; padding: 0.3rem 0; color: var(--muted); text-decoration: none; font-size: 0.9rem; line-height: 1.35; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a[aria-current="true"] { color: var(--accent); font-weight: 600; }
@media (min-width: 1100px) {
  .has-toc .post-head, .has-toc .post-body { --wrap: 67.5rem; }
  .has-toc .post-head > * { max-width: 44rem; }
  .has-toc .post-body { display: grid; grid-template-columns: minmax(0, 44rem) 15rem; column-gap: 5rem; }
  .has-toc .prose { grid-column: 1; grid-row: 1; }
  .toc { grid-column: 2; grid-row: 1; position: sticky; top: 5rem; align-self: start; margin: 0; max-height: calc(100vh - 7rem); overflow-y: auto; }
  .toc details { border-radius: 0; background: transparent; padding: 0; }
  .toc summary { list-style: none; cursor: default; pointer-events: none; padding-top: 0; }
  .toc summary::-webkit-details-marker { display: none; }
  .toc ol { border-left: 1px solid var(--line); padding: 0 0 0 0.9rem; }
}

.post-nav { --wrap: 47.5rem; display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.pn { display: block; padding: 1.1rem 1.4rem; border-radius: var(--r-lg); color: var(--ink); text-decoration: none; background: var(--parchment); transition: background-color 0.18s ease-out, transform 0.18s ease-out; }
.pn:hover { background: var(--line); color: var(--ink); text-decoration: none; }
.pn:active { transform: scale(0.98); }
.pn small { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 0.2rem; }
.pn span { font-weight: 600; line-height: 1.3; display: block; }
.pn.older { text-align: right; }
.related { padding-block: 2rem 4rem; }
.related .tile { background: var(--parchment); }

/* ---------- Auth (login, setup) ---------- */
.auth { display: grid; place-items: center; padding: 4rem 1.5rem; min-height: 70vh; background: var(--parchment); }
.auth-box { width: 100%; max-width: 26rem; background: var(--surface); border-radius: var(--r-lg); padding: 2.25rem 2rem; }
.auth-box h1 { font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 0.3rem; }
.auth-sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth-back { text-align: center; margin: 1.2rem 0 0; font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--parchment); border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--muted); font-size: 0.85rem; }
.foot { display: grid; gap: 1.4rem; }
.foot-about p { margin: 0.6rem 0 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.copy { margin: 0; font-size: 0.8rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .foot { grid-template-columns: 1fr auto; align-items: start; }
  .copy { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .tile:hover, .btn:active, .port:active, .icon-btn:active { transform: none; }
}
@media print {
  .site-header, .site-footer, .toc, .post-nav, .related, .progress, .copy-link, .copy-code, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; font-size: 12pt; }
}
