/* ==========================================================================
   ATLAS CONSTRUCTION PLC — Core stylesheet
   Brand: teal #147B8D · gold #DFBF23 · engineered negative space
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Saira';
  src: url('../fonts/saira-var-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-var-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand. The --brand-* values come from Admin → Branding; the literals are
     the fallback when no palette has been saved. */
  --teal: var(--brand-teal, #147b8d);
  --teal-bright: var(--brand-teal-bright, #1fa3ba);
  --teal-dim: #0f5d6b;
  --gold: var(--brand-gold, #dfbf23);
  --gold-bright: var(--brand-gold-bright, #f2d244);
  --gold-dim: #a88f14;

  /* Gold as a fill, and the ink that goes on it. Both stay put in either
     theme: the pair has to keep its contrast wherever it lands. */
  --gold-fill: var(--brand-gold, #dfbf23);
  --on-gold: #05161a;

  /* Surfaces (dark-first, as the brand deck specifies) */
  --ink-900: #05161a;
  --ink-800: #082025;
  --ink-700: #0b262b;
  --ink-600: #0f3038;
  --ink-500: #143d47;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* Surfaces lift off the page; scrims sit over artwork. Both flip with the
     theme, which is why nothing below hard-codes white or ink any more. */
  --surface-1: rgba(255, 255, 255, 0.045);
  --surface-1-to: rgba(255, 255, 255, 0.012);
  --surface-2: rgba(255, 255, 255, 0.03);
  --surface-3: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-track: rgba(255, 255, 255, 0.12);
  --surface-ghost: rgba(255, 255, 255, 0.015);
  --surface-index: rgba(255, 255, 255, 0.06);
  --sheen: rgba(255, 255, 255, 0.5);
  --inset-hilite: rgba(255, 255, 255, 0.04);

  --scrim-header: rgba(5, 22, 26, 0.82);
  --scrim-drawer: rgba(5, 22, 26, 0.97);
  --scrim-chip: rgba(5, 22, 26, 0.82);
  --scrim-pill: rgba(5, 22, 26, 0.75);
  --scrim-hint: rgba(5, 22, 26, 0.85);
  --scrim-float: rgba(5, 22, 26, 0.8);
  --card-veil-a: rgba(5, 22, 26, 0.28);
  --card-veil-b: rgba(5, 22, 26, 0.76);
  --card-veil-c: rgba(5, 22, 26, 0.94);

  /* The wash behind the hero copy — light in light mode, so the headline and
     the navigation keep their contrast against the 3D scene. */
  --hero-wash: 4, 18, 22;
  --wash-teal: rgba(20, 123, 141, 0.16);

  /* Deep backdrops used by the hero, the 3D stages and the footer */
  --stage-top: #061a1f;
  --stage-mid: #05161a;
  --stage-bottom: #041216;
  --stage-panel-a: #0a2a31;
  --stage-panel-b: #082228;
  --stage-panel-c: #04151a;

  /* The sub-page banner follows the theme; the stages above do not. */
  --page-hero-from: #061a1f;
  --page-hero-to: #05161a;

  /* Text */
  --fg: #eef5f6;
  --fg-muted: #a7bfc4;
  --fg-dim: #7d99a0;

  /* Light section surfaces */
  --paper: #f4f7f8;
  --paper-alt: #e7eeef;
  --paper-fg: #0a2429;
  --paper-fg-muted: #4b666c;

  /* Type */
  --font-display: 'Saira', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.79rem, 0.77rem + 0.10vw, 0.85rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.16vw, 1.05rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.34vw, 1.35rem);
  --step-2: clamp(1.42rem, 1.28rem + 0.68vw, 1.85rem);
  --step-3: clamp(1.78rem, 1.50rem + 1.35vw, 2.6rem);
  --step-4: clamp(2.2rem, 1.70rem + 2.45vw, 3.5rem);
  --step-5: clamp(2.5rem, 1.80rem + 3.40vw, 4.5rem);

  /* Space */
  --sp-1: 0.35rem;
  --sp-2: 0.65rem;
  --sp-3: 1rem;
  --sp-4: 1.5rem;
  --sp-5: 2.25rem;
  --sp-6: 3.25rem;
  --sp-7: 4.75rem;
  --sp-8: 7rem;

  --shell: 1280px;
  --gutter: clamp(1.15rem, 4vw, 3rem);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --shadow-lift: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 1px 0 var(--inset-hilite) inset, 0 18px 40px -30px rgba(0, 0, 0, 0.9);

  --header-h: 78px;
}

/* --------------------------------------------------------------------------
   2b. Light theme
   --------------------------------------------------------------------------
   Declared once, against a concrete [data-theme="light"]. "System" is resolved
   to a concrete value by the inline script in the page head before first
   paint, so the CSS never has to carry a second copy of this palette inside a
   prefers-color-scheme block.

   Only the neutrals change, plus the two accents' text weight: teal and gold
   keep their identity and are darkened just enough to hold contrast on white.
   With scripting off the site stays dark, which is the brand's primary look.
   -------------------------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  /* Darkened from the same brand colours so they hold contrast on white.
     Because these are mixes of --brand-*, changing the palette in the admin
     moves both themes together. */
  --teal: color-mix(in srgb, var(--brand-teal, #147b8d) 82%, #00161c);
  --teal-bright: color-mix(in srgb, var(--brand-teal-bright, #1fa3ba) 68%, #00161c);
  --gold: color-mix(in srgb, var(--brand-gold, #dfbf23) 49%, #241c00);
  --gold-bright: color-mix(in srgb, var(--brand-gold-bright, #f2d244) 62%, #241c00);

  --ink-900: #f4f7f8;
  --ink-800: #ffffff;
  --ink-700: #eef2f4;
  --ink-600: #e3eaed;
  --ink-500: #d6e0e4;

  --fg: #0a2429;
  --fg-muted: #43585f;
  --fg-dim: #536369;

  --line: rgba(10, 36, 41, 0.12);
  --line-strong: rgba(10, 36, 41, 0.24);

  --surface-1: #ffffff;
  --surface-1-to: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #ffffff;
  --surface-hover: #eef2f4;
  --surface-track: rgba(10, 36, 41, 0.14);
  --surface-ghost: #ffffff;
  --surface-index: rgba(10, 36, 41, 0.07);
  --sheen: rgba(255, 255, 255, 0.65);
  --inset-hilite: rgba(255, 255, 255, 0.9);

  --scrim-header: rgba(255, 255, 255, 0.88);
  --scrim-drawer: rgba(244, 247, 248, 0.98);
  --scrim-chip: rgba(255, 255, 255, 0.78);
  --scrim-pill: rgba(255, 255, 255, 0.86);
  --scrim-hint: rgba(255, 255, 255, 0.86);
  --scrim-float: rgba(255, 255, 255, 0.9);

  /* Project cards keep dark artwork behind them, so their veil stays dark */
  --card-veil-a: rgba(5, 22, 26, 0.32);
  --card-veil-b: rgba(5, 22, 26, 0.80);
  --card-veil-c: rgba(5, 22, 26, 0.94);

  --hero-wash: 244, 247, 248;
  /* Lighter here: on a light ground the same strength would darken the panel
     enough to push text below AA. */
  --wash-teal: rgba(20, 123, 141, 0.07);
  --page-hero-from: #eef3f5;
  --page-hero-to: #f4f7f8;

  --shadow-lift: 0 24px 60px -28px rgba(10, 36, 41, 0.28);
  --shadow-card: 0 1px 0 var(--inset-hilite) inset, 0 16px 34px -26px rgba(10, 36, 41, 0.45);
}

/* --------------------------------------------------------------------------
   2c. Content that stays dark in light mode
   --------------------------------------------------------------------------
   Some surfaces are dark whichever theme is on: project cards sit over
   photographs, the call-to-action band is a deep teal panel, the footer is
   near-black, and the 3D stages need a dark ground for a lit machine to read
   against.

   Their text must not follow the theme, so the foreground tokens are pinned
   back to their dark-theme values here. Because custom properties inherit,
   setting them on the container is enough for everything inside it — no
   component needs a light-mode variant of its own.
   -------------------------------------------------------------------------- */
:root[data-theme="light"] :is(.project, .gallery-card, .cta-band, .site-footer, .split__media, .fleet__stage) {
  --fg: #eef5f6;
  --fg-muted: #a7bfc4;
  --fg-dim: #9ab2b8;

  /* Text inherits the colour computed on <body>, not the token, so headings
     and anything else without a colour of its own need it restated here. */
  color: var(--fg);

  /* Buttons on these panels put dark text on gold, as they do in dark mode */
  --ink-900: #05161a;
  --ink-800: #082025;

  /* The ground a project card paints under its artwork. Without this the card
     would be pale while the text on it stays light. */
  --ink-700: #0b262b;

  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);

  /* Accents return to full strength: they are on dark again */
  --teal: var(--brand-teal, #147b8d);
  --teal-bright: var(--brand-teal-bright, #1fa3ba);
  --gold: var(--brand-gold, #dfbf23);
  --gold-bright: var(--brand-gold-bright, #f2d244);

  --surface-1: rgba(255, 255, 255, 0.06);
  --surface-1-to: rgba(255, 255, 255, 0.02);
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.11);
  --surface-track: rgba(255, 255, 255, 0.14);
  --surface-index: rgba(255, 255, 255, 0.08);
  --surface-ghost: rgba(255, 255, 255, 0.03);

  --scrim-chip: rgba(5, 22, 26, 0.82);
  --scrim-pill: rgba(5, 22, 26, 0.75);
  --scrim-hint: rgba(5, 22, 26, 0.85);
  --scrim-float: rgba(5, 22, 26, 0.8);
}

:root[data-theme="dark"] { color-scheme: dark; }

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); font-weight: 800; font-stretch: 108%; }
h2 { font-size: var(--step-4); font-stretch: 106%; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--sp-3); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

strong { font-weight: 650; }

::selection { background: var(--gold-fill); color: var(--on-gold); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-3);
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--gold-fill);
  color: var(--on-gold);
  font-weight: 650;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(3.75rem, 8vw, 7.5rem);
}

.section--tight { padding-block: clamp(2.75rem, 5vw, 4.5rem); }

.section--paper {
  background: var(--paper);
  color: var(--paper-fg);
}
.section--paper .lede,
.section--paper .section-head__text { color: var(--paper-fg-muted); }

.section--ink { background: var(--ink-800); }

.section--seam { border-top: 1px solid var(--line); }

/* Blueprint grid texture, used behind dark sections */
.section--grid::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 163, 186, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 163, 186, 0.055) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 25%, transparent 78%);
}
.section > * { position: relative; z-index: 1; }

.grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* --------------------------------------------------------------------------
   5. Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--gold-fill);
  flex: none;
}
.eyebrow--teal { color: var(--teal-bright); }
.eyebrow--teal::before { background: var(--teal-bright); }
.section--paper .eyebrow { color: var(--teal); }
.section--paper .eyebrow::before { background: var(--teal); }

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 62ch;
}

.muted { color: var(--fg-muted); }
.gold { color: var(--gold); }
.teal { color: var(--teal-bright); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  margin-bottom: clamp(2.25rem, 4vw, 3.5rem);
  align-items: end;
}
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.section-head h2 { margin-bottom: 0; }
.section-head__text {
  color: var(--fg-muted);
  max-width: 56ch;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--gold-fill);
  --btn-fg: var(--on-gold);
  --btn-bd: var(--gold-fill);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.92rem 1.7rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              background-color 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, var(--sheen) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px rgba(223, 191, 35, 0.75);
}
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-bd: var(--line-strong);
}
.btn--ghost:hover {
  --btn-bg: rgba(31, 163, 186, 0.12);
  --btn-bd: var(--teal-bright);
  box-shadow: 0 14px 30px -18px rgba(31, 163, 186, 0.8);
}
.section--paper .btn--ghost { --btn-fg: var(--paper-fg); --btn-bd: rgba(10, 36, 41, 0.25); }

