/* ===========================================================================
   layout.css — header, colour blocks, grids, ticker, scalloped CTA, footer.
   Depends on tokens.css.
   =========================================================================== */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main { flex: 1 0 auto; }

/* ===========================================================================
   HEADER — flat, no shadow, no border radius. Sits on the hero colour.
   =========================================================================== */

/* TRANSLUCENT, from 2026-08-10. It was a solid mulberry slab that sat over
   five different colour grounds and stayed the same colour on all of them —
   so the hardest visual seam on the page was the chrome's own bottom edge
   rather than any of the section seams the design actually draws.

   Now the ground shows through and the header takes a tint from whatever it is
   over: warmer on peach, deeper over the near-black contact section. Content
   passing under it is legible-but-blurred, which is what makes a floating
   layer read as a layer rather than as a bar bolted to the top.

   ON THE ALPHA. 0.82 is not a taste value, it is the contrast floor. The nav
   sets 12px cream on this, so it needs 4.5:1 — the large-text allowance does
   not apply. Composited at 0.82, measured against every ground it crosses:

     over --c-paper    #FDFBF6   ~#874567   5.61:1
     over --c-tint     #F6EDE7   ~#864466   5.79:1
     over --c-peach    #EFBEA3   ~#843A58   6.33:1
     over --c-plum-ink #280D24   ~#611A42   9.95:1

   Lower the alpha and paper is the ground that fails first. Re-measure there
   if --c-cream or --block-hero-bg ever changes.

   NO saturate() in the filter, deliberately. It would push the backdrop's
   chroma before compositing and invalidate every number above — on peach most
   of all. Blur alone leaves the averages intact.

   The reduced-transparency fallback lives in base.css, beside the other
   preference queries, so all three sit in one place. */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--block-hero-bg);
  color: var(--block-hero-fg);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: color-mix(in srgb, var(--block-hero-bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: 3.75rem;
  padding-block: var(--space-2xs);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  text-decoration: none;
  color: inherit;
  /* Below 30rem the logo mark is hidden (see the query further down) and this
     link collapses to the wordmark's own line box — measured 18.6px at 390px,
     under the 24x24 WCAG 2.2 SC 2.5.8 asks for. 4px each side clears it. The
     header's min-height is 3.75rem and the brand tops out at 44px even with
     the mark showing, so this never changes the header's height. */
  padding-block: var(--space-3xs);
}

/* The logo is detailed character art and turns to mush below ~64px, so the
   wordmark does the reading and the mark is a
   small companion. */
.site-brand__mark { height: 2.25rem; width: auto; flex: none; }

.site-brand__name {
  font-size: var(--step-small);
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
  color: var(--block-hero-fg);
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-m);
  margin: 0; padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: var(--space-3xs) 0;
  color: var(--block-hero-fg);
  font-size: var(--step-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}

/* aria-current="true", not "page" — these are sections of one document, not
   separate pages. Set by js/nav-scroll.js as the reader scrolls. */
.site-nav a:hover,
.site-nav a[aria-current] { border-bottom-color: var(--block-hero-fg); }

/* ---------------------------------------------------------------------------
   READING PROGRESS — a 2px rule along the bottom of the sticky header.
   Reinforces that this is one continuous document rather than four pages.
   Decorative: the nav carries the real position information, and the bar is
   aria-hidden. Animated via transform only, so it never triggers layout.
   --------------------------------------------------------------------------- */
.progress {
  height: 2px;
  background: rgba(248, 234, 159, 0.18);
}

.progress__bar {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--c-peach);
  will-change: transform;
}

/* Below ~30rem the brand lockup plus four nav items overflow and the nav wraps
   to a second row (verified: item tops at 8px and 48px at 375px). Drop the logo
   mark rather than the wordmark — the mark is illegible at 36px anyway, so
   the wordmark is what actually identifies the site. */
@media (max-width: 30rem) {
  .site-brand__mark { display: none; }
  .site-nav ul { gap: var(--space-2xs) var(--space-s); }
}

/* ===========================================================================
   COLOUR BLOCKS — sections are full-bleed colour on a cream base, not white
   boxes floating on white. The single biggest change from the first pass.
   =========================================================================== */

.block { padding-block: var(--space-2xl); }

.block--hero {
  background: var(--block-hero-bg);
  color: var(--block-hero-fg);
  padding-block: var(--space-xl) var(--space-2xl);
}

.block--paper { background: var(--block-paper-bg); }
.block--tint  { background: var(--block-tint-bg); }

.block--dark {
  background: var(--block-dark-bg);
  color: var(--block-dark-fg);
}

.block--flush-bottom { padding-bottom: 0; }

/* Section head: two-tone heading on the left, pill link on the right. */
.block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
  margin-bottom: var(--space-l);
}

/* ---------------------------------------------------------------------------
   EYEBROW — numbered section label ("02 — Work") above each h2, and a small
   meta line above each work entry.

   These carry the hierarchy on a long single-page scroll. Section headings and
   entry headings share one type size on purpose (no intermediate scale step —
   see tokens.css), so the numbering is what tells the reader they have moved
   from one top-level section to the next.
   --------------------------------------------------------------------------- */
.eyebrow {
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2xs);
}

