/* =========================================================================
   Music Metadata Org — Fiery Ocean design system
   ========================================================================= */

:root {
  /* Fiery Ocean palette */
  --fo-crimson-900: #5a0a14;
  --fo-crimson-700: #b71c2b;
  --fo-crimson-500: #e63946;
  --fo-crimson-100: #fbe3e5;

  --fo-gold-700: #c8881f;
  --fo-gold-500: #f5b942;
  --fo-gold-200: #fbe4b0;

  --fo-indigo-900: #14224f;
  --fo-indigo-700: #1f3a8a;
  --fo-indigo-500: #274690;
  --fo-indigo-300: #6b80c4;

  --fo-sky-700: #1f6fb2;
  --fo-sky-500: #4ea1d3;
  --fo-sky-300: #9fcef0;
  --fo-sky-100: #e7f1fb;

  --fo-paper: #fbf7f0;
  --fo-paper-2: #ffffff;
  --fo-paper-3: #f4ece0;
  --fo-ink: #1a2233;
  --fo-ink-2: #45526b;
  --fo-ink-3: #6b7892;

  /* Semantic */
  --bg: var(--fo-paper);
  --bg-elev: var(--fo-paper-2);
  --bg-soft: var(--fo-paper-3);
  --text: var(--fo-ink);
  --text-muted: var(--fo-ink-2);
  --text-subtle: var(--fo-ink-3);
  --link: var(--fo-crimson-700);
  --link-hover: var(--fo-crimson-500);
  --accent: var(--fo-gold-500);
  --accent-2: var(--fo-sky-500);
  --border: rgba(31, 58, 138, 0.14);
  --border-strong: rgba(31, 58, 138, 0.28);

  /* Code */
  --code-bg: #fdf6ec;
  --code-bg-inline: rgba(245, 185, 66, 0.14);
  --code-border: rgba(199, 136, 31, 0.28);
  --code-text: #2a1a08;
  --code-keyword: var(--fo-crimson-700);
  --code-string: #2a7a3e;
  --code-number: var(--fo-indigo-700);
  --code-comment: #8a7a5a;
  --code-fn: var(--fo-sky-700);

  /* Layout */
  --header-h: 68px;
  --container: 1400px;
  --container-narrow: 1100px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 34, 79, 0.06), 0 1px 4px rgba(20, 34, 79, 0.04);
  --shadow: 0 4px 14px rgba(20, 34, 79, 0.08), 0 2px 6px rgba(20, 34, 79, 0.05);
  --shadow-lg: 0 18px 40px rgba(20, 34, 79, 0.14), 0 6px 12px rgba(20, 34, 79, 0.06);

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --step--1: clamp(0.85rem, 0.82rem + 0.15vw, 0.95rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.32rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.7vw, 1.65rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.2vw, 2.15rem);
  --step-4: clamp(2.05rem, 1.6rem + 1.8vw, 2.8rem);
  --step-5: clamp(2.4rem, 1.8rem + 2.6vw, 3.6rem);
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 90% -10%, rgba(245, 185, 66, 0.12), transparent 60%),
    radial-gradient(1200px 800px at -10% 110%, rgba(78, 161, 211, 0.14), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.2s ease, background-size 0.25s ease;
}
a:hover, a:focus-visible { color: var(--link-hover); background-size: 100% 1.5px; }
a:focus-visible { outline: 2px solid var(--fo-sky-500); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 1.8em 0 0.6em;
  color: var(--fo-indigo-900);
}
h1 { font-size: var(--step-5); margin-top: 0.2em; line-height: 1.08; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); color: var(--fo-indigo-700); }
h4 { font-size: var(--step-1); color: var(--fo-indigo-700); }

p { margin: 0 0 1em; }
strong { color: var(--fo-indigo-900); }

hr {
  border: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
  margin: 2.5rem 0;
}

