/* =========================================================================
   Syb's AI-Slop Journal — shared stylesheet
   A dark, editorial "annotated edition": the complementary inverse of the
   original's warm-paper precious-literary look. Same journal bones (timeline,
   glossary ※ links, footnote popovers, dashed rules) flipped to a clinical,
   lamp-lit dark reading room where the prose gets quietly decoded.
   ========================================================================= */

:root {
  /* dark base */
  --ink: #e7e3d4;
  --ink: #e8e4da;            /* warm off-white text */
  --ink-soft: #8b8798;       /* muted labels */
  --ink-faint: #5b5868;
  --paper: #0c0d12;          /* near-black, cool */
  --panel: #14151d;          /* raised surface */
  --panel-2: #1b1d27;
  --rule: #282a38;           /* hairline / dashed */
  --dot: rgba(167, 139, 250, 0.06);

  /* per-entry accent — overridden inline per page (mirrors the original) */
  --ac: #a78bfa;
  /* the satire's signal colour: the editor's red pen */
  --correction: #ff5b6e;

  --serif: 'Newsreader', ui-serif, 'Iowan Old Style', Georgia, serif;
  --display: 'Fraunces', 'Newsreader', ui-serif, Georgia, serif;
  --mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* per-register tone: subtle, keeps the family coherent */
body[data-register='sharp']   { --correction: #5ad1e6; }  /* ice — cold & precise */
body[data-register='playful'] { --correction: #ffb24c; }  /* amber — sunny */
body[data-register='savage']  { --correction: #ff4d5e; }  /* blood — no mercy */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* dot-grid + a faint lamp-glow vignette from top */
  background-image:
    radial-gradient(var(--dot) 1.4px, transparent 1.4px),
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--ac) 13%, transparent), transparent 60%);
  background-size: 24px 24px, 100% 100%;
  background-attachment: fixed;
  font-family: var(--serif);
  font-size: 1.13rem;
  line-height: 1.74;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* faint scanline grain so the dark never reads as flat */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1.4rem 5rem;
}

/* ---- masthead ---- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.4rem;
  border-bottom: 3px dashed var(--rule);
}

.masthead .sigil {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.masthead .sigil .bot {
  font-style: normal;
  filter: grayscale(0.1);
}

.masthead .sigil a {
  text-decoration: none;
  background: linear-gradient(100deg, #a78bfa, #ff5b6e 48%, #5ad1e6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.masthead .sigil .hc {
  border-bottom: 2px dotted color-mix(in srgb, var(--correction) 65%, transparent);
}
.masthead .sigil .hc:hover { border-bottom-style: solid; }

.masthead .tagline {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #0c0d12;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(100deg, var(--correction), #a78bfa);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  transform: rotate(-2deg);
  transition: transform 0.14s ease;
  font-weight: 700;
}
.masthead .tagline:hover { transform: rotate(2deg) scale(1.05); }

/* ---- register switcher ---- */
.register-switch {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 2rem;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--panel);
}
.register-switch .rs-label {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  color: var(--ink-faint);
  border-right: 1.5px solid var(--rule);
  white-space: nowrap;
}
.register-switch a {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.5rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-right: 1.5px solid var(--rule);
  transition: background 0.14s ease, color 0.14s ease;
}
.register-switch a:last-child { border-right: none; }
.register-switch a:hover { background: var(--panel-2); color: var(--ink); }
.register-switch a[aria-current='true'] {
  background: var(--correction);
  color: #0c0d12;
  font-weight: 700;
}
/* voice toggle (jump to the other voice) sits at the right, set apart */
.register-switch .rs-voice {
  flex: 0 0 auto;
  border-right: none;
  border-left: 1.5px solid var(--rule);
  color: var(--ink);
  background: color-mix(in srgb, var(--ac) 16%, transparent);
  white-space: nowrap;
}
.register-switch .rs-voice:hover {
  background: color-mix(in srgb, var(--ac) 30%, transparent);
  color: var(--ink);
}

/* hub: voice-group headings */
.group-head {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  margin: 2.4rem 0 0.9rem;
}
.group-head .group-sub {
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ---- breadcrumbs ---- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 2rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.crumbs a { color: var(--ac); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.crumb-sep { opacity: 0.5; }

a {
  color: var(--ac);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--ac) 45%, transparent);
}

