/* ============================================================
   Agreement Graph — explainer site
   Dark editorial theme, dependency-free.
   ============================================================ */

:root {
  --bg:        #0a0b0f;
  --bg-soft:   #111319;
  --bg-card:   #14161d;
  --bg-elev:   #191c25;
  --line:      #242833;
  --line-soft: #1c1f28;
  --text:      #e8eaf0;
  --text-mid:  #aab0c0;
  --text-dim:  #6b7280;

  --accent:        #5b8cff;   /* electric blue — active / verified */
  --accent-soft:   #3a5b8f;
  --amber:         #f5b94d;   /* review / human checkpoint */
  --green:         #46d6a0;   /* active state */
  --rose:          #f06a82;   /* terminal */
  --violet:        #b08cff;   /* superseded */

  --bronze: #c87f4a;
  --silver: #aeb6c4;
  --gold:   #f5c451;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- scroll progress ---------- */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  z-index: 100; transition: width .1s linear;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(18px, 5vw, 48px);
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.nav-mark {
  width: 18px; height: 18px;
  background-image: url('/favicon.svg');
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.nav-links { display: flex; gap: clamp(10px, 2.4vw, 28px); }
.nav-links a {
  color: var(--text-dim); text-decoration: none; font-size: 13.5px;
  font-weight: 500; transition: color .18s;
}
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 28px); }

/* Nav sign-in button — proactive auth, mirrors the playground gate */
.nav-auth {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); cursor: pointer; white-space: nowrap;
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.45);
  transition: background .18s, border-color .18s;
}
.nav-auth:hover { background: rgba(91, 140, 255, 0.2); border-color: rgba(91, 140, 255, 0.7); }
/* signed-in state: green dot + name, click to sign out */
.nav-auth.signed-in {
  background: rgba(63, 185, 122, 0.1);
  border-color: rgba(63, 185, 122, 0.4);
  color: var(--text-mid);
}
.nav-auth.signed-in:hover { background: rgba(225, 90, 110, 0.12); border-color: rgba(225, 90, 110, 0.45); color: var(--text); }
.nav-auth-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); flex: none;
}
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- layout primitives ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--line-soft);
}
.section-wide { max-width: 1240px; }

.kicker {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(28px, 4.4vw, 48px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.06;
  margin-bottom: 18px;
}
.section-intro {
  max-width: 720px; color: var(--text-mid); font-size: 17px;
  margin-bottom: 40px;
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(90px, 16vh, 180px) clamp(20px, 5vw, 40px) clamp(70px, 12vh, 130px);
  text-align: left;
}
.hero-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 78%);
  opacity: .6;
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 28px;
}
.hero-title {
  font-family: var(--display);
  font-size: clamp(46px, 9.5vw, 112px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 0.98;
  margin-bottom: 30px;
}
.hero-title .hl { color: var(--accent); }
.hero-sub {
  font-family: var(--serif); font-size: clamp(18px, 2.4vw, 23px);
  color: var(--text-mid); max-width: 640px; margin: 0 0 42px;
  line-height: 1.55;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  color: #fff; box-shadow: 0 6px 22px rgba(91,140,255,.32);
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(91,140,255,.45); }
.btn-ghost {
  background: var(--bg-card); color: var(--text); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent-soft); background: var(--bg-elev); }

/* ---------- argument ---------- */
.argument-body { max-width: 760px; }
.lead {
  font-size: clamp(20px, 2.8vw, 26px); line-height: 1.5;
  color: var(--text); margin-bottom: 26px; font-weight: 500;
  letter-spacing: -0.01em;
}
.argument-body p { color: var(--text-mid); font-size: 17px; margin-bottom: 20px; }
.argument-body strong { color: var(--text); font-weight: 600; }
.argument-body em { color: var(--text); font-style: italic; }
.pull {
  margin-top: 40px; padding: 28px 32px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(100deg, rgba(91,140,255,.08), transparent);
  border-radius: 0 12px 12px 0;
  font-family: var(--serif); font-size: clamp(19px, 2.4vw, 23px);
  color: var(--text); line-height: 1.5;
}
.chain { font-family: var(--mono); font-size: .82em; color: var(--accent); }

/* ---------- pillars ---------- */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 26px;
  position: relative; overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.pillar:hover { transform: translateY(-4px); border-color: var(--accent-soft); }
.pillar-num {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  letter-spacing: .1em;
}
.pillar h3 {
  font-size: 19px; font-weight: 700; margin: 14px 0 12px;
  letter-spacing: -0.015em; line-height: 1.25;
}
.pillar p { color: var(--text-mid); font-size: 15px; }
.pillar code {
  font-family: var(--mono); font-size: .86em; color: var(--green);
  background: rgba(70,214,160,.1); padding: 1px 6px; border-radius: 5px;
}
.pillar strong { color: var(--text); }
.pillar-tag {
  margin-top: 18px; font-family: var(--mono); font-size: 11.5px;
  color: var(--text-dim); letter-spacing: .04em;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}

