/* ============================================================================
   Artifactly — UI layer. Forensic lab paperwork.
   Every color/size/radius derives from tokens.css. Sections build up by screen.
   ============================================================================ */

/* ---- reset / base --------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* paper lives on the canvas so the fixed z-index:-1 grid stays visible above it */
html { background: var(--paper); }
body {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

/* graph-paper texture — fixed, behind all content, non-interactive */
.grid-paper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(to right, var(--rule-2) 0.5px, transparent 0.5px),
    linear-gradient(to bottom, var(--rule-2) 0.5px, transparent 0.5px);
  background-size: var(--grid) var(--grid);
}

/* ---- typography scale ----------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
h1 {
  font-weight: 700;
  font-size: clamp(42px, 5.6vw, 74px);
  letter-spacing: -0.038em;
  line-height: 0.98;
}
h2 {
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.033em;
  line-height: 1.02;
}
h3 { font-weight: 500; font-size: 19px; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ash);
}
.mono { font-family: var(--font-mono); }
.ash { color: var(--ash); }

/* ---- focus (keyboard) ----------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 11px 17px;
  border: var(--rule-w) solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn[disabled] { opacity: 0.45; cursor: default; pointer-events: none; }

/* ---- app shell ------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: var(--rule-w) solid var(--rule);
}
.topbar-inner {
  max-width: var(--maxw);
  height: 60px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.wordmark { display: inline-flex; align-items: center; gap: 13px; }
.wordmark-glyph {
  width: 11px;
  height: 11px;
  background: var(--ink);
  /* two offset dots: ink, then alert, then rule — chain of custody marks */
  box-shadow:
    4px 4px 0 0 var(--alert),
    8px 8px 0 0 var(--rule);
  margin-right: 8px; /* room for the offset shadows */
}
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ash);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--ink); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.auth-controls { display: flex; align-items: center; gap: 10px; }
.auth-controls[hidden] { display: none; }
.auth-identity {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
}
.auth-button {
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
}
.auth-button:hover { border-color: var(--ink); }
.auth-button:disabled { opacity: 0.5; cursor: wait; }
.quick-investigate {
  flex: 1;
  max-width: 560px;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.quick-investigate[hidden] { display: none; }
.topbar .quick-investigate input[type="text"] {
  min-width: 0;
  height: 34px;
  border-radius: 999px 0 0 999px;
  border-right: 0;
  padding: 7px 14px;
  background: var(--card);
  font-size: 11.5px;
}
.quick-investigate button {
  height: 34px;
  border: var(--rule-w) solid var(--ink);
  border-radius: 0 999px 999px 0;
  padding: 0 15px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.quick-investigate button:disabled { opacity: 0.55; cursor: wait; }
.case-nav-open .nav { display: none; }
.case-nav-open .topbar-right { margin-left: 0; }
@media (max-width: 720px) {
  .case-nav-open .wordmark-text { display: none; }
  .case-nav-open .quick-investigate button { padding-inline: 11px; font-size: 0; }
  .case-nav-open .quick-investigate button::after { content: '→'; font-size: 13px; }
  .case-nav-open .ws-badge { display: none; }
}
.ws-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ash);
  background: var(--card);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius);
  padding: 4px 10px;
}
.ws-badge[hidden] { display: none; }

/* ---- page container ------------------------------------------------------- */
.app {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 76px 32px var(--sp-9);
}
@media (max-width: 940px) {
  .app { padding-left: 20px; padding-right: 20px; }
}

/* ---- form primitives ------------------------------------------------------ */
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ash);
  margin-bottom: var(--sp-2);
}
input[type="text"], textarea, select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius);
  padding: 9px 11px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }
textarea { min-height: 150px; line-height: 1.6; resize: vertical; }


/* ===========================================================================
   Home — one question, one input, one button. Almost boring on purpose.
   =========================================================================== */
.home { max-width: 640px; margin: 0 auto; padding-top: var(--sp-8); }
.home-h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4vw, 46px); line-height: 1.04; letter-spacing: -0.035em;
}
.home-lede { margin-top: var(--sp-4); font-size: 16px; color: var(--ash); line-height: 1.55; max-width: 52ch; }

.type-switch {
  display: inline-flex; background: var(--card);
  border: var(--rule-w) solid var(--rule); border-radius: var(--radius);
  overflow: hidden; margin-top: var(--sp-6);
}
.type-switch-btn {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ash); background: transparent; border: none; padding: 10px 16px; cursor: pointer;
}
.type-switch-btn + .type-switch-btn { border-left: var(--rule-w) solid var(--rule); }
.type-switch-btn.on { background: var(--ink); color: var(--paper); }

.ask-card {
  margin-top: var(--sp-4);
  background: var(--card); border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius); padding: var(--sp-5);
}
.ask-input-row { display: flex; align-items: baseline; }
.coord-prefix, .coord-input {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(17px, 2.2vw, 24px); letter-spacing: -0.02em;
}
.coord-prefix { color: var(--rule); }
.coord-input { flex: 1; border: none; background: transparent; padding: 0; color: var(--ink); border-radius: 0; }
.coord-input::placeholder { color: var(--rule); }
.coord-input:focus { outline: none; }
.ask-hint { margin-top: var(--sp-2); font-family: var(--font-mono); font-size: 11px; color: var(--ash); }
.ask-actions { margin-top: var(--sp-5); }
.ask-unavailable { font-family: var(--font-mono); font-size: 12px; color: var(--ash); }
.card-error { color: var(--alert); font-family: var(--font-mono); font-size: 12px; margin-top: var(--sp-3); }