footer {
  position: relative;
  z-index: 1;
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 3px dashed var(--rule);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  line-height: 1.6;
}
footer::before {
  content: '✦ ✦ ✦';
  display: block;
  letter-spacing: 0.5em;
  margin-bottom: 0.6rem;
  background: linear-gradient(100deg, #a78bfa, #ff5b6e, #5ad1e6, #ffb24c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
footer .fnote { margin: 0 0 0.5rem; }
footer .fnote:last-child { margin-bottom: 0; }
footer a { color: var(--ink-soft); }

/* ---- index: vertical timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 1.35rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(to bottom, #ec4899, #06b6d4, #f59e0b, #10b981, #f97316);
  opacity: 0.6;
}
.timeline li { position: relative; }
.tl-item {
  display: grid;
  grid-template-columns: 2.7rem 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 0.55rem 0.6rem 0.9rem 0;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.14s ease;
}
.tl-item:hover { transform: translateX(4px); }
.tl-node {
  position: relative;
  z-index: 1;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: #0c0d12;
  background: var(--ac);
  box-shadow: 0 0 0 4px var(--paper), 3px 3px 0 color-mix(in srgb, var(--ac) 45%, #000);
}
.tl-content { padding-top: 0.15rem; min-width: 0; }
.tl-date {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 0.2rem;
}
.tl-title { font-family: var(--display); font-size: 1.34rem; line-height: 1.2; font-weight: 600; }
.tl-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  line-height: 1.45;
}
.tl-item:hover .tl-title { color: var(--ac); }

/* ---- callout / PLAIN TERMS decode box ---- */
.callout {
  margin: 0 0 2.4rem;
  padding: 1.05rem 1.2rem;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--ac) 38%, transparent);
  background: color-mix(in srgb, var(--ac) 10%, transparent);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--ac) 16%, transparent);
}
.callout-kicker {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ac);
}
.callout-kicker::before { content: '✦ '; }
.callout-body { margin: 0; font-style: italic; line-height: 1.6; }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }

/* PLAIN-TERMS variant: the signature satire element. Editor's-pen framed. */
.plainbox {
  margin: 0 0 2.4rem;
  padding: 1.05rem 1.2rem 1.1rem;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--correction) 45%, transparent);
  border-left-width: 6px;
  background:
    linear-gradient(color-mix(in srgb, var(--correction) 7%, transparent),
                    color-mix(in srgb, var(--correction) 3%, transparent));
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--correction) 16%, transparent);
}
.plainbox-kicker {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--correction);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.plainbox-kicker::before { content: '⌖'; font-size: 1.05em; }
.plainbox-body { margin: 0; line-height: 1.62; }
.plainbox-body > :first-child { margin-top: 0; }
.plainbox-body > :last-child { margin-bottom: 0; }

/* ---- critic verdict block: real words, preserved & set apart ---- */
.verdict {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 0;
  border-radius: 12px;
  border: 1.5px solid var(--rule);
  background: var(--panel);
  overflow: hidden;
}
.verdict-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  background: var(--panel-2);
  border-bottom: 1.5px solid var(--rule);
}
.verdict-head .who { color: var(--correction); font-weight: 700; }
.verdict-body {
  padding: 0.7rem 1.05rem 0.9rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  line-height: 1.6;
}
.verdict-body > :first-child { margin-top: 0; }
.verdict-body > :last-child { margin-bottom: 0; }

/* ---- disclosure (collapsible) ---- */
.disclosure {
  margin: 0 0 1.6rem;
  border: 2px dashed var(--rule);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.disclosure > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: '▸';
  display: inline-block;
  color: var(--ac);
  transition: transform 0.15s ease;
}
.disclosure[open] > summary { color: var(--ac); }
.disclosure[open] > summary::before { transform: rotate(90deg); }
.disclosure-body { padding: 0.1rem 1.1rem 0.9rem; color: var(--ink-soft); }
.disclosure-body > :first-child { margin-top: 0; }
.disclosure-body > :last-child { margin-bottom: 0; }

/* ---- article ---- */
article h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.08;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ac);
  background: linear-gradient(120deg, var(--ac), color-mix(in srgb, var(--ac) 35%, #fff));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
article .dateline {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0c0d12;
  background: var(--ac);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 2.4rem;
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--ac) 45%, #000);
}
article :is(h2, h3) {
  font-family: var(--display);
  margin-top: 2.4rem;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ac);
}
article p { margin: 0 0 1.3rem; }
article blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-left: 4px solid var(--ac);
  background: color-mix(in srgb, var(--ac) 8%, transparent);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  font-style: italic;
}
article :is(code, pre) { font-family: var(--mono); font-size: 0.84em; }
article pre {
  background: #060709;
  color: #e8e4da;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.5;
  border: 1px solid var(--rule);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--ac) 30%, transparent);
}
article :not(pre) > code {
  background: color-mix(in srgb, var(--ac) 16%, transparent);
  color: color-mix(in srgb, var(--ac) 80%, var(--ink));
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
article strong { color: color-mix(in srgb, var(--ac) 70%, var(--ink)); }
article em { color: inherit; }
article ul, article ol { margin: 0 0 1.3rem; padding-left: 1.3rem; }
article li { margin-bottom: 0.5rem; }
article figure { margin: 2rem 0; }
article img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--rule);
  filter: saturate(0.92) brightness(0.92);
}
article figcaption {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
article figcaption .src {
  color: var(--correction);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.92em;
}
article hr { border: none; border-top: 3px dashed var(--rule); margin: 2.5rem 0; }

/* link to the original (high-context) entry on sydjrnl */
.orig-link {
  margin: -1.4rem 0 2.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}
.orig-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1.5px dashed var(--rule);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.orig-link a:hover {
  border-color: color-mix(in srgb, var(--ac) 60%, var(--rule));
  color: var(--ac);
  background: color-mix(in srgb, var(--ac) 8%, transparent);
}

/* inline plain-terms tag — a struck jargon word with its decode */
.decode {
  border-bottom: 2px dotted color-mix(in srgb, var(--correction) 60%, transparent);
}
.jargon { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--correction) 70%, transparent); }