/* ---------- state machine ---------- */
.machine-toolbar {
  display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap;
}
.machine-hint {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
}
.machine-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 22px;
}
@media (max-width: 940px) { .machine-layout { grid-template-columns: 1fr; } }
.machine-canvas {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
  background-image: radial-gradient(circle at 1px 1px, var(--line-soft) 1px, transparent 0);
  background-size: 26px 26px;
}
#state-machine { width: 100%; height: auto; display: block; }

.machine-panel {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; min-height: 200px;
}
.panel-empty { color: var(--text-dim); font-size: 14px; font-style: italic; }
.panel-state-name {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 4px;
}
.panel-state-desc { color: var(--text-mid); font-size: 14px; margin-bottom: 18px; }
.panel-sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim);
  margin: 16px 0 10px;
}
.trans-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border-radius: 9px; background: var(--bg-elev);
  border: 1px solid var(--line-soft); margin-bottom: 8px;
}
.trans-name {
  font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 500;
}
.trans-to { font-size: 12.5px; color: var(--text-mid); }
.trans-to b { color: var(--text); }
.trans-guard {
  font-size: 12px; color: var(--amber); margin-top: 2px;
}
.trans-guard--always { color: var(--text-dim); }
.terminal-badge {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  color: var(--rose); border: 1px solid rgba(240,106,130,.4);
  padding: 3px 10px; border-radius: 20px; margin-top: 10px;
}

/* SVG node styling hooks */
.sm-node { cursor: pointer; transition: opacity .2s; }
.sm-node-box {
  fill: var(--bg-elev); stroke: var(--line); stroke-width: 1.5;
  transition: fill .2s, stroke .2s, filter .2s;
}
.sm-node-label {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  fill: var(--text); text-anchor: middle; dominant-baseline: middle;
  pointer-events: none; letter-spacing: .02em;
}
.sm-node.selected .sm-node-box { stroke: var(--accent); stroke-width: 2.5; }
.sm-node.active .sm-node-box { fill: rgba(70,214,160,.16); stroke: var(--green); }
.sm-node.dim { opacity: .28; }
.sm-edge { fill: none; stroke: var(--line); stroke-width: 1.6; transition: stroke .2s, opacity .2s; }
.sm-edge.hot { stroke: var(--accent); stroke-width: 2.4; opacity: 1; }
.sm-edge.dim { opacity: .12; }
.sm-edge-label {
  font-family: var(--mono); font-size: 10.5px; fill: var(--text-dim);
  text-anchor: middle; pointer-events: none;
}
.sm-edge-label.hot { fill: var(--accent); }
.sm-pulse { fill: var(--green); filter: drop-shadow(0 0 8px var(--green)); }

/* ---------- simulator ---------- */
.simulator {
  margin-top: 24px; display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 16px; align-items: center;
}
@media (max-width: 720px) { .simulator { grid-template-columns: 1fr; }
  .sim-arrow { transform: rotate(90deg); } }
.sim-col {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.sim-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px;
}
.sim-code {
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: var(--text-mid); white-space: pre-wrap; transition: opacity .2s;
}
.sim-arrow { font-size: 24px; color: var(--accent); text-align: center; }

/* ---------- graph ---------- */
.graph-layout { display: grid; grid-template-columns: 1fr 260px; gap: 22px; }
@media (max-width: 900px) { .graph-layout { grid-template-columns: 1fr; } }
.graph-canvas {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; overflow: hidden;
}
#agreement-graph { width: 100%; height: auto; display: block; }
.graph-legend {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.graph-legend h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px;
}
.legend-edges { margin-top: 20px; }
.legend-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.legend-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-mid); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-party { background: var(--accent); }
.dot-active { background: var(--green); }
.dot-superseded { background: var(--violet); }
.edge-key { width: 22px; height: 0; border-top-width: 2px; border-top-style: solid; flex: none; }
.edge-parent { border-color: var(--amber); }
.edge-supersede { border-color: var(--violet); border-top-style: dashed; }
.edge-role { border-color: var(--line); }
.graph-inspect {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  min-height: 90px;
}
.gi-name { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.gi-meta { font-family: var(--mono); font-size: 12px; color: var(--text-mid); line-height: 1.7; }
.gi-meta .k { color: var(--text-dim); }

/* graph SVG hooks */
.g-node { cursor: pointer; }
.g-node-shape { transition: filter .2s, opacity .2s, stroke-width .2s; }
.g-node-label {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  fill: var(--text); text-anchor: middle; pointer-events: none;
}
.g-node-sub {
  font-family: var(--mono); font-size: 10px; fill: var(--text-dim);
  text-anchor: middle; pointer-events: none;
}
.g-edge { fill: none; transition: opacity .2s, stroke-width .2s; }
.g-dim { opacity: .15; }

/* ---------- medallion ---------- */
.medallion {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 2vw, 22px); margin-bottom: 28px; flex-wrap: wrap;
}
.med-stage {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px clamp(20px, 4vw, 40px); cursor: pointer;
  transition: transform .2s, border-color .2s, background .2s; min-width: 150px;
}
.med-stage:hover { transform: translateY(-3px); }
.med-icon { font-size: 20px; }
.med-bronze .med-icon { color: var(--bronze); }
.med-silver .med-icon { color: var(--silver); }
.med-gold   .med-icon { color: var(--gold); }
.med-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.med-tag { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: .03em; }
.med-stage.active { background: var(--bg-elev); }
.med-bronze.active { border-color: var(--bronze); box-shadow: 0 0 28px rgba(200,127,74,.2); }
.med-silver.active { border-color: var(--silver); box-shadow: 0 0 28px rgba(174,182,196,.16); }
.med-gold.active   { border-color: var(--gold);   box-shadow: 0 0 28px rgba(245,196,81,.2); }
.med-arrow { color: var(--text-dim); font-size: 22px; }
@media (max-width: 640px) { .med-arrow { transform: rotate(90deg); } }

