/* ==========================================================================
   exp33 . graph-sections.css
   Owned by the graph-sections builder. Styles exactly three partials:

     partials/requirement.html   page section 2  "A requirement isn't
                                                  documentation anymore."
     partials/intent.html        page section 3  "Your code has dependencies.
                                                  Your intent does too."
     partials/radius.html        page section 4  "Change this. What else did
                                                  you change?"

   Contract with the shell
     - colour comes ONLY from site.css tokens, so all themes follow
       (--paper --card --ink --ink-rgb --ink-60 --ink-40 --muted --hair
        --hair-strong --signal --signal-rgb --fail --pass --wash --radius
        --sans --mono --prose --maxw).
     - typography obeys the two-layer rule: var(--prose) for every sentence a
       visitor reads, var(--mono) for IDs, paths, labels, status and counts.
     - motion reuses the shell's arrival system: site.js adds .in to .fig and
       to [data-reveal]; strokes are pathLength="1" + .dr, text is .fx.
       Only section 4 ships a script (assets/radius.js) and only for the
       selection interaction, never for layout or reveal.

   SEMANTIC COLOUR (exp33 founder rule) — state is never carried by the accent:
     verified / proven / resolved   var(--pass)
     violated / hazard / broken     var(--fail)
     changed / stale / re-prove     var(--stale, var(--fail))
     inactive / unknown / no proof  var(--unknown, var(--muted))
     plain structure and rules      var(--ink) / var(--hair)
     var(--signal)                  interactive affordance + current selection
                                    ONLY. It never means a state.
   --stale and --unknown are read with fallbacks so the three sections render
   correctly on the themes that exist today and pick up the new palette when
   the state-aware theme lands.

   Every class here is prefixed .gs- (figure-internal state classes .rn / .rw
   are scoped under .gs-rad) so nothing can collide with site.css.
   ========================================================================== */

/* ---------- shared ---------- */
.gs .section-head{max-width:60ch;}
.gs-art{margin:0;}

/* ==========================================================================
   SECTION 2 . the requirement artifact card
   A record you could click, not a screenshot: everything is real markup.
   ========================================================================== */
.gs-card{
  max-width:900px;min-width:0;
  background:var(--card);
  border:1px solid var(--hair-strong);border-radius:var(--radius);
  box-shadow:0 1px 0 rgba(var(--ink-rgb),.04),0 22px 48px -30px rgba(var(--ink-rgb),.42);
  overflow:hidden;
  transition:transform .32s ease,box-shadow .32s ease,border-color .32s ease;
}
@media (hover:hover){
  .gs-card:hover{
    transform:translateY(-2px);border-color:var(--ink);
    box-shadow:0 1px 0 rgba(var(--ink-rgb),.04),0 30px 60px -30px rgba(var(--ink-rgb),.5);
  }
}
@media (prefers-reduced-motion:reduce){
  .gs-card,.gs-card:hover{transition:none;transform:none;}
}

/* header: the identity row */
.gs-card-h{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.8rem 1.4rem;background:var(--paper);border-bottom:1px solid var(--hair);
}
.gs-card-id{
  font-family:var(--mono);font-size:.88rem;font-weight:600;letter-spacing:.05em;
  color:var(--ink);
}
/* VERIFIED is proven knowledge, so it is --pass and nothing else on the card is */
.gs-state{
  display:inline-flex;align-items:center;gap:.45em;flex:0 0 auto;
  font-family:var(--mono);font-size:.63rem;font-weight:600;
  letter-spacing:.16em;text-transform:uppercase;
  padding:.24rem .5rem;border-radius:calc(var(--radius) - 3px);
}
.gs-state-ok{color:var(--pass);border:1px solid var(--pass);}
.gs-state svg{display:block;width:11px;height:11px;flex:0 0 auto;}
.gs-state svg path{fill:none;stroke:var(--pass);stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round;}

