:root {
  --bg-page: #232120;
  --bg-panel: #171717;
  --bg-panel-soft: #1d1d1d;
  --bg-line: rgba(255, 255, 255, 0.1);
  --text-main: #f2eee8;
  --text-body: rgba(242, 238, 232, 0.76);
  --text-muted: rgba(242, 238, 232, 0.52);
  --accent: #cc2200;
  --accent-soft: rgba(204, 34, 0, 0.12);
  --success: #3a8a50;
  --warning: #fbbf24;
  --font-heading: "Avenir Next Condensed", "Arial Narrow", "Franklin Gothic Medium", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
  background: var(--bg-page);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(180deg, #262322 0%, #232120 52%, #1d1b1a 100%);
  background-size: 160px 160px, 160px 160px, auto;
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

a {
  color: var(--text-main);
  text-decoration-color: rgba(204, 34, 0, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover,
a:focus-visible {
  color: var(--text-main);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

strong {
  color: var(--text-main);
}

code {
  padding: 0.16rem 0.34rem;
  border: 1px solid var(--bg-line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  padding: 28px 32px 72px;
}

.sidebar {
  min-width: 0;
}

.sidebar-stack {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 22px;
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding-right: 4px;
}

.brand-panel,
.side-card {
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--bg-line);
  background: rgba(255, 255, 255, 0.018);
  padding: 18px 0 20px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
}

.panel-overline,
.mini-label,
.meta-line,
.status-chip,
.toc a,
.section-kicker,
.summary-card strong,
.fact-list dt,
th,
.foot-note,
.hero-rule-list span {
  font-family: var(--font-mono);
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-overline {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.68rem;
}

.brand-panel h2 {
  max-width: 10ch;
  font-size: 2.7rem;
}

.sidebar-copy,
.side-card p,
.fact-list dd,
.quick-list li,
.section-card p,
.section-card li,
td,
.summary-card span,
.hero-aside-copy {
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.65;
}

.mini-label {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.fact-list,
.quick-list,
.toc-list,
.section-card ul {
  margin: 0;
  padding: 0;
}

.fact-list {
  display: grid;
  gap: 16px;
}

.fact-list div + div {
  padding-top: 14px;
  border-top: 1px solid var(--bg-line);
}

.fact-list dt {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.68rem;
}

.quick-list,
.section-card ul {
  list-style: none;
}

.quick-list li,
.section-card li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
}

.quick-list li::before,
.section-card li::before {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  top: 0.72rem;
  left: 0;
  background: var(--accent);
}

.toc-list {
  display: grid;
  gap: 2px;
}

.toc a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible {
  border-left-color: var(--accent);
  color: var(--text-main);
  padding-left: 10px;
}

.content-column {
  min-width: 0;
  display: grid;
  gap: 48px;
}

.hero {
  min-width: 0;
  padding: 38px 0 32px;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--bg-line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 40px;
  align-items: start;
}

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

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-kicker .panel-overline {
  margin-bottom: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(204, 34, 0, 0.35);
  background: var(--accent-soft);
  color: var(--text-main);
  font-size: 0.65rem;
}

.hero h1 {
  max-width: 760px;
  font-size: 4.25rem;
  line-height: 0.95;
}

.hero-copy {
  max-width: 760px;
  margin-top: 24px;
  color: var(--text-body);
  font-size: 1.18rem;
  line-height: 1.62;
}

.hero-aside {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
}

.hero-rule-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.hero-rule-list span {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-main);
  font-size: 0.68rem;
}

.hero-footer {
  margin-top: 28px;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 18px;
  border-top: 1px solid var(--bg-line);
}

.meta-line {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  background: var(--bg-line);
  border: 1px solid var(--bg-line);
}

.summary-card {
  min-height: 132px;
  padding: 18px;
  background: var(--bg-panel);
}

.summary-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.68rem;
}

.section-card {
  min-width: 0;
  padding-top: 34px;
  border-top: 1px solid var(--bg-line);
  scroll-margin-top: 28px;
}

.section-header {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.section-kicker {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.section-card h2 {
  font-size: 2.3rem;
}

.section-card h3 {
  margin: 28px 0 12px;
  font-size: 1.35rem;
}

.section-card > p + p {
  margin-top: 14px;
}

.callout {
  margin: 24px 0 0;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.callout strong {
  display: block;
  margin-bottom: 8px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 22px;
  border: 1px solid var(--bg-line);
  background: var(--bg-panel);
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-line);
}

th {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.68rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.note-tile {
  padding: 18px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.note-tile strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.foot-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  background: var(--success);
}

.dot.warning {
  background: var(--warning);
}

.footer-card {
  padding-bottom: 32px;
}

@media (max-width: 1120px) {
  .page-shell {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sidebar-stack {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .toc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 14px 12px 48px;
  }

  .sidebar {
    order: 2;
  }

  .content-column {
    order: 1;
    gap: 36px;
  }

  .brand-panel,
  .side-card {
    padding: 16px 0 18px;
  }

  .brand-panel h2 {
    max-width: none;
    font-size: 2.35rem;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-grid,
  .summary-grid,
  .note-grid,
  .toc-list {
    grid-template-columns: 1fr;
  }

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

  .hero-copy {
    font-size: 1.05rem;
  }

  .hero-aside {
    padding-left: 14px;
  }

  .section-card h2 {
    font-size: 2rem;
  }

  table {
    min-width: 650px;
  }
}
