@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,900&family=Manrope:wght@400;600;700;800&display=swap');

:root {
  --ink: #17120d;
  --muted: #6d6156;
  --paper: #f5efe5;
  --paper-2: #fff9ef;
  --charcoal: #211b16;
  --amber: #f1a823;
  --red: #d84c31;
  --green: #2b9c68;
  --blue: #3277b8;
  --line: rgba(23,18,13,.14);
  --shadow: 0 24px 70px rgba(30,18,8,.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding-left: 286px;
  font-family: Manrope, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff7db 0, transparent 32rem), var(--paper);
}
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: .08;
  z-index: 1;
  background-image: linear-gradient(90deg, rgba(0,0,0,.6) 1px, transparent 1px), linear-gradient(rgba(0,0,0,.5) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}
a { color: inherit; }
section, header { scroll-margin-top: 18px; }
.toc-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 286px;
  padding: 24px 18px;
  background: rgba(33, 27, 22, .96);
  color: var(--paper);
  border-right: 1px solid rgba(245,239,229,.16);
  box-shadow: 18px 0 70px rgba(23,18,13,.2);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.toc-brand { display:flex; align-items:center; gap:12px; text-decoration:none; font-weight:900; }
.toc-brand .mark { background:var(--amber); color:var(--ink); }
.toc-kicker { margin:12px 0 0; color:var(--amber); font-size:12px; font-weight:900; text-transform:uppercase; letter-spacing:.16em; }
.toc-links { display:flex; flex-direction:column; gap:7px; }
.toc-links a {
  position: relative;
  display:flex;
  align-items:center;
  min-height:42px;
  padding: 0 12px 0 18px;
  border-radius: 14px;
  color: rgba(245,239,229,.78);
  text-decoration:none;
  font-size: 14px;
  font-weight:800;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.toc-links a:before {
  content:'';
  position:absolute;
  left:7px;
  width:5px;
  height:5px;
  border-radius:999px;
  background:rgba(245,239,229,.3);
}
.toc-links a:hover { background:rgba(245,239,229,.08); color:#fff9ef; transform:translateX(2px); }
.toc-links a.active { background:var(--amber); color:var(--ink); box-shadow:0 12px 28px rgba(241,168,35,.22); }
.toc-links a.active:before { background:var(--ink); }
.toc-mini-note { margin-top:auto; padding:14px; border-radius:18px; background:rgba(245,239,229,.08); color:rgba(245,239,229,.7); font-size:13px; line-height:1.45; }
.toc-toggle { display:none; }
.toc-scrim { display:none; }
.hero, main, footer { position: relative; z-index: 2; }
.hero { padding: 26px clamp(20px, 5vw, 72px) 70px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:58px; }
.brand { display:flex; align-items:center; gap:12px; font-weight:800; letter-spacing:-.02em; }
.mark { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:var(--ink); color:var(--amber); font-family:Fraunces, serif; font-size:24px; }
.audit-date { color: var(--muted); font-size: 14px; }
.hero-grid { display:grid; grid-template-columns: minmax(0, 1.3fr) 420px; gap:42px; align-items:end; }
.eyebrow { margin:0 0 12px; text-transform:uppercase; letter-spacing:.16em; color:var(--red); font-size:12px; font-weight:900; }
h1, h2, h3 { font-family: Fraunces, serif; line-height:.96; letter-spacing:-.045em; margin:0; }
h1 { font-size: clamp(45px, 8vw, 100px); max-width: 980px; }
h2 { font-size: clamp(34px, 5vw, 62px); max-width: 900px; }
h3 { font-size: 25px; }
.lead { margin: 26px 0 0; max-width: 760px; color: var(--muted); font-size: 19px; line-height: 1.6; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:30px; }
.button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 18px; border-radius:999px; border:1px solid var(--line); background:rgba(255,255,255,.44); text-decoration:none; font-weight:800; }
.button.primary { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.score-card { background:var(--paper-2); border:1px solid var(--line); border-radius:28px; padding:26px; box-shadow:var(--shadow); transform: rotate(1deg); }
.score-title { font-weight:900; margin-bottom:18px; }
.stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.stat { border:1px solid var(--line); border-radius:20px; padding:16px; background:#fffdf7; }
.stat b { display:block; font-size:32px; letter-spacing:-.04em; }
.stat span { color:var(--muted); font-size:12px; text-transform:uppercase; font-weight:900; letter-spacing:.08em; }
.score-note { margin:18px 0 0; color:var(--muted); line-height:1.5; }
.section { padding: 76px clamp(20px, 5vw, 72px); border-top:1px solid var(--line); }
.section.dark { background:var(--charcoal); color:var(--paper); border-top:0; }
.section.dark .eyebrow { color:var(--amber); }
.section.dark p, .section.dark li { color:rgba(245,239,229,.76); }
.section-heading { margin-bottom:30px; }
.section-heading > p:not(.eyebrow) { max-width:780px; line-height:1.6; color:var(--muted); }
.section.dark .section-heading > p:not(.eyebrow) { color:rgba(245,239,229,.72); }
.split { display:flex; justify-content:space-between; align-items:end; gap:20px; flex-wrap:wrap; }
.stack-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:16px; }
.stack-card, .app-card, .strand, .decision, .timeline-item { background:var(--paper-2); border:1px solid var(--line); border-radius:24px; padding:22px; box-shadow:0 10px 35px rgba(30,18,8,.07); }
.stack-card { display:flex; flex-direction:column; gap:14px; }
.badge-row { display:flex; gap:8px; flex-wrap:wrap; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:7px 10px; font-size:12px; font-weight:900; border:1px solid var(--line); background:rgba(255,255,255,.6); }
.badge.keep { background:rgba(43,156,104,.12); color:#19724b; }
.badge.archive { background:rgba(216,76,49,.12); color:#a4311d; }
.badge.merge { background:rgba(241,168,35,.18); color:#916111; }
.badge.critical { background:var(--ink); color:var(--paper); }
.card-link { margin-top:auto; font-weight:900; text-decoration:none; color:var(--blue); }
.decision-list { display:grid; gap:14px; }
.decision { background:#2b241d; border-color:rgba(245,239,229,.14); }
.decision-top { display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:10px; }
.decision h3 { color:#fff7db; }
.decision .badge { border-color:rgba(245,239,229,.2); color:var(--amber); background:rgba(241,168,35,.12); }
.item-tags { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.item-tags span { padding:6px 9px; border-radius:999px; background:rgba(245,239,229,.09); color:rgba(245,239,229,.8); font-size:12px; font-weight:800; }
.strand-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:16px; }
.strand-icon { font-size:34px; margin-bottom:10px; }
.strand ul { padding-left:20px; color:var(--muted); line-height:1.6; }
.filters { display:flex; gap:10px; flex-wrap:wrap; }
input, select { min-height:44px; border-radius:14px; border:1px solid var(--line); padding:0 14px; background:#fffdf7; font:inherit; }
.cards { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:16px; }
.app-card { display:flex; flex-direction:column; gap:12px; }
.card-meta { display:flex; justify-content:space-between; align-items:start; gap:10px; }
.app-card p { color:var(--muted); line-height:1.5; margin:0; }
.notes { padding-left:18px; margin:0; color:var(--muted); line-height:1.5; }
.risk { border-left:4px solid var(--red); padding:10px 12px; background:rgba(216,76,49,.08); border-radius:12px; color:#743020 !important; font-size:13px; }
.timeline { display:grid; gap:14px; counter-reset: road; }
.timeline-item { background:#2b241d; border-color:rgba(245,239,229,.14); position:relative; padding-left:72px; }
.timeline-item:before { counter-increment: road; content: counter(road); position:absolute; left:22px; top:22px; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:var(--amber); color:var(--ink); font-weight:900; }
.warning { background:linear-gradient(135deg, #ffefb5, #ffe1d2); }
.warning p { max-width:880px; line-height:1.6; color:#5d4937; }
footer { display:flex; justify-content:space-between; gap:20px; padding:28px clamp(20px, 5vw, 72px); color:var(--muted); border-top:1px solid var(--line); }
@media (max-width: 1050px) { .hero-grid, .stack-grid, .strand-grid, .cards { grid-template-columns:1fr 1fr; } .score-card { transform:none; } }
@media (max-width: 900px) {
  body { padding-left:0; }
  .toc-toggle {
    display:flex;
    position:fixed;
    z-index:30;
    left:14px;
    bottom:14px;
    align-items:center;
    justify-content:center;
    min-height:46px;
    padding:0 16px;
    border:0;
    border-radius:999px;
    background:var(--ink);
    color:var(--paper);
    font: inherit;
    font-weight:900;
    box-shadow:0 18px 46px rgba(23,18,13,.32);
  }
  .toc-panel { transform:translateX(-105%); transition:transform .22s ease; }
  body.toc-open .toc-panel { transform:translateX(0); }
  .toc-scrim {
    display:block;
    position:fixed;
    inset:0;
    z-index:15;
    background:rgba(23,18,13,.45);
    opacity:0;
    pointer-events:none;
    transition:opacity .22s ease;
  }
  body.toc-open .toc-scrim { opacity:1; pointer-events:auto; }
}
@media (max-width: 720px) { .hero-grid, .stack-grid, .strand-grid, .cards { grid-template-columns:1fr; } h1 { font-size:46px; } .topbar, footer { align-items:flex-start; flex-direction:column; } .timeline-item { padding-left:22px; padding-top:72px; } }