.med-detail {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px clamp(22px, 4vw, 40px);
  min-height: 220px;
}
.md-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.md-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.md-semantic {
  font-family: var(--mono); font-size: 12px; padding: 4px 12px; border-radius: 20px;
  letter-spacing: .04em;
}
.md-bronze-c { color: var(--bronze); border: 1px solid rgba(200,127,74,.4); }
.md-silver-c { color: var(--silver); border: 1px solid rgba(174,182,196,.4); }
.md-gold-c   { color: var(--gold);   border: 1px solid rgba(245,196,81,.4); }
.md-lead { color: var(--text-mid); font-size: 16px; max-width: 680px; margin-bottom: 24px; }
.md-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .md-cols { grid-template-columns: 1fr; } }
.md-block h5 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px;
}
.md-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.md-list li {
  font-size: 14px; color: var(--text-mid); padding-left: 20px; position: relative;
}
.md-list li::before {
  content: '→'; position: absolute; left: 0; color: var(--accent);
  font-family: var(--mono);
}
.md-list code {
  font-family: var(--mono); font-size: .86em; color: var(--text);
  background: var(--bg-elev); padding: 1px 6px; border-radius: 5px;
}

/* ---------- standards ---------- */
.standards-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
@media (max-width: 720px) { .standards-grid { grid-template-columns: 1fr; } }
.std-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
  transition: border-color .2s;
}
.std-card:hover { border-color: var(--accent-soft); }
.std-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.std-card p { color: var(--text-mid); font-size: 14.5px; }
.std-card strong { color: var(--text); }
.std-card code {
  font-family: var(--mono); font-size: .85em; color: var(--green);
  background: rgba(70,214,160,.1); padding: 1px 6px; border-radius: 5px;
}