.sbom-body { margin-top: var(--sp-3); }
.sbom-textarea {
  width: 100%; min-height: 140px; resize: vertical;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--ink);
  background: var(--paper); border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 12px;
}
.sbom-upload { display: flex; align-items: center; gap: 12px; }
.path-input {
  width: 100%; font-family: var(--font-mono); font-size: 13px; color: var(--ink);
  background: var(--paper); border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 9px 11px;
}
.seg { display: flex; gap: 8px; }
.seg button {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ash); background: transparent; border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius); padding: 6px 12px; cursor: pointer;
}
.seg button.on { color: var(--ink); border-color: var(--ink); background: var(--paper-2); }

/* state squares */
.sq { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; }
.sq-rule { background: var(--rule); }
.sq-flag { background: var(--flag); }
.sq-alert { background: var(--alert); }
.tone-flag { color: var(--flag); }
.tone-alert { color: var(--alert); }

/* recent investigations — five rows, nothing else */
.recent-block { margin-top: var(--sp-8); }
.recent { margin-top: var(--sp-3); border-top: var(--rule-w) solid var(--rule-2); }
.recent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px; border-bottom: var(--rule-w) solid var(--rule-2);
}
.recent-row:hover { background: var(--paper-2); }
.recent-coord { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-verdict { font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); }
.recent-verdict.tone-flag { color: var(--flag); }
.recent-verdict.tone-alert { color: var(--alert); }
.recent-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); margin-left: auto; }
.recent-empty { margin-top: var(--sp-3); font-family: var(--font-mono); font-size: 11px; color: var(--ash); }
.recent-all {
  display: inline-block;
  margin-top: var(--sp-4);
  color: var(--ash);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: var(--rule-w) solid var(--rule);
  padding-bottom: 2px;
}
.recent-all:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ===========================================================================
   Case file — the investigation workspace. The timeline IS the interface.
   =========================================================================== */
.case { max-width: 760px; margin: 0 auto; }
.case-back { display: inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--ash); margin-bottom: var(--sp-5); }
.case-back:hover { color: var(--ink); }
.case-coord {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(22px, 3vw, 32px); letter-spacing: -0.02em; color: var(--ink);
  word-break: break-all;
}
.case-status {
  margin-top: var(--sp-3);
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink);
}
.case-status.tone-alert { color: var(--alert); }
.case-status.tone-flag { color: var(--flag); }
.case-verdict-line { font-weight: 400; color: var(--ash); }

.pulse-dot {
  width: 9px; height: 9px; background: var(--flag); border-radius: 50%;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.tl-eyebrow { margin: var(--sp-7) 0 var(--sp-4); }

/* vertical timeline */
.timeline { border-left: var(--rule-w) solid var(--rule); margin-left: 4px; }
.tl-event { position: relative; }
.tl-head {
  display: flex; align-items: baseline; gap: 12px; width: 100%;
  text-align: left; background: transparent; border: none; cursor: pointer;
  padding: 11px 0 11px 22px; font: inherit; color: var(--ink);
}
.tl-head:hover { background: var(--paper-2); }
.tl-node {
  position: absolute; left: -5px; top: 16px;
  width: 9px; height: 9px; background: var(--paper); border: var(--rule-w) solid var(--ink);
}
.tl-event.open .tl-node { background: var(--ink); }
.tl-idx { font-family: var(--font-mono); font-size: 10px; color: var(--ash); flex: 0 0 22px; }
.tl-summary { font-size: 14.5px; line-height: 1.45; flex: 1; }
.tl-kind { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ash); }
.tl-body { display: none; padding: 0 0 var(--sp-4) 22px; }
.tl-event.open .tl-body { display: block; }
.tl-event.tl-flash .tl-head { background: var(--paper-2); }
.tl-meta { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-3); }
.tl-chip {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em;
  border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 2px 8px; color: var(--ash);
}
.tl-chip-grounded { border-color: var(--clean); color: var(--clean); background: var(--clean-bg); }
.tl-source { font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); }
.tl-raw-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ash); margin-bottom: 6px; }
.tl-none { font-family: var(--font-mono); font-size: 11px; color: var(--ash); }