/* -------------------------------------------------------------------------
   Layout containers
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.5vw, 2.5rem);
}
.container--narrow { max-width: var(--container-narrow); }
main { flex: 1 0 auto; }

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 240, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fo-indigo-900);
  background: none;
  letter-spacing: -0.01em;
}
.brand:hover, .brand:focus-visible {
  color: var(--fo-crimson-700);
  background: none;
}
.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}
.brand__name {
  display: none;
}
@media (min-width: 560px) {
  .brand__name { display: inline; }
}

.nav {
  display: none;
  margin-left: auto;
  gap: 0.25rem;
  align-items: center;
}
@media (min-width: 880px) {
  .nav { display: inline-flex; }
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--fo-indigo-700);
  font-weight: 600;
  font-size: 0.95rem;
  background: none;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.nav__link:hover, .nav__link:focus-visible {
  background: var(--fo-sky-100);
  color: var(--fo-crimson-700);
  border-color: var(--border);
  background-size: 0 0;
}
.nav__link[aria-current="page"] {
  background: linear-gradient(180deg, var(--fo-sky-100), rgba(245, 185, 66, 0.18));
  color: var(--fo-crimson-700);
  border-color: var(--border-strong);
}
.nav__link svg { width: 18px; height: 18px; }

.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--fo-paper-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fo-indigo-700);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-toggle:hover { background: var(--fo-sky-100); color: var(--fo-crimson-700); }
@media (min-width: 880px) {
  .nav-toggle { display: none; }
}
.nav-mobile {
  display: none;
  background: var(--fo-paper-2);
  border-bottom: 1px solid var(--border);
}
.nav-mobile.is-open { display: block; }
.nav-mobile__list {
  list-style: none;
  margin: 0; padding: 0.5rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.nav-mobile .nav__link { width: 100%; justify-content: flex-start; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  margin-top: 5rem;
  background: linear-gradient(180deg, transparent, rgba(31, 58, 138, 0.06));
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.site-footer__inner {
  display: grid;
  gap: 1.5rem 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .site-footer__inner { grid-template-columns: 1.5fr 1fr 1fr; }
}
.site-footer h4 {
  color: var(--fo-indigo-900);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.site-footer a {
  color: var(--fo-indigo-700);
  font-weight: 500;
}
.site-footer__bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* -------------------------------------------------------------------------
   Hero (home)
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -5% 30% -5%;
  background:
    radial-gradient(60% 60% at 80% 10%, rgba(245, 185, 66, 0.22), transparent 70%),
    radial-gradient(60% 60% at 10% 90%, rgba(78, 161, 211, 0.22), transparent 70%),
    radial-gradient(40% 40% at 95% 95%, rgba(230, 57, 70, 0.18), transparent 70%);
  z-index: -1;
  filter: blur(8px);
}
.hero__eyebrow {
  display: inline-block;
  max-width: 100%;
  background: linear-gradient(90deg, var(--fo-crimson-700), var(--fo-gold-700));
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  white-space: normal;
  overflow-wrap: break-word;
}
.hero__title {
  margin: 0 0 1rem;
  font-size: var(--step-5);
  line-height: 1.04;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--fo-indigo-900) 0%, var(--fo-indigo-700) 35%, var(--fo-crimson-700) 80%, var(--fo-gold-700) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 22ch;
  overflow-wrap: break-word;
  hyphens: auto;
}
@media (max-width: 520px) {
  .hero__title { font-size: clamp(2rem, 8.5vw, 2.6rem); max-width: 100%; }
}
.hero__lede {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 65ch;
  margin: 0 0 1.25rem;
}
.hero__paragraphs {
  max-width: 70ch;
  color: var(--text);
  margin: 0 0 2rem;
}
.hero__paragraphs p { margin-bottom: 0.85rem; }
.hero__ctas {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .hero__ctas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .hero__ctas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------------------
   Buttons & CTA tiles
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  background: none;
}
.btn:hover, .btn:focus-visible { background-size: 0 0; }
.btn--primary {
  background: linear-gradient(135deg, var(--fo-crimson-700), var(--fo-gold-700));
  color: white;
  box-shadow: var(--shadow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: white; }
.btn--secondary {
  background: var(--fo-paper-2);
  color: var(--fo-indigo-700);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover { background: var(--fo-sky-100); color: var(--fo-crimson-700); transform: translateY(-2px); }

.cta-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1.4rem 1.25rem 1.25rem;
  background: var(--fo-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-align: left;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cta-tile::before {
  content: "";
  position: absolute;
  inset: auto -30% -50% auto;
  width: 60%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle, var(--tile-glow, rgba(245, 185, 66, 0.35)), transparent 70%);
  opacity: 0.55;
  transition: opacity 0.25s ease, transform 0.4s ease;
  pointer-events: none;
}
.cta-tile:hover, .cta-tile:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  color: var(--text);
  background-size: 0 0;
}
.cta-tile:hover::before { opacity: 0.9; transform: scale(1.05) translate(-4%, -4%); }
.cta-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: white;
  box-shadow: var(--shadow-sm);
}
.cta-tile__icon svg { width: 26px; height: 26px; }
.cta-tile__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fo-indigo-900);
  line-height: 1.25;
}
.cta-tile__blurb {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Icon background variants */
.icon-bg--crimson { background: linear-gradient(135deg, var(--fo-crimson-500), var(--fo-crimson-900)); }
.icon-bg--gold    { background: linear-gradient(135deg, var(--fo-gold-500), var(--fo-crimson-700)); }
.icon-bg--indigo  { background: linear-gradient(135deg, var(--fo-indigo-500), var(--fo-indigo-900)); }
.icon-bg--sky     { background: linear-gradient(135deg, var(--fo-sky-500), var(--fo-indigo-700)); }
.icon-bg--ocean   { background: linear-gradient(135deg, var(--fo-sky-300), var(--fo-indigo-500)); }
.icon-bg--ember   { background: linear-gradient(135deg, var(--fo-gold-500), var(--fo-crimson-500)); }

