/* ============================================================
   STEELMAN - scroll film. Shared stylesheet for v1 + v2.
   Type scale and caption geometry measured from the
   velaarmon.com reference recording (1918x906 viewport).

   Two presentations, one DOM:
     default        - static document (no JS, reduced motion,
                      slow connection). Legible and deliberate.
     html.js.scrub  - the scroll-scrubbed film.
   The <h1> is the same element in both. It is never
   display:none and never visibility:hidden.
   ============================================================ */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
                 U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink:       #ffffff;
  --ink-soft:  rgba(255,255,255,.78);
  --ink-faint: rgba(255,255,255,.52);
  --ground:    #07080a;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono",
          "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* caption geometry - ref: left margin 5.1% of width, title 5.2vw */
  --gut-x: clamp(20px, 5vw, 92px);
  --gut-y: clamp(26px, 8.5vh, 104px);

  --cap-eyebrow: clamp(10px, .78vw, 14px);
  --cap-title:   clamp(2rem, 5.2vw, 6.3rem);
  --cap-desc:    clamp(.92rem, 1.22vw, 1.42rem);

  /* Brand. This is the size the static document actually ships at, so
     it has to fit on its own: measured, STEELMAN PIPING sets 11.44em
     wide in Archivo Expanded 700, so 8vw clears --brand-pad at every
     width from 320px up. In scrub mode film.js re-fits it to 94% of
     the viewport, which is a touch larger. */
  --brand-size: clamp(1.4rem, 8vw, 12.8rem);
  --brand-pad:  clamp(12px, 3vw, 56px);

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   1. STATIC DOCUMENT  (the default presentation)
   ============================================================ */

.film { position: relative; }

/* canvas-only furniture is absent until the film is actually running */
.film__canvas,
.film__vignette,
.film__scrim,
.film__bridge,
.film__rail { display: none; }

.film__brand {
  margin: 0;
  padding: clamp(56px, 14vh, 160px) var(--brand-pad) clamp(36px, 8vh, 96px);
  text-align: center;
}

.brand {
  margin: 0;
  font-size: var(--brand-size);
  font-weight: 700;
  font-variation-settings: 'wdth' 125, 'wght' 700;
  line-height: .92;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
/* Both lines are set to fit by film.js, so they must never wrap:
   STEELMAN PIPING is one line and SOLUTIONS is the other. */
.brand span { display: block; white-space: nowrap; }

.caps { list-style: none; margin: 0; padding: 0; }

/* list-style also on the item itself - these <li> are cloned out of
   the list and into the film, where they have no <ol> ancestor. */
.cap { list-style: none; padding: 0 var(--gut-x) clamp(56px, 10vh, 132px); }

.cap__still {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: clamp(20px, 3.4vh, 40px);
  background: #101216;
}

.cap__eyebrow {
  margin: 0 0 clamp(10px, 1.5vh, 18px);
  font-family: var(--mono);
  font-size: var(--cap-eyebrow);
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cap__title {
  margin: 0;
  font-size: var(--cap-title);
  font-weight: 700;
  font-variation-settings: 'wdth' 106, 'wght' 700;
  line-height: .98;
  letter-spacing: -.022em;
}

/* the short hairline the reference sets between title and description */
.cap__rule {
  width: clamp(140px, 15.8vw, 302px);
  height: 1px;
  margin: clamp(16px, 2.6vh, 30px) 0 clamp(14px, 2.2vh, 26px);
  background: rgba(255,255,255,.34);
  border: 0;
}

.cap__desc {
  margin: 0;
  max-width: 34ch;
  font-size: var(--cap-desc);
  line-height: 1.6;
  color: var(--ink-soft);
}

.after {
  padding: clamp(64px, 14vh, 180px) var(--gut-x) clamp(96px, 20vh, 240px);
  border-top: 1px solid rgba(255,255,255,.1);
}
.after h2 {
  margin: 0 0 .6em;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 700;
  font-variation-settings: 'wdth' 110, 'wght' 700;
  letter-spacing: -.02em;
}
.after p { margin: 0; max-width: 56ch; color: var(--ink-faint); line-height: 1.7; }

/* ============================================================
   2. SCRUB MODE   (html.js.scrub)
   ============================================================ */

.js.scrub .film { height: var(--film-h, 620vh); }

.js.scrub .film__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--ground);
}

.js.scrub .film__canvas,
.js.scrub .film__vignette,
.js.scrub .film__scrim,
.js.scrub .film__bridge { display: block; }

