:root {
  /* Brand — single premium indigo accent (replaces the old cyan+amber pair) */
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-rgb: 99, 102, 241;

  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-body);

  /* Dark theme (default) */
  --bg: #0b1020;
  --panel: #111827;
  --panel-soft: #172033;
  --surface: rgba(17, 24, 39, 0.92);
  --surface-2: rgba(15, 23, 42, 0.70);
  --text: #e5e7eb;
  --text-strong: #f8fafc;
  --muted: #9ca3af;
  /* The accent as text — section labels, links, tags, the ghost button. The accent itself read 3.7 to
     4.2:1 on the backgrounds it sits on, under the 4.5:1 minimum for text this size. This tint reads
     6.7:1 at worst: taken over the page's background glow at full strength, under the ghost button's
     own tint. */
  --accent-text: #a5b4fc;
  --border: rgba(255, 255, 255, 0.12);
  --code-bg: #0b1220;
  --hero-grid: rgba(255, 255, 255, 0.035);
  --accent-glow: rgba(var(--accent-rgb), 0.16);
  --header-bg: rgba(11, 16, 32, 0.82);
  --preview-bg: #0f172a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --max-width: 1180px;
  /* Height of the box a gallery card or a featured tile shows its page in. */
  --card-preview-height: 320px;
  --tile-preview-height: 380px;
}

/* Light theme — opt-in via the header toggle (data-theme="light" on <html>).
   Code panels intentionally stay dark in both themes; code reads best dark. */
html[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #334155;
  --text-strong: #0f172a;
  /* #64748b measured 4.45:1 on --bg, under the 4.5:1 minimum for body text; this darker tone reads
     about 6:1 there. */
  --muted: #52606d;
  /* The accent read 3.7 to 4.2:1 on the light backgrounds; this deeper indigo of the same hue reads
     5.3:1 at worst, over the background glow at full strength under the ghost button's tint. */
  --accent-text: #4338ca;
  --border: rgba(15, 23, 42, 0.12);
  --hero-grid: rgba(15, 23, 42, 0.045);
  --accent-glow: rgba(var(--accent-rgb), 0.12);
  --header-bg: rgba(255, 255, 255, 0.85);
  --preview-bg: #e9edf6;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, var(--accent-glow), transparent 30rem),
    radial-gradient(circle at 82% 18%, rgba(var(--accent-rgb), 0.08), transparent 26rem),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--font-body);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 72%);
}

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

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

code {
  color: #dbeafe;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

/* A followed anchor lands below the sticky header instead of under it: the header is 79px tall
   here, 146px from 641 to 980px where the menu wraps under the logo, and 141px below that. */
html {
  scroll-padding-top: 88px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(20px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 150px;
  height: auto;
  object-fit: contain;
}

.brand span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.site-nav a {
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.site-nav .nav-cta {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  white-space: nowrap;
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible {
  color: #06111f;
}

.section-shell {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 88px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 48px;
  align-items: center;
  padding-top: 60px;
  padding-bottom: 56px;
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  max-width: 100%;
  margin: 0;
  /* At most two lines at any width. The heading wraps once its column is narrower than about ten
     times the type size (measured from 320 to 1440px), so the size follows the column: beside the
     document the column is 0.51 of the content width, less the gap. A fixed size between two
     breakpoints wrapped to three and four lines. */
  font-size: clamp(2.625rem, calc((100vw - 105px) / 20.4), 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
}

.hero-lead {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--text-strong);
  font-size: 1.55rem;
  font-weight: 720;
  line-height: 1.18;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.96rem;
  font-weight: 760;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 42px rgba(var(--accent-rgb), 0.24);
}

.button-secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.46);
  background: rgba(var(--accent-rgb), 0.11);
}

.button-ghost {
  color: var(--accent-text);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.09);
}

.button-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.hero-visual {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
}

/* The switch is rendered hidden and shown by home.js. The display rules below would otherwise
   override the attribute and show a switch that swaps nothing. */
.hero-visual [hidden] {
  display: none !important;
}

/* One whole document at its own aspect ratio: the hero is where a visitor judges the output, so
   the page is neither cropped nor fanned out behind two others. The width and height attributes
   reserve its space before the image arrives. */
.hero-document {
  display: grid;
  gap: 10px;
  /* Beside the copy, the document, its caption and the switch have to fit a laptop's first
     screen, so on a short viewport the page gives up width rather than pushing them below it. */
  width: min(100%, 400px, max(280px, calc((100vh - 240px) * 0.707)));
  margin: 0;
}

.hero-document-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.hero-document-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-document-title {
  margin-right: auto;
  color: var(--text-strong);
  font-weight: 700;
}

.hero-document-link {
  color: var(--accent-text);
  font-weight: 650;
}

.hero-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-switch-option {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.hero-switch-option:hover,
.hero-switch-option:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.46);
}

