/* ==========================================================================
   shellnotes — design system
   Zero external dependencies. Zero third-party requests.
   Type is self-hosted; art is local SVG.
   ========================================================================== */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #0a0710;
  --bg-soft: #0d0916;
  --panel: #110c1b;
  --panel-2: #171023;

  --line: rgba(190, 178, 214, 0.13);
  --line-strong: rgba(190, 178, 214, 0.27);

  --text: #ece7f6;
  --muted: #aaa0bd;
  --faint: #8a7f9c;

  --accent: #ff7a45;
  --accent-2: #67e8f9;
  --accent-ink: #1b0d05;
  --accent-soft: rgba(255, 122, 69, 0.12);
  --link: #7ee7fa;

  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #fb7185;

  --code-bg: #08050e;
  --code-line: rgba(190, 178, 214, 0.16);
  --code-text: #d9d2e8;

  --header-bg: rgba(10, 7, 16, 0.78);
  --glow-1: rgba(255, 122, 69, 0.1);
  --glow-2: rgba(139, 92, 246, 0.09);

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 20px;

  --shadow: 0 30px 80px -34px rgba(0, 0, 0, 0.98);
  --shadow-soft: 0 18px 44px -26px rgba(0, 0, 0, 0.94);

  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Manrope", ui-sans-serif, system-ui,
    "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Code",
    Consolas, "Liberation Mono", monospace;

  --header-h: 74px;
  --wrap: 1160px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Design System v2 — type (12px floor) */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.5rem;     /* 24px */
  --text-2xl: 2rem;      /* 32px */
  --text-display: clamp(2.4rem, 5.5vw, 4.25rem);
  --leading-body: 1.7;
  --leading-tight: 1.12;
  --measure: 72ch;

  /* Design System v2 — spacing (4/8 ramp) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 128px;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f7f5fb;
  --bg-soft: #f1edf8;
  --panel: #ffffff;
  --panel-2: #f3effa;

  --line: rgba(35, 25, 52, 0.11);
  --line-strong: rgba(35, 25, 52, 0.24);

  --text: #171120;
  --muted: #564b68;
  --faint: #665b78;

  --accent: #b93f0d;
  --accent-2: #0e7490;
  --accent-ink: #fff8f4;
  --accent-soft: rgba(185, 63, 13, 0.08);
  --link: #0b6b85;

  --ok: #166534;
  --warn: #a16207;
  --danger: #be123c;

  --header-bg: rgba(247, 245, 251, 0.84);
  --glow-1: rgba(196, 67, 15, 0.07);
  --glow-2: rgba(109, 74, 196, 0.06);

  --shadow: 0 30px 70px -38px rgba(23, 17, 32, 0.4);
  --shadow-soft: 0 16px 36px -24px rgba(23, 17, 32, 0.32);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 28px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(54rem 36rem at 50% -14%, var(--glow-1), transparent 64%),
    radial-gradient(46rem 34rem at 96% 10%, var(--glow-2), transparent 60%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---------- utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.wrap--narrow {
  max-width: 820px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.5;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--muted);
  vertical-align: 0.08em;
}

.faint {
  color: var(--faint);
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 0.18s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
  flex-shrink: 0;
}

.dot--accent {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.masthead-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  transition: background 0.18s;
}

.brand:hover {
  background: var(--panel);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  border: 1px solid rgba(255, 122, 69, 0.42);
  background:
    radial-gradient(80% 80% at 50% 18%, rgba(255, 122, 69, 0.22), transparent 68%),
    var(--bg-soft);
  color: var(--accent);
  box-shadow:
    0 0 26px rgba(255, 122, 69, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

[data-theme="light"] .brand-mark {
  box-shadow:
    0 0 22px rgba(185, 63, 13, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.brand-name em {
  font-style: normal;
  color: var(--accent);
}

.masthead-actions {
  position: absolute;
  top: 50%;
  right: 0;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  gap: 0.24rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.menu-toggle .ico-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .ico-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .ico-close {
  display: block;
}

.theme-toggle .ico-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .ico-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .ico-moon {
  display: block;
}

/* dropdown menu */
.site-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 80;
  width: 278px;
  padding: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: none;
}

.site-menu[data-open="true"] {
  display: block;
  animation: menu-in 0.16s var(--ease);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.site-menu a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.14s, background 0.14s;
}

