/* ==========================================================================
   FORTHWAY — Components
   Nav, buttons, cards, marquee, process, work list, form, preloader.

   Animation rules followed throughout:
   - only transform and opacity are animated (GPU, skips layout + paint)
   - transition lists name exact properties, never `all`
   - hover effects are gated behind (hover: hover) so touch taps don't stick
   - nothing enters from scale(0) — real things don't appear from nothing
   ========================================================================== */

/* --- Preloader ----------------------------------------------------------- */

/* Hidden by default. Only shown once JS has confirmed it is running and can
   therefore also dismiss it. Without this gate, a no-JS visitor gets a black
   rectangle over the whole site forever. */
.preloader { display: none; }

[data-enhanced='true'] .preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  background: var(--ground);
  /* Exits as a wipe, not a fade — the page is revealed from the bottom up,
     which is exactly where the hero copy is waiting. */
  transition: transform 850ms var(--ease-drawer), visibility 850ms;
}

.preloader[data-done='true'] {
  transform: translateY(-100%);
  visibility: hidden;
}

.preloader__inner {
  display: grid;
  gap: var(--space-m);
  justify-items: start;
}

/* Wordmark slides up out of a clip while the bar fills below it. */
.preloader__brand {
  overflow: hidden;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 118;
  font-weight: 700;
  font-size: var(--step-3);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.preloader__brand span {
  display: block;
  transform: translateY(110%);
  animation: brand-up 700ms var(--ease-out) 120ms forwards;
}

@keyframes brand-up {
  to { transform: translateY(0); }
}

.preloader__bar {
  width: min(280px, 60vw);
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.preloader__fill {
  height: 100%;
  width: 100%;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms linear;
}

/* The counter runs huge in the corner — the one indulgence of the intro. */
.preloader__count {
  position: absolute;
  right: var(--gutter);
  bottom: var(--space-l);
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  font-size: var(--step-7);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .preloader__brand span { animation: none; transform: none; }
}

/* --- Header / nav -------------------------------------------------------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  /* Only transform + background-color animate. The blur is applied at rest
     so it never has to be composited mid-transition. */
  transition: transform var(--dur-ui) var(--ease-out),
              background-color var(--dur-ui) var(--ease-out);
}

.header[data-scrolled='true'] {
  background: rgba(14, 17, 22, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border);
}

/* Hide on scroll down, show on scroll up. */
.header[data-hidden='true'] { transform: translateY(-100%); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  width: 100%;
}

.logo {
  display: flex;
  transition: transform 200ms var(--ease-out);
  align-items: baseline;
  gap: var(--space-2xs);
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 118;
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: -0.02em;
}

.logo__mark {
  width: 9px;
  height: 9px;
  background: var(--amber);
  border-radius: 1px;
  /* The mark drifts right and resets — a two-second restatement of the
     brand idea. Runs on transform only, off the main thread. */
  animation: drift 2.4s var(--ease-in-out) infinite;
}

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  45%      { transform: translateX(5px); }
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}

.nav__link {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--fog);
  position: relative;
  padding-block: var(--space-3xs);
  transition: color var(--dur-hover) ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-hover) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover { color: var(--paper); }
  .nav__link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* SPECIFICITY NOTE: the toggle also carries .btn, which sets
   display: inline-flex and is declared later in this file. At equal
   specificity the later rule wins, so a bare `.nav__toggle { display: none }`
   loses and the Menu button appears on desktop. Qualifying with .nav raises
   specificity to (0,2,0) so it holds. This is the classic way these
   stylesheets quietly cancel each other out — check it whenever a component
   has two classes on it. */
.nav .nav__toggle { display: none; }

