:root {
  --bg-canvas: #1e1612;
  --bg-surface: #30241d;
  --bg-surface-alt: #271d17;
  --text-primary: #f5ecdf;
  --text-muted: #cdbba7;
  --accent-primary: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: #fbbf24;
  --amber-band-bg: #f59e0b;
  --amber-band-text: #1e1612;
  --border-subtle: rgba(245, 236, 223, 0.16);
  --border-amber: rgba(245, 158, 11, 0.35);
  --glow-amber: 0 0 35px -8px rgba(245, 158, 11, 0.28);
  --radius-standard: 4px;
  --font-serif: Charter, Cambria, Georgia, serif;
  --ease-ledger: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  line-height: 1.65;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow-wrap: anywhere;
  hyphens: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover, a:focus-visible {
  color: var(--accent-light);
}

/* Header & Navigation */
.header-wrapper {
  max-width: 1200px;
  width: 94%;
  margin: 1.25rem auto;
  position: relative;
  z-index: 50;
}

.ledger-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.brand-anchor {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.brand-icon {
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 2px;
  display: inline-block;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.desktop-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.35rem 0.2rem;
  transition: all 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--accent-primary);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-amber);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 16px 36px rgba(0,0,0,0.6);
  flex-direction: column;
  gap: 0.85rem;
  z-index: 99;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-variant: small-caps;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* Layout Containers */
.main-wrapper {
  width: 94%;
  max-width: 1200px;
  margin: 0 auto 3rem;
  flex: 1;
}

.prose-measure {
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

/* Typography Ledger Elements */
.small-caps-label {
  font-variant: small-caps;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 0.4rem;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.25rem;
}

p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-amber-outline {
  display: inline-block;
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: 0;
  padding: 0.75rem 1.6rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-ledger), background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-amber-outline:hover, .btn-amber-outline:focus-visible {
  background: var(--accent-primary);
  color: #1e1612;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-dark-outline {
  display: inline-block;
  background: transparent;
  color: #1e1612;
  border: 1px solid #1e1612;
  border-radius: 0;
  padding: 0.75rem 1.6rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-ledger), background 0.2s ease, color 0.2s ease;
}

.btn-dark-outline:hover {
  background: #1e1612;
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero-ledger {
  padding: 3.5rem 0 2.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: 10%;
  left: 0;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(30, 22, 18, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* Investigation Lead Block */
.investigation-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: 4px;
  padding: 1.8rem;
  margin: 2rem 0 3rem;
}

/* Two-column Stacked Layout */
.ledger-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin: 2.5rem 0;
}

/* Icon-led Hairline Rows */
.hairline-list {
  display: flex;
  flex-direction: column;
}

.hairline-row {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.hairline-row:first-child {
  border-top: 1px solid var(--border-subtle);
}

.hairline-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-amber);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--bg-surface-alt);
}

.hairline-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.hairline-body p {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

/* Amber Interruption Band */
.amber-full-band {
  background-color: var(--amber-band-bg);
  color: var(--amber-band-text);
  padding: 3rem 0;
  margin: 3.5rem 0;
  border-radius: 4px;
}

.amber-band-inner {
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
}

.amber-full-band h2, .amber-full-band h3 {
  color: #1e1612;
}

.amber-full-band p {
  color: #2b1f18;
}

/* Natural Images */
.ledger-figure {
  margin: 1.8rem 0;
}

.ledger-image {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  display: block;
}

.figure-caption {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Comparison Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.ledger-table th, .ledger-table td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ledger-table th {
  background: var(--bg-surface-alt);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  font-weight: 600;
}

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

.ledger-table tr:hover td {
  background: rgba(245, 158, 11, 0.04);
}

/* Experiment Step List */
.step-list {
  list-style: none;
  counter-reset: ledger-counter;
  margin: 1.5rem 0;
}

.step-item {
  counter-increment: ledger-counter;
  position: relative;
  padding-left: 2.8rem;
  margin-bottom: 1.5rem;
}

.step-item::before {
  content: counter(ledger-counter);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Safety Callout Box */
.safety-callout {
  border: 1px solid #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-left: 4px solid #ef4444;
  padding: 1.25rem;
  border-radius: 4px;
  margin: 2rem 0;
}

.safety-callout h3 {
  color: #fca5a5;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.safety-callout p {
  color: #fecaca;
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* Disclosures for FAQ */
.faq-disclosure {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.faq-summary {
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--accent-primary);
  font-weight: 400;
}

details[open] .faq-summary::after {
  content: "—";
}

.faq-content {
  padding-top: 0.8rem;
  color: var(--text-muted);
}

/* Workbench / Contact Form */
.workbench-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2rem;
  margin: 2rem 0;
}

.workbench-form .form-group {
  margin-bottom: 1.25rem;
}

.workbench-form label {
  display: block;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin-bottom: 0.35rem;
}

.workbench-form input,
.workbench-form textarea,
.workbench-form select {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.workbench-form input:focus,
.workbench-form textarea:focus,
.workbench-form select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--accent-light);
}

/* Footer */
.ledger-footer {
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  width: 94%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-column h4 {
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-bottom {
  max-width: 1200px;
  width: 94%;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .ledger-columns {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
}

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