/* the sentence: the one prose moment inside the card */
.gs-card-b{padding:0;}
.gs-say{
  margin:0;padding:clamp(1.4rem,2.6vw,1.9rem) 1.4rem clamp(1.6rem,3vw,2.1rem);
  font-family:var(--prose);font-weight:500;letter-spacing:-.024em;
  font-size:clamp(1.38rem,2.7vw,2.05rem);line-height:1.22;
  color:var(--ink);max-width:27ch;text-wrap:pretty;
}

/* THE ROW STRUCTURE IS THE DESIGN (canonical brief).
   Four bands stacked, never a 3-across grid of six equal cells:

     APPROVED BY                                     <- full width, alone
     IMPLEMENTATION        | EVIDENCE                <- a 2-up pair
     HAZARDS               | KNOWN ISSUES            <- a 2-up pair
     DEPENDS ON                                      <- full width, alone

   The two lone rows are what make the card read as a record rather than a
   dashboard: the approver opens it and the dependencies close it, and the two
   pairs in between are the only things that belong side by side. */
.gs-facets{display:block;margin:0;border-top:1px solid var(--hair);}
.gs-facets > *{border-bottom:1px solid var(--hair);}
.gs-facets > *:last-child{border-bottom:0;}
.gs-facet{padding:1rem 1.3rem 1.1rem;min-width:0;}
.gs-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
.gs-pair > .gs-facet + .gs-facet{border-left:1px solid var(--hair);}
.gs-flab{
  display:flex;align-items:center;gap:.55em;margin:0 0 .5rem;max-width:none;
  font-family:var(--mono);font-size:.63rem;font-weight:500;
  letter-spacing:.13em;text-transform:uppercase;
  color:var(--unknown,var(--muted));
}
.gs-flab::before{content:"";flex:0 0 auto;width:6px;height:6px;background:var(--hair-strong);}
.gs-facet.is-ok .gs-flab{color:var(--pass);}
.gs-facet.is-ok .gs-flab::before{background:var(--pass);}
.gs-facet.is-bad .gs-flab{color:var(--fail);}
.gs-facet.is-bad .gs-flab::before{background:var(--fail);}
.gs-facet.is-dep .gs-flab::before{background:var(--unknown,var(--muted));}
.gs-fval{
  margin:0;font-family:var(--mono);font-size:.85rem;line-height:1.5;
  color:var(--ink);overflow-wrap:anywhere;
}
.gs-fdim{color:var(--unknown,var(--muted));}
.gs-path{border-bottom:1px solid var(--hair);padding-bottom:.05em;}
.gs-n{
  font-size:1.24rem;font-weight:600;letter-spacing:-.03em;
  font-variant-numeric:tabular-nums;line-height:1;
}
.gs-facet.is-ok .gs-n{color:var(--pass);}
/* dependency IDs are structure, not state: --unknown, never the accent */
.gs-dep{
  display:inline-block;margin:0 .32rem .3rem 0;padding:.16rem .42rem;
  border:1px solid var(--hair);border-radius:calc(var(--radius) - 3px);
  font-size:.76rem;color:var(--unknown,var(--muted));white-space:nowrap;
}

.gs-card-f{
  max-width:none;
  display:flex;align-items:baseline;justify-content:space-between;
  gap:.4rem 1.4rem;flex-wrap:wrap;
  padding:.68rem 1.4rem .72rem;background:var(--paper);border-top:1px solid var(--hair);
  font-family:var(--mono);font-size:.66rem;font-weight:500;
  letter-spacing:.11em;text-transform:uppercase;color:var(--unknown,var(--muted));
}
.gs-card-f .gs-path{border-bottom-color:var(--hair);color:var(--ink-60);}

/* the pairs survive down to the phone: two short mono values sit happily in a
   180px column, and collapsing them would flatten the card into six identical
   rows, which is the shape the canonical brief rules out */
@media (max-width:560px){
  .gs-say{padding-left:1.05rem;padding-right:1.05rem;}
  .gs-card-h,.gs-card-f{padding-left:1.05rem;padding-right:1.05rem;}
  .gs-facet{padding:.85rem 1.05rem .9rem;}
}
@media (max-width:400px){
  /* below this the EVIDENCE test name cannot hold a column, so the pairs stack
     and each half keeps its own hairline */
  .gs-pair{grid-template-columns:1fr;}
  .gs-pair > .gs-facet + .gs-facet{border-left:0;border-top:1px solid var(--hair);}
}