/* .work-entry and its two child rules were removed on 2026-07-28: zero uses in
   index.html. Each project became its own #id section with its own colour
   ground, so the hairline-separated entry inside one Work section no longer
   exists. The scroll-margin-top it carried is not lost — .block[id] and
   html { scroll-padding-top } handle header clearance for the real targets. */

/* ---------------------------------------------------------------------------
   HERO ACTIONS + SCROLL CUE — the page is one pass, so invite the scroll
   explicitly instead of leaving the nav as the only way down.
   --------------------------------------------------------------------------- */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  margin-top: var(--space-l);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-top: var(--space-2xl);
  color: var(--c-peach);
  text-decoration: none;
}

.scroll-cue__arrow {
  font-size: 1.1em;
  animation: cue-bob 2s var(--ease-out) infinite;
}

.scroll-cue:hover { color: var(--c-cream); }

/* rotate() is composed in from .icon's --icon-rotate, and translate comes
   FIRST so the shift happens in parent space rather than along the rotated
   axis. Without this the keyframe would win the transform outright and the cue
   would point east while bobbing south. One owner per transform. */
@keyframes cue-bob {
  0%, 100% { transform: translateY(0)     rotate(var(--icon-rotate, 0deg)); }
  50%      { transform: translateY(0.3em) rotate(var(--icon-rotate, 0deg)); }
}

/* Sections are scroll targets on a single page: clear the sticky header. */
.block[id] { scroll-margin-top: 0; }

/* ===========================================================================
   GRIDS
   =========================================================================== */

/* .grid-3 removed 2026-07-28 — zero uses. .split below is the only grid the
   page actually reaches for. */

/* Services: image left, ruled list right. Stacks under 52rem. */
.split {
  display: grid;
  gap: var(--space-l) var(--space-xl);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 52rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* .bleed and .bleed > * removed 2026-07-28 — zero uses. The idea it carried
   (a strip that runs off the edge to signal "there is more") now lives in the
   character roster's edge fade in selector.css, which does the same job for
   the one strip on the page that genuinely overflows. */

/* ===========================================================================
   TICKER — scrolling marquee on peach. Decorative; aria-hidden in the markup
   and parked entirely under prefers-reduced-motion (see base.css).
   =========================================================================== */

.ticker {
  background: var(--block-ticker-bg);
  color: var(--block-ticker-fg);
  overflow: hidden;
  padding-block: var(--space-xs);
  border-block: 1.5px solid var(--c-plum-ink);
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker-scroll var(--ticker-duration) linear infinite;
}

/* THE HOVER PAUSE IS GONE, DELIBERATELY. It used to be
   `.ticker:hover .ticker__track { animation-play-state: paused }`, on the
   theory that stopping it lets you read it. In practice the banner is a
   full-bleed strip directly under the hero, so a reader scrolling the page
   with the cursor anywhere near it froze the banner without ever asking to —
   which read as the marquee being broken. It is aria-hidden decoration with
   five repeating words; there is nothing here anyone needs to stop and study,
   so continuous motion is worth more than the pause. */

.ticker__group {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding-right: var(--space-m);
  white-space: nowrap;
}

.ticker__dot { font-size: 0.5em; transform: translateY(-0.15em); }

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

/* ===========================================================================
   SCALLOPED CTA — the one deliberate playful shape. Everything else is
   disciplined, which is what makes this land rather than read as decoration.
   Built from repeating radial gradients, so no SVG and no extra request.
   =========================================================================== */

.cta { background: var(--block-dark-bg); color: var(--block-dark-fg); }

.cta__intro { padding-block: var(--space-2xl) var(--space-xl); }

.cta__scallop {
  height: var(--scallop-rise);
  /* An EXPLICIT radius, not a percentage. A percentage colour-stop resolves
     against the gradient ray (farthest-corner = ~39.6px on a 56x28 tile), which
     yields a 19px radius and leaves dark gaps between the bumps. Setting the
     radius to half the tile width makes neighbouring half-circles touch, so the
     edge reads as one continuous scalloped wave. */
  background-image: radial-gradient(
    circle calc(var(--scallop-size) / 2) at 50% 100%,
    var(--c-paper) 0 98%,
    transparent 100%
  );
  background-size: var(--scallop-size) var(--scallop-rise);
  background-repeat: repeat-x;
  background-position: center bottom;
}

.cta__panel {
  background: var(--c-paper);
  color: var(--c-plum-ink);
  text-align: center;
  padding-block: var(--space-xl) var(--space-2xl);
}

.cta__link {
  display: inline-block;
  font-size: var(--step-section);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-plum-ink);
  padding: var(--space-2xs) var(--space-s);
  transition: color var(--dur-fast) var(--ease-out);
}

.cta__link:hover { color: var(--c-raspberry); }

/* ===========================================================================
   FOOTER — one thin line, micro type. Nothing else.
   =========================================================================== */

.site-footer {
  background: var(--c-paper);
  color: var(--c-plum-ink);
  padding-block: var(--space-m);
  border-top: 1.5px solid var(--color-rule);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  align-items: center;
  justify-content: space-between;
}

.site-footer a { color: var(--c-plum-ink); text-decoration: none; }
.site-footer a:hover { color: var(--c-raspberry); }
