/* Cleft Labs Projects & CleftAudio: Swiss Editorial Scientific Monograph Stylesheet
   Unified house style aligned with cleftlabs.com/projects.html and cleftverse.com.
   Zero third-party fonts, zero external CDNs, zero cookies, 100% DSGVO-clean. */

:root {
  color-scheme: light;
  /* Core Paper & Ink (exact cleftlabs.com tokens) */
  --paper: #f6f5f0;
  --sheet: #ffffff;
  --surface-alt: #efede6;
  --ink: #141619;
  --ink-soft: #3a3f47;
  --ink-inv: #ffffff;
  --muted: #606670;
  --rule: #dcd9d0;
  --rule-strong: #b8b3a6;

  /* Primary Cleft Labs Accent (Slate Blue) */
  --accent: #1b4d7e;
  --accent-hover: #13395e;
  --accent-tint: #ebf1f7;
  --btn-accent-bg: #1b4d7e;
  --btn-accent-hover: #13395e;
  --btn-accent-ink: #ffffff;

  /* Four-Pillar Jewel Palette */
  --teal: #0f5257;
  --teal-tint: #e8f1f1;
  --violet: #4c2a85;
  --violet-tint: #f1ecfa;
  --audio: #8f3822;
  --audio-hover: #702a18;
  --audio-tint: #f9ede9;
  --gold: #f2b45a;
  --rust: #963b22;

  /* Semantic Status Tokens */
  --amber: #8a5a00;
  --amber-tint: #fbf3e6;
  --emerald: #166534;
  --emerald-tint: #edf7f0;
  --crimson: #991b1b;
  --crimson-tint: #fbeeee;

  /* Surfaces, Overlays & Plots */
  --header-bg: rgba(246, 245, 240, 0.94);
  --modal-backdrop: rgba(20, 22, 25, 0.78);
  --shadow-card: 0 10px 26px rgba(20, 22, 25, 0.07);
  --shadow-render: 0 10px 26px rgba(20, 22, 25, 0.10);
  --shadow-nav: 0 14px 28px rgba(20, 22, 25, 0.08);
  --wordmark-ring: none;
  --badge-species-border: rgba(27, 77, 126, 0.32);
  --badge-whole-bg: #edf7f0;
  --badge-whole-border: rgba(22, 101, 52, 0.32);
  --badge-part-bg: #fbf3e6;
  --badge-part-border: rgba(138, 90, 0, 0.35);
  --light-plot-bg: #ffffff;
  --light-plot-filter: none;
  --media-dark-bg: #0b0f14;

  /* System Typography Stack (Zero External Fonts) */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max-w: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121417;
    --sheet: #181b1f;
    --surface-alt: #1f2329;
    --ink: #eae8e1;
    --ink-soft: #c4c7cd;
    --ink-inv: #121417;
    --muted: #9298a2;
    --rule: #292e36;
    --rule-strong: #3e4550;

    --accent: #6aa6de;
    --accent-hover: #8fc0ec;
    --accent-tint: rgba(106, 166, 222, 0.14);
    --btn-accent-bg: #1e5b94;
    --btn-accent-hover: #2870b3;
    --btn-accent-ink: #f6f5f0;

    --teal: #4fb3ba;
    --teal-tint: rgba(79, 179, 186, 0.14);
    --violet: #9e82da;
    --violet-tint: rgba(158, 130, 218, 0.14);
    --audio: #e07a5f;
    --audio-hover: #ec967f;
    --audio-tint: rgba(224, 122, 95, 0.14);
    --gold: #f2b45a;
    --rust: #de7d60;

    --amber: #e2a24a;
    --amber-tint: rgba(226, 162, 74, 0.14);
    --emerald: #56c281;
    --emerald-tint: rgba(86, 194, 129, 0.13);
    --crimson: #e87272;
    --crimson-tint: rgba(232, 114, 114, 0.14);

    --header-bg: rgba(18, 20, 23, 0.92);
    --modal-backdrop: rgba(6, 8, 10, 0.84);
    --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.35);
    --shadow-render: 0 10px 26px rgba(0, 0, 0, 0.42);
    --shadow-nav: 0 14px 28px rgba(0, 0, 0, 0.45);
    --wordmark-ring: 0 0 0 1px #3e4550;
    --badge-species-border: rgba(106, 166, 222, 0.38);
    --badge-whole-bg: rgba(86, 194, 129, 0.12);
    --badge-whole-border: rgba(86, 194, 129, 0.34);
    --badge-part-bg: rgba(226, 162, 74, 0.13);
    --badge-part-border: rgba(226, 162, 74, 0.36);
    --light-plot-bg: #15181c;
    --light-plot-filter: invert(0.915) hue-rotate(180deg);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121417;
  --sheet: #181b1f;
  --surface-alt: #1f2329;
  --ink: #eae8e1;
  --ink-soft: #c4c7cd;
  --ink-inv: #121417;
  --muted: #9298a2;
  --rule: #292e36;
  --rule-strong: #3e4550;

  --accent: #6aa6de;
  --accent-hover: #8fc0ec;
  --accent-tint: rgba(106, 166, 222, 0.14);
  --btn-accent-bg: #1e5b94;
  --btn-accent-hover: #2870b3;
  --btn-accent-ink: #f6f5f0;

  --teal: #4fb3ba;
  --teal-tint: rgba(79, 179, 186, 0.14);
  --violet: #9e82da;
  --violet-tint: rgba(158, 130, 218, 0.14);
  --audio: #e07a5f;
  --audio-hover: #ec967f;
  --audio-tint: rgba(224, 122, 95, 0.14);
  --gold: #f2b45a;
  --rust: #de7d60;

  --amber: #e2a24a;
  --amber-tint: rgba(226, 162, 74, 0.14);
  --emerald: #56c281;
  --emerald-tint: rgba(86, 194, 129, 0.13);
  --crimson: #e87272;
  --crimson-tint: rgba(232, 114, 114, 0.14);

  --header-bg: rgba(18, 20, 23, 0.92);
  --modal-backdrop: rgba(6, 8, 10, 0.84);
  --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.35);
  --shadow-render: 0 10px 26px rgba(0, 0, 0, 0.42);
  --shadow-nav: 0 14px 28px rgba(0, 0, 0, 0.45);
  --wordmark-ring: 0 0 0 1px #3e4550;
  --badge-species-border: rgba(106, 166, 222, 0.38);
  --badge-whole-bg: rgba(86, 194, 129, 0.12);
  --badge-whole-border: rgba(86, 194, 129, 0.34);
  --badge-part-bg: rgba(226, 162, 74, 0.13);
  --badge-part-border: rgba(226, 162, 74, 0.36);
  --light-plot-bg: #15181c;
  --light-plot-filter: invert(0.915) hue-rotate(180deg);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  color: var(--ink);
}