.hero-switch-option[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.7);
  /* The pressed state is carried by the border and the tint; the text keeps full contrast, which
     the accent colour alone did not have at this size in either theme. */
  color: var(--text-strong);
  background: rgba(var(--accent-rgb), 0.18);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  border-top: 1px solid var(--border);
}

.section-label {
  margin: 0 0 12px;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  max-width: 760px;
  margin: 0;
  font-size: 3rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 34px;
}

.section-heading p:last-child,
.section-copy {
  color: var(--muted);
  font-size: 1.02rem;
}

.section-copy p {
  margin: 0 0 16px;
}

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

.example-card,
.feature-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.20);
}

.example-card {
  display: flex;
  min-height: 100%;
  overflow: hidden;
  flex-direction: column;
}

.example-preview {
  display: grid;
  min-height: 310px;
  padding: 18px;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 55%),
    var(--preview-bg);
}

.example-preview img {
  width: min(78%, 260px);
  max-height: 285px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: white;
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.34);
  object-fit: contain;
}

.example-preview-missing {
  color: var(--muted);
  font-weight: 720;
}

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

.example-body h3,
.feature-card h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.18rem;
  letter-spacing: 0;
}

.example-body p,
.feature-card p,
.architecture-copy {
  margin: 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Scoped to our gallery containers — bare `.tag` would otherwise
   collide with Prism's `.token.tag` and turn every XML element in
   the install snippet into a pill. */
.tag-list .tag,
.example-tags .tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  color: var(--accent-text);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 0.75rem;
  font-weight: 760;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.gallery-fallback {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.architecture {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline li {
  position: relative;
  min-height: 104px;
  padding: 20px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius);
  color: var(--text-strong);
  background: var(--surface);
  font-weight: 800;
}

.pipeline li::after {
  position: absolute;
  top: 50%;
  right: -15px;
  z-index: 2;
  color: var(--accent-text);
  content: "->";
  font-weight: 900;
  transform: translateY(-50%);
}

.pipeline li:last-child::after {
  content: "";
}

.architecture-copy {
  max-width: 820px;
  margin-top: 24px;
  font-size: 1.03rem;
}

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

.feature-card {
  padding: 22px;
}

.feature-card p {
  margin-top: 10px;
}

.install-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.code-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow);
}

.code-panel::before {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #93a4b8;
  content: attr(data-label);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(7, 17, 31, 0.92));
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 760;
}

.code-panel pre {
  padding: 22px 24px 24px;
}

.code-panel code {
  color: #dbeafe;
  font-size: 0.9rem;
  line-height: 1.7;
  tab-size: 4;
}

.token.keyword {
  color: #c792ea;
}

.token.type {
  color: #82aaff;
}

.token.method {
  color: #7fdbca;
}

.token.string {
  color: #ecc48d;
}

.token.number {
  color: #f78c6c;
}

.token.comment {
  color: #637777;
  font-style: italic;
}

.token.annotation {
  color: #ffcb6b;
}

.token.operator,
.token.punctuation {
  color: #89ddff;
}

.token.tag {
  color: #ffcb6b;
}

.token.attr {
  color: #c3e88d;
}

.token.plain {
  color: #dbeafe;
}

.code-example {
  padding-top: 26px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  padding: 28px 20px 38px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer span:first-child {
  color: var(--text);
  font-weight: 820;
}

.site-footer a {
  color: var(--accent-text);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text-strong);
}

:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.72);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  html {
    scroll-padding-top: 154px;
  }

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

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .section-grid,
  .install-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    padding-top: 56px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  /* One column: the document sits below the copy, so the height cap that keeps it in a laptop's
     first screen beside the copy does not apply. */
  .hero-document {
    width: min(100%, 400px);
  }

  .hero-lead {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 2.55rem;
  }

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

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

  .pipeline li:nth-child(3)::after {
    content: "";
  }
}