/* -------------------------------------------------------------------------
   Section helpers (home)
   ------------------------------------------------------------------------- */
.section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.section__head {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-bottom: 2rem;
  max-width: 70ch;
}
.section__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fo-crimson-700);
}
.section__title { margin: 0; font-size: var(--step-3); color: var(--fo-indigo-900); }
.section__lede { margin: 0; color: var(--text-muted); font-size: var(--step-1); }

.pillar-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pillar-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.75rem;
  background: var(--fo-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.pillar-card__head { display: flex; align-items: center; gap: 0.85rem; }
.pillar-card__title { margin: 0; font-size: var(--step-2); color: var(--fo-indigo-900); }
.pillar-card__topics {
  list-style: none; padding: 0; margin: 0.5rem 0 0;
  display: grid; gap: 0.45rem;
}
.pillar-card__topics a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--fo-indigo-700); font-weight: 500;
}
.pillar-card__topics a::before { content: "›"; color: var(--fo-crimson-700); font-weight: 700; }

/* -------------------------------------------------------------------------
   Content page
   ------------------------------------------------------------------------- */
.content-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 2rem 0 4rem;
}
@media (min-width: 1080px) {
  .content-shell { grid-template-columns: minmax(0, 1fr) 280px; gap: 3rem; }
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a {
  color: var(--fo-indigo-700);
  background: none;
}
.breadcrumbs a:hover { color: var(--fo-crimson-700); }
.breadcrumbs__sep { color: var(--fo-gold-700); font-weight: 600; }
.breadcrumbs__current { color: var(--fo-indigo-900); font-weight: 600; }

.article {
  background: var(--fo-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.article h1 {
  margin-top: 0;
  margin-bottom: 1.2em;
  line-height: 1.15;
  background: linear-gradient(120deg, var(--fo-indigo-900) 0%, var(--fo-indigo-700) 30%, var(--fo-crimson-700) 75%, var(--fo-gold-700) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.article h2 {
  margin-top: 2.8em;
  margin-bottom: 0.9em;
  padding-top: 1.6em;
  border-top: 1px solid var(--border);
  line-height: 1.25;
}
.article h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1.6em; }
.article h2::before {
  content: "";
  display: inline-block;
  width: 0.5rem; height: 0.5rem;
  margin-right: 0.55rem;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--fo-crimson-500), var(--fo-gold-500));
  vertical-align: middle;
  transform: translateY(-0.18em);
}
.article h3 { margin-top: 2em; margin-bottom: 0.7em; line-height: 1.3; }
.article h4 { margin-top: 1.6em; margin-bottom: 0.6em; line-height: 1.35; }
.article p, .article ul, .article ol {
  font-size: var(--step-0);
  line-height: 1.85;
  color: var(--text);
}
.article p { margin: 0 0 1.4em; }
.article ul, .article ol { padding-left: 1.5rem; margin: 0 0 1.4em; }
.article li { margin: 0.55em 0; }
.article li > p { margin-bottom: 0.6em; }
.article li::marker { color: var(--fo-crimson-500); }
.article a {
  color: var(--fo-crimson-700);
  font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.2s ease, background-size 0.25s ease;
}
.article a:hover {
  color: var(--fo-gold-700);
  background-size: 100% 2px;
}

/* Header anchor links (markdown-it-anchor headerLink) */
.article :is(h2, h3, h4) a.header-anchor {
  color: inherit;
  background: none;
  text-decoration: none;
}
.article :is(h2, h3, h4) a.header-anchor:hover {
  color: var(--fo-crimson-700);
  background: none;
}

/* Inline code */
.article :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg-inline);
  color: var(--fo-crimson-700);
  padding: 0.05em 0.4em;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Block quotes */
.article blockquote {
  margin: 1.25rem 0;
  padding: 0.8rem 1.2rem;
  background: var(--fo-sky-100);
  border-left: 4px solid var(--fo-sky-500);
  border-radius: 6px;
  color: var(--fo-indigo-900);
  font-style: italic;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--fo-paper-2);
  -webkit-overflow-scrolling: touch;
}
.article table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.95rem;
}
.article thead {
  background: linear-gradient(180deg, var(--fo-indigo-700), var(--fo-indigo-500));
  color: white;
}
.article th, .article td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.article th { font-weight: 600; letter-spacing: 0.01em; }
.article tbody tr:nth-child(even) { background: var(--fo-sky-100); }
.article tbody tr:hover { background: rgba(245, 185, 66, 0.18); }
.article tbody tr:last-child td { border-bottom: 0; }