.js.scrub .film__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* soft vertical grade so lower-left captions always hold up */
.js.scrub .film__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(4,5,7,.72) 0%, rgba(4,5,7,.28) 26%, rgba(4,5,7,0) 54%),
    radial-gradient(130% 88% at 50% 44%, rgba(0,0,0,0) 46%, rgba(0,0,0,.42) 100%);
}

/* scrim that rides in only under the brand reveal */
.js.scrub .film__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(76% 52% at 50% 48%, rgba(4,5,8,.66) 0%, rgba(4,5,8,.34) 52%, rgba(4,5,8,0) 100%),
    linear-gradient(to bottom, rgba(4,5,8,.30) 0%, rgba(4,5,8,0) 38%, rgba(4,5,8,.30) 100%);
}

/* white / black bridge overlay */
.js.scrub .film__bridge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #fff;
}

/* ---- the brand, as the reveal ---- */
.js.scrub .film__brand {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  margin: 0;
  padding: 0 var(--brand-pad);
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}
.js.scrub .film__brand .brand {
  display: block;
  text-shadow: 0 2px 44px rgba(0,0,0,.42);
  will-change: transform;
}

/* ---- captions ---- */
.js.scrub .film__doc {
  /* Out of the visual flow, still in the DOM and the a11y tree.
     The film's own captions are aria-hidden duplicates, so this
     copy is what assistive tech and crawlers read. */
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}

.js.scrub .film__caps {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.js.scrub .film__caps .cap {
  position: absolute;
  left: var(--gut-x);
  bottom: var(--gut-y);
  /* Wide enough that a two-word title stays on one line - `ch` here
     would resolve against this block's font-size, not the title's.
     The description sets its own 34ch measure. */
  width: min(58vw, 760px);
  padding: 0;
  opacity: 0;
  will-change: opacity, transform;
}
.js.scrub .film__caps .cap__still { display: none; }

@media (max-width: 760px) {
  .js.scrub .film__caps .cap {
    left: var(--gut-x);
    right: var(--gut-x);
    width: auto;
    text-align: center;
  }
  .js.scrub .film__caps .cap__rule { margin-left: auto; margin-right: auto; }
  .js.scrub .film__caps .cap__desc { margin-left: auto; margin-right: auto; }
}

/* ---- progress rail (desktop only) ---- */
@media (min-width: 900px) and (pointer: fine) {
  .js.scrub .film__rail {
    display: flex;
    position: absolute;
    right: clamp(18px, 3.4vw, 58px);
    top: 50%;
    transform: translateY(-50%);
    align-items: center;
    gap: 14px;
    pointer-events: none;
  }
}

.rail__label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.rail__ticks { display: flex; flex-direction: column; gap: 7px; width: 1px; }
.rail__tick {
  position: relative;
  width: 1px;
  background: rgba(255,255,255,.22);
  border-radius: 1px;
}
.rail__fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  border-radius: 1px;
  transform-origin: top;
  transform: scaleY(0);
}

/* ---- preloader (never rendered without JS: [hidden] in markup) ---- */
.film__load {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--ground);
  transition: opacity .7s var(--ease);
}
.film__load[hidden] { display: none !important; }
.film__load.is-done { opacity: 0; pointer-events: none; }
.load__inner { text-align: center; padding: 0 24px; }
.load__text {
  font-family: var(--mono);
  font-size: clamp(10px, .82vw, 13px);
  letter-spacing: .36em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.load__bar {
  width: min(280px, 56vw);
  height: 1px;
  margin: 22px auto 0;
  background: rgba(255,255,255,.16);
}
.load__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
  transition: width .24s linear;
}

/* ============================================================
   3. REDUCED MOTION
   Belt and braces: film.js never enters scrub mode when this
   is set, and drops out of it if it becomes set mid-session.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .js.scrub .film { height: auto !important; }
  .js.scrub .film__stage { position: static; height: auto; }
  .js.scrub .film__canvas,
  .js.scrub .film__vignette,
  .js.scrub .film__scrim,
  .js.scrub .film__bridge,
  .js.scrub .film__caps,
  .js.scrub .film__rail { display: none !important; }
  .js.scrub .film__brand {
    position: static;
    opacity: 1 !important;
    transform: none !important;
    padding: clamp(56px, 14vh, 160px) var(--brand-pad) clamp(36px, 8vh, 96px);
    font-size: var(--brand-size) !important;
  }
  .js.scrub .film__doc {
    position: static;
    width: auto; height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
  .film__load { display: none !important; }
}
