/* ============================================================================
   SYNTHWAVE CHROME — "Neko's Knowledge Vault"
   One disciplined synthwave system over the whole app.

   The laws:
   1. Two accents, two jobs. CYAN is the machine — every border, link and
      structure line. MAGENTA is the cat — the brand and whatever is selected.
      The sun keeps its yellow-orange-pink gradient, but only inside the sun
      (the header diorama and the site-home hero, which is the same scenery).
   2. Glow is feedback, not decoration. Nothing glows at rest except the neon
      signs: the wordmark, the sun, the active nav pill. Hover/focus/active
      earn their glow.
   3. Type: Bungee is the signage display (motto + standalone page titles),
      Audiowide is the quiet kicker voice, Mr Dafoe is the motel-sign script
      (the wordmark), Oswald is the condensed HUD voice (labels, nav,
      buttons, numbers), Rajdhani is everything humans read.
   4. The scenery is a dusk poster, not an arcade: pine ridges and the banded
      sun (no perspective grid) under a violet-to-indigo sky.

   Note *prose* keeps the Obsidian typography for readability; this sheet only
   skins the chrome around it. Loaded after obsidian-theme and blog-adapter so
   it wins the cascade.
   ========================================================================== */

:root {
  --sw-void: #030814;
  --sw-bg: #050b1e;
  --sw-panel: rgba(7, 18, 51, 0.82);
  --sw-card: rgba(5, 15, 45, 0.92);

  /* The machine (dominant) and the cat (selection + brand). */
  --sw-cyan: #00c8ff;
  --sw-cyan-soft: rgba(0, 200, 255, 0.32);
  --sw-cyan-dim: rgba(0, 200, 255, 0.12);
  --sw-magenta: #ff3fae;

  /* Cluster ramp — derived from the accents + the sun. */
  --sw-blue: #4895ef;
  --sw-amber: #ffb84d;
  --sw-ice: #9fd8ff;
  --sw-neutral: #5c6a8a;

  /* Chrome lettering — the wordmark title's metal, all cyan-family. */
  --sw-chrome-text: linear-gradient(180deg,
      #ffffff 0%,
      #d9f4ff 28%,
      #8fdcff 52%,
      #2f8fd8 78%,
      #1a5fae 100%);

  /* Standard resting border for panels, cards, inputs. */
  --sw-line: rgba(0, 200, 255, 0.22);

  /* Legacy vars kept for the standalone auth/private pages. */
  --sw-purple: #8a5cff;
  --sw-orange: #ff9e1f;

  --sw-text: #b8c6e0;
  --sw-bright: #e8f6ff;
  --sw-muted: #7f8fb0;
  --sw-header-h: 126px;

  --sw-glow-cyan: 0 0 9px rgba(0, 200, 255, 0.4), 0 0 26px rgba(0, 200, 255, 0.15);
  --sw-glow-magenta: 0 0 9px rgba(255, 63, 174, 0.45), 0 0 26px rgba(255, 63, 174, 0.16);

  --sw-font-display: "Oswald", "Rajdhani", ui-sans-serif, system-ui, sans-serif;
  /* Motel-sign script — the wordmark only. */
  --sw-font-script: "Mr Dafoe", cursive;
  --sw-font-body: "Rajdhani", ui-sans-serif, system-ui, sans-serif;
  /* Signage display — the motto and the standalone page titles. */
  --sw-font-neon: "Bungee", "Oswald", ui-sans-serif, sans-serif;
  --sw-font-80s: "Oswald", ui-sans-serif, sans-serif;

  /* Palm watermark motif — the same stock fan-palm silhouette the header rows
     use (img/palm-motif.png, #0a0a0a @10% alpha baked in), as a
     background-image layer so it always paints behind content. */
  --sw-palm-motif: url("/wiki/static/img/palm-motif.png");
}

/* Recolour the Obsidian variable layer so everything downstream (cards,
   panels, links, tags) shifts to the synthwave palette in one move. */
.theme-dark {
  --background-primary: var(--sw-bg);
  --background-secondary: var(--sw-panel);
  --panel-border: var(--sw-line);
  --text-normal: var(--sw-text);
  --text-muted: #7f8fb0;
  --text-faint: #5c6a8a;
  --text-accent: var(--sw-cyan);
  --text-on-accent: var(--sw-void);
  --link-color: var(--sw-cyan);
  --link-external-color: var(--sw-blue);
  --interactive-accent: var(--sw-cyan);
  --default-font: var(--sw-font-body);
  --h2-font: var(--sw-font-display);
  background-color: var(--sw-bg);
}

/* ---------------------------------------------------------------- background */

/* Starfield over a dusk sky — violet at the top of the world (where the sun
   diorama lives) sinking to indigo night. No perspective grid: the scenery
   is a pine-poster, not an arcade. */
body.theme-dark::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(232, 246, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 8%, rgba(232, 246, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 56% 26%, rgba(0, 200, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 42%, rgba(232, 246, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 33%, rgba(0, 200, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 5% 55%, rgba(232, 246, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 74%, rgba(232, 246, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 88%, rgba(0, 200, 255, 0.35) 50%, transparent 51%),
    linear-gradient(180deg, #1b0b36 0%, #0e0a26 42%, var(--sw-void) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .sw-sun-glow,
  .sw-wordmark-script,
  .site-header {
    animation: none !important;
  }
}

/* Slow breathing glow around the sun — the one motion the chrome gets. */
.sw-sun-glow {
  animation: sw-sun-breathe 7s ease-in-out infinite;
}

@keyframes sw-sun-breathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* The script tube buzzes now and then — a motel sign that is on, not
   strobing. Two faint dips per 9s cycle. */
.sw-wordmark-script {
  animation: sw-tube-buzz 9s linear infinite;
}

@keyframes sw-tube-buzz {
  0%, 91%, 95%, 99%, 100% { opacity: 1; }
  92% { opacity: 0.82; }
  94% { opacity: 0.93; }
  97% { opacity: 0.88; }
}

/* -------------------------------------------------------------------- header */

.site-header {
  position: relative;
  height: var(--sw-header-h);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}

.site-header-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
  padding: 0 2rem;
}

/* The synthwave diorama (inline SVG) fills the header behind the chrome. */
.sw-header-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* Brand — a neon sign, allowed to glow at rest. ------------------------------ */

/* Brand — a motel billboard: dark acrylic cabinet, magenta tube edge,
   glow pooling on the glass. A sign, so it may glow at rest. */
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
  padding: 0.5rem 0.95rem 0.62rem;
  background: rgba(4, 10, 26, 0.6);
  border: 1px solid rgba(255, 63, 174, 0.4);
  border-radius: 14px;
  box-shadow:
    0 0 16px rgba(255, 63, 174, 0.14),
    inset 0 0 22px rgba(255, 63, 174, 0.07);
  backdrop-filter: blur(3px);
}

.site-brand a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.sw-cat {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255, 63, 174, 0.8));
}

.sw-wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sw-wordmark-script {
  font-family: var(--sw-font-script);
  font-size: 1.62rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--sw-magenta);
  text-shadow:
    0 0 5px rgba(255, 63, 174, 0.85),
    0 0 16px rgba(255, 63, 174, 0.5),
    0 0 34px rgba(255, 63, 174, 0.3);
  /* the script hangs over the chrome line, motel-sign style */
  position: relative;
  z-index: 1;
  margin-bottom: -0.42rem;
  white-space: nowrap;
}

/* Chrome lettering — vertical metal in the cyan family, gradient clipped
   to the glyphs; filter (not text-shadow) so it survives background-clip. */
.sw-wordmark-title {
  font-family: "Audiowide", var(--sw-font-80s);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--sw-cyan);
  background-image: var(--sw-chrome-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 7px rgba(0, 200, 255, 0.4));
  white-space: nowrap;
}

/* Nav — quiet text items; the active tab is a filled cyan pill -------------- */

/* Nav sits mid-band beside the wordmark — a marquee board: dark acrylic
   pill, cyan tube edge, letter-spaced signage inside. Only the active
   item is a lit sign (mock: 1_.png). */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  align-self: center;
  padding: 0.3rem 0.85rem;
  background: rgba(4, 10, 26, 0.6);
  border: 1px solid rgba(0, 200, 255, 0.32);
  border-radius: 999px;
  box-shadow:
    0 0 16px rgba(0, 200, 255, 0.12),
    inset 0 0 18px rgba(0, 200, 255, 0.05);
  backdrop-filter: blur(3px);
}