/* ---- glossary links ---- */
.glossary-link {
  color: var(--ac);
  text-decoration: none;
  border-bottom: 2px dotted color-mix(in srgb, var(--ac) 55%, transparent);
  transition: background 0.14s ease, border-bottom-color 0.14s ease;
}
.glossary-link::after {
  content: '※';
  font-size: 0.72em;
  vertical-align: 0.25em;
  margin-left: 0.08em;
  opacity: 0.8;
}
.glossary-link:hover {
  border-bottom-style: solid;
  background: color-mix(in srgb, var(--ac) 12%, transparent);
  border-radius: 3px;
}

/* ---- glossary index ---- */
.gloss-section-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin: 2.2rem 0 0.9rem;
}
.glossary-index { list-style: none; margin: 0; padding: 0; }
.glossary-index li { margin: 0 0 0.7rem; }
.glossary-index li::before {
  content: '●';
  color: var(--ac);
  margin-right: 0.55rem;
  font-size: 0.7em;
  vertical-align: 0.12em;
}
.glossary-index a {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}
.glossary-index a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--ac) 55%, transparent);
}
.glossary-index .gi-gloss {
  display: block;
  margin-left: 1.1rem;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---- backlinks ('Mentioned in') ---- */
.backlinks { margin-top: 3rem; padding-top: 1.25rem; border-top: 3px dashed var(--rule); }
.backlinks h2 {
  margin: 0 0 0.7rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.backlinks ul { margin: 0; padding-left: 1.1rem; }
.backlinks li { margin-bottom: 1rem; }
.backlinks a { color: var(--ac); text-decoration: none; }
.backlinks a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.backlink-excerpt {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-soft);
}
.backlink-excerpt mark {
  background: color-mix(in srgb, var(--ac) 22%, transparent);
  color: inherit;
  font-style: normal;
  padding: 0 0.15em;
  border-radius: 3px;
}

/* ---- footnotes ---- */
a[data-footnote-ref] {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.7em;
  color: #0c0d12;
  background: var(--correction);
  padding: 0.05em 0.4em;
  border-radius: 999px;
  line-height: 1;
  cursor: pointer;
}
sup:has(> a[data-footnote-ref]) { margin-left: 0.1em; }
.fn-popover {
  position: absolute;
  z-index: 50;
  max-width: min(94vw, 34rem);
  margin: 0;
  padding: 0.8rem 0.95rem;
  font-family: var(--serif);
  font-size: 0.94rem;
  font-style: normal;
  line-height: 1.55;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid color-mix(in srgb, var(--correction) 45%, transparent);
  border-radius: 12px;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--correction) 18%, transparent),
              0 14px 40px rgba(0, 0, 0, 0.55);
}
.fn-popover[hidden] { display: none; }
.fn-popover :first-child { margin-top: 0; }
.fn-popover :last-child { margin-bottom: 0; }
.fn-popover a { color: var(--ac); }
.fn-coda { display: block; margin-top: 0.7em; }
.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;
}
.footnotes[hidden] { display: none; }
.footnotes {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 3px dashed var(--rule);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footnotes ol { padding-left: 1.2rem; }
.footnotes li { margin-bottom: 0.65rem; }
.footnotes li:target { background: color-mix(in srgb, var(--correction) 12%, transparent); border-radius: 8px; }
.footnotes a { color: var(--ac); }

/* ---- hub (root index) specifics ---- */
.hub-lede {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 2.4rem;
}
.hub-lede .lead-cap::first-letter {}
.editions { display: grid; gap: 1.1rem; margin: 0 0 2.5rem; }
.edition {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1.5px solid var(--rule);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  background: var(--panel);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.edition::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--ed);
}
.edition:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ed) 60%, var(--rule)); background: var(--panel-2); }
.edition .ed-name {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ed);
}
.edition .ed-title { font-family: var(--display); font-size: 1.5rem; font-weight: 600; margin: 0.2rem 0 0.3rem; }
.edition .ed-desc { font-family: var(--serif); font-size: 0.98rem; color: var(--ink-soft); line-height: 1.55; }

/* responsive */
@media (max-width: 640px) {
  body { font-size: 1.06rem; }
  .register-switch { font-size: 0.56rem; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
