/* EB Construction — website
 *
 * THE BRAND CHAIN. This file imports the design system's tokens and never
 * declares a color or typeface of its own. `python3 tools/gates.py` fails if a
 * raw hex or literal font-family appears below.
 *
 *   assets/brand/*.pdf → design-system/tokens/*.css → css/site.css → website/index.html
 *
 * Structure and motion follow the reference Will supplied: fixed nav,
 * full-viewport hero over moving media, a light statement section, and a
 * bento grid. The reference's opening splash is deliberately gone — the site
 * lands directly. The palette does NOT follow it — the brand contract allows one
 * accent, so where the reference punches with orange this punches with white on
 * navy, which the guidelines explicitly sanction.
 */

@import url("../design-system/tokens/color.css");
@import url("../design-system/tokens/type.css");
@import url("../design-system/tokens/layout.css");

/* ============================================================ surface scale */

:root {
  --text-body:    1.0625rem;
  --text-sm:      1rem;
  --text-caption: 0.875rem;
  --text-h3:      1.25rem;
  --text-h2:      1.75rem;
  --text-h1:      2rem;
  --text-micro:   0.75rem;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --page-pad: var(--space-7);
}

/* ============================================================ base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: var(--weight-bold); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: var(--focus-ring-width) solid var(--eb-navy);
  outline-offset: 3px;
}
/* Dark surfaces flip the ring back to white. */
.foot :focus-visible, .menu :focus-visible, .tile--dark :focus-visible {
  outline-color: var(--eb-white);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================ motion
 * One easing curve for the whole page. Elements start hidden and are revealed
 * by IntersectionObserver adding .is-in.
 */

@keyframes fade-up   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in  { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* Content is hidden ONLY once JS has confirmed it can reveal it again. Without
 * this gate, a failed script or a stalled IntersectionObserver leaves the page
 * permanently blank — the failure mode has to be "unanimated", not "invisible". */
.js-reveal [data-reveal] { opacity: 0; }
.is-in[data-reveal="up"]    { animation: fade-up   0.8s var(--ease-expo) forwards; }
.is-in[data-reveal="in"]    { animation: fade-in   0.8s var(--ease-expo) forwards; }
.is-in[data-reveal="scale"] { animation: scale-in  0.8s var(--ease-expo) forwards; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; animation: none !important; }
  /* Ambient loops hold still too — they are decorative by definition, and
   * this block already said so before it named them. */
  .stage__mark-sq, .vlight__panel::after,
  .vlight__panel.is-loading::before { animation: none !important; }
  /* No flight: the panel simply appears centred. */
  .vlight__panel { transform: none !important; }
  * { transition-duration: 0ms !important; }
}



/* ============================================================ backdrop
 * Stands in for the reference's background video. An animated structural grid
 * drawn on canvas — plan lines, column grid, a slow sweep. Construction-native,
 * needs no assets, and sits behind everything at z-0.
 */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--surface-raised);
}
.backdrop canvas { display: block; width: 100%; height: 100%; }
.backdrop__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    hsl(0 0% 100% / 0.15) 0%,
    hsl(0 0% 100% / 0.40) 55%,
    hsl(0 0% 100% / 0.72) 100%);
}

/* Everything above the backdrop. */
.stack { position: relative; z-index: 10; }

/* ============================================================ nav */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-4) var(--page-pad);
  /* Frosted glass: the bar stays legible over every section without ever
   * fully hiding what scrolls beneath it. */
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(0 0% 100% / 0.5));
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: var(--border-width) solid hsl(211 30% 82% / 0.45);
}
/* Over the dark mobile overlay the glass reads as a grey smear — drop it. */
.nav.is-open {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
}

.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 0; }
/* Ink by default: the glass bar is always a light ground, so the wordmark is
 * always legible — no more white-on-white while scrolling. */
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  color: var(--eb-black);
  transition: color var(--duration-base) var(--easing),
              border-color var(--duration-base) var(--easing);
}
.brand__name {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--eb-black);
  transition: color var(--duration-base) var(--easing);
}

/* Over the light sections the mark and wordmark flip to ink. */
.nav.is-light .brand__name,
.nav.is-light .brand__mark { color: var(--eb-black); border-color: var(--border-default); }
.nav.is-light .nav__burger { background: var(--surface-raised); border-color: var(--border-default); color: var(--eb-black); }

/* Centre pill — fully rounded bar; the active highlight is a single navy
 * chip that GLIDES between links (positioned from site.js, animated here).
 * Absolutely centred on the bar so it stays dead-centre no matter what sits
 * left or right of it. */
.nav__pill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface-raised);
  border-radius: var(--radius-pill);
  box-shadow: var(--elev-overlay);
}
.nav__glider {
  position: absolute;
  top: var(--space-1);
  bottom: var(--space-1);
  left: 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--eb-navy);
  opacity: 0;
  will-change: transform, width;
  transition: transform 450ms var(--ease-expo), width 450ms var(--ease-expo),
              opacity 200ms var(--easing);
}
.nav__glider.is-set { opacity: 1; }
.nav__link {
  position: relative;
  z-index: 1;
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 300ms var(--ease-expo);
}
.nav__link:hover { color: var(--eb-black); }
/* CSS-only fallback: a solid navy chip, so a JS failure can never leave the
 * active label white-on-white. Once the glider is live it takes over. */
.nav__link.is-active { color: var(--eb-white); background: var(--eb-navy); }
.nav__pill:has(.nav__glider.is-set) .nav__link.is-active { background: transparent; }
/* Focus ring drawn INSIDE the link so it stays on the pill's own white ground
 * whatever section the fixed nav is floating over. */
.nav__pill .nav__link:focus-visible { outline-offset: -2px; }

/* CTA — the reference's accent square, rendered in white because the brand
 * allows exactly one accent and navy would vanish on a navy ground. */
.cta {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--eb-navy);
  cursor: pointer;
  transition: background var(--duration-base) var(--easing);
}
.cta:hover { background: var(--navy-600); }
.cta__sq {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--eb-white);
  color: var(--eb-navy);
  flex: none;
}
.cta__sq svg { width: 16px; height: 16px; transition: transform var(--duration-base) var(--easing); }
.cta:hover .cta__sq svg { transform: translateX(2px); }
.cta__label {
  padding: 0 var(--space-5);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--eb-white);
  white-space: nowrap;
}
.cta--lg { border-radius: var(--radius-lg); }
.cta--lg .cta__sq { width: 44px; height: 44px; border-radius: var(--radius-md); }
.cta--lg .cta__sq svg { width: 20px; height: 20px; }
.cta--lg .cta__label { padding: 0 var(--space-6); font-size: var(--text-body); }

/* Inverted CTA for light sections. */
.cta--light { background: var(--surface-raised); box-shadow: var(--elev-overlay); }
.cta--light:hover { background: var(--surface-hover); }
.cta--light .cta__sq { background: var(--eb-navy); color: var(--eb-white); }
.cta--light .cta__label { color: var(--eb-black); }