.site-nav a {
  font-family: var(--sw-font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-text);
  text-decoration: none;
  padding: 0.35rem 0.35rem;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.site-nav a:hover {
  color: var(--sw-bright);
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.5);
}

.site-nav a[aria-current="page"] {
  color: var(--sw-cyan);
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.45);
}

.nav-toggle {
  font-family: var(--sw-font-display);
  background: rgba(3, 8, 20, 0.72);
  color: var(--sw-cyan);
  border: 1px solid var(--sw-cyan-soft);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

/* -------------------------------------------------------------------- panels */

/* Nothing inside the chrome may force the page wider than the viewport —
   grid/flex children default to min-width:auto, which a wide canvas or a
   nowrap chip row exploits to blow out phones. */
.site-wrapper {
  max-width: 100%;
  overflow-x: clip;
}

.global-graph-panel,
.node-list-panel {
  min-width: 0;
}

.site-main {
  padding: 1.1rem 1.4rem 1.6rem;
}

.home-layout {
  gap: 1rem;
  height: calc(100vh - var(--sw-header-h) - 2.7rem);
  min-height: 420px;
}

.global-graph-panel,
.node-list-panel,
.sw-recent,
.sw-hubs-panel,
.sw-posts-panel {
  position: relative;
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  background: var(--sw-panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.global-graph-panel,
.node-list-panel {
  overflow: hidden;
}

/* HUD corner brackets — the chrome's signature, on every framed panel. */
.global-graph-panel::before,
.global-graph-panel::after,
.node-list-panel::before,
.node-list-panel::after,
.sw-recent::before,
.sw-recent::after,
.sw-hubs-panel::before,
.sw-hubs-panel::after,
.sw-posts-panel::before,
.sw-posts-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 5;
  pointer-events: none;
  border-color: var(--sw-cyan);
  border-style: solid;
  opacity: 0.85;
}

.global-graph-panel::before,
.node-list-panel::before,
.sw-recent::before,
.sw-hubs-panel::before,
.sw-posts-panel::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.global-graph-panel::after,
.node-list-panel::after,
.sw-recent::after,
.sw-hubs-panel::after,
.sw-posts-panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.sw-panel-icon {
  width: 16px;
  height: 16px;
  stroke: var(--sw-cyan);
  filter: drop-shadow(0 0 4px rgba(0, 200, 255, 0.6));
}

.home-layout .global-graph-panel #graph {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(0, 200, 255, 0.07), transparent 60%),
    rgba(3, 8, 20, 0.5);
}

/* Graph legend — the graph panel's header. Chips are built by graph.js from
   the top topic clusters; clicking one filters graph + notes. */
.sw-graph-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--sw-line);
  background: rgba(3, 8, 20, 0.55);
}