pre {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 16px 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.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;
}

/* ==========================================================================
   Masthead & Navigation (Shared Contract Across All 7 Website Pages)
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 64px;
  position: relative;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
}

.wordmark:hover {
  text-decoration: none;
  color: var(--ink);
}

.wordmark img,
.wordmark svg {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
  box-shadow: var(--wordmark-ring);
}

.wordmark-text {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark-sub,
.wordmark-parent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  border-left: 1px solid var(--rule-strong);
  padding-left: 11px;
}

.nav-toggle {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  order: 2;
}

.site-nav a {
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  white-space: nowrap;
  transition: color 140ms ease, border-color 140ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.site-nav .nav-mobile-only {
  display: none;
}

.site-nav .nav-cta,
.site-nav .nav-parent-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 11px;
  margin-left: 4px;
}

.site-nav .nav-cta:hover,
.site-nav .nav-parent-link:hover {
  background: var(--btn-accent-bg);
  color: var(--btn-accent-ink);
  border-color: var(--btn-accent-bg);
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  order: 3;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Breadcrumb Bar */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.breadcrumb-sep { color: var(--rule-strong); }
.breadcrumb-curr { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Editorial Hero & Buttons
   ========================================================================== */
.hero {
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 44px;
  align-items: center;
}

.cv-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 40px;
  align-items: center;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.kicker-audio {
  color: var(--audio);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.1vw, 3.15rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--ink);
}