@media (max-width: 780px) {
  .nav__links {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--ground);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-l);
    transform: translateY(-100%);

    /* Without this the panel is a bug, not a menu. Translated up by its own
       height (~776px on a phone) its box spans y=-708 to y=68 — an opaque
       slab sitting exactly over the header bar, hiding the logo and the
       button that opens it. visibility:hidden takes it out of paint and out
       of the tab order while closed; the delay lets the slide-up finish
       before it disappears. */
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--dur-ui) var(--ease-drawer),
                visibility 0s linear var(--dur-ui);
  }

  .nav__links[data-open='true'] {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform var(--dur-ui) var(--ease-drawer),
                visibility 0s linear 0s;
    /* Don't let an overscrolled flick inside the panel rubber-band the
       page behind it. */
    overscroll-behavior: contain;
  }

  .nav .nav__toggle { display: inline-flex; }
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.85em 1.5em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform var(--dur-press) var(--ease-out),
              background-color var(--dur-hover) ease,
              border-color var(--dur-hover) ease,
              color var(--dur-hover) ease;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--amber);
  color: var(--ground);
  font-weight: 600;
}

.btn--ghost {
  border: 1px solid var(--line-bright);
  color: var(--paper);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #FFB459; }
  .btn--ghost:hover   { border-color: var(--amber); color: var(--amber); }
}

.btn__arrow {
  transition: transform var(--dur-hover) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__arrow { transform: translateX(3px); }
}

/* --- Cards --------------------------------------------------------------- */

.card {
  position: relative;
  padding: var(--space-m);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-ui) var(--ease-out),
              border-color var(--dur-ui) ease,
              background-color var(--dur-ui) ease;
}

/* The top hairline lights up on hover — a small state indication that the
   card is interactive, without moving anything the eye has to re-find. */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
    border-color: var(--line-bright);
    background: var(--surface-hi);
  }
  .card:hover::before { transform: scaleX(1); }
}

.card__index {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--fog-dim);
  margin-block-end: var(--space-s);
}

.card__title { margin-block-end: var(--space-2xs); }

.card__body {
  color: var(--fog);
  font-size: var(--step--1);
  line-height: 1.65;
}

.card__list {
  list-style: none;
  padding: 0;
  margin-block-start: var(--space-s);
  display: grid;
  gap: var(--space-3xs);
}

.card__list li {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--fog-dim);
  padding-inline-start: var(--space-s);
  position: relative;
}

.card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 1px;
  background: var(--cyan);
}

/* --- Stat block ---------------------------------------------------------- */

.stat__value {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 108;
  font-weight: 700;
  font-size: var(--step-4);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--fog-dim);
  margin-block-start: var(--space-2xs);
  letter-spacing: 0.06em;
}

/* --- Marquee ------------------------------------------------------------
   Constant motion, so easing is linear — anything else reads as a stutter
   at the loop point. Duplicated track means a seamless wrap with no JS. */

.marquee {
  overflow: hidden;
  border-block: var(--border);
  padding-block: var(--space-s);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: var(--space-l);
  animation: marquee 38s linear infinite;
}

.marquee__item {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--fog-dim);
  white-space: nowrap;
}

.marquee__dot { color: var(--amber); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .logo__mark     { animation: none; }
}

/* --- Process (numbered — the content genuinely is a sequence) ------------ */

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-m);
  padding-block: var(--space-m);
  border-top: var(--border);
}

.step__num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--amber);
  padding-block-start: 0.35em;
}

.step__title { margin-block-end: var(--space-2xs); }

.step__body {
  color: var(--fog);
  font-size: var(--step--1);
  max-width: 56ch;
}

/* --- Work list ----------------------------------------------------------- */

.work-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-m);
  padding-block: var(--space-m);
  border-top: var(--border);
  transition: padding-inline-start var(--dur-ui) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .work-item:hover { padding-inline-start: var(--space-s); }
  .work-item:hover .work-item__title { color: var(--amber); }
}

.work-item__title {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 105;
  font-weight: 700;
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  transition: color var(--dur-hover) ease;
}

.work-item__meta {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--fog-dim);
  margin-block-start: var(--space-3xs);
}

.work-item__tag {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  border-radius: 100px;
  padding: 0.3em 0.9em;
  white-space: nowrap;
}

