:root {
  --spk-navy: #0B1026;
  --spk-navy-2: #111838;
  --spk-red: #EF4444;
  --spk-white: #FFFFFF;
  --spk-text: #E6E8F0;
  --spk-muted: #9AA1BC;
  --spk-line: rgba(255,255,255,0.10);
  --spk-card: rgba(255,255,255,0.03);
  --font-head: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --maxw: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  font-family: var(--font-body);
  background: var(--spk-navy);
  color: var(--spk-text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--spk-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 54px 22px 30px; border-bottom: 1px solid var(--spk-line);
  text-align: center;
}
.eyebrow {
  font-family: var(--font-head); font-weight: 700; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--spk-red); margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.12;
  letter-spacing: -0.02em; color: var(--spk-white);
  margin-inline: auto;
}
.hero-sub {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(15px, 2.3vw, 19px); color: var(--spk-text);
  margin-top: 12px; text-wrap: balance;
}
.hero .updated { margin-top: 16px; color: var(--spk-muted); font-size: 14px; white-space: nowrap; }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 34px 22px 80px;
  display: grid; grid-template-columns: 260px 1fr; gap: 46px; align-items: start;
}

/* TOC — sidebar on desktop, slide-in drawer on mobile */
.toc { position: sticky; top: 24px; font-size: 13.5px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.toc::-webkit-scrollbar { display: none; }
.toc-trigger { display: none; }       /* shown on mobile only */
.toc-backdrop { display: none; }      /* shown on mobile only */
.toc-drawer-head { display: none; }   /* shown inside the drawer only */
.toc-close { display: none; }
.toc-group {
  font-family: var(--font-head); font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--spk-red);
  margin: 18px 0 8px; padding-left: 10px;
}
.toc-group:first-child { margin-top: 0; }
.toc ul { list-style: none; }
.toc li { margin-bottom: 2px; }
.toc a {
  display: flex; gap: 9px; padding: 5px 10px; border-radius: 8px;
  color: var(--spk-muted); font-weight: 500; line-height: 1.35;
}
.toc a .n { color: var(--spk-red); font-family: var(--font-head); font-weight: 700; font-size: 11px; min-width: 18px; }
.toc a:hover { background: var(--spk-card); color: var(--spk-white); text-decoration: none; }

/* Content */
.content { min-width: 0; }
.intro { color: var(--spk-muted); margin-bottom: 34px; }
.part-head {
  font-family: var(--font-head); font-weight: 800; color: var(--spk-white);
  font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 16px; margin: 40px 0 22px; border-radius: 10px;
  background: var(--spk-navy-2); border: 1px solid var(--spk-line);
}
.part-head:first-of-type { margin-top: 0; }
.part-head span { color: var(--spk-red); }

.content section { padding-top: 6px; margin-bottom: 34px; }
.content h2 {
  font-family: var(--font-head); font-weight: 700; font-size: 20px;
  letter-spacing: -0.01em; color: var(--spk-white); margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 11px;
}
.content h2 .num { color: var(--spk-red); font-size: 14px; font-weight: 800; min-width: 24px; }
.content h3 { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--spk-white); margin: 18px 0 8px; }
.content p { margin-bottom: 12px; }
.content ul { margin: 0 0 12px 0; padding-left: 20px; }
.content li > ul { margin-top: 7px; margin-bottom: 0; }
.content li { margin-bottom: 7px; }
.content li::marker { color: var(--spk-red); }
.muted { color: var(--spk-muted); }

.contact-card {
  background: var(--spk-card); border: 1px solid var(--spk-line);
  border-radius: var(--radius); padding: 20px 22px; margin-top: 6px;
}
.contact-card p { margin-bottom: 6px; }

/* Responsive */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; gap: 0; }

  /* Trigger button (stays reachable while scrolling) */
  .toc-trigger {
    display: inline-flex; align-items: center; gap: 10px;
    position: sticky; top: 10px; z-index: 30; align-self: start; width: max-content;
    margin-bottom: 24px; cursor: pointer;
    font-family: var(--font-head); font-weight: 700; font-size: 13px;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--spk-white);
    padding: 12px 18px; border-radius: 10px;
    background: var(--spk-navy-2); border: 1px solid var(--spk-line);
  }
  .toc-trigger-icon { color: var(--spk-red); font-size: 16px; line-height: 1; }

  /* The drawer itself */
  .toc {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; margin: 0;
    width: min(84vw, 320px); max-height: none; overflow-y: auto;
    padding: 20px 18px 44px;
    background: var(--spk-navy); border-right: 1px solid var(--spk-line);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    transform: translateX(-100%); transition: transform 0.28s ease;
  }
  .toc.open { transform: translateX(0); }

  /* Dimmed backdrop behind the drawer */
  .toc-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(0,0,0,0.55);
    opacity: 0; visibility: hidden; transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  .toc-backdrop.open { opacity: 1; visibility: visible; }

  /* Drawer header with title + close */
  .toc-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--spk-line);
  }
  .toc-drawer-title {
    font-family: var(--font-head); font-weight: 800; font-size: 13px;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--spk-white);
  }
  .toc-close {
    display: block; background: none; border: none; cursor: pointer;
    color: var(--spk-muted); font-size: 26px; line-height: 1; padding: 0 4px;
  }
  .toc-close:hover { color: var(--spk-white); }

  /* Freeze the page while the drawer is open (iOS-proof; `top` set by terms.js) */
  body.toc-locked { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

  /* Keep section headings on a single line (scales down to fit) */
  .content h2 {
    white-space: nowrap; gap: 8px;
    font-size: clamp(13px, 3.6vw, 20px);
  }
  .content h2 .num { min-width: 18px; }
  /* The one long heading may use up to two lines */
  #s25 h2 { white-space: normal; }

  /* Body text always a step smaller than its heading */
  .content p, .content li, .intro { font-size: clamp(12px, 3.2vw, 16px); }
  .content h3 { font-size: clamp(12px, 3.2vw, 15px); }

  /* Part dividers on a single line too */
  .part-head {
    white-space: nowrap;
    font-size: clamp(11px, 3.3vw, 15px);
    letter-spacing: 0.05em;
  }
}
@media (max-width: 480px) { .hero h1 { font-size: 28px; } .hero-sub { font-size: 15px; } .hero .updated { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
a:focus-visible { outline: 2px solid var(--spk-red); outline-offset: 2px; border-radius: 4px; }


/* === Site typography: small labels use JetBrains Mono; headings and body use Plus Jakarta Sans === */
.toc-group,.eyebrow{font-family:'JetBrains Mono',ui-monospace,monospace !important}