@media (max-width: 640px) {
  .section-shell {
    width: min(100% - 28px, var(--max-width));
    padding: 64px 0;
  }

  html {
    scroll-padding-top: 149px;
  }

  .site-header {
    padding: 12px 14px;
  }

  .site-nav {
    gap: 14px;
    font-size: 0.86rem;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    /* The full content width, which is the viewport less 28px here. */
    font-size: clamp(1.75rem, calc((100vw - 28px) / 10.4), 2.25rem);
  }

  .hero-lead {
    font-size: 1.16rem;
  }

  h2 {
    font-size: 2.1rem;
  }

  .button {
    width: 100%;
  }

  /* On a phone the hero keeps one compact document rather than none: it is the proof of what the
     engine produces, and hiding it left the first screen all words. */
  .hero-document {
    width: min(72%, 280px);
  }

  .examples-grid,
  .feature-grid,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline li {
    min-height: auto;
  }

  .pipeline li::after,
  .pipeline li:nth-child(3)::after {
    top: auto;
    right: 50%;
    bottom: -19px;
    content: "v";
    transform: translateX(50%);
  }

  .pipeline li:last-child::after {
    content: "";
  }

  .example-preview {
    min-height: 260px;
  }

  .example-body {
    padding: 18px;
  }
}

@media (max-width: 360px) {
  .hero-lead {
    font-size: 1.22rem;
  }
}

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

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

/* ===========================================================
   Showcase site v2 (v1.6 reorg) — category-driven gallery
   =========================================================== */

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Documentation block: where the template-authoring guide lives now that the home page leads with
   results rather than with how templates are built. */
.docs-more {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.docs-more a {
  color: var(--accent-text);
  font-weight: 650;
}

/* Inline code inside prose blocks. The global `code` colour is set for the dark code panels and
   has no light counterpart, so on these surfaces it follows the text instead of vanishing. */
.docs-block code,
.feature-card code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-strong);
  /* A call like BrandTheme.modernProfessional() has no break opportunity, and as a grid item's
     min-content it widened every card past a 320px screen. `anywhere` lets it wrap and counts
     toward the minimum width, which `break-word` does not. */
  overflow-wrap: anywhere;
}

.feature-card {
  min-width: 0;
}

/* Present to assistive technology and the document outline, absent from the layout. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.layered-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Value prop strip */
.value-prop {
  padding-top: 56px;
  padding-bottom: 56px;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.04));
}

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

.value-grid > div {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.value-grid h3 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 1.02rem;
}

.value-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* Install blocks */
.install-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* Four install scenarios read as two pairs; the one-column rule for narrow screens comes later in
   the file and still wins there. */