/* --- Form ---------------------------------------------------------------- */

.field {
  display: grid;
  gap: var(--space-2xs);
  margin-block-end: var(--space-m);
}

.field__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-dim);
}

.field__input,
.field__textarea {
  width: 100%;
  padding: 0.85em 1em;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--paper);
  transition: border-color var(--dur-hover) ease,
              background-color var(--dur-hover) ease;
}

.field__input:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--surface-hi);
}

.field__textarea { resize: vertical; min-height: 130px; }

/* --- Scroll progress ----------------------------------------------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 150;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  /* No transition — this tracks scroll position directly. A transition here
     would make it lag behind the thing it is reporting on. */
}

/* --- Reveal on scroll ---------------------------------------------------
   Applied by js/modules/reveal.js. Elements start slightly displaced and
   transparent, never at scale(0). Stagger is set inline as --i. */

[data-enhanced='true'] [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 38ms);
}

[data-enhanced='true'] [data-reveal][data-visible='true'] {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-enhanced='true'] [data-reveal] { transform: none; }
  [data-enhanced='true'] [data-reveal][data-visible='true'] { transform: none; }
}

/* --- Split-text word reveals ---------------------------------------------
   js/modules/splittext.js wraps each word of a [data-split] element in
   .word > .word-inner. The outer span clips; the inner slides up out of
   the clip with a per-word stagger (--w set inline by the module).

   Two triggers:
   - hero: fires when the preloader releases (html[data-loading='false'])
   - everything else: fires with the standard reveal observer
     ([data-visible='true'], set by js/modules/reveal.js)

   The padding/negative-margin pair gives descenders (y, p, g) room inside
   the clip — the headings run line-height 0.95, tighter than the glyphs. */

[data-split] .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-block-end: 0.12em;
  margin-block-end: -0.12em;
}

[data-split] .word-inner {
  display: inline-block;
  transform: translateY(120%);
  transition: transform 600ms var(--ease-out);
  transition-delay: calc(var(--w, 0) * 30ms);
}

html[data-loading='false'] .hero [data-split] .word-inner,
[data-split][data-visible='true'] .word-inner {
  transform: translateY(0);
}

/* Elements that both reveal and split shouldn't ALSO slide as a block —
   the words carry the motion; the container only fades. */
[data-enhanced='true'] [data-reveal][data-split] { transform: none; }
[data-enhanced='true'] [data-reveal][data-split][data-visible='true'] { transform: none; }

/* --- Hero intro choreography ---------------------------------------------
   The supporting cast enters after the preloader wipe, staggered under the
   title's word cascade. Scoped to [data-enhanced] so a no-JS visitor gets
   everything immediately. */

[data-enhanced='true'] .hero__inner > .eyebrow,
[data-enhanced='true'] .hero__inner > .lede,
[data-enhanced='true'] .hero__inner > .hero__actions,
[data-enhanced='true'] .hero__inner > .hero__meta {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}

html[data-loading='false'] .hero__inner > .eyebrow,
html[data-loading='false'] .hero__inner > .lede,
html[data-loading='false'] .hero__inner > .hero__actions,
html[data-loading='false'] .hero__inner > .hero__meta {
  opacity: 1;
  transform: translateY(0);
}

html[data-loading='false'] .hero__inner > .eyebrow       { transition-delay: 250ms; }
html[data-loading='false'] .hero__inner > .lede          { transition-delay: 650ms; }
html[data-loading='false'] .hero__inner > .hero__actions { transition-delay: 780ms; }
html[data-loading='false'] .hero__inner > .hero__meta    { transition-delay: 920ms; }