/* raw exhibit block */
.json {
  margin: 0; padding: 14px 16px;
  background: var(--exhibit-ink); color: var(--exhibit-text);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.75;
  border-radius: var(--radius);
  white-space: pre-wrap; word-break: break-word;
  max-height: 380px; overflow: auto;
}
.json .k { color: #a8c7e8; }
.json .s { color: #b5d4a8; }
.json .n { color: #e8b3a8; }
.json .b { color: #d4b8e8; }
.json mark { background: var(--exhibit-mark-bg); color: var(--exhibit-mark-text); }

/* findings — claims with citations */
.case-findings { margin-top: var(--sp-7); border-top: var(--rule-w) solid var(--rule); padding-top: var(--sp-4); }
.find-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: var(--sp-4) 0; border-bottom: var(--rule-w) solid var(--rule-2);
}
.find-row .sq { margin-top: 6px; }
.find-main { flex: 1; min-width: 0; }
.find-title { font-size: 15px; font-weight: 500; }
.find-detail { margin-top: 4px; font-size: 13.5px; color: var(--ash); line-height: 1.5; }
.find-refs { margin-top: var(--sp-2); font-family: var(--font-mono); font-size: 11px; color: var(--ash); }
.find-ref {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink);
  background: transparent; border: var(--rule-w) solid var(--rule); border-radius: var(--radius);
  padding: 1px 7px; margin-right: 6px; cursor: pointer;
}
.find-ref:hover { border-color: var(--ink); }
.find-sev { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.find-sev.tone-rule { color: var(--ash); }

/* live reveal */
.tl-hidden { opacity: 0; transform: translateY(6px); }
.tl-event, .case-findings { transition: opacity 260ms ease, transform 260ms ease; }
@media (prefers-reduced-motion: reduce) {
  .tl-event, .case-findings { transition: none; }
  .tl-hidden { opacity: 1; transform: none; }
  .pulse-dot { animation: none; }
}

/* ===========================================================================
   History (all investigations)
   =========================================================================== */
table.history { width: 100%; border-collapse: collapse; margin-top: var(--sp-5); }
.history th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ash); font-weight: 500;
  padding: 8px 10px; border-bottom: var(--rule-w) solid var(--rule);
}
.history td { padding: 11px 10px; border-bottom: var(--rule-w) solid var(--rule-2); font-size: 13.5px; }
.history tr { cursor: pointer; }
.history tbody tr:hover td { background: var(--paper-2); }
.pill {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 2px 8px; border-radius: var(--radius);
  border: var(--rule-w) solid var(--rule); color: var(--ash);
}
.pill.notable { border-color: var(--flag); color: var(--flag); background: var(--flag-bg); }
.pill.ok { color: var(--clean); }
.pill.fail { color: var(--alert); border-color: var(--alert); background: var(--alert-bg); }
.count-note { font-family: var(--font-mono); font-size: 11px; color: var(--ash); margin-top: var(--sp-2); }
.empty { color: var(--ash); padding: var(--sp-7) 0; text-align: center; }
.error-banner {
  margin-top: var(--sp-4); padding: 10px 14px;
  background: var(--alert-bg); border: var(--rule-w) solid var(--alert); border-radius: var(--radius);
  color: var(--alert); font-family: var(--font-mono); font-size: 12px;
}

/* ===========================================================================
   Case file — narrative layers (observation → supporting evidence → raw data)
   =========================================================================== */
.tl-observation { font-size: 13.5px; color: var(--ash); line-height: 1.55; max-width: 62ch; margin: 0 0 var(--sp-3); }
.tl-sub-label {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ash); margin: var(--sp-3) 0 var(--sp-2);
}
.tl-evi-item { border: var(--rule-w) solid var(--rule-2); border-radius: var(--radius); background: var(--card); }
.tl-evi-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; cursor: pointer; font: inherit; color: var(--ink);
  padding: 9px 12px; text-align: left;
}
.tl-evi-head:hover { background: var(--paper-2); }
.tl-evi-label { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; flex: 1; }
.tl-evi-body { display: none; border-top: var(--rule-w) solid var(--rule-2); padding: 10px 12px 12px; }
.tl-evi-item.open .tl-evi-body { display: block; }
.tl-evi-body .tl-sub-label { margin-top: 0; }

/* event node tones */
.tl-node-alert { border-color: var(--alert); background: var(--alert); }
.tl-node-flag { border-color: var(--flag); background: var(--flag); }

/* findings embedded in the timeline */
.tl-finding .tl-head { cursor: default; }
.tl-finding-title { font-size: 15px; font-weight: 500; margin-bottom: var(--sp-2); }
.tl-finding-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-finding-meta .tl-sub-label { margin: 0; }
.tl-finding.tl-event .tl-body { padding-top: 2px; }

/* the decision closes the investigation */
.tl-decision .tl-summary { font-weight: 500; }
.tl-decision .tl-head { cursor: default; }

/* ===========================================================================
   Pathways — structured evidence, related intelligence, actions
   =========================================================================== */
.kv { margin-top: var(--sp-2); }
.kv-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 12px;
  padding: 6px 0; border-bottom: var(--rule-w) solid var(--rule-2);
  align-items: baseline;
}
.kv-row:last-child { border-bottom: none; }
.kv-k { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ash); }
.kv-v { font-family: var(--font-mono); font-size: 12px; color: var(--ink); word-break: break-word; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--sp-2) 0; }
.chip-btn {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink);
  background: transparent; border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius); padding: 3px 9px; cursor: pointer;
}
.chip-btn:hover { border-color: var(--ink); background: var(--paper-2); }
.chip-plain {
  font-family: var(--font-mono); font-size: 11px; color: var(--ash);
  border: var(--rule-w) solid var(--rule-2); border-radius: var(--radius); padding: 3px 9px;
}

.act-row { display: flex; flex-wrap: wrap; gap: 18px; }
.act-link {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink); background: transparent; border: none; padding: 0; cursor: pointer;
  border-bottom: var(--rule-w) solid var(--rule); padding-bottom: 2px;
}
.act-link:hover { border-bottom-color: var(--ink); text-decoration: none; }

.rel-list { display: flex; flex-direction: column; gap: 6px; }
.rel-link { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); }
.rel-link:hover { text-decoration: underline; }

.raw-toggle {
  display: inline-block; margin-top: var(--sp-3);
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ash); background: transparent; border: var(--rule-w) solid var(--rule-2);
  border-radius: var(--radius); padding: 3px 9px; cursor: pointer;
}
.raw-toggle:hover { color: var(--ink); border-color: var(--rule); }
.raw-wrap { display: none; margin-top: var(--sp-2); }
.raw-wrap.open { display: block; }

/* ===========================================================================
   Case opening and completion — the investigation's bookends
   =========================================================================== */
