/* ------------------------------------------------------------------
   BisonTongue — HERO COLOUR treatments
   Five ways to put colour into the headline band and the hero split,
   switched from Tweaks ▸ Hero ▸ Colour. Default is "none" — the
   shipped near-monochrome.

   Rules every treatment obeys:
     · near-monochrome ground, one warm accent — no second hue
     · nothing competes with the ASCII render; it stays the loudest
       thing on the page
     · each treatment touches BOTH sections, so the headline band and
       the split read as one hero rather than two stacked ideas

   The headline hook is <span class="hl-2"> around the final clause.
   It carries no colour of its own.
   ------------------------------------------------------------------ */

/* ---------------- base: everything the headline panel can drive ----------------
   Declared BEFORE the treatments so a treatment still wins where it
   sets the same property. Defaults are the shipped values, so the
   panel opens changing nothing. */
:root{
  --hl-scale: 1;
  --hl-weight: 800;
  --hl-track: -.045em;
  --hl-lead: .94;
  --hl-case: none;
  --hl-align: left;
  --hl-ink: var(--forest);
  --hl-meas-v: 24ch;
  --hl-pt: 70px;                /* signed off 2026-08-20 — was 34 */
  --hl-pb: 70px;                /* signed off 2026-08-20 — was 30 */
  --hl-bg: var(--ground);       /* explicit, not transparent — see panelkit hexOf */
  --hl-bw: 1px;
  --hl-bc: var(--rule);
  --g-ang: 0deg;                /* signed off 2026-08-20 */
  --g-midp: 44%;                /* signed off 2026-08-20 */
  --g-lo: #6E9268;              /* seeded defaults for the gradient stops, */
  --g-mid: #3F5439;             /* so Reset writes something sane rather */
  --g-hi: #16281B;              /* than #000000 */
  --hs-l: 26%;                  /* signed off 2026-08-20 */
  --hs-div: var(--rule);
  --hs-heat: 15;
}

.hl-2{ color:inherit; transition:color .3s ease; }

.headline{
  position:relative;
  padding:var(--hl-pt) var(--gutter) var(--hl-pb);
  background:var(--hl-bg);
  border-bottom:var(--hl-bw) solid var(--hl-bc);
  text-align:var(--hl-align);
}
/* .headline prefix (2026-10-28): tweak.css's display-weight rule loads later
   at equal specificity and was silently overriding the Headline panel's
   Weight. One owner per property — the headline belongs to this panel. */
.headline h1.mega{
  font-size:calc(var(--fs-d1) * var(--hl-scale));
  font-weight:var(--hl-weight);
  letter-spacing:var(--hl-track);
  line-height:var(--hl-lead);
  text-transform:var(--hl-case);
  color:var(--hl-ink);
}
/* measure is a relationship, not a number — off means full bleed */
html[data-hl-meas="on"] h1.mega{ max-width:var(--hl-meas-v); }
html[data-hl-meas="on"][data-hl-align="center"] h1.mega{ margin-left:auto; margin-right:auto; }

.split{ grid-template-columns:minmax(300px, var(--hs-l)) 1fr; }
.pane-l{ border-right-color:var(--hs-div); }

/* ============ 1 · CLAUSE — accent the last clause, nothing else ============
   The smallest possible move. Colour appears once in the headline and
   once in the render pane's tag, so the eye links the two. */
html[data-hero-hue="clause"] .hl-2{ color:var(--ochre); }
html[data-hero-hue="clause"] .stage__tag{ color:var(--ochre); border-color:color-mix(in srgb, var(--ochre) 34%, var(--rule)); }
html[data-hero-hue="clause"] .index__btn[aria-selected="true"] .sq{ background:var(--ochre); }

/* ============ 2 · BAND — the headline sits in warm light ============
   A wash under the headline only. The split keeps the cool ground, so
   the hairline between them reads as a change of climate. */
html[data-hero-hue="band"] .headline{
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--ochre) 7%, var(--ground)) 0%,
    var(--ground) 100%);
  border-bottom-color:color-mix(in srgb, var(--ochre) 30%, var(--rule));
}
html[data-hero-hue="band"] .hl-2{ color:color-mix(in srgb, var(--ochre) 82%, var(--forest)); }
html[data-hero-hue="band"] .pane-l{
  background:linear-gradient(180deg, color-mix(in srgb, var(--ochre) 4%, var(--ground)), var(--ground) 42%);
}

/* ============ 3 · RULE — colour only in the lines ============
   No fills anywhere. The headline's baseline rule and the split's
   divider ignite from the left and fade out. Closest to the drafting
   language the rest of the site already speaks. */