.nav__burger {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--eb-black);
  cursor: pointer;
}
.nav__burger svg { width: 20px; height: 20px; }
.nav__burger .i-close { display: none; }
.nav.is-open .nav__burger .i-close { display: block; }
.nav.is-open .nav__burger .i-menu { display: none; }
.nav.is-open .brand__name, .nav.is-open .brand__mark { color: var(--eb-white); border-color: var(--border-on-navy); }
.nav.is-open .nav__burger { background: hsl(211 40% 38% / 0.18); border-color: var(--border-on-navy); color: var(--eb-white); }

@media (min-width: 1080px) {
  .nav__pill { display: flex; }
  .nav__burger { display: none; }
  /* The pill is absolutely centred, so the long wordmark must give way before
   * it reaches the pill's left edge rather than running underneath it. */
  .brand__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 50vw minus: half the pill (~250px) + page pad + mark square + gaps. */
    max-width: calc(50vw - 350px);
  }
}

/* Mobile overlay */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--space-12) + var(--space-5)) var(--page-pad) var(--space-9);
  background: hsl(211 56% 6% / 0.96);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms var(--ease-expo), visibility 700ms var(--ease-expo);
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu__list { display: grid; gap: var(--space-2); }
.menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-4);
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  color: var(--navy-200);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 700ms var(--ease-expo), transform 700ms var(--ease-expo),
              background var(--duration-base) var(--easing), color var(--duration-base) var(--easing);
}
.menu.is-open .menu__link { opacity: 1; transform: none; }
.menu__link.is-active { color: var(--eb-white); background: hsl(211 40% 38% / 0.18); }
.menu__link svg { width: 20px; height: 20px; opacity: 0; }
.menu__link.is-active svg { opacity: 1; }
.menu__foot { display: grid; gap: var(--space-4); justify-items: center; }
.menu__foot .cta { width: 100%; justify-content: center; opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease-expo), transform 700ms var(--ease-expo); }
.menu.is-open .menu__foot .cta { opacity: 1; transform: none; }
.menu__caption {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-300);
}

/* ============================================================ stage
 * The opening viewport. A tall navy panel with a chamfered bottom-left corner
 * held in the middle of the screen, with the headline and the lede sitting in
 * the light gutters either side of it — the composition Will supplied.
 *
 * Below 900px the gutters are too narrow to hold type, so the layout collapses:
 * the panel becomes the full field and the copy sits on top of it in white.
 * That is why every gutter rule lives inside the media query rather than being
 * written desktop-first and undone.
 *
 * The chamfer itself is a clip-path computed in site.js from live pixel
 * dimensions — a percentage shape would skew off 45 degrees as the panel
 * changes aspect ratio.
 */

.stage {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--space-12) + var(--space-5)) var(--space-5) var(--space-9);
}

.stage__wrap { position: relative; }

.stage__panel {
  position: relative;
  height: 62svh;
  border-radius: var(--radius-lg);
  background: var(--eb-navy);
  overflow: hidden;
}
.stage__art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--navy-600) var(--border-width), transparent var(--border-width)),
    linear-gradient(to bottom, var(--navy-600) var(--border-width), transparent var(--border-width));
  background-size: 40px 40px;
}
.stage__tag {
  position: absolute;
  right: var(--space-5);
  top: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}

/* --- copy: over the panel on small screens, in the gutters on large --- */

.stage__head { position: absolute; left: var(--space-6); top: var(--space-7); }
.stage__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--navy-200);
}
.stage__title {
  margin-top: var(--space-4);
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--eb-white);
}
.stage__title-alt { letter-spacing: 0.16em; }

.stage__note {
  position: absolute;
  left: var(--space-6);
  bottom: var(--space-7);
  max-width: 34ch;
}
.stage__note-title {
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--eb-white);
}
.stage__note-body {
  margin-top: var(--space-4);
  font-size: var(--text-caption);
  line-height: 1.625;
  color: var(--navy-200);
}
.stage__note .cta { margin-top: var(--space-6); }

/* --- cards --- */

/* The right column: the Clients & partners video stack. */
.stage__cards {
  display: grid;
  gap: var(--space-4);
  width: min(100%, 420px);
  margin: var(--space-5) auto 0;
}

.stage__meta {
  margin-top: var(--space-6);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}

/* --- Clients & partners video strip ---
 * Slots are dormant placeholders until their .mov exists (site.js arms them);
 * armed slots show the video's first frame and open the lightbox. */
.clients {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space-3);
}
/* The label gets its own box at the head of the column. Its padding is set so
 * the centred text lands on the same line as the panel's [placeholder] tag,
 * which sits a --space-5 inset below the panel's top edge. */
.clients__label {
  display: grid;
  place-items: center;
  padding: var(--space-5);
  border: var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}
/* The fourth slot: a held space for a film that does not exist yet. Static and
 * unclickable by design — an affordance here would promise something. */
/* Doubled class on purpose: .clip is declared further down this file, so a
 * single class here loses the background and opacity to it on source order. */
.clip.clip--empty {
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: var(--grey-200);
  border-color: var(--border-default);
  opacity: 1;
  cursor: default;
}
.clip__empty-tag {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  text-align: center;
  color: var(--text-muted);
}
.clients__row {
  display: grid;
  gap: var(--space-3);
}
.clip {
  position: relative;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: var(--border-width) solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--eb-navy);
  overflow: hidden;
  opacity: 0.7;
  cursor: default;
  transition: transform 200ms var(--easing), opacity 200ms var(--easing);
}
.clip.is-ready { opacity: 1; cursor: pointer; }
/* While its clip is up, the tile stands empty — the panel IS that tile, in
 * flight. It keeps its space in the column so nothing reflows underneath. */
.clip.is-away { visibility: hidden; }
.clip.is-ready:hover { transform: translateY(-2px); }
.clip__thumb { position: absolute; inset: 0; display: grid; place-items: center; }
.clip__thumb video,
.clip__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The posters are the film's own frame at the five second mark. They are
 * light, so a white play glyph would vanish on them — but scrimming the whole
 * tile just turns a partner's logo to mud. Give the glyph its own navy chip
 * instead and leave the frame to read at full strength. */
/* Cornered, not centred: these frames are co-branded, and a chip in the
 * middle sits straight across the partner's mark. */
.clip__thumb::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;            /* the poster is positioned too, and paints later */
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: hsl(211 56% 14% / 0.82);
  transition: background 200ms var(--easing), transform 200ms var(--easing);
}
/* Barely-there wash, so the three tiles sit together as a set. */
.clip__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: hsl(211 56% 18% / 0.08);
  transition: background 200ms var(--easing);
}
.clip.is-ready:hover .clip__thumb::before,
.clip.is-ready:focus-visible .clip__thumb::before {
  background: hsl(211 56% 14% / 0.92);
  transform: scale(1.08);
}
.clip.is-ready:hover .clip__thumb::after,
.clip.is-ready:focus-visible .clip__thumb::after { background: hsl(211 56% 18% / 0); }
.clip__play {
  position: absolute;
  left: 25px;            /* centred on the 40px chip at 14px, plus 1px optical */
  bottom: 23px;
  z-index: 2;            /* above the chip, which is above the poster */
  width: 18px;
  height: 18px;
  color: var(--eb-white);
  opacity: 0.9;
}