/* ---------- build ---------- */
.build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .build-grid { grid-template-columns: 1fr; } }
.code-block {
  background: #0c0d12; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.code-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.code-dot:nth-child(1) { background: #f0625f; }
.code-dot:nth-child(2) { background: #f5be4f; }
.code-dot:nth-child(3) { background: #5ec866; }
.code-file {
  margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-dim);
}
.code-block pre { padding: 20px; overflow-x: auto; }
.code-block code {
  font-family: var(--mono); font-size: 13px; line-height: 1.75; color: var(--text);
}
.c-c { color: var(--text-dim); font-style: italic; }
.c-k { color: var(--violet); }
.c-s { color: var(--green); }

.build-foot {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px;
}
@media (max-width: 640px) { .build-foot { grid-template-columns: repeat(2, 1fr); } }
.build-stat {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 18px; text-align: center;
}
.stat-num {
  display: block; font-size: 36px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--text), var(--text-dim));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  letter-spacing: .03em; margin-top: 4px; display: block;
}

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 60px 40px 80px;
  border-top: 1px solid var(--line-soft); text-align: center;
}
.footer-line { font-family: var(--serif); font-size: 18px; color: var(--text-mid); }
.footer-sub { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 8px; letter-spacing: .04em; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- contact widget ---------- */
.contact-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  width: 340px; font-family: var(--sans);
  filter: drop-shadow(0 8px 32px rgba(0,0,0,.55));
}
.contact-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 18px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer;
  color: var(--text); font-weight: 500; font-size: 13.5px;
  transition: border-color .18s, background .18s, border-radius .2s;
}
.contact-toggle:hover { border-color: var(--accent-soft); }
.contact-toggle[aria-expanded="true"] { border-radius: 0 0 14px 14px; }
.contact-toggle:hover { opacity: .9; }
.contact-toggle-icon { font-size: 16px; }
.contact-toggle-label { flex: 1; text-align: left; }
.contact-toggle-chevron {
  font-size: 10px; transition: transform .2s;
  display: inline-block;
}
.contact-toggle[aria-expanded="true"] .contact-toggle-chevron { transform: rotate(180deg); }
.contact-panel {
  background: var(--bg-card); border: 1px solid var(--line);
  border-bottom: none; border-radius: 14px 14px 0 0;
  padding: 22px 20px 18px; order: -1;
}
.contact-widget { display: flex; flex-direction: column; }
.contact-toggle { order: 1; }
.contact-panel { order: 0; }
.contact-header { margin-bottom: 16px; }
.contact-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; margin-bottom: 4px;
}
.contact-sub { font-size: 13px; color: var(--text-dim); }
.contact-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.contact-field label {
  font-size: 12px; font-weight: 500; color: var(--text-mid);
  font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase;
}
.contact-field input, .contact-field textarea {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px;
  color: var(--text); font-size: 13.5px; font-family: var(--sans);
  outline: none; transition: border-color .18s; resize: none;
}
.contact-field input:focus, .contact-field textarea:focus {
  border-color: var(--accent);
}
.contact-field input::placeholder, .contact-field textarea::placeholder {
  color: var(--text-dim);
}
.contact-submit {
  width: 100%; padding: 11px; border: none; border-radius: 9px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  transition: opacity .18s;
}
.contact-submit:hover { opacity: .88; }
.contact-submit:disabled { opacity: .5; cursor: not-allowed; }
.contact-status {
  font-size: 13px; text-align: center; margin-top: 10px; min-height: 18px;
}
.contact-status.ok { color: var(--green); }
.contact-status.err { color: var(--rose); }
@media (max-width: 420px) {
  .contact-widget { width: calc(100vw - 32px); right: 16px; bottom: 16px; }
}