.install-scenarios {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.install-hello {
  grid-column: 1 / -1;
}

.install-block {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* The label above each coordinate. The Gradle line is Groovy DSL: the single quotes the version guard
   reads do not compile in a build.gradle.kts, so the label says which file it belongs in. */
.install-block > p.install-form {
  margin: 14px 0 6px;
  color: var(--text-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.install-block h3 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 1.02rem;
}

.install-block > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.install-block pre + pre {
  margin-top: 10px;
}

.install-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 999px;
  color: var(--text-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.format-limits {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.format-limits li + li {
  margin-top: 4px;
}

.install-block pre,
.install-block pre[class*="language-"] {
  margin: 0;
  padding: 16px 18px;
  border-radius: 7px;
  background: var(--code-bg);
  color: #e0f2fe;
  font-size: 0.83rem;
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
  line-height: 1.55;
  text-shadow: none;
}

.install-block code,
.install-block code[class*="language-"] {
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  text-shadow: none;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Override Prism Tomorrow theme bg (keep our dark navy panel) +
   tweak token colours to match the site palette. */
pre[class*="language-"].language-java,
pre[class*="language-"].language-groovy,
pre[class*="language-"].language-xml,
pre[class*="language-"].language-markup {
  background: var(--code-bg) !important;
  color: #e0f2fe !important;
}

code[class*="language-"] .token.comment,
code[class*="language-"] .token.prolog,
code[class*="language-"] .token.doctype,
code[class*="language-"] .token.cdata {
  color: #64748b;
  font-style: italic;
}

code[class*="language-"] .token.string,
code[class*="language-"] .token.attr-value {
  color: #fcd34d;
}

code[class*="language-"] .token.keyword,
code[class*="language-"] .token.builtin,
code[class*="language-"] .token.atrule {
  color: #93c5fd;
  font-weight: 660;
}

code[class*="language-"] .token.tag {
  color: #f0abfc;
}

code[class*="language-"] .token.attr-name,
code[class*="language-"] .token.function {
  color: #a5f3fc;
}

code[class*="language-"] .token.punctuation,
code[class*="language-"] .token.operator {
  color: #94a3b8;
}

code[class*="language-"] .token.number {
  color: #f59e0b;
}

code[class*="language-"] .token.class-name {
  color: #fde68a;
}

/* Showcase controls (search + filters) */
.showcase-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0;
  align-items: center;
  justify-content: space-between;
}

#showcase-search {
  flex: 1 1 280px;
  min-width: 240px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color 0.18s ease;
}

#showcase-search:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.showcase-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 660;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: #e2e8f0;
  border-color: rgba(var(--accent-rgb), 0.4);
}

.filter-pill.is-active {
  color: var(--text-strong);
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.55);
}

/* Showcase content layout */
.showcase-content {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.showcase-loading,
.showcase-empty,
.showcase-error {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.showcase-error code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.14);
  color: #bae6fd;
}

.showcase-error a {
  color: var(--accent-text);
  text-decoration: underline;
}

.showcase-category {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.category-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.category-heading h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.55rem;
  letter-spacing: -0.01em;
}

.category-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.showcase-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.group-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.group-heading h4 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.08rem;
  font-weight: 720;
}

.group-count {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Example card overrides for v2 layout */
.example-card[data-id] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.example-card[data-id] .example-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--card-preview-height);
  min-height: 0;
  padding: 16px;
}

/* The whole first page at its own aspect ratio: the image shrinks into the
   fixed box instead of being cropped to it, so a landscape slide and an A4
   page each read as what they are, and every card keeps the same height
   before its image loads. */
.example-card[data-id] .example-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.example-card[data-id] .example-preview-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 720;
  letter-spacing: 0.05em;
  background: var(--code-bg);
}

.example-card[data-id] .example-body {
  padding: 18px;
  gap: 12px;
}

.example-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.04rem;
  font-weight: 720;
  letter-spacing: 0;
}

.example-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.example-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.example-tags .tag {
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.7rem;
}

/* Earned, never defaulted: only a CV preset whose showcase sample passed
   the resume-parser checks carries this chip. It links to the documented
   claim and its caveats. */
.example-tags .ats-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 999px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  font-size: 0.7rem;
  font-weight: 760;
  text-decoration: none;
}

.example-tags a.ats-badge:hover,
.example-tags a.ats-badge:focus-visible {
  border-color: rgba(16, 185, 129, 0.8);
  background: rgba(16, 185, 129, 0.2);
}

.example-tags a.ats-badge:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.8);
  outline-offset: 2px;
}

/* The second declaration gives the mark empty alternative text where it is
   supported; a browser that does not parse it keeps the first. */
.example-tags .ats-badge::before {
  content: "\2713";
  content: "\2713" / "";
}

html[data-theme="light"] .example-tags .ats-badge {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.35);
  background: rgba(16, 185, 129, 0.1);
}

/* The chip's full claim, for a screen reader only. */
.example-tags .ats-badge-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.example-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.example-action {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 660;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.example-action:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.32);
}

.example-action-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.example-action-ghost:hover {
  color: #e2e8f0;
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.06);
}

/* Responsive */
@media (max-width: 980px) {
  .value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .install-blocks {
    grid-template-columns: 1fr;
  }
  .showcase-controls {
    flex-direction: column;
    align-items: stretch;
  }
  /* Reset the desktop flex-grow so the search input does not
     vertically stretch to ~280pt on narrow viewports — the column
     layout makes flex-basis act on the cross axis. */
  #showcase-search {
    flex: 0 0 auto;
    width: 100%;
  }
  .showcase-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================================================
   Showcase v2 polish (post-launch review feedback)
   =========================================================== */

/* Treat preview cards like real document pages — visible page
   border + drop shadow so each card reads as "this is a page",
   not as a flat image floating on the dark canvas. */