/* --- video lightbox --- */
.vlight {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease-expo), visibility 300ms var(--ease-expo);
}
/* The scrim is its own layer so it can fade on its own. Fading the whole
 * overlay on exit would take the panel with it, and the panel is the one
 * thing that has to stay visible all the way back to its tile. */
.vlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: hsl(211 56% 8% / 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 320ms var(--ease-expo);
}
.vlight.is-leaving::before { opacity: 0; }
.vlight[hidden] { display: none; }
.vlight.is-on { opacity: 1; visibility: visible; }
/* The panel HUGS the clip. Each bundle reports its own shape once it has
 * rendered — site.js measures the stage and writes --clip-ar — so 16/9 is
 * only the opening guess, not a frame the picture has to fit inside.
 * Nothing in here may carry a background: a background IS the black border. */
.vlight__panel {
  --clip-ar: 1.7778;
  position: relative;
  width: min(1100px, 94vw, calc((100svh - 140px) * var(--clip-ar)));
  aspect-ratio: var(--clip-ar);
  background: transparent;
  transform-origin: 50% 50%;
  transition: width 420ms var(--ease-expo), aspect-ratio 420ms var(--ease-expo),
              transform 520ms var(--ease-expo);
}
/* The single frame where the panel is pinned over its tile before being
 * released — and the reset on teardown. Neither may animate. */
.vlight__panel.is-flying { transition: none; }
.vlight__panel video,
.vlight__panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}
/* A bundle paints wherever it unpacked to before site.js has measured and
 * scaled it. Hold the frame back until a groom pass has actually landed, so
 * the clip fades in already in place instead of jumping into it. JS reveals
 * it regardless after 1.4s — unfitted is recoverable, invisible is not. */
.vlight__panel iframe { opacity: 0; transition: opacity 200ms var(--ease-expo); }
.vlight__panel.is-groomed iframe { opacity: 1; }
/* The tile's own frame, carried into the panel. It rides the flight and holds
 * the picture through the seconds the bundle spends unpacking, then hands over
 * once the film is actually moving — so there is never a blank panel. */
.vlight__poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  pointer-events: none;
  transition: opacity 300ms var(--ease-expo);
}
.vlight__poster:not([src]) { display: none; }
/* Cut, do not dissolve. The still and the running film are at two different
 * moments, so a cross-fade smears them over each other — the cut is the
 * smaller artefact of the two. */
.vlight__panel.is-playing .vlight__poster { opacity: 0; transition: none; }
/* Ambient light, not a border. It sits on its own layer so the breathe
 * animates opacity alone, and the panel keeps no overflow clip that would
 * crop the glow. Hue held at 211 — the brand's own blue, lifted bright
 * enough to read as light rather than smuggled in as a second accent. */
.vlight__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow:
    0 0 0 1px hsl(211 72% 70% / 0.32),
    0 0 26px hsl(211 82% 60% / 0.26),
    0 0 84px hsl(211 86% 54% / 0.15);
  animation: clip-ambient 7s ease-in-out infinite;
}
@keyframes clip-ambient {
  0%, 100% { opacity: 0.62; }
  50%      { opacity: 1; }
}
/* A bundle takes a moment to unpack, and an empty panel reads as broken
 * rather than busy. One breathing ring says working — white, so it adds no
 * second colour, and gone the instant the first frame plays. */
.vlight__panel.is-loading::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: var(--border-width) solid hsl(0 0% 100% / 0.5);
  border-radius: var(--radius-pill);
  pointer-events: none;
  animation: clip-wait 1.4s ease-in-out infinite;
}
@keyframes clip-wait {
  0%, 100% { opacity: 0.25; transform: scale(0.82); }
  50%      { opacity: 0.9;  transform: scale(1); }
}
.vlight__panel video[hidden],
.vlight__panel iframe[hidden] { display: none; }
.vlight__close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--border-width) solid hsl(0 0% 100% / 0.4);
  border-radius: var(--radius-pill);
  background: hsl(211 56% 8% / 0.55);
  color: var(--eb-white);
  cursor: pointer;
  transition: background 200ms var(--easing), border-color 200ms var(--easing);
}
.vlight__close:hover { background: hsl(211 56% 8% / 0.8); border-color: hsl(0 0% 100% / 0.8); }
.vlight__close svg { width: 18px; height: 18px; }
.vlight :focus-visible { outline-color: var(--eb-white); }

/* --- centre mark ---
 * The EB square held in the middle of the navy panel with a soft breathing
 * glow. White only — the brand's sanctioned partner on a navy ground. */
.stage__mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}
.stage__mark-sq {
  display: grid;
  place-items: center;
  width: clamp(120px, 14vw, 190px);
  height: clamp(120px, 14vw, 190px);
  border: var(--border-width) solid hsl(0 0% 100% / 0.8);
  border-radius: var(--radius-lg);
  background: hsl(211 56% 8% / 0.35);
  font-family: var(--font-mono);
  font-size: clamp(2.75rem, 5.2vw, 4.5rem);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  color: var(--eb-white);
  animation: mark-glow 4.5s ease-in-out infinite;
}
@keyframes mark-glow {
  0%, 100% { box-shadow: 0 0 26px hsl(0 0% 100% / 0.10); }
  50% { box-shadow: 0 0 44px hsl(0 0% 100% / 0.24); }
}

/* --- the gutter composition --- */