.hero-wide h1 {
  max-width: 32ch;
}

.hero-lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 26px;
  max-width: 64ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 18px;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
}

.hero-meta-bar strong {
  color: var(--ink);
  font-weight: 600;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--ink-inv);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-ink);
  text-decoration: none;
}

.btn-audio {
  background: var(--audio);
  color: #ffffff;
  border-color: var(--audio);
}

.btn-audio:hover {
  background: var(--audio-hover);
  border-color: var(--audio-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
  text-decoration: none;
}

.btn-disabled {
  background: var(--surface-alt);
  color: var(--muted);
  border-color: var(--rule-strong);
  cursor: default;
}

/* ==========================================================================
   4-Pillar Quick-Jump Ribbon & Pillar Filter Bar (index.html)
   ========================================================================== */
.pillar-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.pillar-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.pillar-chip:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  text-decoration: none;
  color: var(--ink);
}

.pillar-chip.is-audio {
  border-color: var(--audio);
}

.pillar-chip.is-audio:hover {
  background: var(--audio-tint);
}

.pillar-chip img {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  box-shadow: var(--wordmark-ring);
}

.pillar-chip-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pillar-chip-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pillar-chip-name {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.25;
}

.pillar-filter-wrap {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.pillar-filter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pillar-filter-bar,
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-inv);
}

.pillar-filter-status {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.is-filtered-out {
  display: none !important;
}

/* ==========================================================================
   Metrics Ledger Band
   ========================================================================== */
.ledger {
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
}

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

.ledger-cell {
  padding: 24px 22px 24px 0;
  border-right: 1px solid var(--rule);
}

.ledger-cell:not(:first-child) {
  padding-left: 22px;
}

.ledger-cell:last-child {
  border-right: none;
  padding-right: 0;
}

.ledger-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ledger-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  color: var(--ink);
}

.ledger-note,
.ledger-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.48;
}

/* ==========================================================================
   Editorial Sections & Section Headers
   ========================================================================== */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 76px;
}

.section-alt,
.section-sheet {
  background: var(--sheet);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
  gap: 32px;
  margin-bottom: 36px;
  align-items: baseline;
}

.section-head-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head h2,
.section-head-bar h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}

/* ==========================================================================
   Flagship Release Panels (cleftlabs.com/projects.html)
   ========================================================================== */
.release-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 36px 38px;
}

.section:not(.section-alt):not(.section-sheet) .release-panel {
  background: var(--sheet);
}

.release-panel-audio {
  border-left: 4px solid var(--audio);
}

.release-panel-weightome {
  border-left: 4px solid var(--teal);
}

.release-panel-cleftverse {
  border-left: 4px solid var(--accent);
}

.release-panel-cleftengine {
  border-left: 4px solid var(--violet);
}

.release-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 14px;
}

.release-title-row img {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  box-shadow: var(--wordmark-ring);
}

.release-panel h3 {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

.release-panel p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 15px;
  line-height: 1.65;
}

.project-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
}

.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  color: var(--muted);
}

.status-pill-live {
  background: var(--emerald-tint);
  border-color: var(--emerald);
  color: var(--emerald);
}

.status-pill-new {
  background: var(--audio-tint);
  border-color: var(--audio);
  color: var(--audio);
}

.status-pill-soon {
  background: var(--amber-tint);
  border-color: var(--amber);
  color: var(--amber);
}