/* ---------- playground ---------- */
.pg-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.pg-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  text-align: left; cursor: pointer;
  transition: border-color .2s, transform .18s, background .2s;
  display: flex; flex-direction: column; gap: 6px;
}
.pg-card:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.pg-card.selected { border-color: var(--accent); background: var(--bg-elev); }
.pg-card.expiring { border-color: rgba(245,185,77,.5); }
.pg-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-card-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.pg-card-sub { font-size: 11.5px; color: var(--text-dim); }
.pg-card-date { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.pg-card-source { font-family: var(--mono); font-size: 10px; color: var(--line); margin-top: 4px; }

/* badges */
.pg-badge {
  display: inline-block; font-family: var(--mono); font-weight: 600;
  font-size: 10.5px; padding: 3px 8px; border-radius: 20px; letter-spacing: .04em;
  border-width: 1px; border-style: solid;
}
.pg-badge-sm { font-size: 10px; padding: 2px 7px; }
.pg-badge-accent  { color: var(--accent);  border-color: rgba(91,140,255,.4);  background: rgba(91,140,255,.08); }
.pg-badge-green   { color: var(--green);   border-color: rgba(70,214,160,.4);  background: rgba(70,214,160,.08); }
.pg-badge-amber   { color: var(--amber);   border-color: rgba(245,185,77,.4);  background: rgba(245,185,77,.08); }
.pg-badge-rose    { color: var(--rose);    border-color: rgba(240,106,130,.4); background: rgba(240,106,130,.08);}
.pg-badge-violet  { color: var(--violet);  border-color: rgba(176,140,255,.4); background: rgba(176,140,255,.08);}
.pg-badge-dim     { color: var(--text-dim);border-color: var(--line);           background: var(--bg-elev); }

.pg-expiry-warn {
  font-family: var(--mono); font-size: 10.5px; color: var(--amber);
  background: rgba(245,185,77,.1); border: 1px solid rgba(245,185,77,.3);
  padding: 2px 7px; border-radius: 20px;
}

/* workspace */
.pg-workspace {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 8px;
}
@media (max-width: 900px) { .pg-workspace { grid-template-columns: 1fr; } }

.pg-left, .pg-right {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}

/* detail panel */
.pg-exp-banner {
  background: rgba(245,185,77,.12); border-bottom: 1px solid rgba(245,185,77,.25);
  padding: 10px 18px; font-size: 13px; color: var(--amber);
}
.pg-detail-title-row { padding: 18px 18px 0; }
.pg-detail-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pg-detail-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.pg-detail-summary { padding: 10px 18px 0; font-size: 13.5px; color: var(--text-mid); line-height: 1.5; }
.pg-detail-meta {
  margin: 14px 18px 0;
  background: var(--bg-elev); border-radius: 9px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.pg-meta-row { display: flex; justify-content: space-between; font-size: 13px; }
.pg-meta-key { color: var(--text-dim); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.pg-parties { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 0; }
.pg-party-chip {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px;
}
.pg-party-name { font-size: 12.5px; font-weight: 600; }
.pg-party-role { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: .04em; }
.pg-party-signatory .pg-party-name { color: var(--accent); }
.pg-party-reviewer .pg-party-name { color: var(--amber); }
.pg-depends-note { padding: 10px 18px 0; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.pg-source-note { padding: 8px 18px 12px; font-family: var(--mono); font-size: 10px; color: var(--line); }

/* transitions area */
.pg-section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 14px 18px 8px; display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--line-soft);
}
.pg-audit-count {
  background: var(--bg-elev); border: 1px solid var(--line);
  font-size: 10px; padding: 1px 7px; border-radius: 20px; color: var(--text-mid);
}
.pg-transition-btns { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.pg-trans-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-elev); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: border-color .18s, background .18s;
}
.pg-trans-btn:hover { background: var(--bg-card); }
.pg-trans-arrow { font-family: var(--mono); font-size: 11px; color: var(--text-dim); font-weight: 400; }
.pg-trans-accent  { border-color: rgba(91,140,255,.5);  color: var(--accent); }
.pg-trans-green   { border-color: rgba(70,214,160,.5);  color: var(--green); }
.pg-trans-amber   { border-color: rgba(245,185,77,.5);  color: var(--amber); }
.pg-trans-rose    { border-color: rgba(240,106,130,.5); color: var(--rose); }
.pg-trans-violet  { border-color: rgba(176,140,255,.5); color: var(--violet); }
.pg-trans-dim     { color: var(--text-dim); }
.pg-terminal-note { padding: 0 18px 14px; font-size: 13px; color: var(--text-dim); font-style: italic; }

/* audit trail */
.pg-audit-list { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.pg-audit-row {
  display: grid; grid-template-columns: auto auto 1fr auto;
  align-items: start; gap: 8px;
  padding: 8px 10px; background: var(--bg-elev); border-radius: 7px;
  font-size: 12px;
}
.pg-audit-ts { font-family: var(--mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.pg-audit-name { font-weight: 600; color: var(--text); white-space: nowrap; }
.pg-audit-states { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pg-audit-actor { font-family: var(--mono); font-size: 11px; color: var(--accent); text-align: right; }
.pg-audit-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-dim); padding-left: 2px; }
.pg-empty-note { padding: 0 18px 14px; font-size: 13px; color: var(--text-dim); font-style: italic; }

/* right panel — tabs + query */
.pg-right-tabs {
  display: flex; border-bottom: 1px solid var(--line);
}
.pg-tab {
  flex: 1; padding: 12px 16px; font-size: 13px; font-weight: 600;
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .18s, border-color .18s;
}
.pg-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.pg-tab:hover:not(.active) { color: var(--text); }

#pg-query-panel, #pg-extract-panel { padding: 16px; }

.pg-query-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.pg-query-bar input {
  flex: 1; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 14px; color: var(--text); font-size: 14px;
  outline: none; font-family: var(--sans); transition: border-color .18s;
}
.pg-query-bar input:focus { border-color: var(--accent); }
.pg-query-bar input::placeholder { color: var(--text-dim); }
.pg-query-bar button {
  padding: 10px 18px; background: var(--accent); color: #fff;
  border: none; border-radius: 9px; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: opacity .18s; white-space: nowrap;
}
.pg-query-bar button:hover { opacity: .88; }

.pg-query-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.pg-chip {
  padding: 6px 12px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 20px; font-size: 12.5px; color: var(--text-mid); cursor: pointer;
  transition: border-color .18s, color .18s;
}
.pg-chip:hover { border-color: var(--accent-soft); color: var(--text); }

.pg-query-results { min-height: 160px; }
.pg-result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pg-result-icon { font-size: 18px; }
.pg-result-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.pg-action, .pg-action-warn, .pg-action-ok {
  font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; line-height: 1.5;
}
.pg-action      { color: var(--text-mid); background: var(--bg-elev); }
.pg-action-warn { color: var(--amber); background: rgba(245,185,77,.08); border: 1px solid rgba(245,185,77,.3); }
.pg-action-ok   { color: var(--green); background: rgba(70,214,160,.08); border: 1px solid rgba(70,214,160,.3); }
.pg-result-group-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); margin: 10px 0 6px;
}
.pg-result-cards { display: flex; flex-direction: column; gap: 7px; }
.pg-mini-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; cursor: pointer; transition: border-color .18s;
}
.pg-mini-card:hover { border-color: var(--accent-soft); }
.pg-mini-card-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.pg-mini-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.pg-mini-card-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.pg-result-transitions { display: flex; flex-direction: column; gap: 6px; }
.pg-result-trans {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--bg-elev); border-radius: 8px;
}
.pg-trans-label { font-weight: 600; font-size: 13px; color: var(--text); }
.pg-trans-dest { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }

/* extraction panel */
.pg-extract-intro {
  font-size: 13px; color: var(--text-mid); margin-bottom: 16px;
  padding: 10px 12px; background: var(--bg-elev); border-radius: 8px; line-height: 1.5;
}
.pg-extract-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .pg-extract-grid { grid-template-columns: 1fr; } }
.pg-raw-text {
  font-size: 13px; line-height: 1.8; color: var(--text-mid);
  background: var(--bg-elev); padding: 14px; border-radius: 9px;
  margin-top: 8px;
}
mark.pg-span { border-radius: 3px; padding: 1px 3px; color: var(--bg); font-weight: 600; }
.pg-span-accent  { background: var(--accent); }
.pg-span-green   { background: var(--green); }
.pg-span-amber   { background: var(--amber); }
.pg-span-violet  { background: var(--violet); }
.pg-span-rose    { background: var(--rose); }

.pg-fields-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pg-field-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--bg-elev); border-radius: 8px; font-size: 12.5px;
}
.pg-field-key { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: .04em; white-space: nowrap; }
.pg-field-value { font-weight: 600; color: var(--text); }
.pg-field-span {
  font-family: var(--mono); font-size: 10.5px; padding: 2px 7px;
  border-radius: 5px; white-space: nowrap; opacity: .85;
}
.pg-field-span.pg-span-accent  { color: var(--accent);  background: rgba(91,140,255,.12); }
.pg-field-span.pg-span-green   { color: var(--green);   background: rgba(70,214,160,.12); }
.pg-field-span.pg-span-amber   { color: var(--amber);   background: rgba(245,185,77,.12); }
.pg-field-span.pg-span-violet  { color: var(--violet);  background: rgba(176,140,255,.12);}
.pg-field-conf { font-family: var(--mono); font-size: 11px; color: var(--green); white-space: nowrap; }
.pg-extract-diff {
  margin-top: 16px; padding: 12px; background: rgba(91,140,255,.06);
  border: 1px solid rgba(91,140,255,.2); border-radius: 9px;
  font-size: 12.5px; color: var(--text-mid); line-height: 1.6;
}
.pg-extract-diff strong { color: var(--text); }

/* ---------- playground: scale strip ---------- */
.pg-scale-strip {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-card));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 0 0 22px;
}
.pg-scale-line {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  font-size: 14px; color: var(--text-mid); line-height: 1.5;
}
.pg-scale-line strong { color: var(--text); font-weight: 600; }
.pg-scale-line span { white-space: normal; }

/* ---------- playground: parent card ---------- */
.pg-card--primary {
  border-color: var(--accent);
  border-width: 1.5px;
  background: linear-gradient(180deg, rgba(91,140,255,.05), var(--bg-card));
  position: relative;
}
.pg-card--primary:hover { border-color: var(--accent); }
.pg-card-flag {
  position: absolute; top: -9px; left: 14px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent); color: #fff;
  padding: 3px 9px; border-radius: 5px;
}
.pg-card-deps {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--accent); margin-top: 4px;
}

/* ---------- playground: post-demo CTA ---------- */
.pg-conv {
  margin-top: 36px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px clamp(22px, 4vw, 36px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 720px) {
  .pg-conv { grid-template-columns: 1fr; }
  .pg-conv-btn { justify-self: start; }
}
.pg-conv-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em; color: var(--text);
  margin-bottom: 6px;
}
.pg-conv-sub {
  font-size: 14.5px; color: var(--text-mid); line-height: 1.55; max-width: 620px;
}
.pg-conv-btn { white-space: nowrap; }

/* ---------- playground: live force graph ---------- */
.pg-graph-wrap {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 10px;
  margin-bottom: 22px;
  background-image: radial-gradient(circle at 1px 1px, var(--line-soft) 1px, transparent 0);
  background-size: 24px 24px;
}
.pg-graph-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 6px;
}
.pg-graph-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
}
.pg-graph-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.pgl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.pgl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pgl-line { width: 16px; height: 0; border-top-width: 2px; border-top-style: solid; display: inline-block; }
.pgl-parent     { border-color: var(--accent); }
.pgl-depends    { border-color: var(--green); border-top-style: dashed; }
.pgl-amends     { border-color: var(--amber); }
.pgl-references { border-color: var(--violet); border-top-style: dotted; }

.pg-graph { width: 100%; height: clamp(360px, 46vw, 460px); display: block; cursor: grab; }
.pg-graph:active { cursor: grabbing; }
.pg-graph-hint {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  text-align: center; margin-top: 2px;
}

/* edges */
.pgg-edge { stroke-width: 1.6; opacity: .55; transition: opacity .2s, stroke-width .2s; }
.pgg-edge-party { stroke-width: 1; opacity: .25; }
.pgg-dimmed .pgg-edge { opacity: .08; }
.pgg-dimmed .pgg-edge.hot { opacity: .95; stroke-width: 2.4; }