/* ==========================================================================
   THE MODEL, stated once: the seven relations
   The card carries six of them as rows; "described by DOCS" has no row, so the
   legend is what makes the model complete. Kept to micro mono chips on purpose
   — it is a key to the card above it, not a second artifact.
   ========================================================================== */
.gs-rel{margin:clamp(1.5rem,2.6vw,2.1rem) 0 0;}
.gs-rel-h{
  margin:0 0 .7rem;max-width:none;
  display:flex;align-items:center;gap:.55em;
  font-family:var(--mono);font-size:.66rem;font-weight:500;
  letter-spacing:.17em;text-transform:uppercase;color:var(--unknown,var(--muted));
}
.gs-rel-h::before{content:"";flex:0 0 auto;width:6px;height:6px;background:var(--hair-strong);}
.gs-rel-legend{
  display:flex;flex-wrap:wrap;gap:.4rem .45rem;margin:0;max-width:none;
}
.gs-rk{
  font-family:var(--mono);font-size:.64rem;line-height:1.4;letter-spacing:.04em;
  color:var(--unknown,var(--muted));
  border:1px solid var(--hair);border-radius:calc(var(--radius) - 3px);
  padding:.24rem .5rem;white-space:nowrap;
}
.gs-rk b{font-weight:600;letter-spacing:.11em;color:var(--ink-60);}

/* ==========================================================================
   THESIS ONE  (never in the hero; the visitor has just met one requirement)
   A mid-page statement, deliberately set BELOW the intent section's signature
   line so the page still has one loudest sentence per screen.
   ========================================================================== */
.gs-thesis{
  margin:clamp(2.4rem,4.4vw,3.4rem) 0 0;padding-top:clamp(1.4rem,2.4vw,2rem);
  border-top:1px solid var(--hair);
  font-family:var(--prose);font-weight:500;letter-spacing:-.02em;
  font-size:clamp(1.24rem,2.1vw,1.68rem);line-height:1.32;
  max-width:44ch;color:var(--ink);text-wrap:pretty;
}
@media (max-width:400px){
  .gs-rk{white-space:normal;}
}

/* ==========================================================================
   SECTION 3 . code graph vs intent graph
   The asymmetry is the argument, so the right panel gets more room.
   ========================================================================== */
.gs-cmp{margin:2.4rem 0 0;}
.gs-panels{
  display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
  gap:0;align-items:start;
}
.gs-panel{min-width:0;}
.gs-panel-a{padding:0 clamp(1.2rem,3vw,2.4rem) 0 0;}
.gs-panel-b{
  padding:0 0 0 clamp(1.2rem,3vw,2.4rem);
  border-left:1px solid var(--hair);
}
.gs-panel-h{
  margin:0 0 .22rem;font-family:var(--mono);font-size:.74rem;font-weight:600;
  letter-spacing:.17em;text-transform:uppercase;color:var(--ink);
}
/* the code-graph panel is structure with nothing proving it: --unknown */
.gs-panel-a .gs-panel-h{color:var(--unknown,var(--muted));}
.gs-panel-sub{
  margin:0 0 1.1rem;font-family:var(--mono);font-size:.66rem;font-weight:500;
  letter-spacing:.11em;text-transform:uppercase;color:var(--unknown,var(--muted));
}
.gs-stage{min-width:0;}
.gs-svg{display:block;width:100%;height:auto;overflow:visible;}
.gs-cmp .gs-mobfig{display:none;}

/* figure ink: semantic stroke + fill classes (site.css supplies .st .thin) */
.fig .gs-unk .st{stroke:var(--unknown,var(--muted));}
.fig .st.gs-ok{stroke:var(--pass);}
.fig .st.gs-bad{stroke:var(--fail);}
.fig .gs-plate{fill:var(--card);stroke:none;}