.btn--teal { --btn-bg: var(--teal); --btn-fg: #fff; --btn-bd: var(--teal); }
.btn--teal:hover { box-shadow: 0 14px 30px -14px rgba(20, 123, 141, 0.9); }

.btn--sm { padding: 0.66rem 1.05rem; letter-spacing: 0.1em; }
.btn--wide { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* Text link with animated rule */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.link-more svg { transition: transform 0.35s var(--ease); }
.link-more:hover svg { transform: translateX(5px); }
.section--paper .link-more { color: var(--teal); }

/* --------------------------------------------------------------------------
   7. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
              border-color 0.4s var(--ease), height 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  height: 66px;
  background: var(--scrim-header);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.site-header__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex: none;
}
.brand__mark {
  width: 44px;
  height: auto;
  transition: transform 0.5s var(--ease);
}
.brand:hover .brand__mark { transform: translateY(-2px) scale(1.04); }
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.02rem;
  letter-spacing: 0.13em;
  color: var(--fg);
}
.brand__sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.30em;
  color: var(--gold);
  margin-top: 4px;
}

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 1.6vw, 1.6rem); }
.nav__list { display: flex; align-items: center; gap: clamp(0.75rem, 1.4vw, 1.5rem); }
.nav__link {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 550;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-block: 0.35rem;
  transition: color 0.3s var(--ease);
  white-space: nowrap;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--gold-fill);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link:hover::after,
.nav__link[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current='page'] { color: var(--fg); }

/* ---- colour theme switch ---- */
.theme {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface-2);
  flex: none;
}
.theme__opt {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.theme__opt svg { width: 15px; height: 15px; }
.theme__opt:hover { color: var(--fg); }
.theme__opt[aria-pressed='true'] {
  background: var(--gold-fill);
  color: var(--on-gold);
}

/* The header button is offered only once seven nav entries, the theme switch
   and the button itself all fit on one line; below that the button lives in
   the drawer, where it has room. Its label never wraps. */
.nav__cta { display: none; white-space: nowrap; }
@media (min-width: 1320px) {
  .nav__cta { display: inline-flex; }
  /* Seven entries, the switch and the button share one line here, so the
     links give up a little tracking and spacing to make room. */
  .nav__list { gap: clamp(0.6rem, 0.9vw, 1rem); }
  .nav__link { font-size: 0.73rem; letter-spacing: 0.07em; }
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--fg);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle span:nth-child(2) { width: 70%; }
.nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 100%; }

@media (min-width: 981px) { .nav-toggle { display: none; } }
@media (max-width: 980px) {
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-5);
    background: var(--scrim-drawer);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; gap: var(--sp-4); }
  .theme { order: 2; }
  .nav__link { font-size: 1.25rem; letter-spacing: 0.16em; }
  .nav__cta { display: inline-flex; }
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(100svh, 980px);
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: var(--sp-6);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 72% 18%, rgba(20, 123, 141, 0.32) 0%, transparent 58%),
    radial-gradient(90% 70% at 12% 88%, rgba(223, 191, 35, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, var(--stage-top) 0%, var(--stage-mid) 55%, var(--stage-bottom) 100%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero__canvas canvas { width: 100% !important; height: 100% !important; }

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(var(--hero-wash), 0.94) 0%, rgba(var(--hero-wash), 0.72) 34%, rgba(var(--hero-wash), 0.06) 62%, transparent 80%),
    linear-gradient(0deg, rgba(var(--hero-wash), 0.92) 0%, transparent 40%);
}
@media (max-width: 860px) {
  .hero__scrim {
    background: linear-gradient(180deg, rgba(var(--hero-wash), 0.88) 0%, rgba(var(--hero-wash), 0.62) 45%, rgba(var(--hero-wash), 0.95) 100%);
  }
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero__content { max-width: 40rem; }

.hero h1 { margin-bottom: var(--sp-4); }
.hero h1 .accent {
  color: var(--gold);
  display: block;
}

.hero__lede {
  font-size: var(--step-1);
  color: var(--fg-muted);
  max-width: 34rem;
  margin-bottom: var(--sp-4);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.95rem 0.45rem 0.5rem;
  margin-bottom: var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  background: var(--surface-3);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.hero__badge b {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 100px;
  background: var(--gold-fill);
  color: var(--on-gold);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.hero__stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 750;
  font-stretch: 105%;
  line-height: 1;
  color: var(--fg);
}
.hero__stat > span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero__cue i {
  display: block;
  width: 1px;
  height: 42px;
  background: linear-gradient(var(--gold), transparent);
  animation: cue 2.4s var(--ease-in-out) infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.35); opacity: 0.35; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}
@media (max-width: 860px) { .hero__cue { display: none; } }

/* Loading state for WebGL scenes */
.scene-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 0.9rem;
  justify-items: center;
  background: var(--ink-900);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.scene-loader.is-done { opacity: 0; visibility: hidden; }
.scene-loader__bar {
  width: min(240px, 50vw);
  height: 2px;
  background: var(--surface-track);
  overflow: hidden;
}
.scene-loader__bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--gold-fill);
  animation: sweep 1.2s var(--ease-in-out) infinite;
}
@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.scene-loader__label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* --------------------------------------------------------------------------
   9. Page hero (sub-pages)
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 7vw, 6rem));
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
  overflow: hidden;
  background:
    radial-gradient(100% 120% at 80% 0%, rgba(20, 123, 141, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, var(--page-hero-from), var(--page-hero-to));
  border-bottom: 1px solid var(--line);
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 163, 186, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 163, 186, 0.07) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.page-hero > * { position: relative; }
.page-hero h1 { font-size: var(--step-4); max-width: 20ch; }
.page-hero .lede { margin-top: var(--sp-3); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: var(--sp-4);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.crumbs a { color: var(--fg-muted); transition: color 0.25s var(--ease); }
.crumbs a:hover { color: var(--gold); }
.crumbs li:not(:last-child)::after { content: '/'; margin-left: 0.55rem; color: var(--fg-dim); opacity: 0.5; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs [aria-current] { color: var(--gold); }

/* --------------------------------------------------------------------------
   10. Cards
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  padding: clamp(1.5rem, 2.4vw, 2.1rem);
  background: linear-gradient(160deg, var(--surface-1), var(--surface-1-to));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(var(--teal-bright), var(--gold));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.card:hover::before { transform: scaleY(1); }

.card__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius-sm);
  background: rgba(20, 123, 141, 0.18);
  border: 1px solid rgba(31, 163, 186, 0.32);
  color: var(--teal-bright);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), transform 0.5s var(--ease);
}
.card:hover .card__icon {
  background: var(--gold-fill);
  border-color: var(--gold-fill);
  color: var(--on-gold);
  transform: rotate(-6deg);
}
.card__icon svg { width: 26px; height: 26px; }

.card h3 { font-size: var(--step-1); margin-bottom: var(--sp-2); }
.card p { color: var(--fg-muted); font-size: 0.95rem; }

.card__index {
  position: absolute;
  top: clamp(1.2rem, 2vw, 1.8rem);
  right: clamp(1.2rem, 2vw, 1.8rem);
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--surface-index);
  pointer-events: none;
}

.card__list { margin-top: var(--sp-3); display: grid; gap: 0.5rem; }
.card__list li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.88rem;
  color: var(--fg-muted);
}
.card__list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.62em;
  width: 7px; height: 7px;
  background: var(--gold-fill);
  transform: rotate(45deg);
}

.section--paper .card {
  background: #fff;
  border-color: rgba(10, 36, 41, 0.10);
  box-shadow: 0 20px 40px -34px rgba(10, 36, 41, 0.55);
}
.section--paper .card p,
.section--paper .card__list li { color: var(--paper-fg-muted); }
.section--paper .card__index { color: rgba(10, 36, 41, 0.07); }

/* --------------------------------------------------------------------------
   11. Feature split (image / text)
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--reverse > *:first-child { order: 2; }
}

/* Half-width columns need a step down from the full-bleed section scale */
.split h2 { font-size: var(--step-3); }

.split__media {
  position: relative;
  aspect-ratio: 4 / 3.2;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--stage-panel-a), var(--stage-top));
}
.split__media canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* Poster shown until (or instead of) a live 3D scene in the media panel */
.split__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.7s var(--ease);
}
.split__media.is-live .split__poster { opacity: 0; }
.split__media::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -80px 80px -60px rgba(4, 18, 22, 0.9);
}