@media (min-width: 900px) {
  .stage { padding: 0; }

  .stage__wrap {
    position: absolute;
    inset: calc(var(--space-12) + var(--space-5)) 0 var(--space-9);
    padding: 0 24%;                    /* the panel holds the middle 52% */
  }
  .stage__panel { height: 100%; }

  /* The copy must live INSIDE the 24% gutter — width and type size are both
   * derived from it, so growing or shrinking the window can never push the
   * headline under the navy panel. */
  .stage__head {
    left: var(--space-9);
    top: 38%;
    transform: translateY(-50%);
    max-width: calc(24% - var(--space-9) - var(--space-6));
  }
  .stage__eyebrow { color: var(--text-muted); }
  .stage__title {
    color: var(--text-primary);
    font-size: clamp(1.375rem, 2.6vw, 3.25rem);
    overflow-wrap: break-word;
  }
  /* The 0.16em display tracking is wider than the gutter can afford —
   * "Automated." must never break mid-word. */
  .stage__title-alt { letter-spacing: 0.04em; }

  .stage__note {
    left: var(--space-9);
    bottom: var(--space-8);
    max-width: calc(24% - var(--space-9) - var(--space-6));
  }
  .stage__note-title { color: var(--eb-black); }
  .stage__note-body { color: var(--text-secondary); }

  /* The column runs the navy panel's own height — its top and bottom are the
   * wrap's insets — and fills the right gutter rather than stopping at a fixed
   * width, so a wider window widens the films instead of stranding them
   * against the edge. Mirrors the left gutter's inset, so the two sides read
   * as one measure. */
  .stage__cards {
    position: absolute;
    right: var(--space-9);
    top: calc(var(--space-12) + var(--space-5));
    bottom: var(--space-9);
    transform: none;
    margin: 0;
    z-index: 10;
    gap: var(--space-3);
    width: calc(24vw - var(--space-9) - var(--space-6));
  }
  .clients {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }
  /* Four equal boxes sharing whatever is left under the label. Height now
   * comes from the column, so the fixed 16:10 has to go — left in, it would
   * fight the grid and push the last box past the panel. */
  .clients__row { grid-template-rows: repeat(4, minmax(0, 1fr)); min-height: 0; }
  .clip { aspect-ratio: auto; min-height: 0; }
  /* Taking height from the column means the boxes are no longer 16:9, and
   * cover would crop straight through the partner's mark — which is the one
   * thing these tiles exist to show. Contain the frame and set the box to the
   * films' own near-white ground, so the spare bands read as part of the card
   * instead of as letterboxing. */
  .clip { background: var(--eb-white); }
  .clip__thumb img { object-fit: contain; }

  /* Sits in the band below the panel. Held clear of the column, which now
   * reaches all the way down to the panel's bottom edge. */
  .stage__meta {
    position: absolute;
    right: var(--space-9);
    bottom: var(--space-5);
    margin: 0;
  }
}


/* ============================================================ sections
 * Workflows, Approach, and Control each get a complete viewport of their own —
 * stacked, one per scroll, separated by the sunken gutter.
 */

.bento {
  padding: var(--space-3);
  background: var(--navy-050);
  color: var(--eb-black);
}
.bento__grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
}

.tile {
  /* Named so a full-bleed child can cancel it exactly. */
  --tile-pad: clamp(var(--space-6), 3vw, var(--space-9));
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-7);
  min-height: calc(100svh - var(--space-6));
  padding: var(--tile-pad);
  /* Clear the fixed nav when a section sits at the top of the viewport. */
  padding-top: calc(var(--space-12) + var(--space-5));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tile__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ------------------------------ Approach data figures (D/01 – D/04) ------
 * White on the navy page, drawn with plain boxes: scale bars, a waffle count,
 * a split bar, and the before/after week. One accent, no chart library.
 */

/* Each figure is its OWN card — a bounded module, not a run-on column. */
.figs { display: grid; gap: var(--space-5); }
.fig {
  padding: clamp(var(--space-6), 2.5vw, var(--space-8));
  border: var(--border-width) solid var(--border-on-navy);
  border-radius: var(--radius-lg);
  background: hsl(211 56% 8% / 0.28);
}

.fig__kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}
.fig__head {
  margin-top: var(--space-3);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--eb-white);
}
.fig__sub {
  max-width: 52ch;
  margin-top: var(--space-3);
  font-size: var(--text-caption);
  color: var(--navy-200);
}
.fig__caption {
  display: block;
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}

/* --- D/05: the trade ---
 * Two photographs of the same job, side by side, and a slot for the
 * productivity visual. Every slot holds a bracketed placeholder until its file
 * lands, so the card is presentable with nothing in it yet. Lives inside .fig,
 * so the card chrome, kicker, head and caption are all inherited. */
/* Centred and capped. The cap is what stops them growing with the monitor;
 * centring is what keeps the pair and the strip beneath it reading as one
 * block rather than two things stacked at the left edge. */
.ground__pair {
  display: grid;
  gap: var(--space-5);
  max-width: 1180px;
  margin: var(--space-6) auto 0;
}
.ground__shot { margin: 0; }
.ground__frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: var(--space-5);
  border: var(--border-width) solid var(--border-on-navy);
  border-radius: var(--radius-md);
  background: hsl(211 56% 8% / 0.45);
  overflow: hidden;
}
.ground__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Once a photo arrives the holding text has nothing left to say. */
.ground__frame.is-filled .ground__hold { display: none; }
.ground__hold {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  text-align: center;
  color: var(--navy-200);
}
.ground__cap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.ground__tag {
  padding: 3px 10px;
  border: var(--border-width) solid var(--border-on-navy);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}
/* The brand allows one accent, and navy disappears on navy — so the "after"
 * side is marked the same way the page marks everything else: white. */
.ground__tag--after {
  border-color: var(--eb-white);
  background: var(--eb-white);
  color: var(--eb-navy);
}
.ground__line { font-size: var(--text-caption); color: var(--navy-200); }

.ground__q {
  max-width: 56ch;
  margin-top: var(--space-6);
  padding-left: var(--space-5);
  border-left: var(--border-width) solid var(--eb-white);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.45;
  color: var(--eb-white);
}

.ground__return {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--border-on-navy);
}
.ground__stat { display: grid; gap: var(--space-2); }
.ground__stat-v {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1;
  color: var(--eb-white);
}
.ground__stat-l { font-size: var(--text-caption); color: var(--navy-200); }

/* The footer to the photographs — but wider than them. It breaks out through
 * the card's own padding to the border, so the strip runs past the pair on
 * both sides instead of sitting in a column with it. */
.ground__viz {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin: var(--space-5) calc(-1 * clamp(var(--space-6), 2.5vw, var(--space-8))) 0;
  border: var(--border-width) dashed var(--border-on-navy);
  border-radius: var(--radius-md);
  background: hsl(211 56% 8% / 0.28);
  overflow: hidden;
}
/* A real visual carries its own ground, so the holding border comes off. */
.ground__viz.is-filled {
  display: block;
  min-height: 0;
  border-color: transparent;
  background: none;
}
.ground__viz.is-filled .ground__hold { display: none; }
/* Cropped to the composition, not to a video's shape. The bundle's height is
 * FIXED at a given width and jumps as it reflows — 331px above 1100 wide,
 * 521 in the 800s, 737 at 700 — so neither an aspect ratio nor a media query
 * can express it (the frame's width does not track the viewport's). site.js
 * measures the real content and sets the height; this is only the fallback
 * for a frame it cannot read, and it errs tall so nothing is ever cut. */
.ground__viz iframe {
  display: block;
  width: 100%;
  height: 780px;
  border: 0;
}
@media (min-width: 1250px) {
  .ground__viz iframe { height: 350px; }
}