/* figure type */
.fig .gs-fn{font-family:var(--mono);font-size:11.5px;letter-spacing:.02em;}
.fig .gs-unk text{fill:var(--unknown,var(--muted));}
.fig .gs-q{
  font-family:var(--prose);font-size:13px;font-weight:500;
  letter-spacing:-.012em;fill:var(--ink);
}
.fig .gs-leaf{
  font-family:var(--mono);font-size:10.6px;font-weight:600;
  letter-spacing:.14em;fill:var(--ink);
}
.fig .lbl.gs-rel{text-transform:none;letter-spacing:.02em;font-size:9.6px;fill:var(--ink-60);}
.fig .lbl.gs-det{text-transform:none;letter-spacing:.015em;font-size:9.4px;}
.fig .lbl.gs-tok,.fig .gs-leaf.gs-tok{fill:var(--pass);}
.fig .lbl.gs-tbad,.fig .gs-leaf.gs-tbad{fill:var(--fail);}

/* the signature line. Set large: it is the page's best contrast. */
.gs-signature{
  margin:clamp(2.6rem,5vw,3.9rem) 0 0;padding-top:clamp(1.5rem,2.6vw,2.2rem);
  border-top:1px solid var(--hair);
  font-family:var(--prose);font-weight:500;letter-spacing:-.026em;
  font-size:clamp(1.5rem,3.5vw,2.65rem);line-height:1.16;
  max-width:36ch;text-wrap:pretty;
}
.gs-sig-a{display:block;color:var(--ink-60);}
.gs-sig-b{display:block;margin-top:.28em;color:var(--ink);}

@media (max-width:900px){
  .gs-panels{grid-template-columns:1fr;gap:2.2rem;}
  .gs-panel-a{padding:0 0 2rem;border-bottom:1px solid var(--hair);}
  .gs-panel-b{padding:0;border-left:0;}
  /* the code graph stays narrow: its thinness is half the argument */
  .gs-panel-a .gs-svg{max-width:270px;}
  .gs-cmp .gs-deskfig{display:none;}
  .gs-cmp .gs-mobfig{display:block;}
  /* the SVG shrinks, so the user-unit type grows to hold its rendered size */
  .fig .gs-fn{font-size:12.6px;}
  .fig .gs-q{font-size:14.6px;}
  .fig .gs-leaf{font-size:11.4px;letter-spacing:.11em;}
  .gs-cmp .lbl{font-size:10.4px;letter-spacing:.08em;}
  .fig .lbl.gs-rel{font-size:10.6px;}
  .fig .lbl.gs-det{font-size:11.2px;}
}

/* ==========================================================================
   SECTION 4 . blast radius, interactive
   Selection is --signal (an affordance). What the selection puts at risk is
   --stale. Everything outside the radius is --unknown.
   ========================================================================== */
.gs-rad{margin:2rem 0 0;}
.gs-hint{
  display:flex;align-items:center;gap:.6em;flex-wrap:wrap;margin:0 0 1.1rem;
  max-width:none;
  font-family:var(--mono);font-size:.7rem;font-weight:600;
  letter-spacing:.13em;text-transform:uppercase;color:var(--signal);
}
.gs-hint-dot{
  flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--signal);
  animation:gs-pulse 1.9s ease-out 3;
}
@keyframes gs-pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(var(--signal-rgb),0);}
  40%{box-shadow:0 0 0 6px rgba(var(--signal-rgb),.22);}
}
@media (prefers-reduced-motion:reduce){ .gs-hint-dot{animation:none;} }
.gs-hint-t{flex:0 0 auto;}
.gs-hint-x{color:var(--unknown,var(--muted));font-weight:500;letter-spacing:.09em;}
.gs-hint-x::before{content:"\00b7";margin-right:.6em;color:var(--hair-strong);}

.gs-stage-rad{min-width:0;}
.gs-rad .gs-mob{display:none;}

/* ---- node + edge states ---- */
.gs-rad .rn,.gs-rad .rw{transition:opacity .28s ease;}
.gs-rad .rn .st,.gs-rad .rw .st{transition:stroke .28s ease,stroke-width .28s ease;}
.gs-rad .rn text{transition:fill .28s ease;}