.release-media-preview {
  margin-bottom: 18px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.spec-table tr {
  border-bottom: 1px solid var(--rule);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 12px 10px 0;
  width: 46%;
}

.spec-table td {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  padding: 10px 0;
}

/* ==========================================================================
   Technical Reports Grid (TR-01 .. TR-09)
   ========================================================================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-card {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 14px 16px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.report-card:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  text-decoration: none;
  color: var(--ink);
}

.report-card.is-featured {
  grid-column: 1 / -1;
  border-color: var(--audio);
  border-left-width: 4px;
  background: var(--audio-tint);
}

.report-card.is-featured:hover {
  border-color: var(--audio-hover);
}

.report-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

.report-card.is-featured .report-id {
  color: var(--audio);
}

.report-title {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}

.report-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--emerald);
}

.report-tag.is-fix {
  color: var(--rust);
}

.report-tag.is-new {
  color: var(--audio);
}

/* ==========================================================================
   Brand & Logo System Components (brand.html)
   ========================================================================== */
.brand-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.brand-card {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  display: flex;
  flex-direction: column;
}

.brand-card-wide {
  grid-column: 1 / -1;
}

.brand-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  min-height: 196px;
  background: #f6f5f0;
  border-bottom: 1px solid var(--rule);
}

.brand-stage-white {
  background: #ffffff;
}

.brand-stage-dark {
  background: #141619;
}

.brand-stage img {
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-meta {
  padding: 16px 20px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-meta h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 4px;
  color: var(--ink);
}

.brand-meta p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.brand-dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-dl {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.brand-dl:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

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

.brand-swatch {
  background: var(--sheet);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.brand-swatch-chip {
  height: 76px;
  border-bottom: 1px solid var(--rule);
}

.brand-swatch-info {
  padding: 12px 13px;
}

.brand-swatch-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
}

.brand-swatch-hex {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 4px;
}

.brand-swatch-role {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

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

.pillar-mark-tile {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 20px 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pillar-mark-tile img {
  width: 56px;
  height: 56px;
  display: block;
  box-shadow: var(--wordmark-ring);
}

.pillar-mark-tile strong {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
}

.pillar-mark-tile span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

/* ==========================================================================
   Scientific Monograph Grids, Media, Figures, Video, Audio & A/B Decks
   ========================================================================== */
.cv-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

.cv-two.wide-left {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 32px;
  align-items: start;
}

.cv-gallery,
.figures-grid,
.cv-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.cv-video-grid .wide,
.figures-grid .wide {
  grid-column: 1 / -1;
}

.cv-stack > * + * {
  margin-top: 28px;
}

.cv-prose {
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 72ch;
}

.cv-prose.full {
  max-width: none;
}

.cv-prose p {
  margin: 0 0 14px;
}

.cv-prose h3 {
  font-family: var(--font-serif);
  font-size: 21px;
  color: var(--ink);
  margin: 26px 0 10px;
  font-weight: 600;
}

.cv-prose ul,
.cv-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.cv-prose li {
  margin-bottom: 6px;
}

.cv-callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 18px 0;
}

.cv-callout strong {
  color: var(--ink);
}

.cv-callout.warn {
  border-left-color: var(--amber);
  background: var(--amber-tint);
}

.cv-callout.audio {
  border-left-color: var(--audio);
  background: var(--audio-tint);
}

.equation-box {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  margin: 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.eq-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.eq-num {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  margin-left: auto;
}

.cv-steps {
  counter-reset: s;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.cv-steps li {
  counter-increment: s;
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 16px 16px 14px;
  font-size: 14px;
  color: var(--ink-soft);
}

.cv-steps li::before {
  content: "0" counter(s);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
}

.cv-steps li strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 4px;
}

/* Media Frames */
figure {
  margin: 0;
}

.cv-media {
  margin: 0;
  background: var(--media-dark-bg);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
}

.cv-media video,
.cv-media img,
.cv-media svg {
  display: block;
  width: 100%;
  height: auto;
}

.cv-media.light {
  background: var(--light-plot-bg);
}

.cv-media.light img {
  filter: var(--light-plot-filter);
}

.cv-media img[data-lightbox] {
  cursor: zoom-in;
}

.cv-caption {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 10px 0 0;
}

.cv-caption strong {
  color: var(--ink-soft);
}

.figure-card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 20px 22px 18px;
  transition: border-color 140ms ease;
}

.figure-card:hover {
  border-color: var(--rule-strong);
}

.figure-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.figure-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.figure-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.figure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 12px;
  height: 3px;
  display: inline-block;
}

/* Video Cards */
.video-card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
}

.video-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Audio Cards & Synced A/B Decks */
.audio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.audio-card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.audio-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.audio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.audio-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

.audio-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}