@media (min-width: 760px) {
  .ground__pair { grid-template-columns: 1fr 1fr; }
  .ground__return { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
}

.fig__rows { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.fig__row {
  /* Fixed value column: both rows' bars span the SAME width, and the values
   * right-align dead even. */
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) 72px;
  gap: var(--space-5);
  align-items: center;
}
.fig__label { display: grid; gap: var(--space-1); }
.fig__name { font-size: var(--text-caption); font-weight: var(--weight-bold); color: var(--eb-white); }
.fig__note { font-size: var(--text-micro); color: var(--navy-200); }
.fig__value {
  font-family: var(--font-mono);
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  color: var(--eb-white);
  white-space: nowrap;
  text-align: right;
}

/* D/01 — scale bars */
.fig__track {
  display: block;
  height: 26px;
  border-radius: var(--radius-sm);
  background: hsl(0 0% 100% / 0.10);
  overflow: hidden;
}
.fig__bar {
  display: block;
  height: 100%;
  background: hsl(0 0% 100% / 0.85);
  transform: scaleX(0);
  transform-origin: left center;
}
.fig__bar--full { width: 100%; }
.fig__bar--sliver { width: 0.9%; min-width: 3px; }
.fig.is-in .fig__bar { animation: bar-grow 900ms var(--ease-expo) 250ms forwards; }
@keyframes bar-grow { to { transform: scaleX(1); } }

/* D/02 — waffle marks (cells generated in site.js) */
.fig__waffle { display: flex; flex-wrap: wrap; gap: 5px; }
.fig__waffle span {
  width: 13px;
  height: 13px;
  border-radius: var(--radius-sm);
  background: hsl(0 0% 100% / 0.85);
  opacity: 0;
}
.fig__waffle--hollow span {
  background: transparent;
  border: var(--border-width) solid hsl(0 0% 100% / 0.7);
}
.fig.is-in .fig__waffle span { animation: fade-in 300ms var(--ease-expo) both; }

/* D/03 — the 95/5 split */
.fig__split {
  display: flex;
  gap: var(--space-1);
  height: 30px;
  margin-top: var(--space-6);
}
.fig__split-a {
  flex: 0 0 95%;
  border-radius: var(--radius-sm);
  background: hsl(0 0% 100% / 0.85);
  transform: scaleX(0);
  transform-origin: left center;
}
.fig__split-b {
  flex: 1 1 auto;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid hsl(0 0% 100% / 0.7);
}
.fig.is-in .fig__split-a { animation: bar-grow 900ms var(--ease-expo) 250ms forwards; }
.fig__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-7);
  margin-top: var(--space-4);
}
.fig__key {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
  font-size: var(--text-caption);
  color: var(--navy-200);
}
.fig__key strong { color: var(--eb-white); }
.fig__swatch {
  width: 11px;
  height: 11px;
  flex: none;
  align-self: center;
  border-radius: var(--radius-sm);
  background: hsl(0 0% 100% / 0.85);
}
.fig__swatch--hollow { background: transparent; border: var(--border-width) solid hsl(0 0% 100% / 0.7); }

/* D/04 — the week, before and after */
.fig__row--week { grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); }
.fig__week { display: flex; gap: var(--space-1); height: 34px; }
.fig__week-a,
.fig__week-b {
  display: grid;
  align-items: center;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
/* Paperwork = the blue box, Field = the white box. */
.fig__week-a { flex: 0 0 12%; background: var(--navy-400); }
.fig__week-a--wide { flex-basis: 55%; }
.fig__week-b { flex: 1 1 auto; background: hsl(0 0% 100% / 0.85); }
.fig__week-a span, .fig__week-b span {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  white-space: nowrap;
}
.fig__week-a span { color: var(--eb-white); }
.fig__week-b span { color: var(--eb-navy); }

@media (max-width: 640px) {
  .fig__row, .fig__row--week { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .fig__value { font-size: var(--text-h3); }
  /* The narrow Review block can't fit its label at phone width. */
  .fig__week-a span { display: none; }
  .fig__week-a--wide span { display: block; }
}

.tile__title {
  margin-top: var(--space-4);
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
/* The white tile keeps its thin frame, so its title carries the nav
 * clearance itself. */
.tile__title--pad { padding: calc(var(--space-12) + var(--space-2)) var(--space-4) 0; }

/* Workflows: content packs to the top so the marquee sits right under the
 * 01 header instead of being pushed to the bottom of the viewport. */
.tile--plan { background: var(--navy-100); color: var(--eb-black); justify-content: flex-start; }
.tile--dark { background: var(--eb-navy); color: var(--eb-white); }
.tile--white { background: var(--surface-raised); gap: var(--space-3); padding: var(--space-3); }

/* The plan tile carries a drawn blueprint field so it is not a flat panel. */
.tile__plan-art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--navy-150) var(--border-width), transparent var(--border-width)),
    linear-gradient(to bottom, var(--navy-150) var(--border-width), transparent var(--border-width));
  background-size: 40px 40px;
  opacity: 0.9;
  pointer-events: none;
}
.tile > *:not(.tile__plan-art) { position: relative; }

.tile__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: var(--weight-bold);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.tile--plan .tile__num { color: var(--eb-navy); }
.tile--dark .tile__num { color: var(--eb-white); }

.tile__lede { max-width: 56ch; margin-top: var(--space-4); font-size: var(--text-sm); }
/* --text-secondary only clears AA on white; the navy-100 ground eats the
 * margin (4.11:1), so the plan tile steps down to the darker grey. */
.tile--plan .tile__lede { color: var(--grey-700); }
.tile--dark .tile__lede { color: var(--navy-200); }
.tile--dark .tile__lede + .tile__lede { margin-top: var(--space-4); }

/* Bar card — label plus a square action, repeated across columns. */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
}
.tile--white .bar { background: var(--navy-100); }
.bar__label { font-size: var(--text-caption); color: var(--eb-black); }
.bar__sq {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--eb-navy);
  color: var(--eb-white);
}
.bar__sq svg { width: 16px; height: 16px; }

/* On the navy tile the square has to invert or it disappears into the ground.
 * White is the brand's sanctioned partner to navy, so this is the accent. */
.tile--dark .bar__sq {
  width: 48px; height: 48px;
  background: var(--eb-white);
  color: var(--eb-navy);
}
.tile--dark .bar__sq svg { width: 20px; height: 20px; }

/* ============================================================ marquee
 * The Workflows strip: a full-bleed band of workflow panels crawling left,
 * grabbable, with curved curtains masking both edges. Position and inertia are
 * driven from site.js on requestAnimationFrame — there is deliberately no CSS
 * animation here, because the track has to be interruptible mid-travel by a
 * pointer drag and a keyframe cannot be caught and held.
 */

.marquee {
  position: relative;
  /* Full-bleed: cancel the tile's padding so the strip runs edge to edge. */
  margin-inline: calc(var(--tile-pad) * -1);
  overflow: hidden;
  /* The curtains are painted in the tile's own ground via currentColor, so they
   * read as the panel dissolving rather than as a grey band laid over it. */
  color: var(--navy-100);
}

/* Curtain depth must stay SHALLOWER than track padding + panel padding, or the
 * curve swallows the card heads at the viewport centre (its deepest point). */
.marquee__mask {
  position: absolute;
  left: 0;
  right: 0;
  height: 32px;
  z-index: 2;
  pointer-events: none;
}
.marquee__mask svg { display: block; width: 100%; height: 100%; }
.marquee__mask--top { top: 0; }
.marquee__mask--bottom { bottom: 0; }

