:root {
    --bg: #2e2c3b;
    --bg-deeper: #232231;
    --bg-deepest: #1a1924;
    --ink: #f6f3e8;
    --ink-dim: rgba(246, 243, 232, 0.62);
    --ink-faint: rgba(246, 243, 232, 0.32);
    --siren-yellow: #ffd400;
    --siren-red: #ff2b3a;
    --rule: rgba(246, 243, 232, 0.14);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { background: var(--bg); color: var(--ink); }
  body {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  /* Subtle texture */
  body::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
      repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
    opacity: 0.25;
  }
  body::after {
    content: "";
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.05 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    pointer-events: none;
    z-index: 9998;
    opacity: 0.4;
  }

  .mono {
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.22em;
  }

  /* Nav */
  nav.topnav {
    position: sticky; top: 0;
    z-index: 100;
    background: rgba(46, 44, 59, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rule);
  }
  .topnav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
    max-width: 1080px; margin: 0 auto;
    padding: 0 32px;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 16px;
    color: var(--ink);
    text-decoration: none;
  }
  .brand-mark {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    background: var(--siren-yellow);
    color: #1a1924;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--siren-red);
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
  }
  .back-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-dim);
    text-decoration: none;
    transition: color .15s;
  }
  .back-link:hover { color: var(--siren-yellow); }

  /* Header */
  .doc-header {
    max-width: 1080px;
    margin: 0 auto;
    padding: 96px 32px 48px;
    border-bottom: 1px solid var(--rule);
    position: relative;
  }
  .doc-header .eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--siren-yellow);
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 14px;
  }
  .doc-header .eyebrow::before {
    content: "";
    width: 32px; height: 2px;
    background: var(--siren-yellow);
  }
  .doc-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(56px, 8vw, 120px);
    line-height: 0.9;
    letter-spacing: -0.005em;
    margin-bottom: 28px;
  }
  .doc-header .meta {
    display: flex; gap: 32px; flex-wrap: wrap;
    margin-top: 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-dim);
  }
  .doc-header .meta strong {
    color: var(--ink);
    font-weight: 700;
    display: block;
    margin-top: 4px;
    letter-spacing: 0.18em;
  }

  /* TLDR card */
  .tldr {
    max-width: 1080px;
    margin: 56px auto 0;
    padding: 0 32px;
  }
  .tldr-inner {
    background: var(--bg-deeper);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--siren-yellow);
    padding: 32px 36px;
    position: relative;
  }
  .tldr-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--siren-yellow);
    margin-bottom: 14px;
  }
  .tldr h2 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 28px;
    line-height: 1.1;
    margin-bottom: 18px;
    letter-spacing: 0.01em;
  }
  .tldr ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 32px;
  }
  .tldr li {
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 16px;
    color: var(--ink);
  }
  .tldr li .check {
    flex-shrink: 0;
    width: 20px; height: 20px;
    margin-top: 3px;
    display: grid; place-items: center;
    background: var(--siren-yellow);
    color: #1a1924;
    font-weight: 700;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
  }
  .tldr li .x {
    flex-shrink: 0;
    width: 20px; height: 20px;
    margin-top: 3px;
    display: grid; place-items: center;
    background: transparent;
    border: 1.5px solid var(--siren-red);
    color: var(--siren-red);
    font-weight: 700;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
  }

  /* Body */
  .doc-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 64px 32px 96px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 64px;
    align-items: flex-start;
  }
  .toc {
    position: sticky;
    top: 96px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
  }
  .toc-label {
    color: var(--ink-faint);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule);
    font-size: 10px;
    letter-spacing: 0.28em;
  }
  .toc ol {
    list-style: none;
    counter-reset: toc;
  }
  .toc li {
    counter-increment: toc;
    margin-bottom: 12px;
  }
  .toc a {
    color: var(--ink-dim);
    text-decoration: none;
    display: flex; gap: 12px;
    transition: color .15s;
    line-height: 1.4;
  }
  .toc a::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--siren-yellow);
    flex-shrink: 0;
  }
  .toc a:hover { color: var(--ink); }

  .sections section {
    margin-bottom: 56px;
    scroll-margin-top: 96px;
  }
  .sections section:last-child { margin-bottom: 0; }
  .sections .num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--siren-yellow);
    letter-spacing: 0.3em;
    margin-bottom: 14px;
    display: block;
  }
  .sections h2 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 36px;
    line-height: 1;
    letter-spacing: 0.005em;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rule);
  }
  .sections p {
    font-size: 17px;
    color: var(--ink);
    line-height: 1.65;
    margin-bottom: 14px;
    text-wrap: pretty;
  }
  .sections p.dim { color: var(--ink-dim); }
  .sections strong { color: var(--siren-yellow); font-weight: 600; }
  .sections ul {
    list-style: none;
    margin: 16px 0;
  }
  .sections ul li {
    font-size: 16px;
    color: var(--ink);
    padding: 8px 0 8px 22px;
    position: relative;
    line-height: 1.55;
  }
  .sections ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--siren-yellow);
  }
  .sections a { color: var(--siren-yellow); text-decoration: none; border-bottom: 1px solid var(--siren-yellow); }
  .sections a:hover { color: var(--ink); border-bottom-color: var(--ink); }

  /* Contact card */
  .contact-card {
    background: var(--bg-deepest);
    border: 1px solid var(--rule);
    padding: 32px;
    margin-top: 24px;
  }
  .contact-card .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 8px;
  }
  .contact-card .email {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 24px;
    color: var(--siren-yellow);
    text-decoration: none;
    border: none;
  }
  .contact-card .email:hover { color: var(--ink); }

  /* Footer */
  footer {
    background: #1a1924;
    padding: 48px 0 32px;
    border-top: 1px solid var(--rule);
  }
  .foot-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-faint);
  }
  .foot-inner a { color: var(--ink-dim); text-decoration: none; margin-left: 24px; transition: color .15s; }
  .foot-inner a:hover { color: var(--siren-yellow); }

  @media (max-width: 820px) {
    .doc-body { grid-template-columns: 1fr; gap: 32px; }
    .toc { position: static; }
    .tldr ul { grid-template-columns: 1fr; }
    .doc-header { padding-top: 56px; }
  }