.site-menu a span {
  width: 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.site-menu a em {
  font-style: normal;
  margin-left: auto;
  color: var(--faint);
}

.site-menu a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.site-menu a:hover span {
  color: var(--accent);
}

.site-menu-foot {
  margin-top: 0.4rem;
  padding: 0.75rem 0.72rem 0.3rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* Desktop navigation (≥ 900px) */
@media (min-width: 900px) {
  .masthead-inner {
    justify-content: space-between;
  }

  .masthead-actions {
    position: static;
    translate: none;
  }

  .menu-toggle {
    display: none;
  }

  .site-menu {
    display: flex !important;
    position: static;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    animation: none;
    align-items: center;
    gap: 0.25rem;
  }

  .site-menu a {
    padding: 0.35rem 0.65rem;
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    color: var(--muted);
  }

  .site-menu a:hover {
    color: var(--text);
    background: var(--panel);
    border-color: var(--line);
  }

  .site-menu a[aria-current="page"] {
    color: var(--accent);
    border-color: var(--accent-soft);
    background: var(--panel);
  }

  .site-menu a span {
    display: none;
  }

  .site-menu a em {
    margin-left: 0.2rem;
  }

  .site-menu-foot {
    display: none;
  }
}

/* no-JS fallback: menu is always open and the toggle is pointless */
html:not(.js) .masthead-inner {
  flex-wrap: wrap;
  height: auto;
  padding-block: 0.6rem;
  row-gap: 0.3rem;
}

html:not(.js) .masthead-actions {
  position: static;
  translate: none;
  margin-left: auto;
}

html:not(.js) .menu-toggle {
  display: none;
}

html:not(.js) .site-menu {
  display: flex;
  position: static;
  width: 100%;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

html:not(.js) .site-menu-foot,
html:not(.js) .site-menu a span {
  display: none;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.4rem, 8vw, 6rem) clamp(2.2rem, 4vw, 3.2rem);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 18% 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(58% 70% at 50% 34%, #000, transparent 78%);
  mask-image: radial-gradient(58% 70% at 50% 34%, #000, transparent 78%);
  opacity: 0.4;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 1.2rem auto 0;
  max-width: 17ch;
  font-size: clamp(2.55rem, 6.4vw, 4.35rem);
  font-weight: 600;
  line-height: 1.01;
  letter-spacing: -0.05em;
}

.grad {
  background: linear-gradient(96deg, var(--accent) 6%, #ffb27d 54%, #ffd4bd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

[data-theme="light"] .grad {
  background-image: linear-gradient(96deg, #b93f0d, #9a3412 52%, #b45309);
}

.hero-lede {
  margin: 1.35rem auto 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.06rem);
  line-height: 1.72;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 1.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.hero-meta strong {
  color: var(--text);
  font-weight: 500;
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* ---------- page intro ---------- */
.page-intro {
  padding-block: clamp(2.8rem, 6vw, 4.4rem) clamp(1.8rem, 3.4vw, 2.6rem);
  text-align: center;
}

.page-intro h1 {
  margin: 0.9rem auto 0;
  max-width: 20ch;
  font-size: clamp(2.1rem, 4.8vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.page-intro .lede {
  margin: 1rem auto 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.98rem;
}

.page-intro-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
}

/* ---------- archive ---------- */
.archive {
  padding-block: 0 clamp(3rem, 6vw, 4.6rem);
}

.archive-head {
  text-align: center;
  margin-bottom: 1.7rem;
}

.archive-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.archive-count {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.archive-title {
  margin: 0.55rem 0 0;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.04em;
}

.archive-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.search-field {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 430px;
}

.search-field svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  translate: 0 -50%;
  width: 15px;
  height: 15px;
  color: var(--faint);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 43px;
  padding: 0 0.95rem 0 2.5rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.87rem;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-field input:focus {
  outline: none;
  border-color: rgba(255, 122, 69, 0.55);
  background: var(--bg-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
  flex-shrink: 0;
}

.filter-btn svg {
  width: 16px;
  height: 16px;
}

.filter-btn:hover,
.filter-btn[aria-expanded="true"] {
  color: var(--accent);
  border-color: rgba(255, 122, 69, 0.45);
  background: var(--accent-soft);
}

.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  flex-shrink: 0;
}

.view-btn {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn:hover {
  color: var(--text);
  background: var(--panel-2);
}

.view-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.result-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  white-space: nowrap;
}

.filter-panel {
  display: none;
  padding-bottom: 1.25rem;
}

.filter-panel[data-open="true"] {
  display: block;
  animation: menu-in 0.16s var(--ease);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.5;
  cursor: default;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

button.chip {
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
  background: var(--panel-2);
}

.chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(255, 122, 69, 0.42);
  background: var(--accent-soft);
}

[data-theme="light"] .chip[aria-pressed="true"] {
  color: #a8380b;
  border-color: rgba(185, 63, 13, 0.34);
}

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.7vw, 1.35rem);
}

.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 122, 69, 0.38);
  box-shadow: var(--shadow-soft);
}

[data-theme="light"] .card {
  box-shadow: 0 1px 0 rgba(23, 17, 32, 0.02);
}

[data-theme="light"] .card:hover {
  box-shadow: var(--shadow-soft);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background: #0b0812;
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.card:hover .card-cover img {
  transform: scale(1.04);
}

.card-cover.is-transparent-media {
  background: transparent;
}

.card-cover.is-transparent-media img {
  object-fit: contain;
  padding: 0.65rem;
  background: transparent;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.42));
}

.card-arrow {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 7, 16, 0.7);
  color: #fff;
  font-size: 0.86rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(-4px);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: opacity 0.18s, transform 0.18s;
}

.card:hover .card-arrow,
.card:focus-within .card-arrow {
  opacity: 1;
  transform: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.28rem;
  padding: 1.02rem 1.15rem 1.2rem;
  text-align: center;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
}

.card h3 {
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  transition: color 0.16s;
}

.card:hover h3 {
  color: var(--accent);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.05rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.card-meta .sep {
  color: var(--line-strong);
}

.card-summary {
  margin-top: 0.45rem;
  color: var(--faint);
  font-size: 0.845rem;
  line-height: 1.62;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1.2rem;
}

/* Dense index view: a date-ordered list for scanning the archive. */
.cards[data-view="index"] {
  display: block;
  border-top: 1px solid var(--line);
}

.cards[data-view="index"] .card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.cards[data-view="index"] .card:hover {
  transform: none;
  border-color: var(--line);
  background: var(--bg-soft);
  box-shadow: none;
}

.cards[data-view="index"] .card-link {
  display: block;
}

.cards[data-view="index"] .card-cover,
.cards[data-view="index"] .card-arrow {
  display: none;
}

.cards[data-view="index"] .card-body {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 15rem);
  grid-template-areas:
    "date title meta"
    "date summary meta";
  align-items: start;
  column-gap: 1.2rem;
  row-gap: 0.25rem;
  padding: 1rem 0.75rem;
  text-align: left;
}

.cards[data-view="index"] .card-date {
  grid-area: date;
  padding-top: 0.3rem;
}

.cards[data-view="index"] .card h3 {
  grid-area: title;
  font-size: 1.02rem;
}

.cards[data-view="index"] .card-summary {
  grid-area: summary;
  margin-top: 0;
  text-align: left;
  -webkit-line-clamp: 1;
  font-size: 0.8rem;
}

.cards[data-view="index"] .card-meta {
  grid-area: meta;
  justify-content: flex-end;
  align-content: flex-start;
  padding-top: 0.26rem;
  text-align: right;
}

/* ---------- tags & badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}

a.tag:hover {
  color: var(--accent);
  border-color: rgba(255, 122, 69, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.badge--insane {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.09);
}

.badge--hard {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.32);
  background: rgba(251, 146, 60, 0.09);
}

.badge--medium {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.badge--easy {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.08);
}

.badge--live {
  color: var(--accent-2);
  border-color: rgba(103, 232, 249, 0.3);
  background: rgba(103, 232, 249, 0.07);
}

[data-theme="light"] .badge--insane {
  color: #be123c;
  border-color: rgba(190, 18, 60, 0.26);
  background: rgba(190, 18, 60, 0.06);
}

[data-theme="light"] .badge--hard {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.26);
  background: rgba(180, 83, 9, 0.06);
}

[data-theme="light"] .badge--medium {
  color: #a16207;
  border-color: rgba(161, 98, 7, 0.26);
  background: rgba(161, 98, 7, 0.06);
}

[data-theme="light"] .badge--easy {
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.26);
  background: rgba(21, 128, 61, 0.06);
}

[data-theme="light"] .badge--live {
  color: #0e7490;
  border-color: rgba(14, 116, 144, 0.26);
  background: rgba(14, 116, 144, 0.06);
}

/* ---------- closing / about strip ---------- */
.closing {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(1.6rem, 4vw, 3.2rem);
  align-items: center;
  margin-top: clamp(2.6rem, 6vw, 4.2rem);
  padding: clamp(1.5rem, 3.2vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 150% at 0% 0%, var(--accent-soft), transparent 58%),
    var(--panel);
}

.closing h2 {
  margin-top: 0.65rem;
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
}

.closing p {
  margin-top: 0.7rem;
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.closing .link-more {
  margin-top: 1.1rem;
}

.closing-side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-left: clamp(0rem, 2vw, 1.6rem);
  border-left: 1px solid var(--line);
}

.closing-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed var(--line);
}

.closing-stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.closing-stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.closing-stat span {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- topics strip ---------- */
.topic-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.topic-strip-label {
  margin-right: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.topic {
  display: inline-flex;
  align-items: baseline;
  gap: 0.42rem;
  padding: 0.32rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.topic:hover {
  color: var(--accent);
  border-color: rgba(255, 122, 69, 0.42);
  background: var(--accent-soft);
}

.topic-count {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--faint);
}

.topic--all {
  color: var(--link);
  border-color: transparent;
  background: transparent;
}

.topic--all:hover {
  color: var(--link);
  border-color: var(--line);
  background: var(--panel);
}

.topic-strip-empty {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
}

/* ---------- follow band ---------- */
.follow {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.1rem 1.5rem;
  align-items: center;
  margin-top: clamp(1.6rem, 4vw, 2.6rem);
  padding: clamp(1.3rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 140% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--panel-2);
  overflow: hidden;
}

.follow::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -78px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 28px rgba(255, 122, 69, 0.03),
    0 0 0 60px rgba(255, 122, 69, 0.02);
  pointer-events: none;
}

.follow-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 122, 69, 0.42);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 30px rgba(255, 122, 69, 0.14);
  flex-shrink: 0;
}

.follow-mark svg {
  width: 24px;
  height: 24px;
}

.follow > div {
  position: relative;
  z-index: 1;
}

.follow h2 {
  margin-top: 0.45rem;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.follow p {
  margin-top: 0.45rem;
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.88rem;
}

.follow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}


/* ---------- buttons / links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 43px;
  padding: 0 1.1rem;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.16s, border-color 0.16s,
    filter 0.16s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--panel-2);
  border-color: var(--line-strong);
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(180deg, #ff8d5f, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 14px 34px -18px rgba(255, 122, 69, 0.75);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #ff9d75, var(--accent));
  filter: brightness(1.03);
}

[data-theme="light"] .btn--primary {
  background: linear-gradient(180deg, #c2410c, var(--accent));
  color: #ffffff;
  box-shadow: 0 14px 34px -18px rgba(185, 63, 13, 0.45);
}

[data-theme="light"] .btn--primary:hover {
  background: linear-gradient(180deg, #9a3412, var(--accent));
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn--quiet:hover {
  background: var(--panel-2);
  color: var(--text);
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.16s;
}

.link-more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.18s var(--ease);
}

.link-more:hover {
  color: var(--accent);
}

.link-more:hover svg {
  transform: translateX(3px);
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  margin-block: clamp(1.6rem, 3.5vw, 2.6rem);
  padding: clamp(1.4rem, 3.2vw, 2.2rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(100% 170% at 0% 0%, var(--accent-soft), transparent 62%),
    var(--panel);
  overflow: hidden;
}

.cta::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -66px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 32px rgba(255, 122, 69, 0.035),
    0 0 0 68px rgba(255, 122, 69, 0.02);
  pointer-events: none;
}

.cta h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
}

.cta p {
  margin-top: 0.4rem;
  max-width: 54ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta > div,
.cta > a {
  position: relative;
  z-index: 1;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(2.6rem, 6vw, 4.4rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, transparent, rgba(35, 25, 52, 0.025));
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.4rem 2rem;
  align-items: start;
  padding-block: 2.3rem 1.3rem;
}

.footer-brand .brand {
  padding-left: 0;
}

.footer-brand .brand:hover {
  background: none;
}

.footer-brand .brand-mark {
  width: 31px;
  height: 31px;
}

.footer-brand .brand-mark svg {
  width: 15px;
  height: 15px;
}

.footer-brand .brand-name {
  font-size: 0.95rem;
}

.footer-brand p {
  margin-top: 0.55rem;
  max-width: 40ch;
  font-size: 0.8rem;
  color: var(--faint);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem;
}

.footer-nav a {
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.footer-nav a:hover {
  color: var(--accent);
  background: var(--panel);
}

.footer-fine {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.footer-fine .served {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

/* ---------- article ---------- */
.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 70;
  background: transparent;
  pointer-events: none;
}

.progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(255, 122, 69, 0.5);
  transition: transform 0.08s linear;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-block: clamp(1.8rem, 3.6vw, 2.8rem) 4rem;
}