.marquee__track {
  display: flex;
  width: max-content;
  gap: var(--space-4);
  padding-block: var(--space-6);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  /* Vertical scroll still belongs to the page; horizontal belongs to the strip. */
  touch-action: pan-y;
}
.marquee__track.is-dragging { cursor: grabbing; }

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: none;
  width: 240px;
  height: 320px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--eb-navy);
  color: var(--eb-white);
  overflow: hidden;
}
.panel__art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--navy-600) var(--border-width), transparent var(--border-width)),
    linear-gradient(to bottom, var(--navy-600) var(--border-width), transparent var(--border-width));
  background-size: 28px 28px;
}
.panel > *:not(.panel__art) { position: relative; }
.panel__num {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}
/* Name at the TOP of the card, clear of the bottom curtain mask. */
.panel__name {
  margin-top: var(--space-3);
  font-size: var(--text-h2);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--eb-white);
}
.panel__tag {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}
/* Each card's line icon, held mid-card in a quiet brand square. */
.panel__icon-wrap {
  margin: auto;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: var(--border-width) solid hsl(0 0% 100% / 0.28);
  border-radius: var(--radius-lg);
  background: hsl(211 56% 8% / 0.25);
  box-shadow: 0 0 26px hsl(0 0% 100% / 0.08);
}
.panel__icon { width: 44px; height: 44px; color: var(--eb-white); opacity: 0.95; }

/* The card's control: the icon square and a pill beneath it, together reading
 * as one pressable thing. It will open a worked example of that workflow —
 * `data-workflow` is the wiring point — and does nothing until then. */
.panel__cta {
  margin: auto;
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-lg);
}
.panel__cta .panel__icon-wrap {
  margin: 0;
  transition: background 220ms var(--easing), border-color 220ms var(--easing),
              box-shadow 220ms var(--easing), transform 220ms var(--easing);
}
.panel__cta-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 7px 15px;
  border: var(--border-width) solid hsl(0 0% 100% / 0.42);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--eb-white);
  transition: background 220ms var(--easing), border-color 220ms var(--easing),
              transform 220ms var(--easing);
}
.panel__cta-chev {
  width: 13px;
  height: 13px;
  transition: transform 220ms var(--easing);
}
.panel__cta:hover .panel__icon-wrap {
  border-color: hsl(0 0% 100% / 0.68);
  background: hsl(211 56% 8% / 0.45);
  box-shadow: 0 0 34px hsl(0 0% 100% / 0.18);
  transform: translateY(-2px);
}
.panel__cta:hover .panel__cta-label {
  background: hsl(0 0% 100% / 0.14);
  border-color: hsl(0 0% 100% / 0.85);
}
.panel__cta:hover .panel__cta-chev { transform: translateX(3px); }
.panel__cta:active .panel__icon-wrap { transform: translateY(0) scale(0.97); }
.panel__cta:active .panel__cta-label { transform: scale(0.98); }
.panel__cta:focus-visible { outline: 2px solid var(--eb-white); outline-offset: 8px; }

@media (min-width: 640px) {
  .marquee__mask { height: 40px; }
  .marquee__track { gap: var(--space-5); }
  .panel { width: 320px; height: 32rem; padding: var(--space-7); }
}

/* ------------------------------ Control: the submittal process flow ------
 * Four boxed steps down the page, connected by datum arrows; the one human
 * step carries the navy edge; a dashed return loop rides the right side.
 */

.flow {
  width: min(100%, 680px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-5);
}
.flow__head { display: grid; gap: var(--space-2); margin-bottom: var(--space-7); }
.flow__kicker {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}
.flow__title { font-size: var(--text-h2); letter-spacing: -0.01em; color: var(--text-primary); }
.flow__sub { font-size: var(--text-caption); color: var(--text-secondary); }

.flow__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.flow__step--human {
  border-color: var(--eb-navy);
  box-shadow: inset 3px 0 0 var(--eb-navy);
}
.flow__steprow { display: flex; align-items: center; gap: var(--space-4); }
.flow__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--eb-navy);
}
.flow__icon svg { width: 15px; height: 15px; }
.flow__name { flex: 1; font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text-primary); }
.flow__touch {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}
.flow__touch--navy { color: var(--eb-navy); font-weight: var(--weight-bold); }
.flow__data { font-family: var(--font-mono); font-size: var(--text-micro); color: var(--text-muted); }

.flow__list { display: grid; gap: var(--space-3); }
.flow__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-caption);
  color: var(--text-secondary);
}
.flow__list svg { width: 13px; height: 13px; flex: none; margin-top: 3px; color: var(--eb-navy); }

.flow__conf {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--border-hairline);
}
.flow__micro {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}
.flow__meter { flex: 1; height: 3px; background: var(--grey-200); }
.flow__meter-fill { display: block; width: 94%; height: 100%; background: var(--eb-navy); }
.flow__confval {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--eb-navy);
}

/* Connector: a centred datum line with an arrowhead and a side label. */
.flow__link { position: relative; height: 40px; flex: none; }
.flow__link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 6px;
  border-left: var(--border-width) solid var(--border-strong);
}
.flow__link::after {
  content: "";
  position: absolute;
  left: calc(50% - 4px);
  bottom: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--border-strong);
}
.flow__link span {
  position: absolute;
  left: calc(50% + 14px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}
.flow__link--navy::before { border-left-color: var(--eb-navy); }
.flow__link--navy::after { border-top-color: var(--eb-navy); }
.flow__link--navy span { color: var(--eb-navy); font-weight: var(--weight-bold); }

/* The redraft return loop, dashed, riding the right edge of steps 02–03. */
.flow__loopwrap { position: relative; display: flex; flex-direction: column; }
.flow__loop {
  position: absolute;
  top: 28px;
  bottom: 28px;
  right: -18px;
  width: 14px;
  border-top: var(--border-width) dashed var(--border-strong);
  border-right: var(--border-width) dashed var(--border-strong);
  border-bottom: var(--border-width) dashed var(--border-strong);
}
.flow__loop::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -4.5px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 6px solid var(--border-strong);
}
.flow__loop span {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  background: var(--surface-raised);
  padding: var(--space-3) 2px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.flow__approve {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.flow__approve > span:first-child { font-size: var(--text-caption); color: var(--text-secondary); }
.flow__btn {
  flex: none;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--eb-navy);
  color: var(--eb-white);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
}
.flow__caption {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--text-muted);
}
.flow__sent {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--status-clear);
}
.flow__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--status-clear); }
.flow__foot {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: var(--border-width) solid var(--border-hairline);
  font-size: var(--text-caption);
  color: var(--text-secondary);
}

@media (max-width: 760px) {
  .flow__loop { display: none; }
}

.tile--white .tile__pane {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  padding: var(--space-6);
  background: var(--navy-100);
  border-radius: var(--radius-md);
}
.tile__pane .tile__num { color: var(--eb-navy); }
.tile__pane h3 {
  margin-top: var(--space-3);
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  color: var(--eb-black);
}