/* nodes */
.pgg-node { cursor: pointer; }
.pgg-node-circle { stroke: var(--bg); stroke-width: 2; transition: opacity .2s, filter .2s; }
.pgg-node-label {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  fill: var(--text-mid); pointer-events: none; transition: fill .2s, opacity .2s;
  paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round;
}
.pgg-node-party .pgg-node-label { fill: var(--text-dim); font-size: 10.5px; }
.pgg-dimmed .pgg-node:not(.hot) .pgg-node-circle { opacity: .2; }
.pgg-dimmed .pgg-node:not(.hot) .pgg-node-label { opacity: .15; }
.pgg-node.hot .pgg-node-label { fill: var(--text); }
.pgg-node.focus .pgg-node-circle { filter: drop-shadow(0 0 7px var(--accent)); }

/* ---------- studio: bring your own contracts ---------- */
.studio-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(100deg, rgba(91,140,255,.08), var(--bg-card));
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 18px;
}
.studio-bar-text { display: flex; flex-direction: column; gap: 3px; }
.studio-bar-text strong { font-size: 15px; color: var(--text); font-weight: 600; }
.studio-bar-text span { font-size: 13px; color: var(--text-mid); }
.studio-bar-btn { white-space: nowrap; }

.studio-badge {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(70,214,160,.08); border: 1px solid rgba(70,214,160,.3);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 18px;
  font-size: 13.5px; color: var(--text);
}
.studio-badge-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.studio-badge-reset, .studio-badge-llm {
  background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 500;
  padding: 0; margin-left: 2px;
}
.studio-badge-reset { color: var(--text-dim); text-decoration: underline; }
.studio-badge-reset:hover { color: var(--text); }
.studio-badge-llm { color: var(--accent); margin-left: auto; }
.studio-badge-llm:hover { text-decoration: underline; }

/* modal */
.studio-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.studio-overlay { position: absolute; inset: 0; background: rgba(5,6,9,.72); backdrop-filter: blur(4px); }
.studio-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 540px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 30px 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  max-height: 90vh; overflow-y: auto;
}
.studio-x {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-dim);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.studio-x:hover { color: var(--text); }
.studio-title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.studio-sub { font-size: 14px; color: var(--text-mid); line-height: 1.55; margin-bottom: 22px; }
.studio-sub code { font-family: var(--mono); font-size: .85em; color: var(--accent); background: rgba(91,140,255,.1); padding: 1px 5px; border-radius: 4px; }
.studio-gbtn { display: flex; justify-content: center; min-height: 44px; }

.studio-email-fallback { margin-top: 8px; }
.studio-email-fallback label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.studio-email-row { display: flex; gap: 8px; margin-top: 6px; }
.studio-email-row input {
  flex: 1; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 13px; color: var(--text); font-size: 14px; outline: none;
}
.studio-email-row input:focus { border-color: var(--accent); }
.studio-email-row input.invalid { border-color: var(--rose); }
.studio-fine { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

.studio-drop {
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 26px 18px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-mid); font-size: 13.5px; transition: border-color .18s, background .18s;
}
.studio-drop:hover, .studio-drop.over { border-color: var(--accent); background: rgba(91,140,255,.05); }
.studio-drop-icon { font-size: 22px; color: var(--accent); }
.studio-paste {
  width: 100%; margin-top: 12px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; color: var(--text); font-family: var(--mono);
  font-size: 12.5px; resize: vertical; outline: none;
}
.studio-paste:focus { border-color: var(--accent); }
.studio-analyze { width: 100%; margin-top: 16px; justify-content: center; }
.studio-status { font-size: 13px; text-align: center; margin-top: 10px; min-height: 16px; }
.studio-status.err { color: var(--rose); }
.studio-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; }

.studio-gate-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 480px) { .studio-gate-actions { flex-direction: column; } .studio-gate-actions .btn { width: 100%; justify-content: center; } }

/* ---------- who it's for ---------- */
.who-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 860px) { .who-grid { grid-template-columns: 1fr; } }
.who-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 26px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .22s, transform .22s;
}
.who-card:hover { border-color: var(--accent-soft); transform: translateY(-3px); }
.who-num {
  font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .1em;
}
.who-title {
  font-size: 19px; font-weight: 700; letter-spacing: -0.015em; color: var(--text);
}
.who-body { font-size: 15px; color: var(--text-mid); line-height: 1.6; flex: 1; }
.who-tag {
  font-size: 13.5px; color: var(--text-dim); border-top: 1px solid var(--line-soft);
  padding-top: 12px; line-height: 1.5;
}
.who-tag em { color: var(--text-mid); font-style: italic; }
.studio-modal[hidden] { display: none; }