.tl-open .tl-body {
  background: var(--card);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-4);
  margin: 4px 0 var(--sp-3) 22px;
}
.tl-open .tl-head { cursor: default; }
.tl-open .kv { margin-top: 0; }

.complete {
  margin-top: var(--sp-7);
  border-top: 2px solid var(--ink);
  padding-top: var(--sp-4);
}
.complete .kv { margin-bottom: var(--sp-4); }
.complete .act-row { margin-top: var(--sp-2); }

/* ===========================================================================
   Trust layer — evidence origin, source/diff inspection, analysis trace
   =========================================================================== */
/* evidence origin chips (replaces the repeated "verified") */
.tl-chip.origin-det { border-color: var(--clean); color: var(--clean); background: var(--clean-bg); }
.tl-chip.origin-model { border-color: var(--flag); color: var(--flag); background: var(--flag-bg); }
.tl-chip.origin-history { border-color: var(--rule); color: var(--ash); }

/* inline source / diff inspection */
.srcdiff { margin-top: var(--sp-2); }
.srcfile { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--sp-3); }
.srcfile-head {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  background: var(--paper-2); border-bottom: var(--rule-w) solid var(--rule);
}
.srcfile-path { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--ink); }
.srcfile-status { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ash); }
.srcfile-flag { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--alert); }
.hunk-head { font-family: var(--font-mono); font-size: 10px; color: var(--ash); padding: 4px 12px; background: var(--card); border-bottom: var(--rule-w) solid var(--rule-2); }
.code-block { background: var(--exhibit-ink); padding: 8px 0; overflow-x: auto; }
.code-line {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; white-space: pre;
  color: var(--exhibit-text); padding: 0 12px 0 0;
}
.code-gutter { display: inline-block; width: 22px; text-align: center; color: #6f7278; user-select: none; }
.code-add { background: rgba(30, 92, 72, 0.28); }
.code-add .code-gutter { color: #b5d4a8; }
.code-del { background: rgba(185, 51, 24, 0.22); }
.code-del .code-gutter { color: #e8b3a8; }
.code-line .tok { background: var(--exhibit-mark-bg); color: var(--exhibit-mark-text); padding: 0 2px; border-radius: 2px; }

/* deterministically decoded values */
.decoded { padding: 10px 12px; border-top: var(--rule-w) solid var(--rule-2); background: var(--card); }
.decoded-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11.5px; }
.decoded-enc { color: var(--ash); }
.decoded-arrow { color: var(--ash); }
.decoded-val { color: var(--alert); word-break: break-all; }

/* collapsibles: analysis path, analysis trace */
.collapsible { margin-top: var(--sp-3); }
.collapsible-head {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: transparent; border: none; padding: 0; font: inherit; color: var(--ink);
}
.collapsible-label {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink); border-bottom: var(--rule-w) solid var(--rule); padding-bottom: 2px;
}
.collapsible-label::before { content: '+ '; color: var(--ash); }
.collapsible.open .collapsible-label::before { content: '− '; }
.collapsible-body { display: none; margin-top: var(--sp-3); }
.collapsible.open .collapsible-body { display: block; }

.trace .kv { margin: var(--sp-3) 0; }
.trace-list { margin: var(--sp-2) 0 0; padding-left: 18px; }
.trace-list li { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); line-height: 1.6; }
.path-note { margin-top: var(--sp-2); font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); }
.find-conf { font-family: var(--font-mono); font-size: 11px; color: var(--ink); }

/* ===========================================================================
   Milestone: compact home, explore, coverage, evidence identity
   =========================================================================== */
.home-tagline { color: var(--ash); font-size: 15px; margin-bottom: var(--sp-5); }
.home-entry-row { display: flex; gap: 10px; }
.home-entry {
  flex: 1; font-family: var(--font-mono); font-size: 14px; color: var(--ink);
  background: var(--paper); border: var(--rule-w) solid var(--rule-strong, var(--rule));
  border-radius: var(--radius); padding: 11px 13px;
}
.home-entry:focus { outline: none; border-color: var(--ink); }
.home-alt { margin-top: var(--sp-4); }
.link-btn {
  font-family: var(--font-mono); font-size: 11px; color: var(--ash);
  background: transparent; border: none; padding: 0; cursor: pointer;
  border-bottom: var(--rule-w) solid var(--rule); padding-bottom: 2px;
}
.link-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* recent case summaries */
.recent-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.recent-line1 { display: flex; align-items: baseline; gap: 10px; }
.recent-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); }
.pub-badge {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--clean); border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 2px 7px; align-self: center;
}
.pub-badge.is-draft { color: var(--ash); }

/* explore */
.explore { margin-top: var(--sp-8); }
.explore-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: var(--sp-3); }
@media (max-width: 620px) { .explore-grid { grid-template-columns: 1fr; } }
.explore-item {
  display: block; border: var(--rule-w) solid var(--rule); border-radius: var(--radius);
  padding: 14px 16px; background: var(--card);
}
.explore-item:hover { border-color: var(--ink); }
.explore-item.is-soon { opacity: 0.55; }
.explore-label { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink); }
.explore-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); margin-top: 3px; }

/* evidence identity + digest */
.tl-evi-id { font-family: var(--font-mono); font-size: 9.5px; color: var(--ash); letter-spacing: 0.06em; }
.digest { word-break: break-all; font-size: 11px; }

/* coverage */
.coverage { margin-top: var(--sp-2); }
.cov-row { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; padding: 3px 0; }
.cov-mark { width: 12px; }
.cov-yes .cov-mark { color: var(--clean); }
.cov-no { color: var(--ash); }