/* outside the radius: inactive structure */
.gs-rad .rn .st,.gs-rad .rw .st{stroke:var(--unknown,var(--muted));}
.gs-rad .rn text{fill:var(--unknown,var(--muted));}
.gs-rad .rn:not(.on):not(.is-sel),
.gs-rad .rw:not(.on){opacity:.55;}

/* inside the radius: promises that may now need re-proving.
   AMBER DOSAGE. Selecting REQ-042 lights seven nodes at once, and this is the
   only place on the page that could shout. So the lit state is STROKE ONLY —
   the amber plate wash that used to fill every lit node is gone — and the two
   lower tiers (components, public surface) carry the amber at reduced strength,
   so the amber reads as one gradient outward from the selection instead of
   seven equal blocks. */
.gs-rad .rn.on .st,.gs-rad .rw.on .st{stroke:var(--stale,var(--fail));}
.gs-rad .rw.on .st{stroke-opacity:.72;}
.gs-rad .rn.on .gs-node{fill:var(--ink);}
.gs-rad .rn-cmp.on .st,.gs-rad .rn-api.on .st{stroke-opacity:.62;}
.gs-rad .rn-cmp.on .gs-node,.gs-rad .rn-api.on .gs-node{fill:var(--ink-60);}

/* the selection itself: the one legitimate use of the accent */
.gs-rad .rn.is-sel .st{stroke:var(--signal);stroke-width:2.6;}
.gs-rad .rn.is-sel .gs-plate{fill:var(--signal);fill-opacity:.08;}
.gs-rad .rn.is-sel .gs-node{fill:var(--ink);}

/* the affordance: a pointer, a corner bracket, a hover and a focus ring */
.gs-rad .rn.is-pick{cursor:pointer;}
.fig .gs-pick{fill:none;stroke:var(--signal);stroke-width:1.7;stroke-linecap:round;opacity:.55;}
.gs-rad .rn.is-sel .gs-pick,.gs-rad .rn.is-pick:hover .gs-pick{opacity:1;}
.gs-rad .rn.is-pick:hover .st{stroke:var(--signal);}
.gs-rad .rn.is-pick:hover .gs-node{fill:var(--ink);}
.gs-rad .rn.is-pick:focus{outline:none;}
.gs-rad .rn.is-pick:focus-visible{outline:2px solid var(--signal);outline-offset:4px;}
.gs-rad .rn.is-pick:focus-visible .st{stroke:var(--signal);stroke-width:2.6;}

.fig .gs-node{
  font-family:var(--mono);font-size:13px;font-weight:600;letter-spacing:.09em;
}
.gs-rad .gs-mob .gs-node{font-size:12px;letter-spacing:.05em;}
.fig .lbl.gs-row{font-size:8.8px;letter-spacing:.15em;}

/* ---- the readout ---- */
.gs-read{
  margin:clamp(1.6rem,3vw,2.3rem) 0 0;padding:1.05rem 1.35rem 1.15rem;
  background:var(--card);border:1px solid var(--hair-strong);border-radius:var(--radius);
  transition:border-color .3s ease,background-color .3s ease;
}
.gs-read.is-upd{border-color:var(--signal);}
.gs-read-h{
  display:flex;align-items:center;gap:.6em;flex-wrap:wrap;margin:0 0 .65rem;
  max-width:none;
  font-family:var(--mono);font-size:.66rem;font-weight:600;
  letter-spacing:.17em;text-transform:uppercase;color:var(--unknown,var(--muted));
}
/* the swatch ties the readout to the lit nodes above it */
.gs-read-h::before{
  content:"";flex:0 0 auto;width:7px;height:7px;background:var(--stale,var(--fail));
}
.gs-read-for{color:var(--signal);letter-spacing:.1em;}
.gs-read-v{
  margin:0;max-width:none;font-family:var(--mono);font-size:.9rem;line-height:1.9;
  letter-spacing:.02em;color:var(--ink-60);
}
.gs-read-v .gs-t{white-space:nowrap;}
.gs-read-v .gs-rn{
  font-size:1.6em;font-weight:600;letter-spacing:-.03em;line-height:1;
  font-variant-numeric:tabular-nums;color:var(--ink);margin-right:.18em;
}
.gs-read-v i{font-style:normal;color:var(--hair-strong);padding:0 .28em;}

