/* ═══════════════════════════════════════════════
   SHED STACK — design system
   workshop editorial · butcher-paper cream ·
   ink green · sage · coral · blueprint grid
   ═══════════════════════════════════════════════ */

:root {
  /* surfaces */
  --paper:          #faf6ef;
  --paper-deep:     #f2ecdd;
  --panel:          #fdfaf3;
  --ink:            #22261f;
  --ink-soft:       #4c554a;
  --ink-faint:      #77806f;

  /* brand */
  --sage:           #5c6f5e;
  --sage-deep:      #44543f;
  --coral:          #de6b4f;
  --amber:          #c98f2a;

  /* lines */
  --line:           #e3d9c6;
  --line-strong:    #d3c6ae;

  /* type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* rhythm */
  --maxw: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.75rem);
  --radius: 10px;

  --shadow-1: 0 1px 2px rgba(34,38,31,.06), 0 4px 16px rgba(34,38,31,.05);
  --shadow-2: 0 2px 4px rgba(34,38,31,.07), 0 14px 34px rgba(34,38,31,.10);

  --ease: cubic-bezier(.22,.68,.32,1);
}

/* ══ DARK THEME ══
   Activated by data-theme="dark" on <html>, toggled via the header button
   and persisted in localStorage. The dark palette keeps the workshop feel:
   ink surfaces, faint blueprint grid, sage + coral accents. */
html[data-theme="dark"] {
  --paper:        #171a16;
  --paper-deep:   #10130e;
  --panel:        #1e221c;
  --ink:          #e8ecdf;
  --ink-soft:     #c4cbb9;
  --ink-faint:    #8b9482;
  --sage:         #7e9980;
  --sage-deep:    #9bb19c;
  --coral:        #e07a5f;
  --amber:        #d9a74f;
  --line:         #2b2f27;
  --line-strong:  #383d31;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--sage-deep); color: var(--paper);
  padding: .75rem 1.25rem; font-weight: 600; z-index: 100;
}
.skip:focus { left: 0; }

/* ── typography helpers ─────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .6rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(222,107,79,.18);
}

/* ── buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .8rem 1.35rem; border-radius: var(--radius);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.btn-primary { background: #3a4a35; color: #f4efe3; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: #2f3d2b; transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ══ HEADER ══ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,246,239,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand-mark { color: var(--sage-deep); transition: transform .3s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.06); }
.brand-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.25rem; letter-spacing: .02em;
}
.brand-stack { color: var(--coral); font-weight: 600; }

.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2rem); }
.site-nav a { font-weight: 500; font-size: .95rem; color: var(--ink-soft); position: relative; }
.site-nav a:hover { color: var(--ink); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--coral); transition: width .25s var(--ease);
}
.site-nav a:hover::after { width: 100%; }
.nav-rss { display: inline-flex; align-items: center; gap: .35rem; }
.nav-rss svg { color: var(--coral); }
.nav-active { color: var(--ink) !important; }
.nav-active::after { width: 100% !important; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--ink-soft); width: 32px; height: 32px; cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--coral); color: var(--ink); transform: translateY(-1px); }
.theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: inline; }

/* ══ HERO ══ */
.hero { position: relative; padding: clamp(3.5rem, 8vw, 6rem) 0 4.5rem; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at 58% 30%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse at 58% 30%, #000 0%, transparent 72%);
}
.hero-inner {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  line-height: 1.03; letter-spacing: -.015em;
  margin: 0 0 1.25rem;
}
.hero-title em { font-style: italic; color: var(--sage-deep); }
.hero-sub { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 1.75rem; }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