html[data-hero-hue="rule"] .headline{ border-bottom-color:transparent; }
html[data-hero-hue="rule"] .headline::after{
  content:''; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background:linear-gradient(90deg, var(--ochre) 0%, color-mix(in srgb, var(--ochre) 40%, var(--rule)) 34%, var(--rule) 68%);
}
html[data-hero-hue="rule"] .pane-l{ border-right-color:transparent; background-image:linear-gradient(180deg, var(--ochre), color-mix(in srgb, var(--ochre) 30%, var(--rule)) 30%, var(--rule) 72%); background-size:1px 100%; background-position:100% 0; background-repeat:no-repeat; }
html[data-hero-hue="rule"] .controls{ border-top-color:color-mix(in srgb, var(--ochre) 26%, var(--rule)); }

/* ============ 4 · SUBJECT — the instrument drives the accent ============
   The live subject sets the accent for the whole hero, so clicking the
   index recolours the headline. Three values of one family rather than
   three hues: fire is the warm one, which is the point.
   Uses :has() to read the instrument's own aria-selected state. */
html[data-hero-hue="subject"] .split{ --sub: var(--hero-accent); }
html[data-hero-hue="subject"] .split:has(#tab-wildfire[aria-selected="true"]){ --sub: var(--ochre); }
html[data-hero-hue="subject"] .split:has(#tab-climate[aria-selected="true"]){  --sub: var(--sage-ink); }
html[data-hero-hue="subject"] .index__btn[aria-selected="true"]{ color:var(--sub); }
html[data-hero-hue="subject"] .index__btn[aria-selected="true"] .sq{ background:var(--sub); }
html[data-hero-hue="subject"] .stage__tag{ color:var(--sub); border-color:color-mix(in srgb, var(--sub) 38%, var(--rule)); }
html[data-hero-hue="subject"] .seg button[aria-pressed="true"]{ background:var(--sub); }
/* the headline follows the instrument — same three states, one step up */
html[data-hero-hue="subject"] .hl-2{ color:var(--hero-accent); }
html[data-hero-hue="subject"] main:has(#tab-wildfire[aria-selected="true"]) .hl-2{ color:var(--ochre); }
html[data-hero-hue="subject"] main:has(#tab-climate[aria-selected="true"])  .hl-2{ color:var(--sage-ink); }

/* ============ 5 · HEAT — the field glows at its core ============
   A soft warm bloom behind the densest part of the render. The typed
   characters are untouched; the light is behind them. Reads as the
   storm having a temperature. */
html[data-hero-hue="heat"] .stage::before{
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(58% 62% at 50% 46%,
    color-mix(in srgb, var(--ochre) calc(var(--hs-heat) * 1%), transparent) 0%,
    color-mix(in srgb, var(--ochre) calc(var(--hs-heat) * 0.34%), transparent) 42%,
    transparent 72%);
}
html[data-hero-hue="heat"] .render{ position:absolute; z-index:1; }
html[data-hero-hue="heat"] .stage__read{ color:var(--ochre); }
html[data-hero-hue="heat"] .hl-2{ color:color-mix(in srgb, var(--ochre) 70%, var(--forest)); }
html[data-hero-hue="heat"] .headline{
  background:radial-gradient(120% 180% at 76% 100%,
    color-mix(in srgb, var(--ochre) 8%, var(--ground)) 0%, var(--ground) 60%);
}

@media (prefers-reduced-motion: reduce){ .hl-2{ transition:none; } }

/* ==================================================================
   GRADIENT-TEXT treatments
   A gradient filling the final clause of the headline, with the hero
   split picking up the same light stop so the two read as one.

   These are a deliberate departure from "one warm accent": sage and
   ice introduce a second hue. Solar stays inside the warm family.

   Light stops were chosen against the 3:1 large-text floor on the
   #fffdfa ground, not by eye — the pale versions of each of these
   (#9CC095, #E8C468, #8FB4C9) all land near 2:1 and fail. Every stop
   below passes at headline sizes.
   ================================================================== */

.hl-2{ -webkit-box-decoration-break:slice; box-decoration-break:slice; }

/* The gradient was the shipped default until 2026-10-28; the user cut it
   ("too much"), so the clause now sits in the headline's own ink and the
   gradient applies only when a grad-* treatment is chosen in the panel. */
html[data-hero-hue^="grad-"] .hl-2{
  color:var(--g-mid);                     /* fallback if clipping is unsupported */
  background-image:linear-gradient(
    calc(var(--g-ang) + var(--hl-sway, 0deg)),
    var(--g-lo) 0%, var(--g-mid) var(--g-midp), var(--g-hi) 100%);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent;
}
/* every non-gradient treatment paints flat ink again */
html[data-hero-hue="none"] .hl-2,
html[data-hero-hue="clause"] .hl-2,
html[data-hero-hue="band"] .hl-2,
html[data-hero-hue="rule"] .hl-2,
html[data-hero-hue="subject"] .hl-2,
html[data-hero-hue="heat"] .hl-2{
  background-image:none; -webkit-text-fill-color:currentColor; animation:none;
}
@supports not ((-webkit-background-clip:text) or (background-clip:text)){
  .hl-2{ -webkit-text-fill-color:currentColor; background-image:none; }
}

/* 6 · SAGE — a lighter green lifting into the forest ink */
html[data-hero-hue="grad-sage"]{ --g-lo:#6E9268; --g-mid:#3F5439; --g-hi:#16281B; }
html[data-hero-hue="grad-sage"] .index__btn[aria-selected="true"] .sq{ background:#6E9268; }
html[data-hero-hue="grad-sage"] .stage__tag{ color:#4F6B49; border-color:#B9CCB5; }
html[data-hero-hue="grad-sage"] .headline{ border-bottom-color:#C2D3BE; }

/* 7 · SOLAR — yellow falling into the house ochre */
html[data-hero-hue="grad-solar"]{ --g-lo:#B8892A; --g-mid:#9A5F1E; --g-hi:#16281B; }
html[data-hero-hue="grad-solar"] .index__btn[aria-selected="true"] .sq{ background:#B8892A; }
html[data-hero-hue="grad-solar"] .stage__tag{ color:#8E4419; border-color:#DCC9A8; }
html[data-hero-hue="grad-solar"] .headline{ border-bottom-color:#DFCFB2; }

/* 8 · ICE — cool blue cooling further into slate */
html[data-hero-hue="grad-ice"]{ --g-lo:#5C8AA8; --g-mid:#2E4453; --g-hi:#16281B; }
html[data-hero-hue="grad-ice"] .index__btn[aria-selected="true"] .sq{ background:#5C8AA8; }
html[data-hero-hue="grad-ice"] .stage__tag{ color:#3D6076; border-color:#B6C8D2; }
html[data-hero-hue="grad-ice"] .headline{ border-bottom-color:#BECDD6; }

/* 9 · SPECTRUM — all three, left to right across the clause.
   The loudest option here. Included so there's a top end to react to. */
html[data-hero-hue="grad-spectrum"] .hl-2{
  color:#3F5439;
  background-image:linear-gradient(var(--g-ang), #5C8AA8 0%, #6E9268 38%, #B8892A 72%, #8E4419 100%);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent;
}
html[data-hero-hue="grad-spectrum"] .index__btn[aria-selected="true"] .sq{ background:#6E9268; }
html[data-hero-hue="grad-spectrum"] .stage__tag{ color:#4F6B49; border-color:#C4CDC2; }

/* ==================================================================
   GRADIENT MOTION
   The ramp sways a few degrees rather than translating, so the stops
   stay pinned and only the angle breathes. Registered as an <angle>
   so it can be interpolated at all — an unregistered custom property
   would just snap between keyframes.

   var(--hl-sway, 0deg) carries a fallback, so where @property is
   unsupported the gradient still renders, just without the motion.
   ================================================================== */
@property --hl-sway{ syntax:'<angle>'; inherits:false; initial-value:0deg; }

:root{ --hl-sway-dur: 45s; }   /* signed off 2026-08-20 — was 26s */

.hl-2{ animation:hl-sway-s var(--hl-sway-dur) ease-in-out infinite alternate; }

@keyframes hl-sway-s{ from{ --hl-sway:-5deg; } to{ --hl-sway:5deg; } }
@keyframes hl-sway-m{ from{ --hl-sway:-11deg; } to{ --hl-sway:11deg; } }
@keyframes hl-sway-l{ from{ --hl-sway:-22deg; } to{ --hl-sway:22deg; } }

html[data-hl-motion="soft"] .hl-2{ animation-name:hl-sway-m; }
html[data-hl-motion="wide"] .hl-2{ animation-name:hl-sway-l; }
html[data-hl-motion="off"]  .hl-2{ animation:none; }

@media (prefers-reduced-motion: reduce){
  .hl-2{ animation:none !important; }
}
