/* ===========================================================================
   panels.css — section fields and scroll reveals.

   SCROLL MODEL: CONTINUOUS FLOW. Changed 2026-07-26.

   This file previously implemented stacked sticky panels — each section pinned
   to the top at exactly 100svh while the next rose over it, tilting as it
   arrived (inspired by thelinestudio.com). That is preserved in git at commit
   4178756 and can be restored wholesale.

   It was replaced because the agreed design reference is a conventional
   continuous scroll. Nothing on that reference pins or stacks;
   sections take the height their content needs and reveal as they enter view.
   The two models are mutually exclusive: pinning forces every section into one
   screen, which is what forced the animatics down to text links and split the
   work section apart. Continuous flow removes that constraint entirely.

   What carries over from the panel work: the colour fields, and the idea that
   each section owns a distinct ground.

   The motion now matches the reference's actual mechanics, read from its DOM:
     - sections rise in from translateY(30px) with a fade
     - headings reveal word by word, each word translateY(10px) -> 0
   Both are driven by IntersectionObserver in js/reveal.js — deliberately NOT
   scroll-driven animations, which this project already proved unreliable.
   =========================================================================== */

/* --- Section fields -------------------------------------------------------
   .panel-wrap / .panel class names are kept so the markup did not need
   rewriting. They are plain sections now, not panels. */

.stack { position: relative; }

.panel-wrap { position: relative; }

.panel {
  position: static;
  display: block;
  background: var(--color-bg);
  /* WAS a flat var(--space-3xl) = 5rem/80px top and bottom, at every width.
     That is 160px of pure padding per section, ten sections deep — about
     1,600px of empty page, and the single biggest source of dead space on
     the page. Now scales with the viewport: ~48px on a phone
     where it hurt most, ~70px at 1280, still 80px on a wide screen where the
     air is earned. Do not go back to a fixed value. */
  padding-block: clamp(3rem, 5.5vw, 5rem);
}

.panel__inner { width: 100%; }

/* Colour grounds */
.panel--hero   { background: var(--block-hero-bg);   color: var(--block-hero-fg); }
.panel--paper  { background: var(--block-paper-bg); }
.panel--tint   { background: var(--block-tint-bg); }
.panel--peach  { background: var(--c-peach);         color: var(--c-plum-ink); }
.panel--dark   { background: var(--block-dark-bg);   color: var(--block-dark-fg); }

.panel--hero .h-duo__label,
.panel--dark .h-duo__label { color: var(--c-cream); }

.panel--hero .h-duo__rest,
.panel--dark .h-duo__rest { color: var(--c-peach); }

/* --- Muted text is per-ground, not global -------------------------------
   --color-text-muted (#7D6C76) was tuned against --c-paper alone, where it
   measures 4.75:1. It is used at 10-12px, so it needs 4.5:1 everywhere — and
   it does not get there on the warmer grounds. Measured:

     on --c-paper (#FDFBF6)   4.75:1   pass
     on --c-tint  (#F6EDE7)   4.25:1   FAIL
     on --c-peach (#EFBEA3)   2.94:1   FAIL

   Overriding the token per ground keeps the "quiet secondary text" intent
   while letting each field carry a tone that actually clears AA on it.
   Re-measure at 10px if any of these grounds change. */
.panel--tint  { --color-text-muted: #5E4E5A; }   /* 6.6:1 on tint, darkened 2026-08-18 with the global token */
.panel--peach { --color-text-muted: var(--c-plum); } /* 6.6:1 on peach */
.panel--hero,
.panel--dark  { --color-text-muted: var(--c-peach); } /* 6.5:1+ on both */

/* The hero carries more air than the rest, as on the reference. Made
   responsive 2026-08-18 alongside the base .panel padding — a fixed 80px top
   was the same dead-space problem, and it is the FIRST thing on the page. */
.panel--hero { padding-block: clamp(3rem, 5.5vw, 5rem) 0; }

/* --- The section that leads with media -----------------------------------
   Only the showreel, and only since it moved directly beneath the hero on
   2026-07-27. Tighter top padding so it reads as a continuation of the hero
   rather than as a separate stop — the reader should fall out of the
   statement straight into the reel.

   ON THE HEIGHT BAND — RESTATED 2026-08-10, because the old note had gone
   stale. It claimed every section but this one lands between 0.62 and 0.84
   viewports, with the showreel as the single deliberate outlier at 1.31. That
   described a page with six sections. It now has ten, and four break the band.
   Re-measured at 1280x800:

     home              0.68        elemental-heroes  0.69
     showreel          1.18        exercises         0.67
     work              0.72        three-d           0.75
     melancholy-love   1.43  <-    characters        1.16  <-
     about             1.14  <-    contact           0.65

   Total: 9.79 viewports, against the ~5.4 of the reference and the 7.3 that
   originally prompted the --space-3xl cut from 7rem.

   THE BAND IS NO LONGER THE INVARIANT. What replaces it: a section may run
   past ~1.0 viewports ONLY when the overrun is artwork rather than padding.
   All four qualify — the showreel is a 641px 16:9 video, melancholy-love
   carries the character wheel plus its caption, characters carries the
   14-panel selector, and about is two columns of Ruby's own prose. None of
   them is tall because of whitespace.

   That is the test to apply to a new section, and the reason not to "correct"
   any of these: bringing them into band would mean capping the media, which
   shrinks the work the site exists to show. The media is the hero here, and
   stays that way. A section being tallest because the artwork is biggest is designed
   emphasis, not an irregularity. */
/* Responsive since 2026-08-18, same reason as .panel — the ratio between the
   two values is preserved, only the fixed pixel floor is gone. */
.panel--media-lead { padding-block: clamp(2.75rem, 5vw, 4.5rem) clamp(3rem, 5.5vw, 5rem); }

/* The veil only existed to shade a panel being covered by the next one.
   Nothing covers anything now. */
.panel__veil { display: none; }

/* --- Ticker sits in normal flow ------------------------------------------ */
.panel .ticker {
  position: static;
  margin-top: var(--space-2xl);
  border-top: 1.5px solid var(--c-plum-ink);
  border-bottom: 1.5px solid var(--c-plum-ink);
}

/* --- Two-column section layout ------------------------------------------- */
.panel-split {
  display: grid;
  gap: var(--space-l) var(--space-xl);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 56rem) {
  .panel-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* Media is no longer height-capped — sections grow to fit their content, so
   nothing can become unreachable. */
.panel-media { border-radius: var(--radius-media); }

/* ===========================================================================
   SCROLL REVEALS — MOVED TO css/motion.css.

   This file used to own the reveal states. They now live in css/motion.css,
   which loads after this one and owns the whole motion system: entrance
   choreography, scroll-linked depth, the two signature moments, and hover.

   They moved because a single reveal rule — everything translateY(30px) over
   0.7s — could not express what the motion needed to do. Distance now scales
   with the visual mass of the element, siblings stagger in reading order, and
   headings no longer carry a transform at all; their word spans do.

   That last point also fixed a real defect. `.panel-split` and its children
   were BOTH reveal targets, so 16 of 39 elements compounded two transforms
   and travelled 60px while their neighbours travelled 30px. The media panels
   — the largest things on the page — were the worst affected.

   What has NOT changed, and must not:
     - the fail-visible contract (.js-reveal is added by JS before anything
       hides — see the header of js/reveal.js)
     - IntersectionObserver, not scroll-driven animation, for anything
       structural
     - no margin between words; js/reveal.js inserts a real space text node,
       so the accessible string stays intact
   =========================================================================== */