.article-main {
  min-width: 0;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs .sep {
  color: var(--line-strong);
}

.article-head .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-head h1 {
  margin-top: 0.85rem;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.03;
}

.article-head .lede {
  margin-top: 0.9rem;
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.01rem;
  line-height: 1.72;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: linear-gradient(150deg, var(--panel-2), var(--bg-soft));
  font-size: 0.66rem;
  color: var(--accent);
  flex-shrink: 0;
}

.byline > span:not(.avatar):not(.sep) {
  color: var(--muted);
}

.byline .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.byline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: auto;
}

.article-cover {
  margin: 1.7rem 0 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0b0812;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  animation: cover-reveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cover-reveal {
  from {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-cover:hover img {
  transform: scale(1.03);
}

.article-cover.is-transparent-media {
  max-width: 280px;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin-inline: auto;
}

.article-cover.is-transparent-media img {
  height: auto;
  max-height: 280px;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.45));
}

/* prose thumbnail — keep transparent badges free of any rectangular box/background */
.prose img.prose-media--manual,
.prose img.is-transparent-media {
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.48));
}

/* machine card */
.machine-card {
  margin-top: 1.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  overflow: hidden;
}

.mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}

.mc-head strong {
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.1em;
}

.mc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mc-cell {
  padding: 0.8rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mc-cell:nth-child(4n) {
  border-right: 0;
}

.mc-cell:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.mc-cell > span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.mc-cell strong {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.mc-grid--fluid {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1px;
  background: var(--line);
}

.mc-grid--fluid .mc-cell {
  border: 0;
  background: var(--panel);
}

/* at-a-glance card, reusing the machine-card cells */
.intel-card {
  margin-top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.intel-card .mc-head {
  background: linear-gradient(90deg, rgba(103, 232, 249, 0.08), transparent 70%);
}

/* share row */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

.share-label {
  margin-right: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.6;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.share-btn:hover {
  color: var(--accent);
  border-color: rgba(255, 122, 69, 0.42);
  background: var(--accent-soft);
}

.share-status {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ok);
}

/* prose */
.prose {
  max-width: 73ch;
  margin-top: 2.5rem;
  font-size: 1.005rem;
  line-height: 1.8;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  position: relative;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.38rem, 2.5vw, 1.62rem);
  letter-spacing: -0.035em;
}

.prose h3 {
  margin: 2rem 0 0.65rem;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}

.prose h4 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1rem;
}

.prose p {
  margin: 0 0 1.15rem;
}

.prose strong {
  color: var(--text);
  font-weight: 700;
}

.prose a:not(.anchor) {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 38%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.prose a:not(.anchor):hover {
  text-decoration-color: var(--link);
}

.anchor {
  position: absolute;
  left: -1.15em;
  padding-right: 0.3em;
  color: var(--faint);
  opacity: 0;
  text-decoration: none;
  transition: opacity 0.15s, color 0.15s;
  font-weight: 400;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.anchor:hover {
  color: var(--accent);
}

.prose ul,
.prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
}

.prose li {
  margin: 0.38rem 0;
  padding-left: 0.15rem;
}

.prose li::marker {
  color: var(--accent);
}

.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose img {
  display: block;
  max-width: 100%;
  max-height: min(65vh, 520px);
  height: auto;
  margin: 1.4rem auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: contain;
  box-shadow: 0 18px 48px -34px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}

.prose img.is-zoomable {
  cursor: zoom-in;
}

.prose img.is-zoomable:hover {
  transform: translateY(-2px) scale(1.012);
}

.prose h2.is-heading-flash,
.prose h3.is-heading-flash {
  animation: heading-flash 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes heading-flash {
  0% {
    color: var(--accent);
    transform: translateX(6px);
  }
  100% {
    color: inherit;
    transform: translateX(0);
  }
}

.prose-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.prose-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.media-lightbox {
  margin: auto;
  max-width: min(94vw, 1120px);
  max-height: 92vh;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.72);
  animation: lightbox-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.media-lightbox::backdrop {
  background: rgba(5, 3, 10, 0.82);
  backdrop-filter: blur(6px);
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.media-lightbox-close {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  cursor: pointer;
  float: right;
  transition: color 0.15s, border-color 0.15s;
}

.media-lightbox-close:hover {
  color: var(--text);
  border-color: var(--accent);
}

.media-lightbox img {
  display: block;
  clear: both;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.media-lightbox-cap {
  margin-top: 0.65rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.prose img.media-shape--square:not(.prose-media--manual),
.prose img.is-transparent-media:not(.prose-media--manual) {
  max-width: min(100%, 280px);
  max-height: 280px;
}

.prose img.media-shape--portrait:not(.prose-media--manual) {
  max-width: min(100%, 380px);
  max-height: min(65vh, 520px);
}

.prose-image-missing {
  display: grid;
  gap: 0.3rem;
  margin: 1.35rem 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line-strong);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
}

.prose-image-missing strong {
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose-image-missing span {
  overflow-wrap: anywhere;
}

.prose figcaption {
  margin-top: -0.7rem;
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
}

/* inline code */
.prose :not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 74%, transparent);
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: #ffb08c;
  word-break: break-word;
}

[data-theme="light"] .prose :not(pre) > code {
  color: #a33b14;
  background: var(--bg-soft);
}

/* code blocks */
.prose pre {
  margin: 1.4rem 0;
  padding: 1rem 1.1rem;
  border-radius: 11px;
  border: 1px solid var(--code-line);
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.81rem;
  line-height: 1.75;
  overflow-x: auto;
  tab-size: 2;
}

.prose pre code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
}

.code-block {
  margin: 1.5rem 0;
  border-radius: 11px;
  border: 1px solid var(--code-line);
  background: var(--code-bg);
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.code-scroll {
  position: relative;
}

.code-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.75rem;
  background: linear-gradient(90deg, transparent, var(--code-bg) 88%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.code-scroll.is-scrollable::after {
  opacity: 1;
}

.code-scroll.is-end::after {
  opacity: 0;
}

.code-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.6rem 0.4rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.026);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: #8d80a3;
}

.code-lang {
  text-transform: lowercase;
}

.copy-btn {
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #a99dbd;
  font-family: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.copy-btn[data-copied="true"] {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.45);
}

/* callouts */
.callout {
  margin: 1.6rem 0;
  padding: 0.95rem 1.05rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted);
  background: var(--panel);
  font-size: 0.93rem;
  line-height: 1.7;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout--note {
  border-left-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 6%, var(--panel));
}

.callout--note .callout-title {
  color: var(--accent-2);
}

.callout--warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 6%, var(--panel));
}