.sw-graph-legend:empty {
  display: none;
}

/* Chips are color dot + count; the tag name lives in the tooltip/aria-label
   so the row stays compact on phones.
   The `:root .theme-dark .site-wrapper` prefix is LOAD-BEARING. The theme's
   generic button rule — button:not(.clickable-icon, …):not(…) — computes to
   (0,3,2) and paints EVERY button with an accent fill + a 2em inset glow.
   The chips are <button>s, so at (0,1,0)/(0,2,0) these rules never applied;
   at (0,4,x) they beat it (plus order). Same trap as the headings: check the
   theme's :not-lists before scoping any button override. */
:root .theme-dark .site-wrapper .sw-legend-chip {
  --cluster: var(--sw-neutral);
  --cluster-dim: rgba(92, 106, 138, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-family: var(--sw-font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sw-text);
  background: transparent;
  border: 1px solid rgba(92, 106, 138, 0.45);
  border-radius: 999px;
  padding: 0.26rem 0.6rem 0.26rem 0.5rem;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

:root .theme-dark .site-wrapper .sw-legend-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cluster);
  box-shadow: 0 0 7px var(--cluster);
}

:root .theme-dark .site-wrapper .sw-legend-chip:hover {
  color: var(--sw-bright);
  border-color: var(--cluster);
}