@media (prefers-reduced-motion: reduce) {
  [data-enhanced='true'] .hero__inner > .eyebrow,
  [data-enhanced='true'] .hero__inner > .lede,
  [data-enhanced='true'] .hero__inner > .hero__actions,
  [data-enhanced='true'] .hero__inner > .hero__meta {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Custom cursor --------------------------------------------------------
   Injected by js/modules/cursor.js on fine-pointer devices only. The dot
   tracks exactly; the ring lags on a lerp and expands over interactive
   elements. Native cursor is hidden only once the replacement exists
   (html[data-cursor] is set by the module, not in markup). */

html[data-cursor='true'],
html[data-cursor='true'] * { cursor: none !important; }

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--amber);
  transition: opacity 200ms ease;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid rgba(255, 158, 44, 0.45);
  transition: opacity 200ms ease,
              width 250ms var(--ease-out),
              height 250ms var(--ease-out),
              margin 250ms var(--ease-out),
              background-color 250ms ease,
              border-color 250ms ease;
}

.cursor-dot[data-visible='true'],
.cursor-ring[data-visible='true'] { opacity: 1; }

.cursor-ring[data-active='true'] {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  background: var(--amber-glow);
  border-color: var(--amber);
}

/* --- Film grain -----------------------------------------------------------
   A fixed noise field over the whole page, shifted in steps so it flickers
   like print stock. SVG turbulence as a data URI — no asset request. */

.grain {
  position: fixed;
  inset: -100%;
  z-index: 300;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  animation: grain 7s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -8%); }
  30% { transform: translate(4%, -3%); }
  50% { transform: translate(-7%, 6%); }
  70% { transform: translate(6%, 4%); }
  90% { transform: translate(-3%, 7%); }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; opacity: 0.035; }
}

/* --- Card spotlight -------------------------------------------------------
   The glow centre (--mx/--my) is fed by js/modules/spotlight.js. ::before
   is taken by the top hairline, so the spotlight rides on ::after. */

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 158, 44, 0.09),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover::after { opacity: 1; }
}

/* --- Marquee velocity skew ------------------------------------------------
   js/modules/parallax.js writes an inline skewX on .marquee proportional
   to scroll velocity. Declared here so the compositor is warned. */

.marquee { will-change: transform; }

/* --- Logo byline ----------------------------------------------------------
   "by Kristian Wood", small, under the wordmark in the header and footer. */

.logo__text {
  display: flex;
  flex-direction: column;
}

/* The lockup: FORTHWAY in signage caps, a hairline, then SYSTEMS
   letterspaced wide beneath it. */
.logo__word {
  text-transform: uppercase;
  letter-spacing: 0.045em;
  line-height: 1;
}

.logo__sub {
  font-family: var(--font-mono);
  font-size: 0.46em;
  font-weight: 500;
  font-variation-settings: normal;
  text-transform: uppercase;
  /* The trailing tracking space would unbalance the centring; the hair
     of extra width on the right is invisible at this size. */
  letter-spacing: 0.42em;
  color: var(--fog-dim);
  border-top: 1px solid var(--line-bright);
  padding-block-start: 0.5em;
  margin-block-start: 0.45em;
  white-space: nowrap;
}

/* Preloader gets the same credit under the wordmark, fading in late so it
   reads second. */
.preloader__byline {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  color: var(--fog-dim);
  margin-block-start: calc(var(--space-m) * -0.5);
  opacity: 0;
  animation: byline-in 500ms var(--ease-out) 450ms forwards;
}

@keyframes byline-in {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader__byline { animation: none; opacity: 1; }
}

/* --- Scroll story (process section) ---------------------------------------
   js/modules/scrollstory.js sets html[data-story-on], strips the steps'
   [data-reveal], and drives --story-progress (0..1) plus per-step
   [data-active]. Without the attribute — no JS, reduced motion — none of
   this applies and the section flows normally.

   IN-FLOW, NOT PINNED. The pinned/scrubbed version got left behind by
   real scrolling twice in testing — the section now scrolls normally and
   each step lights up as it crosses ~72% of the viewport, so the
   animation is physically attached to the content. Works identically on
   mobile, so phones get the full treatment too. */

/* Progress rail: a hairline track with an amber fill that grows as the
   steps pass the activation line. Sits in the steps column's gutter. */