.example-card[data-id] .example-preview {
  position: relative;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 55%),
    var(--preview-bg);
  cursor: pointer;
  border: 0;
  width: 100%;
  appearance: none;
}

.example-card[data-id] .example-preview img {
  background: white;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 38px rgba(0, 0, 0, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.example-card[data-id] .example-preview:hover img {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 48px rgba(var(--accent-rgb), 0.18),
    0 6px 14px rgba(0, 0, 0, 0.4);
}

.example-view-hint {
  position: absolute;
  bottom: 12px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: #bae6fd;
  font-size: 0.72rem;
  font-weight: 660;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.example-card[data-id] .example-preview:hover .example-view-hint,
.example-card[data-id] .example-preview:focus-visible .example-view-hint {
  opacity: 1;
  transform: translateY(0);
}

.example-card[data-id] .example-preview:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.55);
  outline-offset: 2px;
}

/* Slightly larger title + bolder weights for legibility in card body */
.example-title {
  font-size: 1.08rem;
  font-weight: 760;
  line-height: 1.3;
}

.example-desc {
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Document viewer (gallery-viewer.js): one family at a time. Like the code
   panels, it stays dark in both themes, so every page reads on the same ground. */
body.viewer-open {
  overflow: hidden;
}

.gallery-viewer {
  width: min(96vw, 1180px);
  max-width: 96vw;
  height: 94vh;
  height: min(94dvh, 980px);
  max-height: 94vh;
  max-height: 94dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 12px;
  background: var(--code-bg);
  color: #e2e8f0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.gallery-viewer::backdrop {
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(4px);
}

/* Author display rules would otherwise override the hidden attribute. */
.gallery-viewer [hidden] {
  display: none !important;
}

.gallery-viewer-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gallery-viewer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.85);
}

.gallery-viewer-families {
  position: relative;
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.gallery-viewer-family {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 660;
  white-space: nowrap;
  cursor: pointer;
}

.gallery-viewer-family:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: #f8fafc;
}

.gallery-viewer-family[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.24);
  color: #f8fafc;
}

.gallery-viewer-family-count {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.gallery-viewer-close,
.gallery-viewer-step {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.gallery-viewer-close:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fca5a5;
}

.gallery-viewer-step:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.2);
}

.gallery-viewer-step:disabled {
  opacity: 0.3;
  cursor: default;
}

.gallery-viewer-body {
  display: grid;
  flex: 1;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  min-height: 0;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(var(--accent-rgb), 0.025) 0,
      rgba(var(--accent-rgb), 0.025) 12px,
      transparent 12px,
      transparent 24px
    ),
    #06101f;
}

.gallery-viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 20px 0;
  /* A horizontal drag is the viewer's; the page keeps vertical scroll and pinch. */
  touch-action: pan-y pinch-zoom;
}

.gallery-viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: white;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 8px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s ease;
}

.gallery-viewer-stage[aria-busy="true"] .gallery-viewer-image {
  opacity: 0.5;
}

.gallery-viewer-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 36rem;
  padding: 24px;
  color: #cbd5e1;
  text-align: center;
}

.gallery-viewer-notice p {
  margin: 0;
}

.gallery-viewer-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.85);
}

.gallery-viewer-meta {
  flex: 1 1 20rem;
  min-width: 0;
}

.gallery-viewer-title {
  margin: 0;
  color: #f8fafc;
  font-size: 1.1rem;
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: 0;
}