:root .theme-dark .site-wrapper .sw-legend-chip.is-active {
  color: var(--sw-bright);
  border-color: var(--cluster);
  background: var(--cluster-dim);
  box-shadow: 0 0 8px var(--cluster-dim);
}

:root .theme-dark .site-wrapper .sw-legend-count {
  font-family: var(--sw-font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--sw-muted);
}

:root .theme-dark .site-wrapper .sw-legend-chip.is-active .sw-legend-count {
  color: var(--sw-bright);
}

/* Graph zoom controls — rounded HUD squares, bottom-left. */
.sw-graph-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-graph-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--sw-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--sw-cyan);
  background: rgba(3, 8, 20, 0.85);
  border: 1px solid var(--sw-cyan-soft);
  border-radius: 9px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sw-graph-btn:hover {
  border-color: var(--sw-cyan);
  box-shadow: var(--sw-glow-cyan);
}

.sw-graph-btn svg {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 0 3px rgba(0, 200, 255, 0.6));
}

/* Local graph on note pages gets the same controls; anchor them too. */
.local-graph-panel #graph {
  position: relative;
}

/* Notes column -------------------------------------------------------------- */

/* Compact toolbar: contextual title + count, search below. No "NOTES" tab. */
.node-list-header {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-bottom: 1px solid var(--sw-line);
  padding: 0.65rem 1rem 0.6rem;
  background: rgba(3, 8, 20, 0.55);
}