/* ===========================================================================
   Homepage positioning: hero, bring-your-own-key, how-it-works
   =========================================================================== */
.hero-headline {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.6vw, 42px); line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: var(--sp-4);
}
.hero-sub { color: var(--ash); font-size: 15px; line-height: 1.55; max-width: 66ch; margin-bottom: var(--sp-5); }

/* bring your own key — a feature, not a warning */
.byok { margin-top: var(--sp-4); border-top: var(--rule-w) solid var(--rule-2); padding-top: var(--sp-4); }
.byok-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink); }
.byok-check { color: var(--clean); }
.byok-body { color: var(--ash); font-size: 13px; margin-top: 4px; }
.byok-providers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--sp-3); }
.prov {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink);
  border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 3px 9px;
}
.byok-soon { font-family: var(--font-mono); font-size: 10px; color: var(--ash); text-transform: uppercase; letter-spacing: 0.08em; }

/* how it works — compact horizontal flow */
.how { margin-top: var(--sp-8); }
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: var(--sp-3); }
.flow-step {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  border: var(--rule-w) solid var(--rule); border-radius: var(--radius);
  background: var(--card); padding: 10px 12px; flex: 1 1 150px; min-width: 140px;
}
.flow-idx { font-family: var(--font-mono); font-size: 9.5px; color: var(--ash); }
.flow-label { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); line-height: 1.3; }
.flow-arrow { align-self: center; color: var(--ash); font-family: var(--font-mono); font-size: 12px; }
@media (max-width: 620px) { .flow-arrow { display: none; } .flow-step { flex-basis: 100%; } }

/* explore coming-soon tag */
.soon-tag {
  margin-left: 8px; font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ash); border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 1px 6px;
}

/* ===========================================================================
   Homepage as an interactive story. Subtle motion, reinforcing understanding.
   =========================================================================== */
.story { display: block; }
.story-sec { margin: 0 auto; max-width: 760px; }
.story-sec.hero-sec { margin-top: var(--sp-7); }
.sec-h { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.028em; line-height: 1.08; margin: var(--sp-2) 0 var(--sp-5); }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms ease, transform 620ms ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* hero */
.hero-headline { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 3.8vw, 44px); line-height: 1.04; letter-spacing: -0.03em; margin-bottom: var(--sp-4); }
.hero-sub { color: var(--ash); font-size: 15px; line-height: 1.55; max-width: 64ch; margin-bottom: var(--sp-5); }
.hero-foot { color: var(--ash); font-size: 11px; margin-top: var(--sp-4); }

/* browser frame */
.bframe { border: var(--rule-w) solid var(--rule); border-radius: var(--radius-2); background: var(--card); overflow: hidden; transform: translateY(var(--par, 0)); }
.bframe-bar { display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: var(--paper-2); border-bottom: var(--rule-w) solid var(--rule); }
.bdot { width: 9px; height: 9px; border-radius: 50%; border: var(--rule-w) solid var(--rule-strong, var(--rule)); }
.bframe-url { margin-left: 10px; font-size: 11px; color: var(--ash); background: var(--paper); border: var(--rule-w) solid var(--rule-2); border-radius: 999px; padding: 3px 12px; flex: 1; }
.bframe-body { padding: var(--sp-5); }

/* section 2: staged investigation */
.demo-body { display: grid; grid-template-columns: 14px 1fr; gap: 14px; }
.demo-rail { position: relative; width: 2px; background: var(--rule-2); border-radius: 2px; margin: 6px auto; }
.demo-progress { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: var(--ink); border-radius: 2px; transition: height 560ms ease; }
.demo-stage { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; opacity: 0.32; transform: translateY(4px); transition: opacity 420ms ease, transform 420ms ease; }
.demo-stage.on { opacity: 1; transform: translateY(0); }
.demo-node { width: 9px; height: 9px; margin-top: 5px; border: var(--rule-w) solid var(--rule-strong, var(--rule)); background: var(--card); flex: 0 0 9px; transition: background 300ms ease, border-color 300ms ease; }
.demo-stage.on .demo-node { background: var(--ink); border-color: var(--ink); }
.demo-stage-t { font-size: 14px; font-weight: 500; }
.demo-stage-d { font-size: 11.5px; color: var(--ash); margin-top: 2px; line-height: 1.4; word-break: break-word; }
.demo-verdict { display: flex; align-items: center; gap: 9px; margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: var(--rule-w) solid var(--rule-2); font-family: var(--font-mono); font-size: 12.5px; color: var(--alert); opacity: 0; transform: translateY(6px); transition: opacity 500ms ease, transform 500ms ease; }
.demo-verdict.on { opacity: 1; transform: translateY(0); }

/* section 3: architecture svg */
.arch { transform: translateY(var(--par, 0)); }
.arch-svg { width: 100%; height: auto; display: block; }
.arch-box rect, .arch-io rect { fill: var(--card); stroke: var(--rule); stroke-width: 1; }
.arch-box:not(.sat) rect { stroke: var(--ink); }
.arch-io rect { fill: var(--paper-2); }
.bx-t { fill: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 600; text-anchor: middle; }
.bx-d { fill: var(--ash); font-family: var(--font-mono); font-size: 10px; text-anchor: middle; letter-spacing: 0.04em; }
.io-t { fill: var(--ash); font-family: var(--font-mono); font-size: 11px; text-anchor: middle; }
.edge { stroke: var(--rule-strong, var(--rule)); stroke-width: 1.2; }
.ahfill { fill: var(--ash); }
.draw-line { stroke: var(--ash); stroke-width: 1.4; fill: none; stroke-dasharray: 160; stroke-dashoffset: 160; }
.story-sec.in .draw-line { animation: drawline 900ms ease forwards; }
.story-sec.in .draw-line:nth-of-type(2) { animation-delay: 140ms; }
.story-sec.in .draw-line:nth-of-type(3) { animation-delay: 280ms; }
@keyframes drawline { to { stroke-dashoffset: 0; } }