.gallery-viewer-counter {
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.gallery-viewer-description {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
}

.gallery-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Paging inside one document, deliberately unlike the document steps either side of the page:
   those are large arrows over the stage, these are a small centred row under it, so the two
   kinds of movement never read as the same control. */
.gallery-viewer-pages {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 20px;
}

.gallery-viewer-page-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-viewer-page-step:hover:not(:disabled) {
  color: #f8fafc;
  border-color: rgba(var(--accent-rgb), 0.45);
}

.gallery-viewer-page-step:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery-viewer-page-label {
  color: #94a3b8;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* The disclosure over the panel. The document keeps the dialog's room until a reader asks
   for the reproduction details: opened by default the panel took 42vh, twice the stage. */
.gallery-viewer-panel-toggle {
  /* Never grows: `1 1 100%` (copied from the panel) made the button a flex item asking for
     the dialog's whole height, which left the stage 40px and the page 0x0. */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.gallery-viewer-panel-toggle:hover {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.9);
}

.gallery-viewer-panel-toggle::after {
  content: '\25B8';
  margin-left: auto;
  color: #94a3b8;
  transition: transform 120ms ease;
}

.gallery-viewer-panel-toggle[aria-expanded='true']::after {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-viewer-panel-toggle::after {
    transition: none;
  }
}

/* What a reader needs to reproduce the document shown: the coordinates, the classes it
   composes, the compiled snippet, and where the runnable source and the guide are. */
.gallery-viewer-panel {
  flex: 1 1 100%;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.92);
  /* The document keeps roughly a third of the dialog even with the panel open. At 42vh the
     opened panel plus its toggle left the stage 149px and the page 74x105 — smaller than the
     regression this disclosure was added to fix. The panel scrolls, so a lower cap costs
     scrolling; the stage cannot scroll a page into being readable. */
  max-height: 30vh;
  overflow-y: auto;
}

.gallery-viewer-panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 6px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.gallery-viewer-panel-label {
  flex: 0 0 8.5rem;
  color: #94a3b8;
}

.gallery-viewer-panel-value {
  min-width: 0;
  color: #e2e8f0;
  word-break: break-word;
}

/* A class name or a path is set as code; a sentence is not. */
code.gallery-viewer-panel-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.gallery-viewer-panel-code {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.gallery-viewer-panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .gallery-viewer-panel {
    max-height: 34vh;
    padding: 12px 14px 16px;
  }

  .gallery-viewer-panel-label {
    flex-basis: 100%;
  }
}

/* The documents of the family shown, as a strip under the page. */
.gallery-viewer-thumbs {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
  scrollbar-width: thin;
}

.gallery-viewer-thumb {
  display: block;
  flex: 0 0 auto;
  width: 54px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: #0b1524;
  opacity: 0.65;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.gallery-viewer-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.gallery-viewer-thumb:hover,
.gallery-viewer-thumb:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.6);
  opacity: 1;
}

.gallery-viewer-thumb[aria-current="true"] {
  border-color: rgba(var(--accent-rgb), 0.9);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35);
  opacity: 1;
}

/* Heavier section labels + headings for visual hierarchy */
.section-label {
  font-weight: 760;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.category-heading h3 {
  font-size: 1.7rem;
  font-weight: 760;
}

.group-heading h4 {
  font-size: 1.18rem;
  font-weight: 720;
}

.value-grid h3 {
  font-size: 1.1rem;
  font-weight: 760;
}

/* Viewer on a narrow screen: the page fills the screen, and the arrows sit
   over its edges, clear of the safe areas. */
@media (max-width: 768px) {
  .gallery-viewer {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .gallery-viewer-body {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }
  .gallery-viewer-stage {
    padding: 12px;
  }
  .gallery-viewer-step {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
  }
  .gallery-viewer-step[data-viewer-step="-1"] {
    left: calc(8px + env(safe-area-inset-left, 0px));
  }
  .gallery-viewer-step[data-viewer-step="1"] {
    right: calc(8px + env(safe-area-inset-right, 0px));
  }
  .gallery-viewer-footer {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .gallery-viewer-thumbs {
    padding: 8px 10px;
  }
  .gallery-viewer-thumb {
    width: 46px;
    height: 62px;
  }
  .gallery-viewer-description {
    display: none;
  }
}

/* Families: one tile per family, each opening the viewer on it. */
.showcase-families {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.families-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.family-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.family-tile:hover,
.family-tile:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.family-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  margin-bottom: 8px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 55%),
    var(--preview-bg);
}

.family-cover img {
  width: auto;
  height: auto;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  border-radius: 3px;
  background: white;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.family-name {
  color: var(--text-strong);
  font-family: var(--font-display);
  font-weight: 700;
}

.family-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* ===========================================================
   <noscript> showcase fallback — readable static index for
   crawlers and JS-disabled clients. Hidden by JS bootstrap if
   we ever decide to surface it from script paths; for noscript
   it inherits page typography but with tighter spacing.
   =========================================================== */
.showcase-noscript {
  margin-top: 28px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

.showcase-noscript h3 {
  margin: 24px 0 8px;
  color: #e2e8f0;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.showcase-noscript h4 {
  margin: 16px 0 6px;
  color: #cbd5f5;
  font-size: 0.94rem;
  letter-spacing: 0.06em;
}

.showcase-noscript ul {
  margin: 0 0 12px;
  padding-left: 22px;
  line-height: 1.7;
  font-size: 0.92rem;
}

.showcase-noscript a {
  color: var(--accent-2);
}

.showcase-noscript a:hover {
  color: #bae6fd;
}

/* ===========================================================
   Showcase Highlights — curated cross-category strip rendered
   above the regular category grid so first-time visitors hit
   the visually strongest work immediately. Horizontal scroll
   with snap + big A4 tiles + a category badge per tile.
   =========================================================== */
.showcase-highlights {
  margin: 12px 0 36px;
}

.highlights-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.highlights-heading h3 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: var(--text-strong);
  text-transform: uppercase;
}

.highlights-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.highlights-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 12px;
  padding: 8px 4px 24px;
  /* Reserve a generous fade at the edges so users see content
     continues off-screen — strong hint to scroll horizontally. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

/* Compact native scrollbar for desktops with mouse — visible but
   subtle so users discover the horizontal axis. */
.highlights-strip::-webkit-scrollbar {
  height: 8px;
}
.highlights-strip::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.35);
  border-radius: 999px;
}

.highlight-tile {
  flex: 0 0 280px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.highlight-tile:hover,
.highlight-tile:focus-within {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.45),
    0 6px 16px rgba(var(--accent-rgb), 0.12);
}

.highlight-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--tile-preview-height);
  padding: 14px;
  border: 0;
  background:
    radial-gradient(circle at 30% 18%, var(--accent-glow), transparent 60%),
    var(--preview-bg);
  cursor: pointer;
  appearance: none;
}

