:root {
  --bg-canvas: #0b0b0d;
  --bg-surface: #16171b;
  --bg-surface-hover: #22232a;
  --text-primary: #f3f4f6;
  --text-muted: #c0c4cc;
  --accent-primary: #dc2626;
  --accent-secondary: #991b1b;
  --border-subtle: #27272a;
  --border-crimson: rgba(220, 38, 38, 0.4);
  --shadow-block: 4px 4px 0px #000000;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  overflow-wrap: anywhere;
  hyphens: auto;
  background-image: radial-gradient(#27272a 1px, transparent 1px);
  background-size: 24px 24px;
}

h1, h2, h3, h4, .serif-font {
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
p { margin-bottom: 1.2rem; }
a { color: var(--text-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-primary); }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.copy-measure {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

/* Header & Nav */
.header-wrapper {
  padding: 1.25rem 1.5rem 0.5rem;
  position: relative;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.75rem 1.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-dot {
  width: 12px;
  height: 12px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--accent-primary);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

.desktop-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-menu-drawer {
  display: none;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-crimson);
  border-radius: 8px;
  padding: 1.2rem;
  margin: 0.5rem auto 0;
  max-width: 1200px;
}

.mobile-menu-drawer.open {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Common UI Elements */
.btn-crimson {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-primary);
  color: #ffffff;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0;
  border: 1px solid #ef4444;
  box-shadow: var(--shadow-block);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-crimson:hover {
  color: #ffffff;
  background-color: #b91c1c;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #000;
}

.btn-crimson:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 transparent;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--text-primary);
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-block);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-muted);
}

.crimson-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-primary);
  border: 1px solid var(--border-crimson);
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.85rem;
}

/* Sections & Dividers */
section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-head {
  margin-bottom: 2.5rem;
}

.split-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.split-story.reversed {
  direction: rtl;
}

.split-story.reversed > * {
  direction: ltr;
}

.story-media {
  position: relative;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-block);
}

.story-media img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

.story-media-caption {
  background: var(--bg-surface);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* List with Red Glyphs */
.item-ledger {
  list-style: none;
  margin-top: 1.5rem;
}

.item-ledger li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.9rem;
  font-size: 1rem;
}

.item-ledger li::before {
  content: "■";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-size: 0.85rem;
  top: 0.15rem;
}

/* Hairline Ledger Cards */
.hairline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.hairline-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hairline-card:hover {
  border-color: var(--accent-primary);
}

.hairline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-crimson);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  background-color: var(--bg-surface);
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: #101114;
  color: var(--text-primary);
  font-family: "Georgia", serif;
  font-weight: 600;
}

tr:hover td {
  background-color: var(--bg-surface-hover);
}

/* Tool Section */
.tool-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  margin: 2.5rem 0;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

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

.calc-output {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background-color: var(--bg-canvas);
  border-left: 3px solid var(--accent-primary);
  display: none;
}

/* Expansion FAQ panels */
.faq-accordion {
  margin-top: 2rem;
}

.faq-node {
  border-bottom: 1px solid var(--border-subtle);
}

.faq-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.4rem 0;
  color: var(--text-primary);
  font-family: "Georgia", serif;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-trigger:hover {
  color: var(--accent-primary);
}

.faq-icon {
  font-size: 1.2rem;
  color: var(--accent-primary);
}

.faq-body {
  display: none;
  padding-bottom: 1.4rem;
  color: var(--text-muted);
}

.faq-body.active {
  display: block;
}

/* Scroll reveal helper */
.reveal-block {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  background-color: #070709;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-heading {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-bottom {
  border-top: 1px solid #1a1a1e;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: #71717a;
}

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .mobile-nav-toggle { display: inline-flex; }
  .split-story, .split-story.reversed {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .site-header { padding: 0.6rem 1.2rem; }
}

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