.node-list-heading {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.node-list-title {
  margin: 0;
  font-family: var(--sw-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sw-bright);
  white-space: nowrap;
}

/* The variable part of the title (selected note, tag, search term) is the
   one place magenta appears in the chrome: it marks "this is where you are". */
.node-list-subtitle {
  font-family: var(--sw-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sw-magenta);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-list-count {
  margin-left: auto;
  font-family: var(--sw-font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-muted);
  white-space: nowrap;
}

/* Search input — cyan magnifier, glow on focus only. */
.search-input {
  font-family: var(--sw-font-body);
  font-size: 0.98rem;
  color: var(--sw-bright);
  border: 1px solid var(--sw-line);
  border-radius: 10px;
  background: rgba(3, 8, 20, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300c8ff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'%3E%3C/circle%3E%3Cline x1='15.5' y1='15.5' x2='21' y2='21'%3E%3C/line%3E%3C/svg%3E") no-repeat left 0.7rem center / 16px 16px;
  padding: 0.5rem 0.8rem 0.5rem 2.3rem;
}

.search-input::placeholder {
  color: #6d7c9c;
}

.search-input:focus {
  outline: none;
  border-color: var(--sw-cyan);
  box-shadow: var(--sw-glow-cyan);
}

/* "✕ Clear" back-button and pagination — quiet bordered buttons. */
.clear-selection,
.pagination a,
.search-button {
  font-family: var(--sw-font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-cyan);
  background: rgba(3, 8, 20, 0.8);
  border: 1px solid var(--sw-cyan-soft);
  border-radius: 8px;
  padding: 0.38rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.clear-selection:hover,
.pagination a:hover,
.search-button:hover {
  color: var(--sw-bright);
  border-color: var(--sw-cyan);
  box-shadow: var(--sw-glow-cyan);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--sw-line);
  font-family: var(--sw-font-body);
  color: var(--sw-text);
}

/* ---------------------------------------------------------------- note cards */

.node-list {
  padding: 0.9rem;
  gap: 0.9rem;
}

.post-card.node-card,
.post-card {
  position: relative;
  border: 1px solid var(--sw-line);
  border-radius: 12px;
  background-color: var(--sw-card);
  /* Single palm watermark, one corner only — a quiet signature, not noise. */
  background-image: var(--sw-palm-motif);
  background-position: right 10px bottom 8px;
  background-size: 26px auto;
  background-repeat: no-repeat;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  padding: 0.95rem 1.1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Left identity bar: the note's topic-cluster color (set by home.js);
   transparent when the note belongs to no cluster. */
.node-list .post-card.node-card,
.node-list .post-card {
  border-left: 2px solid var(--note-color, transparent);
}

.post-card.node-card:hover,
.post-card:hover {
  border-color: rgba(0, 200, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.22);
  transform: translateY(-1px);
}

/* Selection states: selected = magenta (the selection color), connected =
   blue (structure), tag-match = the card's cluster color. */
.post-card.node-card.selected-card {
  border-color: var(--sw-magenta);
  border-left-color: var(--sw-magenta);
  box-shadow: 0 0 14px rgba(255, 63, 174, 0.4);
}

.post-card.node-card.connected-card {
  border-left-color: var(--sw-blue);
}

.post-card.node-card.tag-card {
  border-left-color: var(--note-color, var(--sw-cyan));
}

.post-card h2 {
  font-family: var(--sw-font-body);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* Document icon before every card title. */
.post-card h2::before {
  content: "";
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300c8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6.5A1.5 1.5 0 0 0 5 4.5v15A1.5 1.5 0 0 0 6.5 21h11a1.5 1.5 0 0 0 1.5-1.5V7z'/%3E%3Cline x1='14' y1='3' x2='14' y2='7.5'/%3E%3Cline x1='18' y1='7.5' x2='14' y2='7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(0, 200, 255, 0.6));
}

.post-card h2 a {
  color: var(--sw-cyan);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--sw-bright);
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

.post-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-family: var(--sw-font-body);
}

.post-card-meta time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: #7f8fb0;
  margin-right: 0.35rem;
}

.post-card-meta time::before {
  content: "";
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8fb0' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Tag chips — neutral by default; cluster tags get their color inline from
   home.js (colorizeTags). */
a.tag,
.tag {
  display: inline-block;
  font-family: var(--sw-font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.14rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(92, 106, 138, 0.45);
  color: var(--sw-muted);
  background: rgba(92, 106, 138, 0.12);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

a.tag:hover,
.tag:hover {
  color: var(--sw-bright);
  border-color: rgba(0, 200, 255, 0.5);
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.25);
}

.post-card-excerpt {
  font-family: var(--sw-font-body);
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--sw-text);
  margin: 0.5rem 0 0;
}

.panel-empty,
.graph-empty {
  font-family: var(--sw-font-body);
  color: var(--sw-text);
}

/* ------------------------------------------------- tag & search list pages */

.page-header h1 {
  font-family: var(--sw-font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sw-cyan);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 760px;
}

.results-count,
.page-header p {
  font-family: var(--sw-font-body);
  color: var(--sw-text);
}

/* Heading glow — OFF, globally. The Obsidian cyberpunk theme puts a 4–5
   layer text-shadow haze on every heading via BOTH scoped selectors
   (.markdown-rendered h2) AND bare ones (h2, h2 strong) — the bare ones are
   what glowed on the classroom/library pages, which have no .note-content
   wrapper. This reset ((0,1,1)/(0,1,2), loaded after the theme) beats every
   applicable reading-mode selector. The intentional neon signs opt back in
   at (0,2,x): .sw-hero .sw-hero-title, .theme-dark .private-title,
   .theme-dark .auth-title — keep those above this bar if you touch them. */
.theme-dark h1, .theme-dark h2, .theme-dark h3,
.theme-dark h4, .theme-dark h5, .theme-dark h6,
.theme-dark h1 strong, .theme-dark h2 strong, .theme-dark h3 strong,
.theme-dark h4 strong, .theme-dark h5 strong, .theme-dark h6 strong {
  text-shadow: none;
}

/* Note headings still take the HUD voice (theme's Orbitron isn't even
   loaded here — falls back to Inter). */
.note-content h2,
.note-content h2 strong,
.note-content h3,
.note-content h3 strong,
.note-content h4,
.note-content h4 strong,
.note-content h5,
.note-content h5 strong,
.note-content h6,
.note-content h6 strong {
  font-family: var(--sw-font-display);
}

.note-content h2,
.note-content h2 strong {
  border-image-source: linear-gradient(to right, var(--sw-cyan), transparent);
}

/* Links inside note headings: text-shadow inherits from the heading while
   the theme layers its own glow on top (and a 4-stop burst on hover) —
   an <a> in an H1/H2 doubles the neon. Heading links wear the heading's
   light, with a dotted underline as the only link cue. The .markdown-rendered
   prefix is load-bearing: it out-specifies the theme's
   .markdown-rendered .internal-link:hover burst (0,3,0) — without it the
   override silently loses and the burst stacks on the heading halo. */
.markdown-rendered .note-content h1 a,
.markdown-rendered .note-content h2 a,
.markdown-rendered .note-content h1 a:hover,
.markdown-rendered .note-content h2 a:hover {
  color: inherit;
  text-shadow: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 200, 255, 0.45);
}

.markdown-rendered .note-content h1 a:hover,
.markdown-rendered .note-content h2 a:hover {
  border-bottom-color: rgba(0, 200, 255, 0.85);
}

/* Tables — the theme wraps every table in a cyan aura, glows the inside of
   EVERY cell, and draws the grid with full-accent !important borders (plus a
   3em inset wash on thead). Quiet table: hairline grid in the standard line
   color, no glows anywhere, faint header tint as the only structure. The
   !important on the border is required — the theme's is !important too and
   a plain declaration always loses to one. */
.markdown-rendered table {
  box-shadow: none;
}

.markdown-rendered td,
.markdown-rendered th,
.markdown-rendered thead tr > * {
  border: 1px solid var(--sw-line) !important;
  box-shadow: none !important;
}

.markdown-rendered thead,
.markdown-rendered thead th {
  box-shadow: none;
  background: rgba(0, 200, 255, 0.05);
}

/* --------------------------------------------------------- note detail page */

.blog-three-column {
  gap: 1rem;
}

.blog-three-column .blog-sidebar {
  border: 1px solid var(--sw-line);
  border-radius: 12px;
  background: var(--sw-panel);
  padding: 1rem;
}

.blog-three-column .blog-main {
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  background: rgba(4, 10, 28, 0.88);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 1.6rem 2rem;
}

.blog-three-column .blog-main .note-content {
  font-family: var(--sw-font-body);
}

.blog-sidebar h2,
.roadmap-panel h2 {
  font-family: var(--sw-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sw-cyan);
}

.note-meta-bar time {
  font-family: var(--sw-font-body);
  letter-spacing: 0.08em;
  color: #7f8fb0;
}

/* ------------------------------------------------- syntax highlighting */
/* Pygments tokens emitted by the codehilite extension (wiki notes AND
   classroom lessons, which is why the token rules hang off plain
   .codehilite). Colors stay on the vault ramp — magenta = keywords,
   amber = strings, ice = numbers/escapes, cyan = functions & markup tags,
   blue = builtins/types, bright = attributes/variables. Comments go
   quiet in the muted body tone. No glow: code never glows at rest. */

.markdown-rendered .codehilite pre {
  background: rgba(3, 8, 20, 0.8);
}

.codehilite .k, .codehilite .kd, .codehilite .kn, .codehilite .kp,
.codehilite .kr, .codehilite .ow {
  color: var(--sw-magenta);
}

.codehilite .kt, .codehilite .nb, .codehilite .bp, .codehilite .nc,
.codehilite .ne, .codehilite .nn, .codehilite .no {
  color: var(--sw-blue);
}

.codehilite .nf, .codehilite .fm, .codehilite .nd, .codehilite .nt {
  color: var(--sw-cyan);
}

.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sa,
.codehilite .sb, .codehilite .sc, .codehilite .sd, .codehilite .se,
.codehilite .sh, .codehilite .si, .codehilite .sr, .codehilite .ss,
.codehilite .sx, .codehilite .dl {
  color: var(--sw-amber);
}

.codehilite .m, .codehilite .mb, .codehilite .mf, .codehilite .mh,
.codehilite .mi, .codehilite .il, .codehilite .mo, .codehilite .esc {
  color: var(--sw-ice);
}

.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cs,
.codehilite .ch {
  color: var(--sw-muted);
  font-style: italic;
}

.codehilite .na, .codehilite .nv, .codehilite .nx, .codehilite .vc,
.codehilite .vg, .codehilite .vi {
  color: var(--sw-bright);
}

.codehilite .gi {
  color: var(--sw-cyan);
}

.codehilite .gd, .codehilite .err {
  color: var(--sw-magenta);
}

/* --------------------------------------------------------------- a11y bits */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--sw-bright);
  outline-offset: 2px;
}