/* status board */
.statusboard {
  background: #171a15;
  color: #d7ddcf;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(0,0,0,.4);
  overflow: hidden;
  font-family: var(--font-mono);
  border: 1.5px solid #000;
  position: relative;
}
.statusboard::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%, rgba(0,0,0,.25));
  pointer-events: none;
}
.statusboard-bar {
  display: flex; align-items: center; gap: .45rem;
  background: #171a15; padding: .6rem .9rem; border-bottom: 1px solid #2b2f27;
}
.statusboard-file { margin-left: .5rem; font-size: .72rem; color: #7c8574; letter-spacing: .05em; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; }
.dot-r { background: #df5c45; } .dot-y { background: #caa23a; } .dot-g { background: #57a05c; }
.statusboard-body { padding: 1rem 1.1rem 1.1rem; position: relative; z-index: 1; }
.board-tag { margin: 0 0 .9rem; font-size: .74rem; color: #9aa58b; letter-spacing: .08em; }
.board-line {
  display: grid; grid-template-columns: 1.8rem minmax(0,1fr) auto auto auto;
  column-gap: .6rem; align-items: baseline;
  padding: .34rem 0; font-size: .8rem;
  border-bottom: 1px dashed #2c3229;
}
.board-line > * { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-line:last-of-type { border-bottom: none; }
.board-line.dim { opacity: .45; }
.l-date { color: #5d6655; }
.l-name { font-weight: 600; color: #e8ecdf; }
.l-name.heartbeat { animation: pulse 2.2s ease-in-out infinite; color: #9fd39a; }
.l-op { color: #8b9482; font-size: .72rem; }
.l-meta { color: #5d6655; font-size: .68rem; }
.l-state {
  font-size: .66rem; padding: .12rem .42rem; border-radius: 999px; font-weight: 600;
  letter-spacing: .05em; white-space: nowrap;
}
.l-state.ok { background: #1f3a22; color: #7fe08a; }
.l-state.warn { background: #3a3118; color: #e0c16f; }
.l-state.off { background: #351d19; color: #e08a6f; }
.board-cursor { margin: .5rem 0 0; font-size: 1rem; color: var(--coral); animation: blink 1.05s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.statusboard-foot {
  background: #171a15; color: #6d7665; font-size: .7rem; letter-spacing: .18em;
  padding: .5rem .9rem; border-top: 1px solid #2b2f27; text-align: right;
}

/* ══ STRIP ══ */
.strip { border-block: 1px solid var(--line); background: var(--paper-deep); }
.strip-inner {
  display: flex; flex-wrap: wrap; gap: .75rem 2.4rem;
  justify-content: center; padding-block: 1.15rem;
}
.strip-item { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; color: var(--ink-soft); }
.strip-k { color: var(--coral); margin-right: .5rem; font-weight: 600; }

/* ══ SECTIONS ══ */
.section { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.section-alt { background: var(--paper-deep); border-block: 1px solid var(--line); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); flex-wrap: wrap;
}
.section-heading { display: flex; flex-direction: column; }
.section-heading .eyebrow { margin-bottom: .5rem; }
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.05; margin: 0;
}
.section-more {
  font-family: var(--font-mono); font-size: .85rem; color: var(--sage-deep); font-weight: 600;
  border-bottom: 1.5px dashed transparent; position: relative;
}
.section-more:hover { border-color: var(--coral); color: var(--coral); }

/* �═ BLOG LIST �═ */
.postlist { list-style: none; margin: 0; padding: 0; }
.post { border-top: 1px solid var(--line); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post-link { display: block; padding: 1.5rem .25rem; position: relative; }
.post-link::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--coral); transform: scaleY(0); transition: transform .25s var(--ease); transform-origin: bottom;
}
.post-link:hover::before { transform: scaleY(1); }
.post-row { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; }
.post-no { font-family: var(--font-mono); font-size: .9rem; color: var(--coral); opacity: .8; padding-top: .3rem; }
.post-tags { display: flex; gap: .45rem; margin-bottom: .55rem; }
.tag {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em;
  text-transform: uppercase; padding: .22rem .55rem; border-radius: 999px; font-weight: 600;
}
.tag-sage { background: #e7ece3; color: var(--sage-deep); border: 1px solid #d3dccb; }
.tag-coral { background: #fbe9e2; color: #b04a2f; border: 1px solid #f3cdbd; }
.post-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.42rem;
  line-height: 1.2; margin: 0 0 .45rem; letter-spacing: -.01em;
}
.post-link:hover .post-title { color: var(--sage-deep); }
.post-excerpt { margin: 0 0 .65rem; color: var(--ink-soft); max-width: 62ch; }
.post-meta { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-faint); }
.readmore { color: var(--sage-deep); font-weight: 600; }
.post-link:hover .readmore { color: var(--coral) }

/* �═ PROJECTS �═ */
.projgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.proj {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column; align-items: flex-start;
  box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  position: relative; overflow: hidden;
}
.proj::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, rgba(222,107,79,.14), transparent 70%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.proj:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.proj:hover::after { opacity: 1; }
.proj-no { font-family: var(--font-mono); font-size: .74rem; color: var(--coral); margin-bottom: .9rem; }
.proj-ico { color: var(--sage-deep); margin-bottom: 1rem; }
.proj-name { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; margin: 0 0 .4rem; }
.proj-desc { font-size: .9rem; color: var(--ink-soft); margin: 0 0 1.1rem; flex: 1; }
.proj-state {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: auto;
}
.dotk { width: .55rem; height: .55rem; border-radius: 50%; }
.dotk.on { background: #5aa35c; box-shadow: 0 0 0 3px rgba(90,163,92,.18); }
.dotk.wait { background: var(--amber); box-shadow: 0 0 0 3px rgba(201,143,42,.18); }

/* ══ THE STACK ══ */
.stack-cols { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(2rem, 5vw, 3.6rem); align-items: stretch; }
.stack-cols .about-card { order: 1; }
.stack-cols .stack-diagram { order: 2; }

/* homelab diagram */
.stack-diagram {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column;
}
.diagram-title {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); padding: .85rem 1.2rem; border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}
.diagram-led { width: .6rem; height: .6rem; border-radius: 50%; background: #5aa35c; box-shadow: 0 0 0 3px rgba(90,163,92,.18); }
.diagram-body { padding: 1.4rem 1.2rem; display: flex; flex-direction: column; align-items: stretch; gap: .55rem; }

/* ── realistic flow topology ── */
.node-row { display: flex; gap: .6rem; }
.node-row.split { justify-content: space-between; }
.flow-arrow { color: var(--coral); align-self: center; display: flex; }
.node {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .05rem;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: .55rem .9rem; flex: 1 1 auto; min-width: 0;
}
.node-ico { color: var(--sage-deep); margin-bottom: .15rem; }
.node-name { font-weight: 600; font-size: .9rem; color: var(--ink); }
.node-sub { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-faint); letter-spacing: .02em; }

/* tinted roles */
.node-wan { background: #eef1e9; border-color: #d3dccb; }
.node-gate { background: #fbe9e2; border-color: #f3cdbd; }
.node-dns { background: #eef1e9; border-color: #d3dccb; }
.node-core.node-wide { background: #e4ece0; border-color: #c4d2ba; box-shadow: inset 0 0 0 1px rgba(92,111,94,.12); }

/* shared fabric bus */
.flow-bus { display: flex; align-items: center; gap: .55rem; margin: .1rem 0; }
.flow-bus .bus-line { flex: 1; height: 1.5px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 5px, transparent 5px 8px); }
.flow-bus .bus-label { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }

/* child services on the fabric */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .5rem; }
.service-grid .node { padding: .5rem .4rem; background: #f4efe3; }

.diagram-note {
  margin: .7rem 0 0; font-family: var(--font-mono); font-size: .72rem; color: var(--ink-faint);
  letter-spacing: .03em; text-align: right;
}

.about-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow-1); align-self: stretch;
}
.about-card-label {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--coral); margin: 0 0 1rem;
}
.spec { margin: 0; }
.spec-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px dashed var(--line-strong);
}
.spec-row:last-child { border-bottom: none; }
.spec-row dt { color: var(--ink-faint); font-size: .85rem; }
.spec-row dd { margin: 0; font-weight: 600; font-size: .9rem; text-align: right; }

/* ══ FOOTER ══ */
.site-footer { background: var(--ink); color: #bcc2b2; padding-block: 3rem; margin-top: 1px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.footer-brand { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #e8ecdf; letter-spacing: .04em; display: inline-flex; align-items: center; }
.footer-brand svg { flex: none; }
.footer-brand span { color: var(--coral); }
.footer-note { margin: 0; font-size: .85rem; color: #8a9280; width: 100%; order: 3; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.statusdot { width: .55rem; height: .55rem; border-radius: 50%; background: #5aa35c; box-shadow: 0 0 0 3px rgba(90,163,92,.18); flex: none; }
.footer-links { display: flex; gap: 1.4rem; }
.footer-links a { font-size: .85rem; color: #a9b0a1; font-weight: 500; }
.footer-links a:hover { color: #e8ecdf; }

/* ╕═ POST PAGE ╕═ */
.post-page { max-width: 720px; margin-inline: auto; padding-top: 3rem; }
.post-page h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; letter-spacing: -.015em; margin: .4rem 0 1rem; }
.post-page .post-excerpt { font-size: 1.2rem; color: var(--ink-soft); max-width: none; }
.post-page p { color: var(--ink-soft); font-size: 1.06rem; }
.post-page h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin-top: 2.6rem; color: var(--ink); }
.post-page code { font-family: var(--font-mono); font-size: .88em; background: var(--paper-deep); padding: .15em .4em; border-radius: 5px; border: 1px solid var(--line); }
.post-page pre.code {
  font-family: var(--font-mono); font-size: .88em; line-height: 1.6;
  background: var(--paper-deep); border: 1px solid var(--line); border-left: 3px solid var(--coral);
  padding: 1rem 1.1rem; border-radius: 8px; overflow-x: auto; color: var(--ink-soft);
}
.post-hero { padding-top: clamp(3rem, 7vw, 4.5rem); }
.post-tags, .post-meta { margin-bottom: .6rem; }

/* ══ POSTS ARCHIVE ══ */
.archive-inner { max-width: 860px; }

/* workshop filter board */
.archive-board {
  background: #171a15; color: #d7ddcf; border: 1px solid #000; border-radius: var(--radius);
  box-shadow: var(--shadow-2); overflow: hidden; margin: 0 0 2rem; position: relative;
}
.archive-board .board-bar {
  display: flex; align-items: center; gap: .45rem;
  background: #171a15; padding: .55rem .85rem; border-bottom: 1px solid #2b2f27;
}
.archive-board .board-bar .dot { width: .65rem; height: .65rem; border-radius: 50%; }
.archive-board .board-file { margin-left: .5rem; font-family: var(--font-mono); font-size: .72rem; color: #7c8574; letter-spacing: .05em; }
.archive-board .board-body { display: flex; flex-direction: column; gap: .8rem; padding: 1rem 1.1rem 1.1rem; }
.searchbox {
  display: flex; align-items: center; gap: .55rem;
  background: #10130e; border: 1px solid #2b2f27; border-radius: 8px; padding: .6rem .8rem;
}
.searchbox:focus-within { border-color: var(--coral); }
.searchbox .prompt { font-family: var(--font-mono); font-weight: 600; color: var(--coral); font-size: .95rem; }
.searchbox input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-mono); font-size: .9rem; color: #e8ecdf;
}
.searchbox input::placeholder { color: #74806c; }
.searchbox input::-webkit-search-cancel-button { filter: invert(.6); cursor: pointer; }
.board-row { display: flex; align-items: flex-start; gap: .8rem; }
.board-label {
  flex: none; width: 4.2rem; padding-top: .3rem;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #7c8574;
}
.tagfilters { display: flex; flex-wrap: wrap; gap: .4rem; }
.tagfilter {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .02em; text-transform: uppercase;
  padding: .28rem .5rem; border-radius: 6px; cursor: pointer;
  background: #1d211a; border: 1px solid #343930; color: #9aa58b;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.tagfilter::before { content: "+ "; color: #5d6655; margin-right: .1rem; }
.tagfilter:hover { border-color: var(--coral); color: #e8ecdf; }
.tagfilter[aria-pressed="true"] { background: #3a3118; border-color: #c98f2a; color: #ecd9a0; }
.tagfilter[aria-pressed="true"]::before { content: "✓ "; color: #e0c16f; }
.archive-stats { margin: 0; font-family: var(--font-mono); font-size: .74rem; color: #9aa58b; line-height: 1.7; }
.archive-stats b { color: #e8ecdf; font-weight: 600; }
.archive-stats .accent { color: var(--coral); }
.archive-empty {
  font-family: var(--font-mono); font-size: .85rem; color: var(--ink-faint); text-align: center;
  padding: 2.5rem 0; border-top: 1px dashed var(--line);
}

/* grid children must be allowed to shrink to stop overflow */
.hero-inner, .stack-cols, .post-row, .projgrid, .board-line > * { min-width: 0; }

/* responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .stack-cols { grid-template-columns: 1fr; }
  .site-nav { gap: 1rem; }
  .nav-rss span { display: none; }
  .statusboard { max-width: 520px; }
}
@media (max-width: 560px) {
  .brand { gap: .35rem; }
  .brand-name { font-size: 1.0rem; }
  .brand-mark { width: 24px; height: 24px; }
  .site-nav { gap: .3rem; }
  .site-nav a { font-size: .74rem; }
  .nav-rss { gap: 0; }
  .nav-rss span { display: none; }
  .nav-rss .rss-label { display: none; }
  .nav-rss svg { width: 15px; height: 15px; }
  .theme-toggle { width: 27px; height: 27px; }
  .theme-toggle svg { width: 15px; height: 15px; }
  .post-row { grid-template-columns: 2rem 1fr; }
  /* status board tightens: drop the meta column, keep name/op/state */
  .board-line { grid-template-columns: 1.4rem minmax(0,1fr) auto auto; }
  .board-line .l-meta { display: none; }
  .hero-title { font-size: clamp(2.1rem, 10vw, 2.7rem); }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .strip-inner { gap: .5rem 1.4rem; }
}
@media (max-width: 380px) {
  .site-nav { gap: .25rem; }
  .site-nav a { font-size: .7rem; }
  .nav-rss { font-size: 0; }
  .nav-rss svg { width: 17px; height: 17px; }
  .theme-toggle { width: 26px; height: 26px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ══ DARK OVERRIDES ══
   Components that hardcode light colors (won't inherit the dark vars above). */
html[data-theme="dark"] body::before { opacity: .12; }
html[data-theme="dark"] .site-header {
  background: rgba(23,26,22,.86);
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .site-footer { background: #10130e; color: #c4cbb9; }
html[data-theme="dark"] .btn-primary { background: #2f3d2b; color: #f4efe3; }
html[data-theme="dark"] .btn-primary:hover { background: #3a4a35; }
html[data-theme="dark"] .btn-ghost { color: var(--ink); border-color: var(--line-strong); }
html[data-theme="dark"] .btn-ghost:hover { border-color: var(--ink); }
html[data-theme="dark"] .strip { background: var(--paper-deep); border-color: var(--line); }
/* tags */
html[data-theme="dark"] .tag-sage { background: #24301f; color: #cfe0c8; border-color: #3a4a35; }
html[data-theme="dark"] .tag-coral { background: #3a201a; color: #f0b5a4; border-color: #5a3327; }
/* project cards + hero post hover */
html[data-theme="dark"] .proj { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .proj:hover { border-color: var(--line-strong); }
/* stack diagram blocks + about card */
html[data-theme="dark"] .about-card,
html[data-theme="dark"] .stack-diagram,
html[data-theme="dark"] .block { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .block-core, html[data-theme="dark"] .block-storage,
html[data-theme="dark"] .block-home { background: #22301f; border-color: #35502f; }
html[data-theme="dark"] .block-net, html[data-theme="dark"] .block-metrics { background: #22301f; border-color: #35502f; }
html[data-theme="dark"] .block-sdr { background: #3a201a; border-color: #5a3327; }
html[data-theme="dark"] .service-grid .node,
html[data-theme="dark"] .node { background: var(--panel); border-color: var(--line-strong); }
html[data-theme="dark"] .node-wan, html[data-theme="dark"] .node-dns { background: #22301f; border-color: #35502f; }
html[data-theme="dark"] .node-gate { background: #3a201a; border-color: #5a3327; }
html[data-theme="dark"] .node-core.node-wide { background: #24301f; border-color: #35502f; }
html[data-theme="dark"] .diagram-title { background: var(--paper-deep); border-color: var(--line); }
html[data-theme="dark"] .flow-bus .bus-line { background: repeating-linear-gradient(90deg, var(--line-strong) 0 5px, transparent 5px 8px); }
/* eyebrows + spec */

/* ══ LIGHT-TERMINAL BOARDS IN DARK MODE ══
   The statusboard + archive filter board flip to a light cream "terminal"
   against the dark page, so they pop the way they do in light mode. */
html[data-theme="dark"] .statusboard,
html[data-theme="dark"] .archive-board {
  background: #f4efe3; color: #22261f; border-color: #d3c6ae;
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(0,0,0,.25);
}
/* title bars */
html[data-theme="dark"] .statusboard::after { background: linear-gradient(180deg, rgba(0,0,0,.02), transparent 30%, rgba(0,0,0,.06)); }
html[data-theme="dark"] .statusboard-bar,
html[data-theme="dark"] .archive-board .board-bar {
  background: #e9e1cf; border-bottom-color: #d3c6ae;
}
html[data-theme="dark"] .statusboard-file,
html[data-theme="dark"] .archive-board .board-file,
html[data-theme="dark"] .board-tag { color: #6f6a5c; }
/* status board rows */
html[data-theme="dark"] .board-line { border-bottom-color: #d9cdb4; }
html[data-theme="dark"] .l-date { color: #9a8f78; }
html[data-theme="dark"] .l-name { color: #22261f; }
html[data-theme="dark"] .l-name.heartbeat { color: #4a7c3a; }
html[data-theme="dark"] .l-op { color: #6f6a5c; }
html[data-theme="dark"] .l-meta { color: #9a8f78; }
html[data-theme="dark"] .l-state.ok { background: #dcebda; color: #2f6b3a; }
html[data-theme="dark"] .l-state.warn { background: #f4ead1; color: #8a6d1e; }
html[data-theme="dark"] .l-state.off { background: #f4dcd5; color: #a34a30; }
html[data-theme="dark"] .statusboard-foot {
  background: #e9e1cf; color: #8a8371; border-top-color: #d3c6ae;
}
/* archive search box */
html[data-theme="dark"] .archive-board .searchbox {
  background: #fffcf5; border-color: #d3c6ae;
}
html[data-theme="dark"] .archive-board .searchbox input { color: #22261f; }
html[data-theme="dark"] .archive-board .searchbox input::placeholder { color: #a29a86; }
html[data-theme="dark"] .archive-board .board-label { color: #8a8371; }
/* archive tag chips */
html[data-theme="dark"] .archive-board .tagfilter {
  background: #fffcf5; border-color: #d3c6ae; color: #554e3e;
}
html[data-theme="dark"] .archive-board .tagfilter::before { color: #9a8f78; }
html[data-theme="dark"] .archive-board .tagfilter:hover { border-color: var(--coral); color: #22261f; }
html[data-theme="dark"] .archive-board .tagfilter[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: #fffaf0; }
html[data-theme="dark"] .archive-board .tagfilter[aria-pressed="true"]::before { color: #fff; }
/* archive stats */
html[data-theme="dark"] .archive-board .archive-stats { color: #6f6a5c; }
html[data-theme="dark"] .archive-board .archive-stats b { color: #22261f; }
html[data-theme="dark"] .post-link:hover .post-title,
html[data-theme="dark"] .post-link:hover .readmore { color: var(--coral); }