.highlight-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  background: white;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 14px 28px rgba(0, 0, 0, 0.42);
}

.highlight-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.86);
  color: #06111f;
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.highlight-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 18px;
}

.highlight-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 760;
  color: var(--text-strong);
}

.highlight-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  :root {
    --card-preview-height: 300px;
    --tile-preview-height: 340px;
  }
  .highlight-tile {
    flex-basis: 240px;
  }
  .highlights-heading h3 {
    font-size: 1.2rem;
  }
}

/* Featured strip arrows — only inserted by JS when overflow exists.
   Sit on top of the edge fade so users get a clear "more here"
   affordance on desktop without taking layout space when hidden. */
.showcase-highlights {
  position: relative;
}

.strip-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.showcase-highlights.has-strip-arrows.strip-overflow .strip-arrow {
  display: inline-flex;
}

.strip-arrow:hover {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.18);
}

.strip-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.strip-arrow-left {
  left: -4px;
}

.strip-arrow-right {
  right: -4px;
}

@media (hover: none) {
  /* Touch devices already swipe — hide the arrows to free space. */
  .showcase-highlights.has-strip-arrows.strip-overflow .strip-arrow {
    display: none;
  }
}

/* ===========================================================
   Collapsible group (used for "Cover Letter" — 15 entries
   would otherwise dominate the Templates section).
   =========================================================== */
.showcase-group.is-collapsible.is-collapsed .examples-grid > .example-card:nth-child(n + 5) {
  display: none;
}

.group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px dashed rgba(var(--accent-rgb), 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-text);
  font-size: 0.86rem;
  font-weight: 660;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.group-toggle:hover,
.group-toggle:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.85);
  background: rgba(var(--accent-rgb), 0.1);
  /* The theme's strongest text, not a fixed pale blue: that read 1.05:1 on the light theme, so the
     label vanished exactly when a keyboard focused it. */
  color: var(--text-strong);
}

.group-toggle-count {
  font-variant-numeric: tabular-nums;
}

/* ===========================================================
   v1.6 brand refresh — display headings + light/dark toggle.
   =========================================================== */

/* Space Grotesk display face on the major headings — distinctive and
   on-brand for a typography/layout engine. Body copy stays Inter. */
.hero h1,
h2,
.category-heading h3,
.group-heading h4,
.example-title,
.highlight-title,
.feature-card h3,
.value-grid h3 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