.audio-player-wrap {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 12px;
}

.audio-player-wrap audio {
  width: 100%;
  height: 36px;
  display: block;
}

.audio-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.audio-specs strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ab-compare {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  padding: 20px 22px;
}

.ab-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ab-track {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ab-track.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.ab-track-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.ab-track audio {
  width: 100%;
  height: 34px;
}

.ab-metrics {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}

/* Badges, Pills & Copy Buttons */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-tint);
  border-color: var(--badge-species-border);
  color: var(--accent);
  font-weight: 600;
}

.badge-audio {
  background: var(--audio-tint);
  border-color: var(--audio);
  color: var(--audio);
  font-weight: 600;
}

.badge-ok {
  background: var(--badge-whole-bg);
  border-color: var(--badge-whole-border);
  color: var(--emerald);
  font-weight: 600;
}

.badge-warn {
  background: var(--badge-part-bg);
  border-color: var(--badge-part-border);
  color: var(--amber);
  font-weight: 600;
}

.cv-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.cv-pill.ok { color: var(--emerald); }
.cv-pill.part { color: var(--amber); }
.cv-pill.no { color: var(--crimson); }

.copy-btn {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 9px;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.copied {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-ink);
}

/* Data Tables */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  background: var(--sheet);
}

.cv-table,
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--sheet);
}

.cv-table th,
.cv-table td,
table.data-table th,
table.data-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.cv-table th,
table.data-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-alt);
  white-space: nowrap;
}

.cv-table td.num,
.cv-table th.num,
table.data-table td.num,
table.data-table th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cv-table tbody tr:hover,
table.data-table tbody tr:hover {
  background: var(--paper);
}

.good { color: var(--emerald); font-weight: 600; }
.warn { color: var(--amber); font-weight: 600; }
.bad { color: var(--crimson); font-weight: 600; }

/* Collapsible Details & Roadmap */
.cv-details {
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

.cv-details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.cv-roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--rule-strong);
}

.cv-roadmap li {
  position: relative;
  padding: 0 0 24px 26px;
}

.cv-roadmap li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sheet);
  border: 2px solid var(--rule-strong);
}

.cv-roadmap li.done::before { background: var(--emerald); border-color: var(--emerald); }
.cv-roadmap li.now::before { background: var(--amber); border-color: var(--amber); }

/* ==========================================================================
   Ear & Pinna Bioacoustic Designer Studio Classes (ear-designer.html)
   ========================================================================== */
.ed-preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.ed-preset-btn {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 13px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.ed-preset-btn small {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-sans);
}

.ed-preset-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.ed-preset-btn.active {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-ink);
}

.ed-preset-btn.active small {
  color: var(--btn-accent-ink);
  opacity: 0.85;
}

.ed-species-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 14px 18px;
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--ink-soft);
}

.ed-species-banner strong {
  color: var(--ink);
}

.ed-studio-grid {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ed-panel {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  padding: 18px 20px;
}

.ed-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.ed-panel-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink);
  margin: 0;
}

.ed-panel-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.ed-control-group {
  margin-bottom: 11px;
}

.ed-control-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 3px;
}

.ed-control-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ed-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.ed-select {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
}

.ed-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 14px 0;
}