.callout--warn .callout-title {
  color: var(--warn);
}

.callout--tip {
  border-left-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 6%, var(--panel));
}

.callout--tip .callout-title {
  color: var(--ok);
}

.callout--danger {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--panel));
}

.callout--danger .callout-title {
  color: var(--danger);
}

/* tables */
.table-wrap {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  background: var(--panel);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.62rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table-wrap th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--faint);
  background: var(--bg-soft);
  white-space: nowrap;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap code {
  white-space: nowrap;
}

/* aside / toc */
.article-aside {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: aside-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes aside-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aside-hud {
  position: relative;
  overflow: hidden;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(249, 115, 22, 0.14), transparent 72%),
    var(--panel);
  animation: aside-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.2s, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.aside-hud:hover {
  border-color: var(--accent);
}

.aside-hud-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
}

.aside-hud-pct {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.aside-hud-meta {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.aside-hud-track {
  margin-top: 0.55rem;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.aside-hud-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  transition: transform 0.12s linear;
}

.aside-top-btn {
  margin-top: 0.65rem;
  width: 100%;
  padding: 0.38rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}

.aside-top-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-2);
  transform: translateY(-1px);
}

.toc {
  border-left: 1px solid var(--line);
  padding-left: 1.1rem;
  position: relative;
}

.toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.toc ol {
  --toc-marker-y: 0px;
  --toc-marker-h: 28px;
  --toc-section-progress: 0;
  position: relative;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.js-ready .toc ol::after {
  content: "";
  position: absolute;
  top: 0;
  left: -1.12rem;
  width: 2.5px;
  height: var(--toc-marker-h);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.55);
  transform: translateY(var(--toc-marker-y));
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), height 0.18s ease;
  pointer-events: none;
}

.toc li {
  animation: toc-item-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toc li:nth-child(1) { animation-delay: 0.05s; }
.toc li:nth-child(2) { animation-delay: 0.10s; }
.toc li:nth-child(3) { animation-delay: 0.15s; }
.toc li:nth-child(4) { animation-delay: 0.20s; }
.toc li:nth-child(5) { animation-delay: 0.25s; }
.toc li:nth-child(6) { animation-delay: 0.30s; }
.toc li:nth-child(7) { animation-delay: 0.35s; }
.toc li:nth-child(8) { animation-delay: 0.40s; }

@keyframes toc-item-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toc a {
  position: relative;
  display: block;
  margin-left: -1.12rem;
  padding: 0.32rem 0.5rem 0.32rem 1.1rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  transition: color 0.18s, background 0.18s, padding-left 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.toc a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  padding-left: 1.35rem;
}

.toc a.is-active {
  color: var(--accent);
  background: rgba(249, 115, 22, 0.08);
  padding-left: 1.35rem;
}

.js-ready .toc a.is-active {
  border-left-color: transparent;
}

.toc a.is-active::after {
  content: "";
  position: absolute;
  left: 1.35rem;
  right: 0.5rem;
  bottom: 0;
  height: 1.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform-origin: left center;
  transform: scaleX(var(--toc-section-progress, 0));
  transition: transform 0.12s linear;
}

.aside-note {
  position: relative;
  overflow: hidden;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background:
    radial-gradient(150px circle at var(--mx, 50%) var(--my, 50%), rgba(249, 115, 22, 0.1), transparent 72%),
    var(--bg-soft);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--faint);
  cursor: pointer;
  animation: aside-enter 0.5s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.2s, background 0.2s, max-height 0.25s ease, opacity 0.2s;
}