.media-tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  background: var(--scrim-pill);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.media-tag i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold-fill);
  box-shadow: 0 0 0 4px rgba(223, 191, 35, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(223, 191, 35, 0); }
}

/* --------------------------------------------------------------------------
   12. Fleet viewer (interactive 3D)
   -------------------------------------------------------------------------- */
.fleet {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
@media (min-width: 1000px) {
  .fleet { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  /* Give the stage its own height rather than letting it stretch to the tab list. */
  .fleet .fleet__stage { height: clamp(360px, 56vh, 620px); }
}

.fleet__stage {
  position: relative;
  min-height: clamp(360px, 52vh, 620px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(80% 70% at 50% 20%, rgba(20, 123, 141, 0.22), transparent 65%),
    linear-gradient(180deg, var(--stage-panel-b), var(--stage-panel-c));
}
/* Each machine's picture fills the stage; only the selected one is shown. */
.fleet__picture {
  position: absolute;
  inset: 0;
  margin: 0;
}
.fleet__picture[hidden] { display: none; }
.fleet__picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fleet__stage.is-switching .fleet__picture:not([hidden]) {
  animation: fleet-fade 0.45s var(--ease) both;
}
@keyframes fleet-fade {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}
/* No picture yet: the emblem and the machine's name stand in for it. */
.fleet__stage.is-empty {
  background:
    url('../img/logo-emblem.svg') center 42% / 34% no-repeat,
    linear-gradient(160deg, var(--stage-panel-a), var(--stage-top));
}
.fleet__picture--empty {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem;
}
.fleet__picture--empty figcaption {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.fleet--tall .fleet__stage { min-height: clamp(420px, 66vh, 720px); }
@media (min-width: 1000px) {
  .fleet--tall { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  /* Keep the machine on screen while the specification list scrolls past it. */
  .fleet--tall .fleet__stage {
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
    height: clamp(420px, 66vh, 720px);
  }
}

.fleet__panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.fleet__tabs {
  display: grid;
  gap: 0.5rem;
  max-height: 100%;
}
.fleet__tab {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: all 0.35s var(--ease);
}
.fleet__tab i {
  flex: none;
  width: 26px;
  font-size: 0.66rem;
  font-weight: 700;
  font-style: normal;
  color: var(--fg-dim);
}
.fleet__tab:hover { border-color: var(--line-strong); color: var(--fg); background: var(--surface-hover); }
.fleet__tab[aria-selected='true'] {
  background: var(--teal);
  border-color: var(--teal-bright);
  color: #fff;
}
.fleet__tab[aria-selected='true'] i { color: #fff; }

.fleet__readout {
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.fleet__readout h3 { font-size: var(--step-1); margin-bottom: 0.35rem; }
.fleet__readout p { font-size: 0.9rem; color: var(--fg-muted); }

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}
.spec-list dt {
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.spec-list dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   13. Stats / counters
   -------------------------------------------------------------------------- */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(140deg, var(--wash-teal), var(--surface-1-to));
}
/* The teal wash is at full strength in this corner, so the dimmest label tier
   needs a little more lift here than it does against the plain panel. */
:root[data-theme="dark"] .stat-band { --fg-dim: #96b8c0; }
.stat {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat b {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 800;
  font-stretch: 104%;
  line-height: 1;
  color: var(--gold);
}
.stat > span {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.stat small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
  letter-spacing: 0;
  text-transform: none;
}

/* --------------------------------------------------------------------------
   14. Process timeline
   -------------------------------------------------------------------------- */
.process { position: relative; display: grid; gap: var(--sp-5); counter-reset: step; }
@media (min-width: 860px) {
  .process { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--sp-4); }
  .process::before {
    content: '';
    position: absolute;
    top: 27px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 12%, var(--line-strong) 88%, transparent);
  }
}
.process__step { position: relative; padding-top: 0; }
.process__num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: var(--sp-3);
  border-radius: 50%;
  background: var(--ink-800);
  border: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 750;
  color: var(--gold);
  transition: all 0.4s var(--ease);
}
.process__step:hover .process__num {
  background: var(--gold-fill);
  color: var(--on-gold);
  border-color: var(--gold-fill);
  box-shadow: 0 0 0 8px rgba(223, 191, 35, 0.12);
}
.process__step h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.process__step p { font-size: 0.92rem; color: var(--fg-muted); }

/* --------------------------------------------------------------------------
   15. Projects
   -------------------------------------------------------------------------- */
.project-grid {
  display: grid;
  gap: clamp(1.1rem, 2vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
@media (min-width: 1000px) {
  .project-grid--feature { grid-template-columns: repeat(6, 1fr); }
  .project-grid--feature > :nth-child(1) { grid-column: span 4; }
  .project-grid--feature > :nth-child(2) { grid-column: span 2; }
  .project-grid--feature > :nth-child(3) { grid-column: span 2; }
  .project-grid--feature > :nth-child(4) { grid-column: span 4; }
  .project-grid--feature > :nth-child(5) { grid-column: span 3; }
  .project-grid--feature > :nth-child(6) { grid-column: span 3; }
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  padding: clamp(1.3rem, 2.4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  background: var(--ink-700);
  transition: transform 0.55s var(--ease), border-color 0.4s var(--ease);
}
.project__art {
  position: absolute;
  inset: 0;
  z-index: -2;
  transition: transform 0.9s var(--ease);
}
.project__art svg { width: 100%; height: 100%; }
.project::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--card-veil-a) 0%, var(--card-veil-b) 45%, var(--card-veil-c) 78%);
  transition: opacity 0.5s var(--ease);
}
.project:hover { transform: translateY(-6px); border-color: var(--teal-bright); }
.project:hover .project__art { transform: scale(1.06); }

.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: var(--scrim-chip);
  backdrop-filter: blur(6px);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.chip--gold {
  border-color: rgba(223, 191, 35, 0.45);
  color: var(--gold);
  /* The tint layers over the scrim rather than replacing it, so the chip still
     has a dark ground when the artwork behind it is bright. */
  background: linear-gradient(rgba(223, 191, 35, 0.08), rgba(223, 191, 35, 0.08)), var(--scrim-chip);
}

.project h3 { font-size: var(--step-2); margin-bottom: 0.4rem; }
.project p { font-size: 0.9rem; color: var(--fg-muted); max-width: 44ch; }

.project__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.project__stats div b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.project__stats div span {
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* Filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: var(--sp-5);
}
.filter {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.filter:hover { color: var(--fg); border-color: var(--line-strong); }
.filter[aria-pressed='true'] { background: var(--gold-fill); border-color: var(--gold-fill); color: var(--on-gold); }

.project.is-hidden,
.gallery-card.is-hidden { display: none; }

/* The tally beside a filter label */
.filter__count {
  margin-left: 0.45rem;
  opacity: 0.6;
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   16. Quote / testimonial
   -------------------------------------------------------------------------- */
.quote {
  position: relative;
  max-width: 62rem;
  margin-inline: auto;
  text-align: center;
  padding-inline: clamp(0, 3vw, 3rem);
}
.quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  font-stretch: 103%;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.quote blockquote em { color: var(--gold); font-style: normal; }
.quote figcaption {
  margin-top: var(--sp-4);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.quote__mark {
  display: block;
  width: 46px;
  margin: 0 auto var(--sp-4);
  color: var(--teal-bright);
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   17. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 7vw, 6rem);
  background:
    radial-gradient(80% 140% at 15% 0%, rgba(20, 123, 141, 0.45), transparent 60%),
    linear-gradient(120deg, #072026, #041418);
  border-block: 1px solid var(--line);
}
.cta-band::before {
  content: '';
  position: absolute;
  right: -8%;
  top: 50%;
  translate: 0 -50%;
  width: min(560px, 55%);
  aspect-ratio: 1000 / 720;
  background: url('../img/logo-emblem.svg') center/contain no-repeat;
  opacity: 0.07;
  pointer-events: none;
}
.cta-band__inner {
  position: relative;
  display: grid;
  gap: var(--sp-5);
  align-items: center;
}
@media (min-width: 900px) {
  .cta-band__inner { grid-template-columns: minmax(0, 1.4fr) auto; }
}
.cta-band h2 { font-size: var(--step-3); margin-bottom: var(--sp-2); }
.cta-band p { color: var(--fg-muted); max-width: 52ch; }

/* --------------------------------------------------------------------------
   18. Forms
   -------------------------------------------------------------------------- */
.form {
  display: grid;
  gap: var(--sp-3);
}
@media (min-width: 700px) {
  .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--full { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.field label .req { color: var(--gold); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 140px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-dim); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal-bright);
  background: var(--surface-hover);
}
.field select { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.field select option { background: var(--ink-700); color: var(--fg); }
.field .hint { font-size: 0.76rem; color: var(--fg-dim); }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #e2685a; }
.field .error {
  font-size: 0.75rem;
  color: #f08e82;
  min-height: 1em;
}

.form__note { font-size: 0.8rem; color: var(--fg-dim); }

.form-status {
  grid-column: 1 / -1;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  display: none;
}
.form-status.is-visible { display: block; }
.form-status.is-ok { border-color: rgba(31, 163, 186, 0.5); background: rgba(31, 163, 186, 0.12); color: #d5f1f6; }
.form-status.is-err { border-color: rgba(226, 104, 90, 0.5); background: rgba(226, 104, 90, 0.12); color: #ffd9d3; }

/* --------------------------------------------------------------------------
   19. Contact details
   -------------------------------------------------------------------------- */
.contact-list { display: grid; gap: var(--sp-4); }
.contact-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.contact-item:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-item__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(20, 123, 141, 0.18);
  border: 1px solid rgba(31, 163, 186, 0.3);
  color: var(--teal-bright);
}
.contact-item__icon svg { width: 20px; height: 20px; }
.contact-item h4 {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.contact-item a, .contact-item p { color: var(--fg); font-size: 1rem; }
.contact-item a:hover { color: var(--gold); }

.map-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  filter: grayscale(0.35) contrast(1.05);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* --------------------------------------------------------------------------
   20. Accordion (FAQ)
   -------------------------------------------------------------------------- */
.accordion { border-top: 1px solid var(--line); }
.acc {
  border-bottom: 1px solid var(--line);
}
.acc__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  padding: 1.35rem 0;
  background: none;
  border: 0;
  color: inherit;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.acc__btn:hover { color: var(--gold); }
.acc__btn i {
  flex: none;
  position: relative;
  width: 18px; height: 18px;
}
.acc__btn i::before,
.acc__btn i::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  background: var(--gold-fill);
  transition: transform 0.35s var(--ease);
}
.acc__btn i::after { transform: rotate(90deg); }
.acc__btn[aria-expanded='true'] i::after { transform: rotate(0deg); }
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.acc__panel > div { overflow: hidden; }
.acc__btn[aria-expanded='true'] + .acc__panel { grid-template-rows: 1fr; }
.acc__panel p { padding-bottom: 1.35rem; color: var(--fg-muted); max-width: 72ch; }

/* --------------------------------------------------------------------------
   21. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--stage-bottom);
  border-top: 1px solid var(--line);
  padding-top: clamp(3rem, 6vw, 5rem);
}
.footer-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
@media (min-width: 1000px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.3fr; }
}
.footer-brand .brand { margin-bottom: var(--sp-4); }
.footer-brand p { color: var(--fg-dim); font-size: 0.92rem; max-width: 34ch; }

.footer-col h4 {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
  font-weight: 650;
}
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a:not(.btn) {
  color: var(--fg-muted);
  font-size: 0.92rem;
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.footer-col a:not(.btn):hover { color: var(--gold); padding-left: 5px; }

.socials { display: flex; gap: 0.6rem; margin-top: var(--sp-4); }
.socials a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  transition: all 0.3s var(--ease);
}
.socials a:hover { color: var(--on-gold); background: var(--gold-fill); border-color: var(--gold-fill); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }

.footer-bar {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-block: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.footer-bar ul { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.footer-bar a:hover { color: var(--gold); }

/* --------------------------------------------------------------------------
   22. Scroll reveal
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
/* Drop the compositing hint once the element has arrived — keeping a permanent
   will-change layer is wasteful and interferes with WebGL canvases nested inside. */
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  z-index: 120;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--teal-bright), var(--gold));
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--scrim-float);
  backdrop-filter: blur(8px);
  color: var(--fg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.4s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--gold-fill); color: var(--on-gold); border-color: var(--gold-fill); }

/* --------------------------------------------------------------------------
   22b. Equipment register
   -------------------------------------------------------------------------- */
.register {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

.register__group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-1), var(--surface-1-to));
  overflow: hidden;
}

.register__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--step-1);
}
.register__title span {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.register__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.register__table thead th {
  padding: 0.7rem 1.35rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.register__table tbody th {
  padding: 0.7rem 1.35rem;
  text-align: left;
  font-weight: 600;
  color: var(--fg);
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.register__table tbody th small {
  display: block;
  margin-top: 0.25rem;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--fg-dim);
}
.register__table td {
  padding: 0.65rem 1.35rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--line);
}
.register__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.register__table tbody tr:last-child td,
.register__table tbody tr:last-child th { border-bottom: 0; }

.register__sum td {
  background: rgba(223, 191, 35, 0.06);
  font-weight: 650;
  color: var(--gold);
  font-size: 0.84rem;
}

.register__grand {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: var(--step-1);
  color: var(--fg-muted);
  text-align: center;
}
.register__grand b {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  color: var(--gold);
  display: block;
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Contract figures on a project card */
.project__contract {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.84rem;
  color: var(--fg-dim);
}
.project__contract b { color: var(--gold); font-weight: 650; }

.progress {
  margin-top: 0.85rem;
  height: 4px;
  border-radius: 100px;
  background: var(--surface-track);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--teal-bright), var(--gold));
}

/* --------------------------------------------------------------------------
   22c. Project pictures & viewer
   -------------------------------------------------------------------------- */
.project__gallery-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  background: var(--scrim-chip);
  backdrop-filter: blur(6px);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.project__gallery-btn:hover {
  color: var(--on-gold);
  background: var(--gold-fill);
  border-color: var(--gold-fill);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(3, 12, 15, 0.94);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.viewer.is-open { opacity: 1; visibility: visible; }

.viewer__stage {
  margin: 0;
  display: grid;
  gap: 1rem;
  justify-items: center;
  max-height: 100%;
}
.viewer__stage img {
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  object-fit: contain;
}
.viewer__stage figcaption {
  font-size: 0.92rem;
  color: var(--fg-muted);
  text-align: center;
  max-width: 60ch;
}

.viewer__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.viewer__nav {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.viewer__close:hover,
.viewer__nav:hover {
  background: var(--gold-fill);
  border-color: var(--gold-fill);
  color: var(--on-gold);
}
.viewer__nav[hidden] { visibility: hidden; }

@media (max-width: 640px) {
  .viewer { grid-template-columns: 1fr; }
  .viewer__nav {
    position: absolute;
    bottom: 1.25rem;
  }
  .viewer__nav--prev { left: 1.25rem; }
  .viewer__nav--next { right: 1.25rem; }
}

/* --------------------------------------------------------------------------
   22d. Gallery
   --------------------------------------------------------------------------
   A grid of photographs, filtered by category. Each tile is a button: it
   opens the same viewer the project pictures use, starting on itself.
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  gap: clamp(0.8rem, 1.6vw, 1.2rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-700);
  cursor: pointer;
  text-align: left;
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease),
              box-shadow 0.4s var(--ease);
}
.gallery-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
/* Same veil as a project card: clear at the top, full strength where the
   caption sits. */
.gallery-card__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--card-veil-a) 0%, var(--card-veil-b) 45%, var(--card-veil-c) 78%);
}
.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--teal-bright);
  box-shadow: var(--shadow-lift);
}
.gallery-card:hover img,
.gallery-card:focus-visible img { transform: scale(1.06); }