::selection {
  background: rgba(0, 200, 255, 0.35);
  color: var(--sw-bright);
}

/* ---------------------------------------------------------- site home deck */

/* Hero: sunset halo + palm watermark trees bleeding off the bottom corners.
   The trees are background-image layers, so they can never sit above text
   or intercept clicks; negative positions crop them at the banner edge. */
.sw-hero {
  text-align: center;
  padding: 2.6rem 1rem 1.8rem;
  background-image:
    radial-gradient(ellipse 62% 78% at 50% 32%, rgba(255, 63, 174, 0.13), rgba(255, 157, 77, 0.06) 55%, transparent 72%),
    var(--sw-palm-motif),
    var(--sw-palm-motif),
    var(--sw-palm-motif);
  background-position:
    center,
    left -30px bottom -10px,
    left 62px bottom -8px,
    right -26px bottom -12px;
  background-size:
    auto,
    104px auto,
    64px auto,
    88px auto;
  background-repeat: no-repeat;
}

/* (0,2,0) — sits above the global heading-glow reset on purpose:
   the motto is a neon sign and keeps its light. */
.sw-hero .sw-hero-title {
  font-family: "Audiowide", var(--sw-font-neon);
  font-weight: 400;
  font-size: clamp(1.45rem, 4vw, 2.6rem);
  line-height: 1.28;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sw-cyan);
  text-shadow:
    0 0 6px rgba(0, 200, 255, 0.45),
    0 0 20px rgba(0, 200, 255, 0.22);
  margin: 0 0 1.1rem;
}

