/* ==========================================================================
   HERMESNET (hermesnet.xyz) — Uncommon Web / Teknium Edition
   Inspired by https://webdev.teknium.io/ & https://teknium.io/
   Techniques integrated:
     01. dithercn — Bayer 8x8 & 4x4 ordered-dither canvas fields & hatched UI
     02. AnsiLove.js — 80x25 CP437 VGA BBS art viewer + SAUCE00 + baud dialer
     03. drawille-canvas / glyphcss — 2x4 subpixel Unicode Braille 3D meshes
     04. crt-terminal / vault66-crt — Interactive phosphor shell & CRT rack
     05. The Monospace Web / WebTUI — Exposed character-grid lattice & boxes
     06. split-flap-elements — Mechanical Solari departures status cells
   Zero external CDNs · Zero build step · WCAG AA · prefers-reduced-motion safe
   ========================================================================== */

@font-face {
  font-family: 'IS fb';
  src: local('Instrument Serif'), local('Times New Roman'), local('TimesNewRomanPSMT'), local('Liberation Serif'), local('Tinos'), local('Georgia');
  size-adjust: 86%;
  ascent-override: 115%;
  descent-override: 35%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'IS fb';
  font-style: italic;
  src: local('Instrument Serif Italic'), local('Times New Roman Italic'), local('TimesNewRomanPS-ItalicMT'), local('Liberation Serif Italic'), local('Tinos Italic'), local('Georgia Italic');
  size-adjust: 88%;
  ascent-override: 113%;
  descent-override: 35%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Geist fb';
  src: local('Geist'), local('Inter'), local('Arial'), local('Liberation Sans'), local('DejaVu Sans');
  size-adjust: 100%;
}
@font-face {
  font-family: 'GM fb';
  src: local('Geist Mono'), local('JetBrains Mono'), local('IBM Plex Mono'), local('Fira Code'), local('DejaVu Sans Mono'), local('Liberation Mono'), local('Courier New');
  size-adjust: 99.5%;
}

:root {
  --bg: #0b0b0c;
  --bg2: #111113;
  --card: #121214;
  --card-hi: #17171a;
  --line: #232327;
  --line2: #2e2e33;
  --ink: #ece8e1;
  --ink-soft: #cfcac2;
  --mut: #8d8a84;
  --dim: #5c5a56;

  /* Teknium Uncommon Web + CGA BBS Accents */
  --acid: #d4ff4f;
  --acid-rgb: 212, 255, 79;
  --cyan: #5ee7ff;
  --cyan-rgb: 94, 231, 255;
  --green: #3dffa8;
  --green-rgb: 61, 255, 168;
  --magenta: #ff6fae;
  --rose: #ff8f7a;
  --amber: #ffcf6a;
  --blue: #8fb0ff;
  --purple: #c9a8ff;
  --danger: #ff5f56;

  --serif: 'Instrument Serif', 'IS fb', Georgia, 'Times New Roman', serif;
  --sans: 'Geist', 'Geist fb', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', 'GM fb', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bar-h: 58px;
  --stick: 98px;
  --max-w: 1320px;
}

/* CGA Cyan/Magenta Palette Mode */
html[data-palette="cga"] {
  --acid: #5ee7ff;
  --acid-rgb: 94, 231, 255;
  --blue: #ff6fae;
  --rose: #3dffa8;
}

/* Phosphor Amber Mode */
html[data-palette="amber"] {
  --acid: #ffb000;
  --acid-rgb: 255, 176, 0;
  --cyan: #ffd269;
  --green: #ffb000;
}

/* Light Theme (Field Manual / Printout Ink Mode) */
html[data-theme="light"] {
  --bg: #f2eee6;
  --bg2: #e7e2d8;
  --card: #ebe6dc;
  --card-hi: #e2ddd2;
  --line: #cfc9bc;
  --line2: #b8b1a3;
  --ink: #141413;
  --ink-soft: #2c2b29;
  --mut: #57544e;
  --dim: #78746c;
  --acid: #1b6b3a;
  --acid-rgb: 27, 107, 58;
  --cyan: #005a78;
  --green: #0d6832;
  --magenta: #9e1958;
  --rose: #a83820;
  --amber: #8a5600;
  --blue: #1f4aa8;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font: 15px/1.55 var(--sans);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

::selection {
  background: var(--acid);
  color: #000;
}

code, pre, kbd, samp, .mono {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 999;
  background: var(--acid);
  color: #000;
  font: 600 12px var(--mono);
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
}
.skip-link:focus {
  left: 12px;
}

/* ---------- The Monospace Web Debug Grid Overlay ---------- */
body.show-grid::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(212, 255, 79, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 255, 79, 0.07) 1px, transparent 1px);
  background-size: 1ch 1.55rem;
}