.ed-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ed-btn-sm {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.ed-btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ed-btn-sm.is-on {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-ink);
}

.ed-viz-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ed-viz-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
}

.ed-canvas-wrap {
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.ed-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.ed-pad-wrap {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  cursor: crosshair;
  touch-action: none;
}

.ed-pad-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

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

.ed-kpi {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 12px;
}

.ed-kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ed-kpi-val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.ed-kpi-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.ed-audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  margin-top: 12px;
}

/* ==========================================================================
   Academic Scientific Paper Layout (paper.html)
   ========================================================================== */
.paper-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding: 44px 0 72px;
}

.paper-toc {
  position: sticky;
  top: 84px;
  border-right: 1px solid var(--rule);
  padding-right: 20px;
}

.paper-toc-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.paper-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.paper-toc li {
  margin-bottom: 6px;
}

.paper-toc a {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 3px 0 3px 8px;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.paper-toc a:hover,
.paper-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  text-decoration: none;
}

.paper-article {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 48px 54px;
  min-width: 0;
}

.paper-header {
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.paper-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  font-weight: 400;
  line-height: 1.18;
  margin: 8px 0 14px;
  color: var(--ink);
}

.paper-authors {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}

.paper-affil {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}

.paper-abstract {
  background: var(--paper);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  margin: 22px 0 28px;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--ink-soft);
}

.paper-abstract-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 6px;
}

.paper-keywords {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}

.paper-article h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--ink);
  margin: 38px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 84px;
}

.paper-article h3 {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 10px;
  scroll-margin-top: 84px;
}

.paper-article p {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-soft);
  margin: 0 0 15px;
}

.paper-article ul,
.paper-article ol {
  font-size: 15px;
  line-height: 1.68;
  color: var(--ink-soft);
  margin: 0 0 16px;
  padding-left: 24px;
}

.paper-figure {
  margin: 26px 0;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.table-caption {
  font-size: 13px;
  color: var(--muted);
  margin: 22px 0 8px;
}

.table-caption strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.ref-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  counter-reset: ref;
}

.ref-list li {
  counter-increment: ref;
  position: relative;
  padding-left: 34px;
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.ref-list li::before {
  content: "[" counter(ref) "]";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ==========================================================================
   Legal Document Pages (impressum.html, datenschutz.html)
   ========================================================================== */
.legal-main {
  padding: 56px 0 80px;
}

.legal-sheet {
  max-width: 780px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 44px 48px;
}

.legal-sheet h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  margin: 8px 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.legal-sheet h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  margin: 30px 0 10px;
  color: var(--ink);
}

.legal-sheet h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 6px;
  color: var(--ink);
}

.legal-sheet p,
.legal-sheet li {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.68;
}

.legal-sheet ul {
  padding-left: 20px;
  margin: 8px 0 16px;
}

.address-block {
  font-style: normal;
  background: var(--paper);
  border-left: 2px solid var(--accent);
  padding: 14px 18px;
  margin: 14px 0 20px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal-panel {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  max-width: 1020px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  margin-bottom: 16px;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
}

.modal-close {
  background: var(--ink);
  color: var(--ink-inv);
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.modal-body img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
}

/* ==========================================================================
   Footer (Shared Across All 7 Website Pages)
   ========================================================================== */
.site-footer {
  padding: 36px 0 48px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 10px 20px;
  flex-wrap: wrap;
  max-width: 620px;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--ink-soft);
}

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

.footer-meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1040px) {
  .ed-studio-grid,
  .ed-viz-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .wordmark-sub,
  .wordmark-parent {
    display: none;
  }
}