/* Second line gets the striped-sun gradient fill — same colors as the header sun. */
.sw-hero-title span {
  color: transparent;
  background: linear-gradient(180deg, #ffd319 0%, #ff9e1f 45%, #ff3fae 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 6px rgba(255, 63, 174, 0.7))
    drop-shadow(0 0 20px rgba(255, 63, 174, 0.35));
}

.sw-hero-sub {
  font-family: var(--sw-font-body);
  font-size: 1.08rem;
  color: var(--sw-text);
  margin: 0 auto;
  max-width: 44rem;
}

/* Quickbar — the hero's action strip. Counts answer "how big is the vault?";
   this answers "what can I do with it": find a note, or stumble on one. */
.sw-quickbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 640px;
  margin: 1.7rem auto 0;
}

.sw-quickbar-search {
  position: relative;
  flex: 1;
}

.sw-quickbar-input {
  width: 100%;
  font-family: var(--sw-font-body);
  font-size: 1.02rem;
  color: var(--sw-bright);
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  background: rgba(3, 8, 20, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300c8ff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'%3E%3C/circle%3E%3Cline x1='15.5' y1='15.5' x2='21' y2='21'%3E%3C/line%3E%3C/svg%3E") no-repeat left 0.85rem center / 16px 16px;
  padding: 0.62rem 1.1rem 0.62rem 2.5rem;
}

.sw-quickbar-input::placeholder {
  color: #6d7c9c;
}

.sw-quickbar-input:focus {
  outline: none;
  border-color: var(--sw-cyan);
  box-shadow: var(--sw-glow-cyan);
}

/* Random note — a quiet bordered action; hover earns the glow. */
.sw-quickbar-random {
  font-family: var(--sw-font-80s);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-text);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sw-quickbar-random:hover,
.sw-quickbar-random:focus-visible {
  color: var(--sw-cyan);
  border-color: var(--sw-cyan);
  box-shadow: var(--sw-glow-cyan);
  outline: none;
}

/* Two-column deck: recent cards + hub list. */
.sw-deck {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
  max-width: 1080px;
  margin: 1.8rem auto 0;
  align-items: start;
}

/* Padding only — the frame (border/radius/fill/shadow/brackets) comes from
   the shared panel rule above, same as the dashboard panels. */
.sw-recent,
.sw-hubs-panel,
.sw-posts-panel {
  padding: 1rem 1rem 1.1rem;
}

.post-list.sw-posts-panel {
  margin-top: 1rem;
}

.sw-deck-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  font-family: var(--sw-font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sw-cyan);
}

.sw-recent .post-card + .post-card {
  margin-top: 0.9rem;
}

.sw-more {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--sw-font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sw-cyan);
  text-decoration: none;
}

