:root {
  --paper: #f6f5f1;
  --paper-2: #eeece6;
  --card: #fbfaf7;
  --ink: #1d1d1b;
  --ink-2: #3d3c38;
  --muted: #6d6b64;
  --faint: #a9a69d;
  --line: #d9d6cd;
  --line-2: #e6e3db;
  --accent: #c4552b;       /* used sparingly: blind spots, focus */
  --accent-soft: #f3e3da;
  --ok: #3f6b4f;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.8rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 88px 20px; }
.band { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 88px 0; }
.band-ink { background: var(--ink); color: var(--paper); border: 0; }
.muted-ink { color: var(--faint); }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.band-ink .eyebrow { color: var(--faint); }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; margin-top: 20px; }
.fineprint { font: 13px/1.4 var(--mono); color: var(--muted); margin-top: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 15px/1 var(--sans); padding: 14px 22px; border-radius: var(--r);
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-invert { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-small { padding: 9px 14px; font-size: 14px; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.topnav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.topnav a:not(.btn):hover { color: var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 96px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-visual { position: relative; height: 460px; }
.hero-box { position: absolute; left: 50%; bottom: 40px; width: 320px; transform: translateX(-50%); overflow: visible; }
.hero-box path { stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.hero-box .box-front { fill: var(--card); }
.hero-box .box-side { fill: var(--paper-2); }
.hero-box .box-rim { fill: #2a2a27; }
.hero-box .flap { fill: var(--paper); }
.hero-caption { position: absolute; bottom: 0; width: 100%; text-align: center; font: 13px var(--mono); color: var(--muted); }
.hero-tiles { position: absolute; inset: 0 0 250px 0; z-index: 1; }
.hero-tile {
  position: absolute; display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; background: var(--card); border: 1px solid var(--ink); border-radius: var(--r);
  font: 500 12px var(--mono); color: var(--ink);
  opacity: 0; transform: translate(-50%, 120px) scale(.6);
  animation: rise .9s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-tile svg { color: var(--ink-2); }
.hero-tile.soft { border-style: dashed; border-color: var(--muted); color: var(--ink-2); }
@keyframes rise { to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero-tile { animation: none; opacity: 1; transform: translate(-50%, 0); } }

/* Landing sections */
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p:not(.eyebrow) { color: var(--ink-2); margin-top: 12px; }
.reveal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.reveal-grid li { padding: 26px 24px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.reveal-grid .num { font: 500 12px var(--mono); color: var(--muted); }
.reveal-grid h3 { margin: 10px 0 6px; }
.reveal-grid p { color: var(--muted); font-size: 15px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; counter-reset: s; }
.steps li { border-top: 2px solid var(--ink); padding-top: 20px; }
.step-n { font: 500 13px var(--mono); color: var(--muted); }
.steps h3 { font-size: 1.25rem; margin: 10px 0 8px; }
.steps p { color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.learn-list { list-style: none; margin: 0; padding: 0; }
.learn-list li { padding: 16px 0 16px 30px; border-bottom: 1px solid var(--line); position: relative; }
.learn-list li::before { content: "→"; position: absolute; left: 0; color: var(--muted); font-family: var(--mono); }
.block-strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; margin-top: 56px; }
.block-strip div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-2); font: 11px var(--mono); text-align: center; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li { padding: 10px 16px; border: 1px solid var(--ink); border-radius: 999px; font-size: 15px; }
.free { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.free p:not(.eyebrow) { color: #cfccc3; margin-top: 12px; max-width: 34em; }
.about { font-size: 1.2rem; max-width: 36em; color: var(--ink-2); }
.footer { border-top: 1px solid var(--line); padding: 28px 0; font: 13px var(--mono); color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Gate */
.gate { max-width: 560px; padding-top: 80px; padding-bottom: 120px; }
.gate h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.gate-form { margin-top: 36px; display: grid; gap: 18px; }
.gate-form label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.optional { color: var(--muted); font-weight: 400; }
input[type=email], input[type=text], textarea {
  width: 100%; font: 16px/1.5 var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px;
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29,29,27,.08); }
.form-error { color: var(--accent); font-size: 14px; }

/* Analyzer */
.analyzer { padding-top: 56px; padding-bottom: 24px; }
.analyzer-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 22px; }
.analyzer textarea { min-height: 150px; resize: vertical; font-size: 17px; padding: 16px 18px; }
.helper { color: var(--muted); font-size: 14px; margin-top: 10px; }
.analyze-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.who { font: 12px var(--mono); color: var(--muted); }
.who button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Loading + messages */
.loading { display: flex; align-items: center; gap: 22px; padding: 40px 0 24px; }
.loading-box { width: 64px; height: 64px; position: relative; flex: none; }
.loading-box span { position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--ink); background: var(--card); animation: peek 1.8s ease-in-out infinite; }
.loading-box span:nth-child(1) { left: 6px; animation-delay: 0s; }
.loading-box span:nth-child(2) { left: 25px; animation-delay: .2s; }
.loading-box span:nth-child(3) { left: 44px; animation-delay: .4s; }
.loading-box::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: var(--paper-2); border: 1.5px solid var(--ink); }
@keyframes peek { 0%, 100% { top: 34px; } 45% { top: 4px; } }
.loading h3 { font-size: 1.2rem; }
.loading p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.notice { margin: 32px 0; padding: 20px 22px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--card); display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice p { max-width: 40em; }

/* Results */
.results { padding-bottom: 80px; }
.r-section { padding: 64px 0 0; }
.r-section > .wrap > h2 { margin-bottom: 8px; }
.r-sub { color: var(--muted); margin-bottom: 28px; max-width: 44em; }
.r-hero { padding-top: 48px; border-top: 1px solid var(--line); }
.r-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.r-summary { font-size: 1.15rem; color: var(--ink-2); max-width: 46em; margin-top: 14px; }
.r-stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 32px; align-items: flex-end; }
.stat-big { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em; }
.stat-big b { font-size: 1.4em; }
.stat { font: 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat strong { display: block; font: 600 1.05rem var(--sans); color: var(--ink); letter-spacing: 0; text-transform: none; margin-top: 4px; }
.cx { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.cx i { width: 8px; height: 14px; border: 1px solid var(--ink); }
.cx i.on { background: var(--ink); }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 18px; font: 12px var(--mono); color: var(--muted); margin-bottom: 18px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 16px; height: 16px; border-radius: 2px; display: inline-block; }
.sw-required { background: var(--ink); }
.sw-recommended { background: var(--card); border: 2px solid var(--ink); }
.sw-optional { background: transparent; border: 1.5px dashed var(--muted); }
.sw-not_needed { background: var(--paper-2); border: 1px solid var(--line-2); }

/* Block grid */
.block-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.block {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 112px; padding: 14px; border-radius: var(--r); text-align: left; cursor: pointer;
  font: inherit; color: inherit; transition: transform .12s ease, box-shadow .12s ease;
}
.block:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(29,29,27,.08); }
.block .b-name { font-weight: 600; font-size: 15px; }
.block .b-tag { position: absolute; top: 12px; right: 12px; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.block.required { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.block.required .b-tag { color: #b9b6ad; }
.block.recommended { background: var(--card); border: 2px solid var(--ink); }
.block.recommended .b-tag { color: var(--ink-2); }
.block.optional { background: transparent; border: 1.5px dashed var(--faint); color: var(--ink-2); }
.block.optional .b-tag { color: var(--muted); }
.block.not_needed { background: transparent; border: 1px solid var(--line-2); color: var(--faint); cursor: default; min-height: 0; flex-direction: row; align-items: center; padding: 10px 12px; }
.block.not_needed:hover { transform: none; box-shadow: none; }
.block.not_needed .b-name { font-weight: 400; font-size: 14px; }
.block.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.show-all { margin-top: 18px; background: none; border: 0; padding: 0; font: 13px var(--mono); color: var(--muted); text-decoration: underline; cursor: pointer; }
.not-needed-grid { margin-top: 12px; }

/* Blind spots */
.spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.spot { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 20px 20px 22px; border-radius: var(--r); }
.spot.medium { border-top-color: #d99a7c; }
.spot.low { border-top-color: var(--line); }
.spot-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.spot h3 { font-size: 1.05rem; }
.imp { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); white-space: nowrap; }
.spot.low .imp { color: var(--muted); }
.spot p { color: var(--ink-2); font-size: 15px; }
.spot .rel { margin-top: 12px; font: 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.spot .rel button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.spots-band { background: var(--accent-soft); border-top: 1px solid #ead2c5; border-bottom: 1px solid #ead2c5; padding-bottom: 64px; margin-top: 64px; }

/* Diagram */
.diagram-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram-wrap svg { display: block; min-width: 760px; width: 100%; height: auto; }
.dg-node { cursor: pointer; }
.dg-node:hover rect { stroke-width: 2.5; }
.diagram-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font: 12px var(--mono); color: var(--muted); }
.diagram-legend span { display: inline-flex; align-items: center; gap: 8px; }
.diagram-legend svg { overflow: visible; }

/* Flows */
.flows { display: grid; gap: 14px; }
.flow { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.flow-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.flow h3 { font-size: 1.1rem; }
.mode { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.mode.asynchronous { border-style: dashed; }
.flow .trigger { font: 13px var(--mono); color: var(--muted); margin-top: 4px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--ink); border-radius: var(--r); font: 500 13px var(--sans); background: var(--paper); }
.chip svg { color: var(--ink-2); }
.chip.plain { border-color: var(--line); color: var(--ink-2); }
.arrow { color: var(--faint); font-family: var(--mono); }
.flow p.explain { color: var(--ink-2); font-size: 15px; }

/* MVP vs later */
.mvp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mvp-col { padding: 26px; background: var(--card); }
.mvp-col + .mvp-col { border-left: 1px solid var(--line); background: transparent; }
.mvp-col h3 { font-size: 1.25rem; margin-bottom: 4px; }
.mvp-col > p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.mvp-blocks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mvp-list { list-style: none; margin: 0; padding: 0; }
.mvp-list li { padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 15px; color: var(--ink-2); }
.later h4 { font-size: 15px; }
.later .when { font: 12px var(--mono); color: var(--muted); margin-top: 4px; }
.later .when b { color: var(--ink-2); font-weight: 500; }

/* Notes */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; counter-reset: n; }
.note { position: relative; padding: 18px 18px 18px 52px; border-left: 2px solid var(--ink); background: var(--card); font-size: 15px; color: var(--ink-2); }
.note::before { counter-increment: n; content: counter(n, decimal-leading-zero); position: absolute; left: 16px; top: 19px; font: 500 12px var(--mono); color: var(--muted); }

/* Details lists */
.details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }
.details-grid h3 { font-size: 1rem; margin-bottom: 10px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 9px 0; border-top: 1px solid var(--line-2); color: var(--ink-2); font-size: 15px; }
.plain-list li b { color: var(--ink); font-weight: 500; }
.entity { padding: 12px 0; border-top: 1px solid var(--line-2); }
.entity b { font-weight: 600; }
.entity p { color: var(--muted); font-size: 14px; }
.entity .fields { font: 12px var(--mono); color: var(--ink-2); margin-top: 4px; }

.download-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.again { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(29,29,27,.25); opacity: 0; transition: opacity .2s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(460px, 100%);
  background: var(--paper); border-left: 1px solid var(--line); padding: 36px 30px 40px; overflow-y: auto;
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--card); border-radius: var(--r); font-size: 22px; line-height: 1; cursor: pointer; }
.d-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--r); margin-bottom: 18px; }
.d-icon.required { background: var(--ink); color: var(--paper); }
.d-icon.recommended { border: 2px solid var(--ink); }
.d-icon.optional { border: 1.5px dashed var(--muted); color: var(--ink-2); }
.d-icon.not_needed { border: 1px solid var(--line); color: var(--faint); }
.d-status { display: inline-block; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.drawer h2 { font-size: 1.8rem; }
.d-sec { margin-top: 24px; }
.d-sec h4 { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.d-sec p { color: var(--ink-2); }
.d-sec ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.d-sec li { margin: 4px 0; }
.d-io { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.d-links { display: flex; flex-wrap: wrap; gap: 6px; }
.d-links button { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--sans); padding: 6px 10px; border: 1px solid var(--line); background: var(--card); border-radius: var(--r); cursor: pointer; }
.d-links button:hover { border-color: var(--ink); }
.d-warn { border-left: 2px solid var(--accent); padding-left: 14px; }

/* Responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-visual { height: 430px; max-width: 520px; margin: 0 auto; width: 100%; }
  .block-grid { grid-template-columns: repeat(3, 1fr); }
  .block-strip { grid-template-columns: repeat(6, 1fr); }
  .reveal-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .section, .band { padding-top: 64px; padding-bottom: 64px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 12px 16px; }
  .brand { gap: 8px; }
  .brand span { white-space: nowrap; }
  .topnav .btn { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .section { padding-left: 16px; padding-right: 16px; }
  .brand span { font-size: 14px; }
  .block-grid { grid-template-columns: repeat(2, 1fr); }
  .block-strip { grid-template-columns: repeat(3, 1fr); }
  .reveal-grid, .steps { grid-template-columns: 1fr; }
  .steps { gap: 28px; }
  .mvp-grid { grid-template-columns: 1fr; }
  .mvp-col + .mvp-col { border-left: 0; border-top: 1px solid var(--line); }
  .d-io { grid-template-columns: 1fr; }
  .hero-box { width: 260px; }
}

#results, #how, #about { scroll-margin-top: 72px; }