@media (max-width: 980px) {
  .paper-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .paper-toc {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 0 0 16px;
  }

  .paper-article {
    padding: 32px 26px;
  }

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

@media (max-width: 900px) {
  .hero-grid,
  .cv-hero-grid,
  .section-head,
  .release-panel,
  .ledger-grid,
  .figures-grid,
  .cv-gallery,
  .cv-two,
  .cv-two.wide-left,
  .method-grid,
  .audio-grid,
  .brand-stage-grid,
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .section-head {
    gap: 10px;
    margin-bottom: 24px;
  }

  .ledger-cell {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 18px 0 !important;
  }

  .ledger-cell:last-child {
    border-bottom: none;
  }

  .release-panel {
    padding: 24px 20px;
    gap: 24px;
  }

  .legal-sheet {
    padding: 28px 20px;
  }

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

@media (max-width: 860px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    height: 58px;
    gap: 8px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    order: 2;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    order: 3;
    background: transparent;
    border: 1px solid var(--rule-strong);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 11px;
    min-height: 36px;
    cursor: pointer;
  }

  .nav-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    width: 14px;
  }

  .nav-toggle-bars span {
    display: block;
    height: 1.5px;
    width: 100%;
    background: currentColor;
    transition: transform 160ms ease;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child {
    transform: translateY(2.75px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child {
    transform: translateY(-2.75px) rotate(-45deg);
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: -16px;
    right: -16px;
    background: var(--sheet);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule-strong);
    box-shadow: var(--shadow-nav);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 16px 16px;
    z-index: 50;
  }

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

  .site-nav a {
    padding: 13px 4px;
    border-bottom: 1px solid var(--rule);
    font-size: 15px;
    color: var(--ink);
  }

  .site-nav a:hover,
  .site-nav a.active {
    border-bottom-color: var(--rule);
    color: var(--accent);
  }

  .site-nav .nav-mobile-only {
    display: block;
    font-size: 13.5px;
    color: var(--muted);
  }

  .site-nav .nav-cta,
  .site-nav .nav-parent-link {
    margin: 12px 0 0;
    padding: 11px 14px;
    text-align: center;
    font-size: 12.5px;
    border: 1px solid var(--accent);
  }

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

  .hero {
    padding: 36px 0 32px;
  }

  .hero h1 {
    font-size: 1.9rem;
    margin-bottom: 14px;
  }

  .hero-lead {
    font-size: 15.5px;
    margin-bottom: 20px;
  }

  .section {
    padding: 40px 0;
  }

  .ledger-val {
    font-size: 22px;
  }

  .spec-table {
    font-size: 12.5px;
  }

  .paper-article {
    padding: 24px 18px;
  }

  .legal-main {
    padding: 28px 0 48px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .pillar-ribbon,
  .cv-steps,
  .audio-specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .pillar-marks-grid,
  .ed-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Academic Print Stylesheet (@media print)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 18mm 16mm 20mm;
  }

  :root,
  :root[data-theme="dark"] {
    color-scheme: light !important;
    --paper: #ffffff !important;
    --sheet: #ffffff !important;
    --surface-alt: #f4f4f2 !important;
    --ink: #000000 !important;
    --ink-soft: #1a1a1a !important;
    --muted: #444444 !important;
    --rule: #cccccc !important;
    --rule-strong: #888888 !important;
    --accent: #1b4d7e !important;
    --accent-tint: #f2f5f8 !important;
    --light-plot-filter: none !important;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .site-header,
  .site-footer,
  .paper-toc,
  .theme-toggle,
  .nav-toggle,
  .hero-actions,
  .filter-bar,
  .pillar-filter-wrap,
  .copy-btn,
  .modal,
  audio,
  video,
  .no-print {
    display: none !important;
  }

  .container {
    max-width: none !important;
    padding: 0 !important;
  }

  .paper-layout {
    display: block !important;
    padding: 0 !important;
  }

  .paper-article {
    border: none !important;
    padding: 0 !important;
  }

  .section {
    padding: 18pt 0 !important;
    border-bottom: 1px solid #cccccc !important;
  }

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

  .paper-figure,
  .figure-card,
  .equation-box,
  .cv-callout,
  .table-scroll,
  .release-panel,
  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #000000 !important;
    text-decoration: none !important;
  }
}