html[data-story-on] .story__steps { position: relative; padding-inline-start: var(--space-m); }

html[data-story-on] .story__steps::before,
html[data-story-on] .story__steps::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
}

html[data-story-on] .story__steps::before { background: var(--line); }

html[data-story-on] .story__steps::after {
  background: var(--amber);
  transform: scaleY(var(--story-progress, 0));
  transform-origin: top;
}

/* Steps: dimmed and pushed back until their moment arrives. */
html[data-story-on] .story__steps .step {
  opacity: 0.22;
  transform: translateX(14px);
  /* Fast — the scrub drives these, and a slow transition here means the
     light-up trails the scroll and finishes after the section releases. */
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

html[data-story-on] .story__steps .step[data-active='true'] {
  opacity: 1;
  transform: translateX(0);
}

html[data-story-on] .story__steps .step[data-active='true'] .step__num {
  color: var(--amber);
}

html[data-story-on] .story__steps .step .step__num {
  color: var(--fog-dim);
  transition: color 450ms ease;
}

/* "01 / 04" readout injected into the aside by the module. */
.story__readout {
  margin-block-start: var(--space-m);
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* --- Hero fallback (no WebGL) ---------------------------------------------
   If the flow shader can't start, main.js sets data-flow-fallback on the
   hero: hide the canvas and paint a static version of the same idea —
   amber energy left, cyan calm right — with plain gradients. */

.hero[data-flow-fallback] .hero__canvas { display: none; }

.hero[data-flow-fallback] {
  background:
    radial-gradient(90% 90% at 12% 68%, rgba(255, 158, 44, 0.16), transparent 60%),
    radial-gradient(80% 80% at 88% 40%, rgba(74, 222, 222, 0.10), transparent 55%),
    var(--ground);
}

/* --- Rule draw-in ---------------------------------------------------------
   The section hairline draws itself left-to-right on reveal instead of
   fading as a block. Overrides the default data-reveal translate. */

[data-enhanced='true'] .rule[data-reveal] {
  opacity: 1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms var(--ease-in-out);
}

[data-enhanced='true'] .rule[data-reveal][data-visible='true'] {
  transform: scaleX(1);
}

/* --- Work list: full-row fill hover ---------------------------------------
   The row floods amber from the bottom on hover and the text inverts to
   the ground colour — a much bigger state change than a colour swap,
   sized to how important these rows are. */

.work-item {
  position: relative;
  isolation: isolate;
  padding-inline: var(--space-s);
}

.work-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--amber);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 320ms var(--ease-drawer);
}

@media (hover: hover) and (pointer: fine) {
  .work-item:hover::before { transform: scaleY(1); }

  /* Inverted text takes over from the old amber-title hover. */
  .work-item:hover .work-item__title { color: var(--ground); }
  .work-item:hover .work-item__meta  { color: rgba(14, 17, 22, 0.72); }
  .work-item:hover .work-item__tag   {
    color: var(--ground);
    border-color: rgba(14, 17, 22, 0.45);
  }
}

.work-item__meta,
.work-item__tag { transition: color var(--dur-hover) ease, border-color var(--dur-hover) ease; }

/* Cursor suppressed over the hero — the glass lens is the cursor there. */
.cursor-dot[data-suppressed='true'],
.cursor-ring[data-suppressed='true'] { opacity: 0; }


/* --- Menu-open locks -------------------------------------------------------
   Set by js/modules/nav.js while the mobile menu is open. The scroll lock
   itself is done in JS (body position:fixed at -scrollY, which preserves
   the scroll position — overflow:hidden on the root resets iOS to top).

   The header must carry NONE of the properties that turn an ancestor
   into the containing block for position:fixed descendants — transform,
   filter, backdrop-filter. The menu panel is fixed INSIDE the header;
   any of these active (the scrolled header's blur, the hide/show
   transform) collapses the full-screen panel into the 68px header box. */

html[data-menu-open='true'] .header {
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