/* section 4: share */
.share-url { display: flex; align-items: center; gap: 12px; margin-top: var(--sp-4); padding: 9px 12px; border: var(--rule-w) solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
.share-url-text { flex: 1; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn.done { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.second-browser {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: max-height 600ms ease, margin-top 600ms ease, opacity 450ms ease, transform 600ms ease;
}
.second-browser.show {
  max-height: 360px;
  margin-top: var(--sp-5);
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.second-label { font-size: 10.5px; color: var(--ash); margin-bottom: var(--sp-2); }

/* the snapshot mock */
.snap-head { display: flex; align-items: baseline; gap: 12px; }
.snap-coord { font-size: 15px; font-weight: 500; }
.snap-verdict { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.snap-meta { font-size: 11px; color: var(--ash); margin-top: 6px; }
.snap-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--ink); }
.snap-line .mono { color: var(--ash); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .demo-stage, .demo-verdict, .second-browser { opacity: 1 !important; transform: none !important; transition: none !important; }
  .flow-line { animation: none !important; }
  .bframe, .arch { transform: none !important; }
}

/* ===========================================================================
   Scroll-driven watch section, morph, intelligence-flow chips
   =========================================================================== */
.watch-sec { max-width: 760px; }
.watch-track { position: relative; min-height: 260vh; }
.watch-track.no-scroll-anim { min-height: 0; }
.watch-sticky { position: sticky; top: 78px; }
.watch-track.no-scroll-anim .watch-sticky { position: static; }
.watch-unavailable { color: var(--ash); font-size: 12.5px; }
.demo-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--ash); margin-top: 3px; font-style: italic; }

/* echo pending stays honestly hollow */
.demo-stage.is-pending.on .demo-node { background: var(--card); border-style: dashed; }
.demo-stage.is-pending .demo-stage-d { color: var(--ash); }

/* verdict row + end-of-scroll morph */
.demo-stage.is-verdict { padding-top: var(--sp-3); border-top: var(--rule-w) solid var(--rule-2); margin-top: var(--sp-2); }
.watch-snaplink {
  display: inline-block; margin-top: var(--sp-4);
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink); border-bottom: var(--rule-w) solid var(--rule); padding-bottom: 2px;
  opacity: 0; transform: translateY(4px); transition: opacity 400ms ease, transform 400ms ease; pointer-events: none;
}
.watch-sec.morphed .watch-snaplink { opacity: 1; transform: translateY(0); pointer-events: auto; }
.watch-sec.morphed .bframe { box-shadow: none; }

/* intelligence-flow chips slide inward once, then rest */
.arch { position: relative; }
.arch-inner { position: relative; z-index: 1; }
.flow-chips { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.fchip {
  position: absolute; font-size: 9.5px; color: var(--ink);
  background: var(--card); border: var(--rule-w) solid var(--rule); border-radius: 999px; padding: 1px 8px;
  opacity: 0; transition: transform 900ms ease, opacity 900ms ease;
}
.fchip-cargo { left: 20%; top: 22%; }
.fchip-model { left: 74%; top: 22%; }
.fchip-echo  { left: 46%; top: 74%; }
.story-sec.in .fchip { opacity: 1; }
.story-sec.in .fchip-cargo { transform: translate(70px, 60px); transition-delay: 200ms; }
.story-sec.in .fchip-model { transform: translate(-70px, 60px); transition-delay: 340ms; }
.story-sec.in .fchip-echo  { transform: translate(0, -60px); transition-delay: 480ms; }
.story-sec.in .fchip { animation: fchipfade 1.6s ease forwards; }
@keyframes fchipfade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .draw-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .fchip { display: none; }
  .watch-snaplink { opacity: 1 !important; transform: none !important; pointer-events: auto; }
}

/* ===========================================================================
   Chapter rhythm — large / small cadence with generous breathing room
   =========================================================================== */
.hero-sec { padding-top: var(--sp-6); }
/* big, intentional whitespace between chapters */
.story-sec + .story-sec { margin-top: clamp(120px, 18vh, 220px); }
/* the watch track already owns a lot of scroll; ease the gap right after it */
.watch-sec + .story-sec { margin-top: clamp(80px, 12vh, 150px); }