/* ---------- CRT Filter Rack Overlay (pixi-filters / vault66-crt) ---------- */
body.crt-on::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.26) 50%),
    radial-gradient(circle at 50% 50%, transparent 68%, rgba(0, 0, 0, 0.38) 100%);
  background-size: 100% 3px, 100% 100%;
}
html[data-theme="light"] body.crt-on::after {
  background:
    linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.06) 50%);
  background-size: 100% 3px;
}

/* ---------- Sticky Bar (exact webdev.teknium.io .bar) ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 11, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .bar {
  background: rgba(242, 238, 230, 0.94);
}

.bar-in {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  min-height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font: 400 24px/1 var(--serif);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.brand i {
  color: var(--acid);
  font-style: italic;
}
.brand-z99 {
  font: 500 10px/1 var(--mono);
  color: #000;
  background: var(--acid);
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html[data-theme="light"] .brand-z99 {
  color: #fff;
}

.navrow {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
.navrow::-webkit-scrollbar {
  display: none;
}
.navrow a {
  flex: none;
  font: 13px/1 var(--sans);
  color: var(--mut);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.navrow a:hover {
  color: var(--ink);
  border-color: var(--line2);
}
.navrow a.on,
.navrow a[aria-current="page"] {
  color: #000;
  background: var(--acid);
  font-weight: 500;
}
html[data-theme="light"] .navrow a.on,
html[data-theme="light"] .navrow a[aria-current="page"] {
  color: #fff;
}
.navrow a .g {
  opacity: 0.8;
  margin-right: 5px;
  font-family: var(--mono);
}

/* Filters / Hardware Rack Strip under Bar */
.filters {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px 10px;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
.filters::-webkit-scrollbar {
  display: none;
}
.filters .lbl {
  flex: none;
  font: 11px var(--mono);
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 4px;
}
.chip {
  flex: none;
  white-space: nowrap;
  font: 11.5px/1 var(--mono);
  color: var(--mut);
  background: none;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--mut);
}
.chip.on,
.chip[aria-pressed="true"] {
  color: #000;
  background: var(--ink);
  border-color: var(--ink);
}
html[data-theme="light"] .chip.on,
html[data-theme="light"] .chip[aria-pressed="true"] {
  color: #fff;
}
.chip .n {
  opacity: 0.6;
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ---------- Hero: Bayer 8x8 Ordered-Dither Field + 3D Globe ---------- */
.hero {
  position: relative;
  min-height: min(84vh, 790px);
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: #070708;
}
html[data-theme="light"] .hero {
  background: #e5e0d5;
}

#herofx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0.92;
  cursor: crosshair;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 11, 12, 0.88) 0%, rgba(11, 11, 12, 0.62) 44%, rgba(11, 11, 12, 0.08) 76%),
    linear-gradient(180deg, rgba(11, 11, 12, 0.1) 0%, rgba(11, 11, 12, 0.25) 48%, rgba(11, 11, 12, 0.94) 86%, var(--bg) 100%);
  pointer-events: none;
}
html[data-theme="light"] .hero::after {
  background:
    linear-gradient(90deg, rgba(242, 238, 230, 0.92) 0%, rgba(242, 238, 230, 0.68) 46%, rgba(242, 238, 230, 0.1) 78%),
    linear-gradient(180deg, rgba(242, 238, 230, 0.05) 0%, rgba(242, 238, 230, 0.92) 86%, var(--bg) 100%);
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 42px 28px 48px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 32px;
  align-items: end;
}

.kick {
  font: 500 12px/1.3 var(--mono);
  text-shadow: 0 0 8px var(--bg), 0 0 2px var(--bg);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.kick b {
  color: var(--acid);
  font-weight: 500;
}
.kick a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--mut);
}
.kick a:hover {
  color: var(--acid);
  border-color: var(--acid);
}

.hero h1 {
  font: 400 clamp(56px, 9.5vw, 134px)/0.88 var(--serif);
  letter-spacing: -0.02em;
  margin: 18px 0 20px;
  max-width: 6.8em;
}
.hero h1 em {
  font-style: italic;
  color: var(--acid);
}