.sw-more:hover {
  color: var(--sw-bright);
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

.sw-hubs-sub {
  font-family: var(--sw-font-body);
  font-size: 0.85rem;
  color: var(--sw-text);
  margin: -0.4rem 0 0.9rem;
}

.sw-hub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.55rem;
  border: 1px solid var(--sw-line);
  border-radius: 9px;
  background: var(--sw-card);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-hub:hover {
  border-color: var(--sw-cyan);
  box-shadow: 0 0 9px rgba(0, 200, 255, 0.25);
}

.sw-hub-title {
  font-family: var(--sw-font-body);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--sw-cyan);
}

.sw-hub-links {
  font-family: var(--sw-font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sw-muted);
  flex-shrink: 0;
}

/* Destination tiles. */
.sw-dest {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1080px;
  margin: 1.8rem auto 1rem;
}

.sw-dest-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.25rem 0.7rem 1.1rem;
  border: 1px solid var(--sw-line);
  border-radius: 12px;
  background: var(--sw-card);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sw-dest-tile:hover {
  border-color: var(--sw-cyan);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.25);
  transform: translateY(-2px);
}

.sw-dest-icon {
  width: 26px;
  height: 26px;
  stroke: var(--sw-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.6));
}

.sw-dest-name {
  font-family: var(--sw-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sw-bright);
}

.sw-dest-desc {
  font-family: var(--sw-font-body);
  font-size: 0.82rem;
  color: var(--sw-text);
  text-align: center;
}

@media (max-width: 900px) {
  .sw-quickbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sw-quickbar-random {
    text-align: center;
  }

  .sw-deck {
    grid-template-columns: 1fr;
  }

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

/* ------------------------------------------------------------- small screens */

@media (max-width: 900px) {
  :root {
    --sw-header-h: 110px;
  }

  /* One row: brand left, menu button right. The nav itself becomes a
     fixed dropdown panel under the header — no more wrapping rows. */
  .site-header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    gap: 0.8rem;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    /* the brand refuses to shrink (nowrap wordmark) — the button must
       never be the element that gives way */
    flex-shrink: 0;
  }

  /* Single-column note pages: .site-main and .blog-main would stack to
     ~54px of side padding — a phone can't afford that. Phones read
     edge-ish; tablets keep a bit more air. */
  .site-main {
    padding: 0.7rem 0.6rem 1rem;
  }

  .blog-three-column .blog-main {
    padding: 0.9rem 0.75rem;
  }

  .site-nav {
    display: none;
    position: fixed;
    top: var(--sw-header-h);
    left: 0;
    right: 0;
    z-index: 60;
    flex-direction: column;
    align-self: stretch;
    gap: 0.4rem;
    margin: 0;
    padding: 0.8rem 1rem 1rem;
    background: rgba(4, 10, 26, 0.97);
    border-bottom: 1px solid var(--sw-cyan-soft);
    /* the marquee pill flattens out for the dropdown panel */
    border-radius: 0;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    border: 1px solid var(--sw-line);
    border-radius: 10px;
  }

  .site-nav a[aria-current="page"] {
    border-color: var(--sw-cyan);
  }

  /* Legend chips scroll horizontally instead of eating graph height. */
  .sw-graph-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sw-graph-legend::-webkit-scrollbar {
    display: none;
  }

  .node-list {
    max-height: 60vh;
  }
}

/* Phones --------------------------------------------------------------- */

@media (max-width: 600px) {
  /* The full billboard (cat + script + "KNOWLEDGE VAULT" lettering) is
     wider than the header row next to the menu button — the sign keeps
     the cat and the script, drops the chrome lettering. */
  .site-brand {
    padding: 0.4rem 0.7rem 0.5rem;
  }

  .site-brand a {
    gap: 0.6rem;
  }

  .sw-cat {
    width: 36px;
    height: 36px;
  }

  .sw-wordmark-script {
    font-size: 1.4rem;
  }

  .sw-wordmark-title {
    display: none;
  }

  /* Note reading: near edge-to-edge, just enough rim that text doesn't
     touch the glass. */
  .site-main {
    padding: 0.5rem 0.35rem 0.9rem;
  }

  .blog-three-column .blog-main {
    padding: 0.75rem 0.6rem;
  }
}