.gallery-card__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: clamp(0.85rem, 1.6vw, 1.15rem);
}
.gallery-card__caption {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.25;
  text-wrap: balance;
}

.gallery-card__zoom {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--scrim-float);
  backdrop-filter: blur(6px);
  color: var(--fg);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.gallery-card:hover .gallery-card__zoom,
.gallery-card:focus-visible .gallery-card__zoom { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   23. Misc
   -------------------------------------------------------------------------- */
.marquee {
  display: flex;
  overflow: hidden;
  gap: 0;
  border-block: 1px solid var(--line);
  padding-block: 1.15rem;
  background: var(--surface-ghost);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  flex: none;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-right: clamp(2rem, 5vw, 4.5rem);
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.marquee__track span::after {
  content: '';
  width: 6px; height: 6px;
  background: var(--gold-fill);
  transform: rotate(45deg);
}
@keyframes marquee { to { transform: translateX(-100%); } }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin-block: var(--sp-5);
}

.badge-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: var(--sp-4); }

.note-card {
  padding: var(--sp-4);
  border-left: 3px solid var(--gold);
  background: rgba(223, 191, 35, 0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note-card p { color: var(--fg-muted); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   24. Reduced motion / no-WebGL
   -------------------------------------------------------------------------- */
.no-webgl .scene-loader { display: none; }
.no-webgl .hero__canvas,
.no-webgl .split__media canvas { display: none; }
.no-webgl .hero {
  background:
    radial-gradient(120% 90% at 72% 20%, rgba(20, 123, 141, 0.4) 0%, transparent 58%),
    url('../img/logo-emblem.svg') 88% 62% / 30% no-repeat,
    linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
}
.no-webgl .split__media {
  background:
    url('../img/logo-emblem.svg') center / 42% no-repeat,
    linear-gradient(160deg, var(--stage-panel-a), var(--stage-top));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero__canvas, .to-top, .progress-bar, .scene-loader { display: none !important; }
  body { background: #fff; color: #000; }
}