/* small chapters recede: they support the story, not interrupt it */
.sec-sm .sec-h { font-size: clamp(18px, 2vw, 23px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: var(--sp-2) 0 var(--sp-5); }
.sec-sm .eyebrow { color: var(--text-faint, var(--ash)); }

/* How-it-works diagram: ~30% smaller, treated as an illustration */
.sec-sm .arch { max-width: 66%; margin: var(--sp-2) auto 0; }
@media (max-width: 620px) { .sec-sm .arch { max-width: 100%; } }

/* Recent chapter sits quietly */
.recent-sec .recent-block { margin-top: 0; }

/* ===========================================================================
   Teaching chapters — contrast, trust stack, model swap, attributes
   =========================================================================== */
.hero-triad { color: var(--ash); font-size: 12px; margin: var(--sp-3) 0 var(--sp-5); }

/* 2. why-not: side-by-side contrast */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: var(--sp-4); }
@media (max-width: 640px) { .versus { grid-template-columns: 1fr; } .versus-vs { display: none; } }
.versus-vs { align-self: center; color: var(--text-faint, var(--ash)); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }
.tcard { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); background: var(--card); padding: var(--sp-4) var(--sp-5); }
.tcard.pro { border-color: var(--ink); }
.tcard-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ash); margin-bottom: var(--sp-3); }
.tlist { list-style: none; margin: 0; padding: 0; }
.tli { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 13px; line-height: 1.45; }
.tmark { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; border: var(--rule-w) solid var(--rule-strong, var(--rule)); }
.tmark-yes { background: var(--clean); border-color: var(--clean); }
.tmark-no { background: transparent; }
.tli.is-model { color: var(--ink); font-weight: 500; }
.model-tag { display: inline-block; margin-left: 8px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--flag); border: var(--rule-w) solid var(--flag); border-radius: 999px; padding: 1px 7px; }
.why-caption { margin-top: var(--sp-5); font-size: 14.5px; color: var(--text); }
.why-caption strong { font-weight: 600; }
.watch-sec { margin-top: var(--sp-7); }
.watch-sec > .eyebrow { margin-bottom: var(--sp-3); }

/* 3. trust: evidence-first stack + claim trace */
.trust-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: var(--sp-4) 0 var(--sp-6); }
.trust-layer { width: 100%; max-width: 420px; border: var(--rule-w) solid var(--rule); border-radius: var(--radius); background: var(--card); padding: 12px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.trust-bottom { border-color: var(--ink); }
.trust-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.trust-sub { font-size: 10.5px; color: var(--ash); }
.trust-arrow { font-size: 10px; color: var(--ash); }
.claim-card { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); background: var(--card); padding: var(--sp-4) var(--sp-5); }
.claim-row { display: flex; align-items: center; gap: 10px; }
.claim-title { font-size: 14.5px; font-weight: 500; flex: 1; }
.origin-pill { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; border: var(--rule-w) solid var(--rule); border-radius: 999px; padding: 2px 8px; color: var(--ash); }
.origin-pill.origin-det { border-color: var(--clean); color: var(--clean); background: var(--clean-bg); }
.origin-pill.origin-history { border-color: var(--rule); color: var(--ash); }
.origin-pill.origin-model { border-color: var(--flag); color: var(--flag); background: var(--flag-bg); }
.trace-body { padding-top: var(--sp-2); }
.trace-ev { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: var(--rule-w) solid var(--rule-2); font-size: 12.5px; }
.trace-id { color: var(--ash); }
.trace-d { color: var(--ink); }

/* 5. model swap */
.byo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--sp-3) 0 var(--sp-5); }
.prov2 { font-family: var(--font-mono); font-size: 11px; color: var(--ash); background: transparent; border: var(--rule-w) solid var(--rule); border-radius: 999px; padding: 5px 13px; cursor: pointer; }
.prov2.on { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.swap-pipe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swap-node { font-family: var(--font-mono); font-size: 12px; border: var(--rule-w) solid var(--rule); border-radius: var(--radius); padding: 9px 13px; background: var(--card); }
.swap-node.swap-model { border-color: var(--flag); color: var(--flag); transition: color 160ms ease, border-color 160ms ease; }
.swap-arrow { color: var(--ash); }
.resp-note { color: var(--ash); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: var(--sp-4); }

/* 6. attributes */
.attrs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-5); }
.attr { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); border: var(--rule-w) solid var(--rule); border-radius: 999px; padding: 3px 10px; }

/* how-it-works responsibility note */
.resp-note { text-align: left; }

/* ===========================================================================
   Refinement pass: wider + calmer, rounded input, real graph, key trust
   =========================================================================== */
/* wider, less stuffy layout */
.story-sec { max-width: 1040px; }
.hero-sub, .why-caption, .why-lead, .byo-copy, .resp-note { max-width: 66ch; }

/* rounded, wider investigation input */
.ask-card { border-radius: 16px; padding: var(--sp-6) var(--sp-6); max-width: 920px; }
.home-entry-row { gap: 12px; }
.home-entry { border-radius: 12px; padding: 14px 18px; font-size: 15px; }
.home-entry-row .btn-primary { border-radius: 11px; padding: 0 24px; }

/* watch: start highlighting sooner, far less dead space */
.watch-sec { width: 100%; max-width: 920px; }
.watch-track { min-height: 0; }
.watch-sticky { position: static; }

/* ---- How it works: a real graph ---- */
.graph-wrap { max-width: 720px; margin: var(--sp-5) auto var(--sp-6); }
.graph .bx-t { font-size: 13px; }
.graph .bx-d { font-size: 10px; }
.arch-core rect { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.7; }
.core-t { font-weight: 700; }
.arch-flow { stroke: var(--ash); stroke-width: 1.5; fill: none; stroke-dasharray: 2 7; opacity: 0.6; }
.story-sec.in .arch-flow { animation: flowin 1.7s linear infinite; }
@keyframes flowin { to { stroke-dashoffset: -18; } }
.arch-box.sat rect { fill: var(--card); stroke: var(--rule); }
.arch-io rect { fill: var(--paper-2); stroke: var(--rule); }
.arch-mobile { display: none; }

/* responsibilities as a tidy grid, not a spilling paragraph */
.resp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: var(--sp-4); }
@media (max-width: 760px) { .resp-grid { grid-template-columns: 1fr 1fr; } }
.resp-cell { border: var(--rule-w) solid var(--rule); border-radius: var(--radius); background: var(--card); padding: 12px 14px; }
.resp-k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.resp-v { display: block; font-size: 12px; color: var(--ash); margin-top: 3px; }

