:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11141b;
  --panel-soft: #151923;
  --line: #252b37;
  --text: #f2f4f8;
  --muted: #939cad;
  --accent: #ff5a36;
  --accent-soft: rgba(255, 90, 54, .12);
  --green: #69d89a;
  --sidebar: 278px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { color: inherit; font: inherit; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--accent); border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.ambient { position: fixed; pointer-events: none; border-radius: 999px; filter: blur(110px); opacity: .1; }
.ambient-one { width: 380px; height: 380px; background: var(--accent); top: -180px; right: 8%; }
.ambient-two { width: 280px; height: 280px; background: #4e6fff; left: 28%; top: 45%; opacity: .05; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 16, .82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid rgba(255,90,54,.45); border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-weight: 900; font-style: italic; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; margin-top: 4px; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.status { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); margin-right: 7px; }
.icon-button, .close-button { display: none; border: 0; background: none; cursor: pointer; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); max-width: 1500px; margin: 0 auto; }
.sidebar { position: sticky; top: 72px; height: calc(100vh - 72px); padding: 34px 25px 25px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: rgba(9,11,16,.65); z-index: 15; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-weight: 750; font-size: 10px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 18px; }
#toc { overflow: auto; padding-right: 7px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#toc a { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 7px; color: #7f899a; text-decoration: none; font-size: 12px; line-height: 1.3; transition: .18s ease; }
#toc a span { color: #555f70; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 25px; }
#toc a:hover, #toc a.active { color: var(--text); background: var(--panel-soft); }
#toc a.active span { color: var(--accent); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 10px 4px; }
.sidebar-foot > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 9px; }
.sidebar-foot strong { color: var(--text); }
.progress-track { height: 4px; overflow: hidden; border-radius: 99px; background: #242a34; }
.progress-track span, .progress-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #ff8a50); transition: width .6s ease; }

main { min-width: 0; padding: 66px clamp(28px, 6vw, 90px) 30px; }
.hero { max-width: 980px; margin-bottom: 54px; }
.hero h1 { font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.055em; margin: 20px 0 25px; max-width: 820px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero > p { max-width: 660px; color: var(--muted); font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 38px; background: rgba(17,20,27,.78); }
.stats article { min-height: 115px; padding: 19px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.stats article:last-child { border: 0; }
.stats span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }
.stats strong { font: 750 30px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: auto; }
.stats small { color: #697384; font-size: 10px; }
.progress-card .progress-track { margin-top: auto; margin-bottom: 3px; }

.document-card { max-width: 980px; border: 1px solid var(--line); border-radius: 14px; background: rgba(17,20,27,.74); overflow: hidden; }
.document-section { padding: 40px clamp(24px, 5vw, 60px); border-bottom: 1px solid var(--line); scroll-margin-top: 92px; }
.document-section:last-child { border: 0; }
.section-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.phase-tag { color: var(--accent); border: 1px solid rgba(255,90,54,.32); background: var(--accent-soft); border-radius: 999px; padding: 3px 9px; font: 700 10px/1.4 ui-monospace, monospace; }
.section-index { color: #5e6878; font: 650 10px/1.4 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; }
.document-section h2 { margin: 0 0 24px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.15; }
.document-section ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; }
.document-section li { position: relative; padding: 12px 12px 12px 43px; color: #b7bfcc; border-radius: 8px; }
.document-section li:hover { background: rgba(255,255,255,.018); }
.document-section li::before { content: ""; position: absolute; left: 12px; top: 15px; width: 15px; height: 15px; border: 1px solid #404a5a; border-radius: 4px; }
.document-section li.done { color: #778191; }
.document-section li.done::before { border-color: rgba(105,216,154,.45); background: rgba(105,216,154,.12); }
.document-section li.done::after { content: "✓"; position: absolute; left: 15px; top: 10px; color: var(--green); font-size: 15px; }
.document-section p { color: #a9b2c0; margin: 16px 0; }
.document-section .exit-gate { border-left: 2px solid var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent); padding: 14px 18px; margin: 28px 0 0; border-radius: 0 8px 8px 0; color: #d5dae3; }
.document-section .exit-gate strong { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; margin-right: 5px; }
.loading { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.loading span { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { max-width: 980px; padding: 28px 4px 0; display: flex; justify-content: space-between; color: #626c7c; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
footer a { color: #8c96a6; text-decoration: none; }
.scrim { display: none; }

@media (max-width: 900px) {
  .topbar { padding: 0 20px; }
  .status { display: none; }
  .icon-button { display: grid; gap: 4px; width: 38px; height: 38px; place-content: center; border: 1px solid var(--line); border-radius: 8px; }
  .icon-button span { display: block; width: 16px; height: 1px; background: var(--text); }
  .close-button { display: block; font-size: 26px; color: var(--muted); }
  .shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: min(320px, 88vw); transform: translateX(-105%); transition: transform .24s ease; background: #0d1016; padding-top: 27px; }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; z-index: 14; border: 0; background: rgba(0,0,0,.66); }
  .scrim.open { display: block; }
  main { padding-top: 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats article:nth-child(2) { border-right: 0; }
  .stats article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  main { padding: 38px 14px 24px; }
  .hero { padding: 0 6px; }
  .hero h1 { font-size: 43px; }
  .stats article { min-height: 100px; padding: 15px; }
  .stats strong { font-size: 25px; }
  .document-section { padding: 32px 20px; }
  .document-section li { padding-left: 38px; }
  .document-section li::before { left: 8px; }
  .document-section li.done::after { left: 11px; }
}

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