/* Code blocks */
.code-block {
  position: relative;
  margin: 1.5rem 0;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: linear-gradient(180deg, rgba(245, 185, 66, 0.18), rgba(245, 185, 66, 0.08));
  border-bottom: 1px solid var(--code-border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--code-text);
}
.code-block__copy {
  background: var(--fo-paper-2);
  color: var(--fo-indigo-700);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.code-block__copy:hover { background: var(--fo-crimson-700); color: white; transform: translateY(-1px); }
.code-block__copy.is-copied { background: var(--fo-gold-500); color: var(--code-text); }
.code-block__pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--code-text);
  background: transparent;
}
.code-block__pre code { background: none; padding: 0; color: inherit; font-weight: 400; }

/* Syntax highlighting (highlight.js classes) — Fiery Ocean palette */
.hljs-keyword, .hljs-built_in, .hljs-type { color: var(--code-keyword); font-weight: 600; }
.hljs-string, .hljs-meta-string { color: var(--code-string); }
.hljs-number, .hljs-literal { color: var(--code-number); }
.hljs-comment, .hljs-quote { color: var(--code-comment); font-style: italic; }
.hljs-function, .hljs-title, .hljs-name { color: var(--code-fn); font-weight: 600; }
.hljs-attr, .hljs-attribute, .hljs-symbol { color: var(--fo-gold-700); }
.hljs-variable, .hljs-template-variable { color: var(--fo-indigo-700); }
.hljs-tag { color: var(--fo-indigo-700); }
.hljs-tag .hljs-name { color: var(--fo-crimson-700); }
.hljs-params { color: var(--fo-ink-2); }
.hljs-deletion { background: rgba(230, 57, 70, 0.15); }
.hljs-addition { background: rgba(46, 130, 78, 0.15); }

/* Task checkboxes */
.task-list-item { list-style: none; margin-left: -1.2rem; }
.article ul li.task-list-item::marker { content: ""; }
.task-checkbox {
  appearance: none;
  width: 18px; height: 18px;
  margin-right: 0.5rem;
  vertical-align: -3px;
  border: 2px solid var(--fo-indigo-500);
  border-radius: 4px;
  background: var(--fo-paper-2);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.task-checkbox:hover { border-color: var(--fo-crimson-700); }
.task-checkbox:checked {
  background: linear-gradient(135deg, var(--fo-crimson-500), var(--fo-gold-500));
  border-color: var(--fo-crimson-700);
}
.task-checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 1px 0 0 4px;
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-list-item.is-done { color: var(--text-subtle); }
.task-list-item.is-done > :where(span, *) { text-decoration: line-through; text-decoration-color: var(--fo-crimson-500); }

/* FAQ accordions */
.faq {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--fo-paper-2);
  overflow: hidden;
}
.faq + .faq { margin-top: 0.5rem; }
.faq__summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  font-weight: 600;
  color: var(--fo-indigo-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.2s ease;
}
.faq__summary::-webkit-details-marker { display: none; }
.faq__summary:hover { background: var(--fo-sky-100); }
.faq__summary::after {
  content: "+";
  margin-left: auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fo-crimson-500), var(--fo-gold-500));
  color: white;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.faq[open] .faq__summary::after { content: "−"; transform: rotate(180deg); }
.faq__body {
  padding: 0 1.1rem 1.1rem;
  color: var(--text);
}

/* Mermaid */
.mermaid {
  background: var(--fo-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
  overflow-x: auto;
}

/* -------------------------------------------------------------------------
   Sidebar (related / TOC)
   ------------------------------------------------------------------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
.sidebar__card {
  background: var(--fo-paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.sidebar__card h4 {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fo-crimson-700);
}
.sidebar__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.sidebar__list a {
  color: var(--fo-indigo-700);
  font-weight: 500;
  font-size: 0.94rem;
}
.sidebar__list a:hover { color: var(--fo-crimson-700); }

@media (min-width: 1080px) {
  .sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto; }
}

/* -------------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

::selection { background: var(--fo-gold-200); color: var(--fo-crimson-900); }

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