/* ---- Evidence-first: clearer mental model ---- */
.why-lead { font-size: 15px; color: var(--text); line-height: 1.6; margin-bottom: var(--sp-6); }
.trust-stack { gap: 0; margin: var(--sp-4) 0 var(--sp-6); }
.trust-top { max-width: 360px; border-radius: var(--radius) var(--radius) 0 0; }
.trust-arrow { padding: 6px 0; }
.trust-bottom { max-width: 560px; border-width: 1.6px; }

/* ---- Bring your own model: the real value ---- */
.byo-copy { font-size: 15px; color: var(--text); line-height: 1.6; margin-bottom: var(--sp-5); }
.byo-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: var(--sp-5); }
@media (max-width: 700px) { .byo-notes { grid-template-columns: 1fr; } }
.byo-note { border: var(--rule-w) solid var(--rule); border-left: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); padding: 13px 16px; font-size: 13px; color: var(--ash); line-height: 1.5; }
.byo-note-k { color: var(--ink); font-weight: 600; }

/* attributes row reads as a nicer strip */
.attrs { gap: 10px; margin-bottom: var(--sp-6); }
.attr { padding: 4px 12px; }

/* The final handoff should not feel like another full chapter break. */
.receive-sec + .recent-sec { margin-top: clamp(72px, 10vh, 120px); }

/* The opening argument uses an editorial rhythm without empty viewport panels. */
.hero-sec {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding: clamp(92px, 10vh, 132px) 0 clamp(112px, 13vh, 160px);
}
.hero-brand {
  --brand-tracking: clamp(0.18em, 1.8vw, 0.46em);
  width: fit-content;
  max-width: 100%;
  margin: 0 0 clamp(22px, 3vh, 34px);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(42px, 6.4vw, 72px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: var(--brand-tracking);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  will-change: letter-spacing, transform, opacity;
}
.hero-sec.in .hero-brand {
  animation: artifactly-gather 1.65s cubic-bezier(0.16, 1, 0.3, 1) 180ms forwards;
}
@keyframes artifactly-gather {
  0% {
    letter-spacing: var(--brand-tracking);
    opacity: 0;
    transform: translateY(8px);
  }
  18% { opacity: 1; }
  100% {
    letter-spacing: -0.055em;
    opacity: 1;
    transform: translateY(0);
  }
}
.hero-headline { font-size: clamp(36px, 4vw, 52px); }
.hero-sec + .difference-sec { margin-top: 0; }
.difference-sec {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding: clamp(96px, 11vh, 140px) 0 clamp(104px, 12vh, 150px);
  border-top: var(--rule-w) solid var(--rule-2);
  border-bottom: var(--rule-w) solid var(--rule-2);
}
.difference-sec + .watch-sec {
  margin-top: 0;
  padding-top: clamp(96px, 11vh, 140px);
}
.watch-chapter .sec-h { margin-bottom: var(--sp-5); }

@media (max-width: 620px) {
  /* Keep the primary action comfortable without crushing the input. */
  .ask-card { padding: 22px 20px; }
  .home-entry-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .home-entry-row .btn-primary { width: 100%; min-height: 44px; }
  .hero-sec {
    min-height: 0;
    padding: clamp(72px, 9vh, 96px) 0 clamp(88px, 11vh, 118px);
  }
  .hero-brand {
    --brand-tracking: clamp(0.1em, 1.2vw, 0.22em);
    font-size: clamp(34px, 11vw, 52px);
  }
  .difference-sec {
    padding: 80px 0 88px;
  }

  /* The desktop SVG becomes illegible when scaled to phone width. */
  .graph-wrap { display: none; }
  .arch-mobile {
    display: block;
    margin: var(--sp-5) 0 var(--sp-6);
    font-family: var(--font-mono);
  }
  .arch-mobile-sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .arch-mobile-node,
  .arch-mobile-io {
    border: var(--rule-w) solid var(--rule);
    border-radius: var(--radius);
    background: var(--card);
    padding: 10px 8px;
    text-align: center;
  }
  .arch-mobile-node strong,
  .arch-mobile-node span { display: block; }
  .arch-mobile-node strong { font-size: 10.5px; }
  .arch-mobile-node span { margin-top: 3px; color: var(--ash); font-size: 8.5px; }
  .arch-mobile-join {
    height: 28px;
    color: var(--ash);
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    letter-spacing: 5.5rem;
    text-indent: 5.5rem;
  }
  .arch-mobile-flow {
    display: grid;
    grid-template-columns: 58px 12px minmax(0, 1fr) 12px 58px;
    align-items: center;
    gap: 4px;
  }
  .arch-mobile-io { padding: 9px 4px; color: var(--ash); font-size: 8.5px; }
  .arch-mobile-arrow { color: var(--ash); font-size: 11px; text-align: center; }
  .arch-mobile-core { border: 1.5px solid var(--ink); }
  .arch-mobile-core strong { font-size: 9.5px; }
  .echo-join { height: 24px; line-height: 24px; letter-spacing: normal; text-indent: 0; }
  .arch-mobile-echo { width: 56%; margin: 0 auto; }

  /* Preserve the pipeline order when there is no horizontal room. */
  .swap-pipe { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .swap-node { width: 100%; text-align: center; }
  .swap-arrow { text-align: center; line-height: 1; transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-brand,
  .hero-sec.in .hero-brand {
    animation: none;
    letter-spacing: -0.055em;
    opacity: 1;
    transform: none;
  }
}