/* ---------- studio: privacy trust block ---------- */
.studio-trust {
  margin-top: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.studio-trust-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
}
.studio-trust-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   SCROLLY STORY — the graph builds itself as you scroll
   Beats are cumulative classes b1..b6 set by app.js.
   ============================================================ */
.scrolly {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.scrolly-inner {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  padding: 0 clamp(20px, 5vw, 40px);
}
.scrolly-figure {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.scrolly-figure svg { width: 100%; max-height: 76vh; }
.scrolly-caption {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em;
  color: var(--rose); text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease .3s, transform .5s ease .3s;
}
.scrolly.b6 .scrolly-caption { opacity: 1; transform: none; }

.scrolly-steps { padding: 38vh 0 45vh; }
.scrolly-step {
  min-height: 62vh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 420px;
  opacity: .25; transition: opacity .4s ease;
}
.scrolly-step.active { opacity: 1; }
.scrolly-num {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: 0.2em; margin-bottom: 12px;
}
.scrolly-step h3 {
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.05;
  margin-bottom: 14px;
}
.scrolly-step p { color: var(--text-mid); font-size: 16.5px; }
.scrolly-step a { color: var(--accent); }

/* --- SVG defaults: hidden until their beat --- */
.sg-node circle {
  fill: var(--bg-card); stroke-width: 2.5;
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.9,.3,1.4), stroke .4s ease;
  transform-box: fill-box; transform-origin: center;
}
.sg-node { opacity: 0; }
.sg-node circle { transform: scale(.5); }
.sg-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  fill: var(--text-dim); text-anchor: middle;
  transition: fill .4s ease, opacity .4s ease;
}
.sg-msa circle  { stroke: var(--accent); }
.sg-sow circle  { stroke: var(--green); }
.sg-add circle  { stroke: var(--amber); }
.sg-party circle{ stroke: var(--text-dim); fill: var(--bg-elev); }
.sg-party .sg-label { font-size: 10px; }

.sg-edge {
  stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s ease, stroke .4s ease, opacity .4s ease;
}
.sg-edge-parent { stroke: var(--accent); }
.sg-edge-amends { stroke: var(--amber); }
.sg-pedge {
  stroke: var(--line); stroke-width: 1.2;
  opacity: 0; transition: opacity .6s ease;
}
.sg-ring {
  stroke: var(--rose); stroke-width: 2; stroke-dasharray: 6 7;
  opacity: 0; transition: opacity .5s ease;
}
.sg-risk-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  fill: var(--rose); text-anchor: middle;
  opacity: 0; transition: opacity .45s ease;
}

/* --- beats (cumulative) --- */
.scrolly.b1 .sg-msa { opacity: 1; }
.scrolly.b1 .sg-msa circle { transform: scale(1); }
.scrolly.b2 .sg-sow { opacity: 1; }
.scrolly.b2 .sg-sow circle { transform: scale(1); }
.scrolly.b2 .sg-e-sow1, .scrolly.b2 .sg-e-sow2 { stroke-dashoffset: 0; }
.scrolly.b3 .sg-add { opacity: 1; }
.scrolly.b3 .sg-add circle { transform: scale(1); }
.scrolly.b3 .sg-e-add { stroke-dashoffset: 0; }
.scrolly.b4 .sg-party { opacity: 1; }
.scrolly.b4 .sg-party circle { transform: scale(1); }
.scrolly.b4 .sg-pedge { opacity: 1; }

/* beat 5: termination cascade */
.scrolly.b5 .sg-ring { opacity: 1; animation: sg-pulse 1.6s ease-in-out infinite; }
.scrolly.b5 .sg-sow circle, .scrolly.b5 .sg-add circle { stroke: var(--rose); }
.scrolly.b5 .sg-edge-parent, .scrolly.b5 .sg-edge-amends { stroke: var(--rose); }
.scrolly.b5 .sg-risk-tag { opacity: 1; }
@keyframes sg-pulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: .35; }
}

/* --- mobile: figure pinned on top, steps scroll beneath --- */
@media (max-width: 880px) {
  .scrolly-inner { grid-template-columns: 1fr; gap: 0; }
  .scrolly-figure {
    height: 46vh; height: 46dvh;
    top: 0; z-index: 5;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line-soft);
  }
  .scrolly-figure svg { max-height: 36vh; }
  .scrolly-steps { padding: 10vh 0 20vh; }
  .scrolly-step { min-height: 52vh; max-width: none; }
}

/* --- reduced motion: show the finished graph, no animation --- */
@media (prefers-reduced-motion: reduce) {
  .scrolly .sg-node, .scrolly .sg-pedge { opacity: 1; transition: none; }
  .scrolly .sg-node circle { transform: scale(1); transition: none; }
  .scrolly .sg-edge { stroke-dashoffset: 0; transition: none; }
  .scrolly .sg-ring { animation: none; }
  .scrolly-step { opacity: 1; transition: none; }
  .scrolly-caption { transition: none; }
}