@media (max-width:760px){
  .gs-rad .gs-desk{display:none;}
  .gs-rad .gs-mob{display:block;}
  .gs-read-v{font-size:.84rem;}
}
@media (max-width:420px){
  .gs-hint{font-size:.64rem;letter-spacing:.09em;}
  .gs-hint-x{display:none;}
}

/* ==========================================================================
   THEME POLISH
   Geometry and weight only. Hue always comes from the tokens above.
   ========================================================================== */

/* ---- brutal: hard plates, thick rules, no softness ---- */
html[data-theme="brutal"] .gs-card,
html[data-theme="brutal"] .gs-read{
  border:3px solid #000;border-radius:0;box-shadow:8px 8px 0 #000;
}
html[data-theme="brutal"] .gs-card:hover{transform:none;box-shadow:8px 8px 0 #000;}
html[data-theme="brutal"] .gs-card-h{border-bottom:3px solid #000;background:#E8FF2A;}
html[data-theme="brutal"] .gs-card-f{border-top:3px solid #000;}
html[data-theme="brutal"] .gs-facets{border-top:3px solid #000;}
html[data-theme="brutal"] .gs-facets > *{border-bottom:3px solid #000;}
html[data-theme="brutal"] .gs-facets > *:last-child{border-bottom:0;}
html[data-theme="brutal"] .gs-pair > .gs-facet + .gs-facet{border-left:3px solid #000;}
html[data-theme="brutal"] .gs-rk{border-width:2px;border-radius:0;}
html[data-theme="brutal"] .gs-state,
html[data-theme="brutal"] .gs-dep{border-width:2px;border-radius:0;}
html[data-theme="brutal"] .gs-say,
html[data-theme="brutal"] .gs-signature{
  font-family:"Bricolage Grotesque",var(--sans);font-weight:800;
  text-transform:uppercase;line-height:1.04;letter-spacing:-.02em;
}
html[data-theme="brutal"] .gs-panel-b{border-left:3px solid #000;}
html[data-theme="brutal"] .gs-hint-dot{border-radius:0;}
html[data-theme="brutal"] .gs-read-h::before{border:2px solid #000;}
/* the theme's marker swipe on p b must not reach the mock surface */
html[data-theme="brutal"] .gs-card b,
html[data-theme="brutal"] .gs-read b{background:none;box-shadow:none;}

/* ---- terminal: square, flat, phosphor glow; prose stays a real sans ---- */
html[data-theme="terminal"] .gs-card,
html[data-theme="terminal"] .gs-read,
html[data-theme="terminal"] .gs-state,
html[data-theme="terminal"] .gs-rk,
html[data-theme="terminal"] .gs-dep{border-radius:0;}
html[data-theme="terminal"] .gs-card{
  border-color:var(--hair-strong);box-shadow:0 0 30px rgba(43,255,111,.1);
}
html[data-theme="terminal"] .gs-card:hover{transform:none;}
html[data-theme="terminal"] .gs-card-h,
html[data-theme="terminal"] .gs-card-f{background:#050807;}
html[data-theme="terminal"] .gs-read{box-shadow:inset 0 0 34px rgba(43,255,111,.04);}
html[data-theme="terminal"] .gs-hint-dot{border-radius:0;}

/* ---- night: the card needs a little more lift off the ground ---- */
html[data-theme="night"] .gs-card{box-shadow:0 26px 54px -30px rgba(0,0,0,.85);}
html[data-theme="night"] .gs-card-h,
html[data-theme="night"] .gs-card-f{background:#0E0F13;}

/* ---- riso / acid: the display face reaches the two large lines ---- */
html[data-theme="riso"] .gs-say,
html[data-theme="riso"] .gs-signature{font-family:"Bricolage Grotesque",var(--sans);font-weight:700;}
