/* Copper Heron sample. Styles for the statement and the sideways gallery (home page only).
   Loaded after style.css. Shared tokens and classes are in style.css; see SYSTEM.md. */

/* ---------- Statement: one sentence on its own dark screen ----------
   The section has no fill of its own (the body carries the dark tone), so it has no top
   edge: it carries straight on from whatever dark ground is above it. A small mark and a
   label sit over the sentence. Nothing else shares the screen. */
.state { display: grid; align-content: center; min-height: 100vh; min-height: 100svh; padding: clamp(60px, 5.6vw, 80px) 0 clamp(90px, 11vw, 160px); }
.state .wrap { display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 3.2vw, 46px); text-align: center; }
.crest { display: grid; justify-items: center; gap: 14px; color: var(--body); }
.crest svg { display: block; width: 54px; height: auto; fill: none; stroke: currentColor; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.state .big { font-size: clamp(38px, 10.2vw, 60px); line-height: .9; }
.state .big em { font-size: 1.06em; line-height: .66; }
/* Wide screens: seven lines broken by hand, sized so the whole sentence fits one screen.
   Each line sits in its own clipped wrapper and rises out of it (site.js adds .in). */
/* The line height leaves a comma's tail clear of the capitals on the line below. */
@media (min-width: 701px) {
  .state .big { font-size: clamp(40px, min(7.35vw, 10.6vh), 150px); line-height: 1; white-space: nowrap; text-wrap: nowrap; }
  .state .ln { display: block; }
  /* The clip needs room for commas and the tall serif; the margin takes all of it back on one side (two negative margins would collapse into one). */
  html.js .state .ln { overflow: hidden; padding: .07em .1em .14em; margin: 0 -.1em -.21em; opacity: 1; transform: none; transition: none; }
  html.js .state .ln > span { display: block; transform: translateY(116%); transition: transform .95s var(--ease-io) calc(var(--d, 0) * 80ms); }
  html.js .state .ln.in > span { transform: none; }
}
/* Tablets and phones: the sentence follows straight on from the hero's two buttons, with no empty screen between. */
@media (max-width: 980px) {
  .state { min-height: 0; padding-top: clamp(40px, 8vw, 72px); }
}
/* Phones: the tick sits in the line after the last word and the two never part. */
@media (max-width: 700px) {
  .state .marked { white-space: nowrap; }
  .state .marked .tick { position: static; display: inline-block; width: .74em; margin: 0 0 0 .1em; vertical-align: -.04em; }
}

/* ---------- Gallery: job photos in three sizes on two lanes ----------
   Markup: .reel > .reel-stage > .reel-strip > .reel-set (three scenes) > .snap and .say.
   Every tile carries its place on the strip (--x, --y) and its size (--w, --h) in strip
   units. Three layouts use them:
   1. Pinned (html.pins, at the end of this block): the section is tall, the stage sticks,
      and the strip slides sideways with --p from the scroll engine. p3-story.js fades the
      ground from dark to cream across the pin.
   2. Wide but not pinned (reduced motion, a short window, no script): the three scenes sit
      one under another, each laid out exactly as it is on the strip.
   3. Phones and tablets: one staggered column.
   In 2 and 3 each scene carries data-ground, so the ground steps dark, mid, cream.
   Nothing in here is colored from --ground: type and lines are the ink at part strength,
   so they are right on every shade of the fade and need no repaint while it runs. */
.reel { padding: 0; }
@supports (color: color-mix(in srgb, #000, #fff)) { .reel { --line: color-mix(in srgb, var(--tint) var(--lw), transparent); --edge: color-mix(in srgb, var(--ink) 34%, transparent); transition: --line .4s linear, --edge .4s linear; } }
/* The statement's contour loops run on into the top of the gallery, so they are drawn the same way. */
@supports (color: color-mix(in srgb, #000, #fff)) { .state { --line: color-mix(in srgb, var(--tint) var(--lw), transparent); transition: --line .7s linear; } }
.reel-stage { position: relative; z-index: 1; }
.reel-strip { --k: 1vw; }
.reel-set { display: flex; flex-direction: column; align-items: flex-start; padding: 0 var(--gut); }
.reel-set:last-child { padding-bottom: 20vw; }
.reel-set > * { margin-top: calc(var(--gap) * var(--k)); }

/* A photo: its place label above the top-left corner, the placeholder note under it. */
.snap { display: flex; flex-direction: column; align-items: flex-start; width: calc(42 * var(--k)); margin-bottom: 0; margin-inline: 0; }
.snap.w-s { width: calc(32 * var(--k)); }
.snap.w-l { width: calc(58 * var(--k)); }
.snap.at-r { align-self: flex-end; align-items: flex-end; }
.snap.at-l.inset { margin-left: calc(20 * var(--k)); }
/* A label may be wider than its photo. It only wraps if it would not fit the screen (a long town from Make it yours). */
.snap .label { display: block; width: max-content; max-width: calc(100vw - 2 * var(--gut)); color: var(--body); }
@supports (color: color-mix(in srgb, #000, #fff)) { .snap .label { color: color-mix(in srgb, var(--ink) 90%, transparent); } }
.snap figcaption { margin-bottom: 9px; }
.snap .cap { margin-top: 8px; opacity: .8; }
/* Pinned, the ground passes through mid grey as the ink changes sides, so the small labels are at full strength there. */
html.pins .snap .label { color: var(--ink); }
html.pins .snap .cap { opacity: 1; }
.snap .pic { width: 100%; aspect-ratio: var(--w) / var(--h); }
.snap .pic img { max-width: none; }
/* Secondary tiles are a flat two-tone in the ground's own grey. It is fixed: no hover, no
   change at the centre of the screen. The tone is mixed from --dark, so Make it yours carries. */
.snap.tint .pic { isolation: isolate; background: #6f6b65; }
@supports (color: color-mix(in srgb, #000, #fff)) { .snap.tint .pic { background: color-mix(in srgb, var(--dark) 45%, var(--mute)); } }
.snap.tint img { filter: grayscale(1) contrast(.6) brightness(1.2); mix-blend-mode: luminosity; opacity: .72; }
/* The outlined two-cell chip under the panel photo */
.amp { display: inline-flex; height: 40px; margin-top: 12px; border-radius: var(--r-s); box-shadow: inset 0 0 0 1px var(--edge); color: var(--body); }
.amp b, .amp i { display: grid; place-items: center; padding: 0 13px; }
.amp b { font: 500 17px/1 var(--sans); font-stretch: 86%; letter-spacing: 0; white-space: nowrap; }
.amp i { border-left: 1px solid var(--edge); }
.amp svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }

/* A line of our own in the serif, plain on the ground, with a small flourish under it */
.say { color: var(--body); }
@supports (color: color-mix(in srgb, #000, #fff)) { .say { color: color-mix(in srgb, var(--ink) 72%, transparent); } }
.say p { max-width: 15em; font: 400 clamp(19px, 2.7vw, 23px)/1.04 var(--serif); letter-spacing: .012em; text-wrap: balance; }
.say b { font-weight: 500; color: var(--ink); }
.flick { width: 58px; margin-top: 15px; stroke-width: 7; }
.say.on-light .flick { stroke: var(--ink); }

/* Tablets: the same column, a little smaller */
@media (min-width: 701px) { .reel-strip { --k: .82vw; } }
/* Tablets and phones: the tone changes between scenes switch at once (style.css fades only the surface there). */
@media (max-width: 980px) { .reel, .state { transition: none; } }

/* Wide screens, not pinned: three scenes, one under another */
@media (min-width: 981px) {
  .reel { --u: 1.05vw; }
  .reel-set { display: block; position: relative; height: calc(64 * var(--u)); padding: 0; }
  .reel-set:last-child { height: calc(68 * var(--u)); padding-bottom: 0; }
  .reel-set:nth-child(2) { --shift: 9; }
  .reel-set > * { position: absolute; left: calc(50% + (var(--x) - var(--x0) - var(--span) / 2 + var(--shift, 0)) * var(--u)); top: calc(var(--y) * .62 * var(--u)); margin: 0; }
  .snap, .snap.w-s, .snap.w-l { display: block; width: calc(var(--w) * var(--u)); }
  .snap.at-l.inset { margin-left: 0; }
  .snap figcaption { position: absolute; left: 0; bottom: 100%; max-width: none; white-space: nowrap; }
  .say { width: calc(var(--w) * var(--u)); }
  .say p { max-width: none; font-size: max(18px, calc(1.5 * var(--u))); }
}

/* Pinned: the strip. One strip unit is 1% of the screen width, or 1.6% of its height if
   that is smaller, so the two lanes always fit the screen. The strip is 214 units long
   after an empty lead-in (--lead), and the section is as tall as the strip has to travel
   (--run), so one pixel of scrolling is one pixel of travel. The travel starts when the
   section's top comes up over the bottom of the screen, a screen before the stage sticks:
   --p (data-track="pass") runs over the section's height plus one screen. The lead-in puts
   the first photo three quarters of the way across at that moment, and never less than an
   eighth of the way in from the left when the stage sticks.
   The top lane has a floor in pixels: on a short window (most laptops) a tile at 10% of the
   height would put its label in the nav row, so no tile starts higher than 94px (its label
   then clears the nav by a few pixels) and no line higher than 78px. The window has to be
   640px tall to pin, so that floor never pushes a top tile into the lower lane. */
@media (min-height: 640px) {
  html.pins .reel { --u: min(1vw, 1.6vh); --lead: max(75vw, calc(100vh + 12.5vw)); --run: calc(var(--lead) + 214 * var(--u) - 100vw); height: max(100vh, var(--run)); }
  html.pins .reel-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
  html.pins .reel-strip { position: absolute; left: 0; top: 0; width: calc(var(--lead) + 214 * var(--u)); height: 100%; transform: translate3d(calc(-1 * min(var(--p, 0) * (100vh + var(--run)), var(--run))), 0, 0); will-change: transform; }
  html.pins .reel-set { display: contents; }
  /* Tiles arrive by travelling, so they do not rise in. */
  html.pins .reel-set > * { left: calc(var(--lead) + var(--x) * var(--u)); top: max(calc(var(--y) * 1%), 94px); opacity: 1; transform: none; transition: none; }
  html.pins .reel-set > .say { top: max(calc(var(--y) * 1%), 78px); }
  /* The full-color photos are a little wider than their frames and drift inside them as the strip passes. */
  html.pins .snap.drift img { left: -27px; width: calc(100% + 54px); transform: translate3d(calc((var(--p, 0) - .5) * 54px), 0, 0); will-change: transform; }
}
/* On the shortest pinned windows the last line's flourish would pass under Make it yours, so it is left off. */
@media (min-height: 640px) and (max-height: 719px) { html.pins .say.on-light .flick { display: none; } }

/* The ground while the strip is pinned: one fixed sheet under the whole page, dark with a
   cream layer over it whose strength p3-story.js sets (--mix, 0 to 1). Only an opacity
   changes per frame. p3-story.js makes the element and shows it only during the pin. */
.reel-wash { position: fixed; inset: 0; z-index: -1; visibility: hidden; pointer-events: none; background: var(--dark); }
.reel-wash::after { content: ""; position: absolute; inset: 0; background: var(--cream); opacity: var(--mix, 0); will-change: opacity; }
.reel-wash.on { visibility: visible; }

/* Without script nothing adds .in, so nothing here may wait for it. */
html:not(.js) .state .rise, html:not(.js) .reel .rise { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .state .ln > span { transform: none; transition: none; }
  .reel, .state { transition: none; }
}