/* ============================================================ footer */

.foot {
  padding: var(--space-10) var(--page-pad) var(--space-7);
  background: var(--navy-950);
  color: var(--eb-white);
}
.foot__about {
  display: grid;
  gap: var(--space-4);
  max-width: 62ch;
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: var(--border-width) solid var(--border-on-navy);
}
.foot__about p { font-size: var(--text-caption); color: var(--navy-200); }

/* The three co-founders — headshot frame, name, role, bio. The frames style
 * whatever lands inside them, placeholder tag or real <img>. */
.team {
  display: grid;
  gap: var(--space-6);
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: var(--border-width) solid var(--border-on-navy);
}
@media (min-width: 760px) {
  .team { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-7); }
}
.team__card { display: grid; gap: var(--space-3); align-content: start; }
.team__photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: var(--border-width) solid var(--border-on-navy);
  border-radius: var(--radius-md);
  background: var(--navy-900);
  overflow: hidden;
}
/* All founder photos run black and white, whatever arrives. */
.team__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.team__photo-icon { width: 34%; height: 34%; color: var(--navy-400); }
.team__photo-tag {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-300);
}
.team__name { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--eb-white); }
.team__role {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-200);
}
.team__bio { font-size: var(--text-caption); color: var(--navy-200); }

.foot__top {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: var(--space-8);
  border-bottom: var(--border-width) solid var(--border-on-navy);
}
@media (min-width: 760px) {
  .foot__top { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); }
}
/* The wordmark is styled for the nav's light glass, so it arrives here as ink
 * on the near-black footer ground — 1.15:1, invisible. This is the only place
 * .brand__name appears on a dark surface. */
.foot .brand__name { color: var(--eb-white); }
.foot__tagline { max-width: 32ch; margin-top: var(--space-4); font-size: var(--text-caption); color: var(--navy-200); }
.foot__heading {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-300);
}
.foot__list { display: grid; gap: var(--space-3); font-size: var(--text-caption); }
.foot__list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  padding-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--navy-300);
}

/* ============================================================ small screens */

@media (max-width: 760px) {
  :root { --page-pad: var(--space-5); }

  /* "EB Construction Automation" is a long wordmark. The mark square is the
   * first thing to go — the name is the identity, the square is decoration. */
  .brand__mark { display: none; }
  .brand__name { font-size: 0.9375rem; letter-spacing: 0.03em; }

  .stage__title { font-size: clamp(2rem, 9vw, 3rem); }
}

/* ============================================================ phone
 *
 * Everything from here down is the phone surface — built against an iPhone 17
 * Pro at 402 x 874. Nothing above this line is touched, and nothing here
 * reaches a desktop: each block is gated either on the site's existing 760px
 * phone edge or on `pointer: coarse`, which no mouse-driven browser reports.
 *
 * The phone is not a narrow desktop. Three things genuinely have to change
 * shape rather than just shrink:
 *
 *   1. The stage. At 402px the headline, the note and the EB mark all land on
 *      top of each other inside the panel, and the CTA falls across the
 *      chamfered corner where the navy has been cut away — putting a white
 *      square on the white ground. The panel becomes a plate and the copy
 *      runs underneath it, in document order.
 *   2. The client films. Four 16:10 tiles stacked is ~950px of scrolling to
 *      get past three logos. They become a swipeable rail.
 *   3. The founders. Three full-width headshots is ~1250px of face. They
 *      become a row of three.
 *
 * Everything else is fit and reach: safe areas, 44px targets, and press
 * states in place of hovers iOS leaves latched on.
 */