.aside-note.is-collapsed {
  padding-block: 0.55rem;
  opacity: 0.75;
}

.aside-note.is-collapsed strong {
  margin-bottom: 0;
}

.aside-note.is-collapsed {
  max-height: 2.3rem;
}

.aside-note:hover {
  border-color: var(--accent);
  background: var(--panel);
}

.aside-note strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.aside-note strong::after {
  content: "−";
  font-size: 0.75rem;
  color: var(--faint);
}

.aside-note.is-collapsed strong::after {
  content: "+";
}

.aside-note a {
  color: var(--link);
}

/* pager */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1.05rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}

.pager a:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
  transform: translateY(-2px);
}

.pager .pg-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}

.pager .pg-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pager .next {
  text-align: right;
  align-items: flex-end;
}

/* related posts */
.related {
  margin-top: 2.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.related-head h2 {
  font-size: 1.18rem;
}

.related-head a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  transition: color 0.15s;
}

.related-head a:hover {
  color: var(--accent);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.related-card {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}

.related-card:hover {
  border-color: rgba(255, 122, 69, 0.38);
  background: var(--panel-2);
  transform: translateY(-2px);
}

.related-index {
  padding-top: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent);
}

.related-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.related-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.related-body strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.related-tags {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
}

/* ---------- topics page ---------- */
.tags-page {
  padding-block: 0 clamp(3rem, 6vw, 4.6rem);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding: 0 0 1.4rem;
  border-bottom: 1px solid var(--line);
}

.tag-cloud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.8rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tag-cloud-item:hover {
  color: var(--accent);
  border-color: rgba(255, 122, 69, 0.42);
  background: var(--accent-soft);
}

.tag-cloud-item .count {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--faint);
}

.tag-cloud-item--md {
  font-size: 0.87rem;
}

.tag-cloud-item--lg {
  padding: 0.46rem 0.9rem;
  font-size: 0.94rem;
  color: var(--text);
}

.tag-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.tag-categories-label {
  margin-right: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.tag-filter {
  max-width: 420px;
  margin-top: 1.4rem;
}

.tag-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.4rem;
  margin-top: 1.5rem;
}

.tag-group {
  align-self: start;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.tag-letter {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.tag-list {
  list-style: none;
}

.tag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 0.8rem;
  padding: 0.58rem 0.55rem;
  border-bottom: 1px dashed var(--line);
  border-radius: 8px;
  transition: background 0.15s;
}

.tag-row:hover {
  background: var(--panel);
}

.tag-row-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.tag-row-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--faint);
  text-align: right;
  white-space: nowrap;
}

.tag-row-latest {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}

.tag-empty {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.84rem;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-block: clamp(1rem, 2vw, 1.6rem) 4rem;
}

.about-prose {
  margin-top: 0;
  max-width: 70ch;
}

.about-prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.about-side {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(180deg, rgba(20, 15, 32, 0.96) 0%, rgba(12, 9, 20, 0.98) 100%);
  box-shadow: 0 16px 42px -15px rgba(0, 0, 0, 0.88), 0 0 28px -10px rgba(56, 189, 248, 0.18);
  position: relative;
  overflow: visible;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  background: linear-gradient(90deg, transparent, #38bdf8 35%, #a855f7 70%, transparent);
  pointer-events: none;
}

.operator-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.15rem;
  position: relative;
}

.operator-avatar-ring {
  position: relative;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.38), inset 0 0 16px rgba(56, 189, 248, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(17, 12, 27, 0.95) 75%);
  overflow: hidden;
}

.operator-avatar-img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.operator-identity {
  text-align: center;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.operator-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.operator-handle {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: #38bdf8;
  letter-spacing: 0.04em;
}

.operator-specs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.spec-val {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text);
  font-size: 0.86rem;
}

.spec-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #38bdf8;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: op-pulse 2s infinite ease-in-out;
}

@keyframes op-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 8px #38bdf8;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.75;
    box-shadow: 0 0 18px #38bdf8;
  }
}

.operator-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.55rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 0.7rem;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.op-btn--discord {
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(88, 101, 242, 0.5);
  color: #8da0f8;
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.18);
}

.op-btn--discord:hover {
  background: #5865f2;
  border-color: #5865f2;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
  transform: translateY(-1px);
}

.op-btn--telegram {
  background: rgba(34, 158, 217, 0.12);
  border: 1px solid rgba(34, 158, 217, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(34, 158, 217, 0.15);
}

.op-btn--telegram:hover {
  background: #229ed9;
  border-color: #229ed9;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(34, 158, 217, 0.45);
  transform: translateY(-1px);
}

.op-btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.operator-socials {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 1.15rem;
}

.op-social-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.op-social-link svg {
  width: 20px;
  height: 20px;
  transition: transform 0.18s var(--ease);
}

.op-social-link:hover {
  transform: translateY(-3px);
}

.op-social-link:hover svg {
  transform: scale(1.1);
}

/* Distinct Authentic Brand Colors */
.op-social-link--github {
  background: rgba(240, 246, 252, 0.08);
  border-color: rgba(240, 246, 252, 0.28);
  color: #f0f6fc;
}

.op-social-link--github:hover {
  color: #ffffff;
  border-color: #ffffff;
  background: rgba(240, 246, 252, 0.2);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.3);
}