/* Header light/dark toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text-strong);
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.1);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Moon in dark mode, sun in light mode. */
.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

/* ===========================================================
   Document pages — one per catalogue card, at
   <category>/<group>/<id>/, generated by scripts/site/build.mjs.
   What the viewer shows of a document, readable without
   JavaScript: every page, the files, how to reproduce it.
   =========================================================== */
.document-page {
  padding-top: 32px;
  padding-bottom: 72px;
}

.document-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 28px;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
}

/* Not a slash: family names carry one ("CV / Resume"). */
.document-breadcrumb li + li::before {
  content: "\203A";
  margin: 0 8px;
  color: var(--muted);
}

.document-breadcrumb a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.55);
  text-underline-offset: 3px;
}

.document-breadcrumb a:hover,
.document-breadcrumb a:focus-visible {
  color: var(--text-strong);
}

.document-breadcrumb [aria-current="page"] {
  color: var(--text-strong);
  font-weight: 650;
}

/* The pages on the left and what a reader does with them on the right; one column once the two
   would squeeze a page below readable. */
.document-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas:
    "pages intro"
    "pages reproduce";
  grid-template-rows: auto 1fr;
  gap: 28px 48px;
  align-items: start;
}

/* A description can be an API call with no break opportunity in it
   (DocumentTextStyle.builder().letterSpacing(...)), which widened a 320px page to 708px. */
.document-intro,
.document-breadcrumb,
.document-related-list a {
  overflow-wrap: anywhere;
}

.document-intro {
  grid-area: intro;
  min-width: 0;
}

.document-intro h1 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
  line-height: 1.08;
}

.document-lead {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 1.08rem;
}

.document-facts {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.document-pages {
  grid-area: pages;
  display: grid;
  gap: 28px;
  min-width: 0;
}

.document-page-image {
  margin: 0;
}

/* A page is white paper in either theme: it is the document as it prints. */
.document-page-image a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.document-page-image img {
  width: 100%;
  height: auto;
}

.document-page-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.document-reproduce {
  grid-area: reproduce;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.document-reproduce h2 {
  margin: 0 0 16px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.reproduce-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reproduce-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 0 0 10px;
}

.reproduce-row .reproduce-label {
  flex: 0 0 9.5rem;
  padding-top: 2px;
}

.reproduce-value {
  flex: 1 1 14rem;
  min-width: 0;
  color: var(--text-strong);
  font-size: 0.95rem;
}

/* A class name or a path, set as code; the global code colour belongs to the dark code panels. */
code.reproduce-value {
  color: var(--text-strong);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.reproduce-listing {
  margin: 0 0 16px;
}

.reproduce-listing .reproduce-label {
  display: block;
  margin-bottom: 6px;
}

/* The same dark code panel as the install snippets, in both themes. */
.reproduce-code {
  padding: 14px 16px;
  border-radius: 7px;
  background: var(--code-bg);
  color: #e0f2fe;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.reproduce-code code {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

.reproduce-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.document-related {
  margin-top: 72px;
}

.document-related h2 {
  margin: 0 0 20px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.document-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-related-list a {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.document-related-list a:hover span,
.document-related-list a:focus-visible span {
  color: var(--text-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* One box for every document, portrait or landscape, so the grid keeps its rows. */
.document-related-list img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--preview-bg);
}

@media (max-width: 980px) {
  .document-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "pages"
      "reproduce";
    grid-template-rows: none;
  }

  .document-pages {
    width: min(100%, 560px);
  }
}

@media (max-width: 640px) {
  .document-page {
    padding-top: 22px;
  }

  .document-reproduce {
    padding: 16px;
  }

  .reproduce-row .reproduce-label {
    flex-basis: 100%;
  }

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

/* ===========================================================
   Documentation page — documentation/, generated by
   scripts/site/build.mjs: the repository's guides, linked at
   the release the site names.
   =========================================================== */
.docs-page {
  padding-top: 40px;
  padding-bottom: 72px;
}

.docs-page h1 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.08;
}

.docs-page .section-heading a {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.55);
  text-underline-offset: 3px;
}

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

.docs-section {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.docs-section h2 {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.docs-section-intro {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.docs-guides {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-guides a {
  color: var(--text-strong);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.55);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.docs-guides p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .docs-sections {
    grid-template-columns: minmax(0, 1fr);
  }
}