.hero p.lede {
  font-size: clamp(15.5px, 1.45vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 42em;
  margin: 0 0 24px;
}
.hero p.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

/* Bayer Dither-accented Buttons (dithercn dither-button) */
.btn-dither {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--acid);
  background: var(--acid);
  color: #000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
html[data-theme="light"] .btn-dither {
  color: #fff;
}
.btn-dither:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(var(--acid-rgb), 0.4);
}
.btn-ghost {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(18, 18, 20, 0.8);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
html[data-theme="light"] .btn-ghost {
  background: rgba(235, 230, 220, 0.85);
}
.btn-ghost:hover {
  border-color: var(--acid);
  color: var(--acid);
}

/* Hero ASCII Winged-Sandal Badge Box */
.hero-ascii-card {
  background: rgba(11, 11, 12, 0.84);
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
html[data-theme="light"] .hero-ascii-card {
  background: rgba(235, 230, 220, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
.hero-ascii-pre {
  margin: 0;
  padding: 14px 16px;
  font: 11px/1.22 var(--mono);
  color: var(--acid);
  overflow-x: auto;
  white-space: pre;
}
.hero-ascii-pre .c-cyan { color: var(--cyan); }
.hero-ascii-pre .c-mag  { color: var(--magenta); }
.hero-ascii-pre .c-amb  { color: var(--amber); }
.hero-ascii-pre .c-mut  { color: var(--mut); }
/* BBS logo: 80 columns, scaled to fill the card at any width (mono glyph ~0.6em) */
.hero-ascii-card { container-type: inline-size; }
.hero-ascii-card .hero-ascii-pre {
  font-size: min(14px, calc((100cqw - 32px) / 48.6));
  line-height: 1.15;
  overflow-x: hidden;
  color: #aaaaaa;
}
.hero-ascii-pre .a-w  { color: #aaaaaa; }
.hero-ascii-pre .a-hw { color: #ffffff; }
.hero-ascii-pre .a-b  { color: #2f4fd8; }
.hero-ascii-pre .a-c  { color: #00aaaa; }
.hero-ascii-pre .a-hc { color: #55ffff; }
.hero-ascii-pre .a-hy { color: #ffff55; }
.hero-ascii-pre .a-hg { color: #55ff55; }
.hero-ascii-pre .a-hk { color: #6b6b6b; }
html[data-theme="light"] .hero-ascii-pre .a-hw { color: #1b1b1b; }
html[data-theme="light"] .hero-ascii-pre .a-w  { color: #555555; }
html[data-theme="light"] .hero-ascii-pre .a-hc { color: #007f8f; }
html[data-theme="light"] .hero-ascii-pre .a-hy { color: #8a6d00; }

/* Hero Stats Row (exact webdev.teknium.io .stats) */
.stats {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--line2);
  max-width: 780px;
}
.stat {
  padding: 14px 26px 0 0;
  margin-right: 26px;
}
.stat b {
  display: block;
  font: 400 38px/1 var(--serif);
  color: var(--ink);
}
.stat b i {
  font-style: italic;
  color: var(--acid);
}
.stat span {
  font: 11.5px/1.3 var(--mono);
  color: var(--mut);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Compact Sub-page Hero ---------- */
.page-hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 46px 28px 38px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(var(--acid-rgb), 0.08), transparent 60%),
    var(--bg);
}
.page-hero-in {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.page-hero h1 {
  font: 400 clamp(44px, 7vw, 92px)/0.92 var(--serif);
  letter-spacing: -0.02em;
  margin: 14px 0 14px;
}
.page-hero h1 em {
  font-style: italic;
  color: var(--acid);
}
.page-hero p.lede {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--ink-soft);
  max-width: 44em;
  margin: 0;
}

/* ---------- Live Status Strip (Split-Flap & Telemetry) ---------- */
.status-strip {
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.status-strip-in {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font: 12px/1.2 var(--mono);
}
.flap-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flap-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #070708;
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 5px 9px;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html[data-theme="light"] .flap-cell {
  background: var(--card);
}
.flap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}
.flap-dot.up {
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}
.flap-dot.down {
  background: var(--danger);
}
.flap-dot.unknown {
  background: var(--amber);
}

/* ---------- Main Container & Sections (exact webdev.teknium.io .sec) ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px 80px;
}

.sec {
  padding-top: 64px;
  scroll-margin-top: calc(var(--stick) - 24px);
}

.sec-h {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 22px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.sec-n {
  font: 12px var(--mono);
  color: var(--dim);
  letter-spacing: 0.1em;
  grid-row: span 2;
  align-self: start;
  padding-top: 10px;
}
.sec-h h2 {
  font: 400 clamp(34px, 4.6vw, 58px)/1 var(--serif);
  margin: 0;
  letter-spacing: -0.01em;
}
.sec-h h2 .g {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.52em;
  vertical-align: 0.28em;
  margin-right: 10px;
}
.sec-h h2 em {
  font-style: italic;
  color: var(--acid);
}
.sec-h p {
  margin: 0;
  color: var(--mut);
  max-width: 48em;
  grid-column: 2;
}
.sec-c {
  font: 12px var(--mono);
  color: var(--dim);
  grid-row: 1;
  grid-column: 3;
  align-self: end;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

@media (max-width: 1080px) {
  .grid, .grid-3 {
    grid-template-columns: 1fr;
  }
  .hero-in {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cards (exact webdev.teknium.io .card + .frame + .cbar) ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-margin-top: calc(var(--stick) + 12px);
  transition: border-color 0.2s;
}
.card:hover,
.card:target {
  border-color: var(--line2);
}
.card.featured {
  border-color: rgba(var(--acid-rgb), 0.45);
}

.frame {
  position: relative;
  min-height: 290px;
  background: #060607;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.frame.tall {
  min-height: 390px;
}
.frame.compact {
  min-height: 210px;
}

.cbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 14px;
  border-bottom: 1px solid var(--line);
  font: 11px/1 var(--mono);
  color: var(--mut);
  min-height: 40px;
  background: var(--bg2);
  flex-wrap: wrap;
}
.cbar .state {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.cbar .state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}
.cbar .state b {
  color: var(--ink);
  font-weight: 400;
}
.cbar .hint {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  padding-left: 8px;
  border-left: 1px solid var(--line2);
}

.pill {
  font: 11px/1 var(--mono);
  color: var(--mut);
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 6px 10px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pill:hover,
.pill.on,
.pill[aria-pressed="true"] {
  border-color: var(--acid);
  color: var(--acid);
}

.body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.toprow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.fw {
  font: 500 10.5px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
  background: var(--ink);
  padding: 4px 7px;
  border-radius: 4px;
}
.fw.vanilla { background: var(--acid); color: #000; }
.fw.ftn     { background: var(--cyan); color: #000; }
.fw.irc     { background: var(--blue); color: #000; }
.fw.agent   { background: var(--purple); color: #000; }
.fw.hub     { background: var(--rose); color: #000; }

.tag {
  font: 11px/1 var(--mono);
  color: var(--mut);
  border: 1px solid var(--line2);
  padding: 4px 7px;
  border-radius: 4px;
  background: none;
}

.card h3 {
  margin: 2px 0 0;
  font: 400 32px/1.04 var(--serif);
  letter-spacing: -0.005em;
  color: var(--ink);
}
.card h3 .dt {
  font: italic 400 21px var(--serif);
  color: var(--mut);
  margin-left: 6px;
}

.tagline {
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
}

.blurb {
  margin: 0;
  color: var(--mut);
  font-size: 14.5px;
  line-height: 1.58;
}

.install {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0a0a0b;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 8px 8px 12px;
}
html[data-theme="light"] .install {
  background: var(--bg2);
}
.install code {
  flex: 1;
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.install code::-webkit-scrollbar {
  display: none;
}
.install code::before {
  content: "$ ";
  color: var(--acid);
}

.copy {
  font: 11px var(--mono);
  background: var(--bg2);
  color: var(--mut);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
  flex: none;
}
.copy:hover {
  color: var(--ink);
  border-color: var(--mut);
}
.copy.ok {
  color: #000;
  background: var(--acid);
  border-color: var(--acid);
}

pre.snip {
  margin: 0;
  background: #0a0a0b;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  font: 12px/1.55 var(--mono);
  overflow: auto;
  max-height: 240px;
  color: #cfcac2;
  tab-size: 2;
}
html[data-theme="light"] pre.snip {
  background: #18181b;
  color: #e6e2da;
}
.snip .k  { color: #ff9e7a; }
.snip .s  { color: #d4ff4f; }
.snip .c  { color: #6e6b65; font-style: italic; }
.snip .m  { color: #ffcf6a; }
.snip .nf { color: #8fb0ff; }
.snip .nt { color: #5ee7ff; }

.links {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font: 12px var(--mono);
  color: var(--dim);
}
.links a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line2);
  padding-bottom: 2px;
}
.links a:hover {
  color: var(--acid);
  border-color: var(--acid);
}

/* ---------- DEMO 1: AnsiLove.js 14.4k BBS Art Viewer ---------- */
.ansilove-wrap {
  display: grid;
  grid-template-columns: 1fr 220px;
  flex: 1;
  background: #050506;
  color: #ece8e1;
  font: 11.5px/1.35 var(--mono);
}
@media (max-width: 720px) {
  .ansilove-wrap {
    grid-template-columns: 1fr;
  }
}
.ansi-stage {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e1e22;
}
.ansi-modem-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #0c0c0f;
  border-bottom: 1px solid #1e1e22;
  font: 11px/1 var(--mono);
  color: #9d9a94;
  flex-wrap: wrap;
}
.ansi-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3dffa8;
  box-shadow: 0 0 8px #3dffa8;
}
.ansi-led.dialing {
  background: #ffcf6a;
  box-shadow: 0 0 8px #ffcf6a;
}
.ansi-meter {
  flex: 1;
  min-width: 60px;
  height: 5px;
  background: #1b1b20;
  border-radius: 3px;
  overflow: hidden;
}
.ansi-meter i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #3dffa8, #d4ff4f);
  transition: width 0.08s linear;
}
.ansi-canvas-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #000;
  overflow: auto;
}
.ansi-canvas-box canvas {
  width: 100%;
  max-width: 640px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid #1f1f24;
  box-shadow: 0 0 28px rgba(0, 170, 255, 0.12);
}
.ansi-sauce {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0a0a0d;
}
.sauce-title {
  font: 600 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--acid);
  border-bottom: 1px solid #222228;
  padding-bottom: 6px;
}
.sauce-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  font-size: 11px;
}
.sauce-dl dt {
  color: #6c6a64;
}
.sauce-dl dd {
  margin: 0;
  color: #ece8e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- DEMO 2: dithercn Dithered 3D Globe & Dashboard ---------- */
.dither-stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  background: #060608;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dither-stage canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: grab;
}
.dither-stage canvas:active {
  cursor: grabbing;
}
.dither-hud {
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  font: 11px/1.35 var(--mono);
  color: #cfcac2;
}
.dither-hud-box {
  background: rgba(8, 8, 10, 0.82);
  border: 1px solid #26262c;
  padding: 6px 10px;
  border-radius: 6px;
}

/* ---------- DEMO 3: drawille-canvas Unicode Braille 3D Orbit ---------- */
.braille-stage {
  position: relative;
  flex: 1;
  min-height: 250px;
  background: #050507;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}
.braille-pre {
  margin: 0;
  font: 11.5px/1.05 var(--mono);
  letter-spacing: 0;
  color: var(--acid);
  white-space: pre;
  user-select: none;
  text-shadow: 0 0 10px rgba(var(--acid-rgb), 0.35);
}

/* ---------- DEMO 4: crt-terminal GLYPH/OS Phosphor Shell ---------- */
.crt-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #050607;
  color: #3dffa8;
  font: 12.5px/1.5 var(--mono);
  padding: 14px;
  min-height: 260px;
}
.crt-shell[data-phosphor="amber"] { color: #ffb000; }
.crt-shell[data-phosphor="cyan"]  { color: #5ee7ff; }
.crt-shell[data-phosphor="acid"]  { color: #d4ff4f; }

.crt-log {
  flex: 1;
  overflow-y: auto;
  max-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
}
.crt-log-line {
  white-space: pre-wrap;
  word-break: break-word;
}
.crt-log-line.dim { color: #7f8c84; }
.crt-log-line.cmd { color: #ece8e1; font-weight: 600; }

.crt-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px dashed #1f2924;
}
.crt-chip {
  font: 11px/1 var(--mono);
  color: inherit;
  background: rgba(61, 255, 168, 0.07);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.85;
}
.crt-chip:hover {
  opacity: 1;
  background: rgba(61, 255, 168, 0.18);
}

.crt-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #1f2924;
  padding-top: 8px;
}
.crt-prompt {
  color: var(--acid);
  white-space: nowrap;
}
.crt-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #ece8e1;
  font: 12.5px var(--mono);
  outline: none;
}

/* ---------- The Monospace Web / WebTUI Tables & Grid Panels ---------- */
.mono-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
table.mono-table {
  width: 100%;
  border-collapse: collapse;
  font: 13px/1.45 var(--mono);
}
.mono-table th,
.mono-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.mono-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mut);
  background: var(--bg2);
}
.mono-table tr:last-child td {
  border-bottom: 0;
}

/* ---------- Board Directory Controls (boards.html) ---------- */
.dir-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.dir-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dir-search {
  position: relative;
  flex: 1;
  max-width: 340px;
  min-width: 220px;
}
.dir-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line2);
  color: var(--ink);
  font: 13px var(--mono);
  padding: 9px 14px;
  border-radius: 9px;
  outline: none;
}
.dir-search input:focus {
  border-color: var(--acid);
}

/* ---------- Dithered Heatmap & Gauges (status.html) ---------- */
.dither-heatmap {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  padding: 12px;
  background: #060607;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.heat-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: #141418;
}
.heat-cell.l1 { background: rgba(var(--acid-rgb), 0.22); }
.heat-cell.l2 { background: rgba(var(--acid-rgb), 0.48); }
.heat-cell.l3 { background: rgba(var(--acid-rgb), 0.75); }
.heat-cell.l4 { background: var(--acid); }

/* ---------- Webchat Placeholder (chat.html) ---------- */
#webchat {
  background: #060608;
  border: 1px dashed var(--line2);
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
  font-family: var(--mono);
  color: var(--mut);
}

/* ---------- Bot ANSI Slot Studio (art.html) ---------- */
.slot-studio {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #050507;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 960px) {
  .slot-studio {
    grid-template-columns: 1fr;
  }
}
.slot-preview-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e1e24;
  background: #000;
}
.slot-editor-pane {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 10px;
  background: #0a0a0e;
  font: 12px/1.4 var(--mono);
}
.slot-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.slot-field label {
  display: block;
  font-size: 10.5px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.slot-field input,
.slot-field select,
.slot-field textarea {
  width: 100%;
  background: #050507;
  border: 1px solid var(--line2);
  color: var(--ink);
  font: 12px/1.35 var(--mono);
  padding: 7px 9px;
  border-radius: 6px;
  outline: none;
}
.slot-field input:focus,
.slot-field select:focus,
.slot-field textarea:focus {
  border-color: var(--acid);
}
.slot-field textarea {
  min-height: 118px;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}
.slot-glyph-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.slot-glyph-btn {
  font: 13px/1 var(--mono);
  background: #141419;
  color: var(--acid);
  border: 1px solid #2a2a33;
  border-radius: 4px;
  padding: 4px 7px;
  cursor: pointer;
}
.slot-glyph-btn:hover {
  border-color: var(--acid);
  background: #1c1c24;
}

/* ---------- Footer (exact webdev.teknium.io footer + Unofficial Notice) ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: var(--bg2);
}
.foot {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 42px 28px 56px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 36px;
  color: var(--mut);
  font-size: 14px;
}
.foot h4 {
  font: 400 32px/1 var(--serif);
  color: var(--ink);
  margin: 0 0 12px;
}
.foot h4 i {
  color: var(--acid);
  font-style: italic;
}
.foot .idx {
  columns: 2;
  font: 12.5px/2 var(--mono);
}
.foot .idx a {
  text-decoration: none;
  color: var(--mut);
  display: block;
}
.foot .idx a:hover {
  color: var(--acid);
}
.disclaimer-box {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line2);
  border-left: 3px solid var(--acid);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-soft);
  font: 12.5px/1.55 var(--mono);
}

@media (max-width: 760px) {
  .bar-in {
    gap: 8px 10px;
    padding: 8px 14px;
    height: auto;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 21px;
    flex: 1;
  }
  .navrow {
    order: 3;
    flex-basis: 100%;
  }
  main, .hero-in, .filters, .status-strip-in, .foot, .page-hero {
    padding-left: 14px;
    padding-right: 14px;
  }
  .foot {
    grid-template-columns: 1fr;
  }
  .sec-h {
    grid-template-columns: 1fr;
  }
  .sec-n, .sec-c {
    grid-row: auto;
    grid-column: auto;
  }
  .sec-h p {
    grid-column: auto;
  }
  .card h3 {
    font-size: 27px;
  }
  .cbar .hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Footer credit to Hermes Agent's author */
.foot .credit { margin: 10px 0 0; font-size: 13px; color: var(--mut); }
.foot .credit a { color: var(--acid); text-decoration: underline; text-underline-offset: 3px; }