.op-social-link--htb {
  background: rgba(159, 239, 0, 0.09);
  border-color: rgba(159, 239, 0, 0.38);
  color: #9fef00;
}

.op-social-link--htb:hover {
  color: #9fef00;
  border-color: #9fef00;
  background: rgba(159, 239, 0, 0.22);
  box-shadow: 0 0 18px rgba(159, 239, 0, 0.45);
}

.op-social-link--thm {
  background: rgba(234, 51, 35, 0.09);
  border-color: rgba(234, 51, 35, 0.38);
  color: #ff4742;
}

.op-social-link--thm:hover {
  color: #ffffff;
  border-color: #ea3323;
  background: rgba(234, 51, 35, 0.22);
  box-shadow: 0 0 18px rgba(234, 51, 35, 0.45);
}

.op-social-link--discord {
  background: rgba(88, 101, 242, 0.14);
  border-color: rgba(88, 101, 242, 0.45);
  color: #7289da;
}

.op-social-link--discord:hover {
  color: #ffffff;
  border-color: #5865f2;
  background: rgba(88, 101, 242, 0.3);
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

.op-social-link--telegram {
  background: rgba(34, 158, 217, 0.14);
  border-color: rgba(34, 158, 217, 0.45);
  color: #29b6f6;
}

.op-social-link[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: #0d1117;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #f0f6fc;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 12px rgba(56, 189, 248, 0.15);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
}

.op-social-link[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.op-social-link:first-child[data-tooltip]::before {
  left: 0;
  transform: translateY(4px);
}

.op-social-link:first-child[data-tooltip]:hover::before {
  transform: translateY(0);
}

.op-social-link:last-child[data-tooltip]::before {
  left: auto;
  right: 0;
  transform: translateY(4px);
}

.op-social-link:last-child[data-tooltip]:hover::before {
  transform: translateY(0);
}



.side-card {
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.side-card h3 {
  margin-bottom: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}

.side-card p {
  font-size: 0.85rem;
  color: var(--muted);
}

.cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin: 1.4rem 0;
}

.skill {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.skill strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
}

.skill span {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.55;
}

.timeline {
  position: relative;
  margin-top: 1.2rem;
  padding-left: 1.4rem;
  border-left: 1px solid var(--line);
}

.tl-item {
  position: relative;
  padding-bottom: 1.3rem;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1.4rem - 4.5px);
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent);
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item time {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.tl-item h4 {
  margin-top: 0.2rem;
  font-size: 0.95rem;
}

.tl-item p {
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ---------- command palette ---------- */
.palette {
  width: min(620px, calc(100% - 2rem));
  margin: 11vh auto auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.palette::backdrop {
  background: rgba(5, 3, 10, 0.72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.palette-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
}

.palette-form svg {
  width: 17px;
  height: 17px;
  color: var(--faint);
  flex-shrink: 0;
}

.palette-input {
  flex: 1;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.palette-input::placeholder {
  color: var(--faint);
}

.palette-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  flex-shrink: 0;
}

.palette-list {
  max-height: 48vh;
  overflow-y: auto;
  list-style: none;
  padding: 0.4rem;
  margin: 0;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
}

.palette-item .pi-main {
  min-width: 0;
  flex: 1;
}

.palette-item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-item span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-item .pi-kind {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.palette-item:hover,
[role="option"][aria-selected="true"] .palette-item {
  background: var(--panel-2);
  color: var(--text);
}

.palette-empty {
  padding: 1.6rem 1rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--faint);
}

.palette-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--faint);
}

.palette-foot kbd {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 0.25rem;
  margin-right: 0.2rem;
}

/* ---------- 404 ---------- */
.center-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 260px);
  padding-block: 4rem;
  text-align: center;
}

.center-page .code-404 {
  font-family: var(--font-mono);
  font-size: clamp(3.2rem, 12vw, 5.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent);
  text-shadow: 0 0 60px rgba(255, 122, 69, 0.25);
}

.center-page h1 {
  margin-top: 1rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.center-page p {
  margin-top: 0.6rem;
  color: var(--muted);
}

.center-page .hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

/* ---------- reveal ---------- */
.motion-ready .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.motion-ready .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .article-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-main {
    width: 100%;
    max-width: 800px;
    justify-self: center;
  }

  .article-aside {
    display: none;
  }

  .about-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    align-items: start;
  }
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards[data-view="index"] {
    display: block;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .follow {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .follow-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .tag-directory {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing-side {
    flex-direction: row;
    flex-wrap: wrap;
    padding-left: 0;
    border-left: 0;
    gap: 1rem 2rem;
  }

  .closing-stat {
    flex: 1 1 9rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-nav {
    justify-content: flex-start;
  }

  .mc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mc-cell:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .mc-cell:nth-child(2n) {
    border-right: 0;
  }

  .mc-cell:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .mc-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 700px) {
  .byline-tags {
    width: 100%;
    margin-left: 0;
  }

  .article-cover {
    aspect-ratio: 16 / 9;
  }

  /* The off-left heading anchor has no room on small screens. */
  .prose .anchor {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 66px;
  }

  .hero {
    padding-block: 2.6rem 1.9rem;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 10.5vw, 3rem);
  }

  .hero-lede {
    font-size: 0.95rem;
  }

  .hero-meta {
    gap: 0.4rem 0.7rem;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .archive-tools {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .archive-tools .search-field {
    flex: 1 1 100%;
    max-width: none;
  }

  .archive-tools .result-count {
    margin-left: auto;
    align-self: center;
  }

  .cards[data-view="index"] .card-body {
    grid-template-columns: 5rem minmax(0, 1fr);
    grid-template-areas:
      "date title"
      "date summary";
    column-gap: 0.85rem;
    padding: 0.9rem 0.4rem;
  }

  .cards[data-view="index"] .card-meta {
    display: none;
  }

  .cards[data-view="index"] .card-summary {
    -webkit-line-clamp: 2;
  }

  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .follow {
    grid-template-columns: minmax(0, 1fr);
  }

  .follow-mark {
    width: 44px;
    height: 44px;
  }

  .follow-actions {
    grid-column: auto;
  }

  .topic-strip {
    gap: 0.35rem;
  }

  .card-body {
    padding: 1rem 1.1rem 1.15rem;
  }

  .card-summary {
    -webkit-line-clamp: 4;
  }

  .archive-tools {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .search-field {
    flex: 1 1 0;
    max-width: none;
  }

  .result-count {
    order: 3;
    flex-basis: auto;
    margin-left: auto;
    padding-top: 0.15rem;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .footer-fine {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .prose {
    font-size: 0.965rem;
  }

  .prose h2 {
    margin-top: 2.3rem;
  }

  .article-head h1 {
    letter-spacing: -0.04em;
  }

  .mc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mc-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mc-cell:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .mc-cell:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 420px) {
  .brand-name {
    font-size: 0.98rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .masthead-actions {
    gap: 0.12rem;
  }

  .icon-btn {
    width: 35px;
    height: 35px;
  }
}

/* ---------- topic learning map ---------- */
.topic-intro {
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.topic-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: fit-content;
  margin: 1.75rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.topic-stats div {
  min-width: 112px;
  padding: 0.85rem 1.1rem;
}

.topic-stats div + div {
  border-left: 1px solid var(--line);
}

.topic-stats dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.75rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.topic-stats dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.topic-map {
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.topic-map-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.topic-map-head h2,
.topic-live-tags h2 {
  margin-top: 0.35rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.topic-map-head .tag-filter {
  width: min(100%, 420px);
  margin: 0;
}

.topic-tree {
  position: relative;
  padding: clamp(1rem, 3vw, 1.8rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 20%),
    var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
}

.topic-tree::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: linear-gradient(var(--accent), var(--accent-2));
}

.topic-tree-root {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.1rem 0 1rem;
  color: var(--text);
}

.topic-root-prompt {
  color: var(--accent);
}

.topic-tree-branch {
  padding: 0.65rem 0;
}

.topic-tree-branch + .topic-tree-branch {
  border-top: 1px dashed var(--line);
}

.topic-tree-branch h2 {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.topic-tree-marker {
  color: var(--faint);
  white-space: pre;
}

.topic-tree-count,
.topic-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  color: var(--faint);
}

.topic-tree-posts {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0 3.7rem;
  padding: 0;
  list-style: none;
}

.topic-tree-post {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 34px;
  color: var(--muted);
}

.topic-tree-link {
  width: fit-content;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  transition: color 0.14s, text-decoration-color 0.14s;
}

.topic-tree-link:hover,
.topic-tree-link:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.topic-state--live {
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  color: var(--ok);
}

.topic-live-tags {
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.topic-tags-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .topic-map-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topic-map-head .tag-filter {
    width: 100%;
  }

  .topic-tree-branch h2,
  .topic-tree-post {
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  }

  .topic-tree-posts {
    margin-left: 1rem;
  }
}

@media (max-width: 420px) {
  .topic-stats {
    width: 100%;
  }

  .topic-stats div {
    min-width: 0;
    flex: 1;
    padding-inline: 0.7rem;
  }

  .topic-tree-marker {
    font-size: 0.68rem;
  }

  .topic-tree-branch h2,
  .topic-tree-post {
    grid-template-columns: 1.8rem minmax(0, 1fr);
  }

  .topic-tree-count,
  .topic-state {
    grid-column: 2;
    width: fit-content;
  }
}

/* ---------- print ---------- */
@media print {
  :root {
    color-scheme: light;
    --text: #111;
    --muted: #444;
    --faint: #666;
    --line: #ddd;
    --line-strong: #bbb;
    --panel: #fff;
    --bg: #fff;
  }

  body {
    background: #fff;
    color: #111;
  }

  body::before,
  .masthead,
  .site-footer,
  .article-aside,
  .progress-track,
  .pager,
  .skip-link,
  .copy-btn,
  .palette,
  .card-cover,
  .article-cover,
  .closing,
  .cta,
  .related,
  .share-row,
  .follow,
  .topic-strip,
  .view-switch,
  .tag-filter {
    display: none !important;
  }

  .article-shell {
    display: block;
    padding: 0;
  }

  .prose {
    max-width: none;
    font-size: 11pt;
  }

  .prose a {
    color: #111;
    text-decoration: underline;
  }

  .prose pre,
  .code-block {
    border: 1px solid #ccc;
    background: #f7f7f7;
    color: #111;
    white-space: pre-wrap;
    word-break: break-word;
    page-break-inside: avoid;
  }

  .code-top {
    display: none;
  }

  .machine-card,
  .callout {
    border: 1px solid #ccc;
    background: #fff;
    page-break-inside: avoid;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .motion-ready .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }
}