@media (max-width: 760px) {

  /* --- safe areas ------------------------------------------------------
   * Under viewport-fit=cover the page paints edge to edge, so every fixed
   * edge has to inset itself. env() is 0 in Safari's normal portrait chrome —
   * these only do something when the hardware actually asks. */

  .nav {
    padding-top: calc(var(--space-4) + env(safe-area-inset-top));
    padding-left: max(var(--page-pad), env(safe-area-inset-left));
    padding-right: max(var(--page-pad), env(safe-area-inset-right));
  }

  .menu {
    padding-top: calc(var(--space-12) + var(--space-5) + env(safe-area-inset-top));
    padding-bottom: calc(var(--space-9) + env(safe-area-inset-bottom));
    /* The overlay owns its own scroll; the page underneath must not take over
     * when it runs out. */
    overscroll-behavior: contain;
  }

  .vlight {
    padding: calc(var(--space-6) + env(safe-area-inset-top))
             calc(var(--space-5) + env(safe-area-inset-right))
             calc(var(--space-6) + env(safe-area-inset-bottom))
             calc(var(--space-5) + env(safe-area-inset-left));
  }
  .vlight__close {
    top: calc(var(--space-5) + env(safe-area-inset-top));
    right: calc(var(--space-5) + env(safe-area-inset-right));
  }

  .foot { padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom)); }

  /* --- reach -----------------------------------------------------------
   * 44px is Apple's floor for a touch target, and the burger is the only way
   * to navigate on a phone. */

  .nav__burger { width: 44px; height: 44px; }
  .cta:not(.cta--lg) .cta__sq { width: 40px; height: 40px; }   /* 44 with the 2px frame */
  .cta:not(.cta--lg) .cta__label { font-size: var(--text-sm); }

  /* The wordmark is the whole identity on a phone — the mark square is
   * already dropped above — so it must never wrap or push the burger off the
   * bar. It scales with the screen instead. */
  .brand__name {
    white-space: nowrap;
    font-size: clamp(0.75rem, 3.4vw, 0.9375rem);
  }

  /* Anchors land under a fixed 68px bar otherwise. Section padding shrinks
   * below, so the clearance moves here where it belongs. */
  .tile, .foot { scroll-margin-top: 5rem; }

  /* --- the stage, rebuilt as a column ---------------------------------- */

  .stage {
    --stage-pad: max(var(--space-5), env(safe-area-inset-left));
    padding-top: calc(var(--space-12) + var(--space-5) + env(safe-area-inset-top));
    padding-left: var(--stage-pad);
    padding-right: var(--stage-pad);
    padding-bottom: var(--space-10);
    min-height: 0;
  }

  /* Panel, headline, note — the DOM is already in this order, so the column
   * only has to stop them being absolutely positioned on top of each other. */
  .stage__wrap {
    display: flex;
    flex-direction: column;
    /* Wider than the gap inside each block, so plate / headline / note read as
     * three things rather than one long run. */
    gap: var(--space-8);
  }
  .stage__head,
  .stage__note {
    position: static;
    max-width: none;
    transform: none;
  }

  .stage__panel {
    height: 38svh;
    min-height: 220px;
    max-height: 340px;
  }
  /* Top-LEFT, not top-right: the tag wrapped against the right edge, and the
   * bottom-left is where the chamfer cuts the panel away. */
  .stage__tag {
    left: var(--space-5);
    right: auto;
    max-width: 70%;
  }

  /* The copy now sits on the light ground, so it inverts to ink. */
  .stage__eyebrow { color: var(--text-muted); }
  .stage__title {
    color: var(--text-primary);
    /* Held where "Your process." still clears the screen on one line — the
     * <br> is the only break this headline is allowed. */
    font-size: clamp(2.125rem, 10vw, 2.75rem);
  }
  .stage__title-alt { letter-spacing: 0.08em; }
  .stage__note { max-width: 40ch; }
  .stage__note-title { color: var(--eb-black); }
  .stage__note-body {
    color: var(--text-secondary);
    font-size: var(--text-sm);
  }

  .stage__meta {
    margin-top: var(--space-8);
    text-align: left;
  }

  /* --- client films: a rail, not a stack ------------------------------- */

  .stage__cards {
    width: auto;
    margin: var(--space-8) 0 0;
  }
  /* The boxed label was a full row of empty border. On a phone it is a label. */
  .clients__label {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
  }
  .clients__row {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    /* A horizontal swipe belongs to the rail, not to Safari's back gesture. */
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Full bleed. The rail running off both edges is what says "swipe me";
     * a row that stops neatly inside the margin reads as clipped instead. */
    margin-left: calc(var(--stage-pad) * -1);
    margin-right: calc(var(--stage-pad) * -1);
    padding-left: var(--stage-pad);
    padding-right: var(--stage-pad);
    scroll-padding-left: var(--stage-pad);
  }
  .clients__row::-webkit-scrollbar { display: none; }
  /* Just under four fifths, so the next card is always half-visible and the
   * rail never looks like it ends at the screen edge. */
  .clients__row > * {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  /* --- sections -------------------------------------------------------- */

  /* A full viewport per section is a desktop rhythm. On a phone it left the
   * Workflows tile with ~300px of empty blueprint under the marquee, and the
   * 80px of nav clearance is now carried by scroll-margin-top instead. */
  .tile { min-height: 0; }
  .tile--plan, .tile--dark { padding-top: var(--space-9); }
  .tile--white .tile__title--pad { padding-top: var(--space-9); }

  .fig { padding: var(--space-6); }
  /* Value beside its label rather than under it — three stacked lines per
   * statistic is a lot of column for one number. */
  .ground__stat {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: var(--space-4);
  }

  /* --- Control: the submittal flow ------------------------------------- */

  /* "You approve" and "The only human step" cannot share a 354px line, and
   * squeezing them broke the step name over two lines. The tag drops to its
   * own row, indented past the icon so it still reads as that step's. */
  .flow { padding: var(--space-5) var(--space-4); }
  .flow__steprow { flex-wrap: wrap; row-gap: var(--space-3); }
  .flow__touch {
    flex: 1 0 100%;
    padding-left: calc(28px + var(--space-4));
  }

  /* --- footer ---------------------------------------------------------- */

  /* Three across. Full-width headshots were 1250px of scrolling to meet three
   * people; at a third of the width you meet all three at once. */
  .team {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }
  .team__card { gap: var(--space-2); }
  /* Small enough that every one of the three names holds a single line — a
   * wrapped surname pushes one role out of step with the other two. */
  .team__name { font-size: var(--text-micro); line-height: var(--leading-snug); }
  .team__role { font-size: 0.625rem; letter-spacing: 0.06em; }

  /* The phone number and the email are the two things a visitor is here to
   * tap. At 14px on an 8px gap they were 22px of target. */
  .foot__list { gap: 0; }
  .foot__list a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

/* Narrow phones: the fig rows have already collapsed to one column by here,
 * so a right-aligned value floats off on its own with nothing to align to. */
@media (max-width: 640px) {
  .fig__value { text-align: left; font-size: var(--text-h2); }
}

/* Landscape phone. Same column as portrait — the plate just gets out of the
 * way faster. Gated on pointer:coarse so a short desktop window is untouched. */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .stage {
    --stage-pad: max(var(--space-5), env(safe-area-inset-left));
    min-height: 0;
    padding-left: var(--stage-pad);
    padding-right: var(--stage-pad);
  }
  .stage__wrap { display: flex; flex-direction: column; gap: var(--space-6); }
  .stage__head,
  .stage__note { position: static; max-width: 52ch; transform: none; }
  .stage__panel { height: auto; aspect-ratio: 16 / 7; }
  .stage__eyebrow { color: var(--text-muted); }
  .stage__title { color: var(--text-primary); }
  .stage__note-title { color: var(--eb-black); }
  .stage__note-body { color: var(--text-secondary); }
  .stage__tag { left: var(--space-5); right: auto; }
  .tile { min-height: 0; }
}

/* ============================================================ touch
 * Gated on the pointer itself rather than a width, because these are about
 * the input device and not the screen.
 */

@media (hover: none) and (pointer: coarse) {

  /* Safari paints its own grey box over anything tapped. The press states
   * below are the replacement, so the default is only noise. */
  a, button, .clip { -webkit-tap-highlight-color: transparent; }

  /* iOS latches :hover onto the last thing touched and leaves it there until
   * something else is. A hover lift becomes a stuck lift, and a hover glow
   * becomes a card that looks selected for the rest of the session. */
  .clip.is-ready:hover { transform: none; }
  .clip.is-ready:hover .clip__thumb::before { background: hsl(211 56% 14% / 0.82); transform: none; }
  .clip.is-ready:hover .clip__thumb::after { background: hsl(211 56% 18% / 0.08); }
  .cta:hover { background: var(--eb-navy); }
  .cta:hover .cta__sq svg { transform: none; }
  .nav__link:hover { color: var(--text-secondary); }
  .panel__cta:hover .panel__icon-wrap {
    transform: none;
    border-color: hsl(0 0% 100% / 0.28);
    background: hsl(211 56% 8% / 0.25);
    box-shadow: 0 0 26px hsl(0 0% 100% / 0.08);
  }
  .panel__cta:hover .panel__cta-label { background: none; border-color: hsl(0 0% 100% / 0.42); }
  .panel__cta:hover .panel__cta-chev { transform: none; }

  /* A press has to answer immediately — there is no cursor to say what is
   * under the finger. */
  .cta:active { background: var(--navy-600); }
  .clip.is-ready:active { transform: scale(0.985); }
  .menu__link:active { background: hsl(211 40% 38% / 0.28); color: var(--eb-white); }
  .nav__burger:active { background: var(--surface-hover); }
  .foot__list a:active { text-decoration: underline; text-underline-offset: 3px; }
  .vlight__close:active { background: hsl(211 56% 8% / 0.8); }
}

/* ============================================================ print */

@media print {
  .nav, .menu, .backdrop, .cta { display: none; }
  body, .stage, .bento, .foot { background: var(--eb-white); color: var(--eb-black); }
  .stage__title, .stage__note-body, .foot__list, .foot__tagline { color: var(--eb-black); }
  /* The panel is a navy plate with no ink value on paper. */
  .stage__panel { display: none; }
  [data-reveal] { opacity: 1; }
}
