/* ==========================================================
         DESIGN TOKENS  —  "petrol & limestone"
         Deep petrol ink for the cinematic blocks, cool limestone
         off-white for the reading blocks (never pure white). The
         logo gradient is a signature, not a texture: it appears on
         the loader rule, the service markers, the primary button
         and the footer edge — nowhere else.
         ========================================================== */
            /* --------------------------------------------------------
         Local names mapped onto the shared design system in
         css/main.css. No colour, font or size is defined here —
         edit the --qw-* tokens in main.css to restyle the site.
         -------------------------------------------------------- */
      :root {
        --ink: var(--qw-navy);
        --ink-2: var(--qw-navy-2);
        --ink-3: var(--qw-navy-3);
        --paper: var(--qw-paper);
        --paper-2: var(--qw-paper-2);
        --paper-3: var(--qw-paper-3);
        --text: var(--qw-ink);
        --muted: var(--qw-muted);
        --on-ink: var(--qw-on-dark);
        --muted-ink: var(--qw-muted-dark);
        --violet: var(--qw-violet);
        --blue: var(--qw-blue);
        --cyan: var(--qw-cyan);
        --mint: var(--qw-mint);
        --grad: var(--qw-grad);
        --line: var(--qw-line);
        --line-dark: var(--qw-line-dark);
        --f-display: var(--qw-font-display);
        --f-body: var(--qw-font-ui);
        --fs-hero: var(--qw-fs-hero);
        --fs-h2: var(--qw-fs-h2);
        --fs-scrub: var(--qw-fs-statement);
        --fs-h3: var(--qw-fs-h3);
        --fs-lead: var(--qw-fs-lead);
        --container: var(--qw-container);
        --gutter: var(--qw-gutter);
        --pad-block: var(--qw-pad-section);
        --ease: var(--qw-ease-out);
        --ease-io: var(--qw-ease-io);
      }

      /* ==========================================================
         RESET & BASE
         ========================================================== */
      *,
      *::before,
      *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      html {
        -webkit-text-size-adjust: 100%;
        scroll-behavior: smooth;
      }
      body {
        font-family: var(--f-body);
        font-size: 1.0625rem;
        line-height: 1.62;
        color: var(--text);
        background: var(--ink);
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
      }
      img,
      video,
      svg {
        display: block;
        max-width: 100%;
      }
      a {
        color: inherit;
        text-decoration: none;
      }
      button {
        font: inherit;
        color: inherit;
        background: none;
        border: 0;
        cursor: pointer;
      }
      ul {
        list-style: none;
      }
      :focus-visible {
        outline: 2px solid var(--cyan);
        outline-offset: 4px;
      }

      h1,
      h2,
      h3 {
        font-family: var(--f-display);
        font-weight: 600;
        line-height: 0.95;
        letter-spacing: -0.025em;
      }
      p {
        max-width: 62ch;
      }

      .container {
        width: 100%;
        max-width: var(--container);
        margin-inline: auto;
        padding-inline: var(--gutter);
      }

      .skip {
        position: fixed;
        top: -100px;
        left: 1rem;
        z-index: 999;
        padding: 0.7rem 1.1rem;
        background: var(--ink);
        color: var(--on-ink);
        transition: top 0.25s var(--ease);
      }
      .skip:focus {
        top: 1rem;
      }

      /* ==========================================================
         BUTTONS
         ========================================================== */

      /* Square icon link that fills with the gradient from the bottom */
      .iconlink {
        width: 54px;
        height: 54px;
        display: grid;
        place-content: center;
        position: relative;
        isolation: isolate;
        border: 1px solid var(--line-dark);
        overflow: hidden;
      }
      .iconlink::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--grad);
        transform: translateY(101%);
        transition: transform 0.5s var(--ease);
      }
      .iconlink:hover::before {
        transform: none;
      }
      .iconlink svg {
        transition:
          transform 0.5s var(--ease),
          stroke 0.3s;
      }
      .iconlink:hover svg {
        transform: translateX(4px);
        stroke: var(--qw-navy);
      }

      /* ==========================================================
         PAGE SHELL
         <main> rides on its own layer above the footer so the footer
         can be uncovered from underneath at the end of the scroll.
         ========================================================== */
      .page {
        position: relative;
        z-index: 1;
        background: var(--paper);
      }

      /* ==========================================================
         HERO
         VIDEO SLOT — the plate is a drop-in: swap the <source> and
         the poster, nothing else changes. An ink base layer sits
         behind it so an empty or still-loading file never leaves a
         hole; the section simply reads as a dark plate.

         Composition: the paragraph and action hold the right side at
         mid height, the headline anchors the bottom-left at full
         display size, a hairline meta rail runs along the base.
         Reading path: mark (top-left) → nav (top-right) → copy
         (right) → headline (bottom-left) → rail.

         The hero is sticky, so the next section slides up over it
         instead of pushing it away — the video stays present while
         the page moves.
         ========================================================== */
      .hero {
        position: sticky;
        top: 0;
        height: 100svh;
        overflow: hidden;
        background: var(--ink);
        color: var(--on-ink);
        z-index: 0;
      }
      .hero__plate {
        position: absolute;
        inset: 0;
        z-index: 0;
        /* aperture reveal: opens from a letterbox band once loaded */
        clip-path: inset(34% 14% 34% 14%);
        transition: clip-path 1.4s var(--ease-io) 0.15s;
        will-change: clip-path, transform;
      }
      body.is-ready .hero__plate {
        clip-path: inset(0% 0% 0% 0%);
      }
      .hero__plate video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* The plexus loop is already dark and already in the brand's
           violet/blue, so the heavy knock-down the old stock photo needed
           would crush it to black. Text contrast comes from .hero__scrim. */
        filter: saturate(1.2) contrast(1.16);
      }
      .hero__base {
        position: absolute;
        inset: 0;
        z-index: -1;
        background:
          radial-gradient(90% 70% at 20% 15%, var(--qw-navy-3) 0%, transparent 60%),
          var(--ink);
      }
      .hero__scrim {
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(
          185deg,
          rgba(12, 23, 48, 0.22) 0%,
          rgba(12, 23, 48, 0) 28%,
          rgba(12, 23, 48, 0.34) 48%,
          rgba(12, 23, 48, 0.72) 68%,
          rgba(12, 23, 48, 0.93) 90%
        );
      }
      .hero__inner {
        position: relative;
        z-index: 2;
        height: 100%;
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: minmax(0, 1fr) auto auto;
        align-items: end;
        gap: clamp(1.4rem, 3vh, 2.6rem) var(--gutter);
        padding-block: clamp(6rem, 12vh, 9rem) clamp(1.5rem, 4vh, 3rem);
      }
      .hero__copy {
        grid-column: 8 / span 5;
        grid-row: 2;
        align-self: center;
        justify-self: end;
        position: relative;
        /* Glass panel rather than a dark wash: the footage stays vivid
           everywhere, and the paragraph gets its own readable ground.
           Same material language as the nav capsule. */
        padding: clamp(1.4rem, 2vw, 1.9rem) clamp(1.5rem, 2.2vw, 2.1rem);
        border-radius: var(--qw-r-lg);
        background: rgba(12, 23, 48, 0.46);
        backdrop-filter: blur(16px) saturate(130%);
        -webkit-backdrop-filter: blur(16px) saturate(130%);
        border: 1px solid rgba(238, 241, 246, 0.12);
      }
      .hero__copy p {
        font-size: var(--fs-lead);
        color: var(--on-ink);
        text-shadow:
          0 1px 2px rgba(12, 23, 48, 0.9),
          0 2px 18px rgba(12, 23, 48, 0.75);
        margin-bottom: 1.8rem;
      }
      .hero__title {
        grid-column: 1 / span 10;
        grid-row: 1;
        font-size: var(--fs-hero);
        text-shadow:
          0 2px 4px rgba(12, 23, 48, 0.6),
          0 4px 30px rgba(12, 23, 48, 0.7);
      }
      .hero__rail {
        grid-column: 1 / -1;
        grid-row: 3;
        display: flex;
        align-items: center;
        gap: 1rem;
        padding-top: clamp(1rem, 2.5vh, 1.8rem);
        border-top: 1px solid var(--line-dark);
        font-size: 0.78rem;
        letter-spacing: 0.16em;
        color: var(--muted-ink);
      }
      .hero__cue {
        flex: 1;
        max-width: 320px;
        height: 1px;
        background: var(--line-dark);
        position: relative;
        overflow: hidden;
      }
      .hero__cue::after {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--grad);
        transform: translateX(-100%);
        animation: cue 2.8s var(--ease-io) infinite;
      }
      @keyframes cue {
        50%,
        100% {
          transform: translateX(100%);
        }
      }

      /* word-mask reveal used by the hero headline */
      .word {
        display: inline-block;
        overflow: hidden;
        vertical-align: top;
        padding-bottom: 0.12em;
        margin-bottom: -0.12em;
      }
      .word__in {
        display: inline-block;
        transform: translateY(110%);
        transition: transform 1s var(--ease);
        transition-delay: var(--d);
      }
      body.is-ready .word__in {
        transform: none;
      }

      /* ==========================================================
         SCRUB — scroll-read statement
         The second brand statement is pinned and its words gain ink
         as you scroll: reading speed is tied to scroll position, so
         the sentence is delivered rather than displayed. No imagery,
         no decoration — the motion is the layout.
         ========================================================== */
      .scrub {
        position: relative;
        z-index: 2;
        height: 260vh;
        background: var(--paper);
      }
      .scrub__stage {
        position: sticky;
        top: 0;
        height: 100svh;
        display: grid;
        align-content: center;
        gap: clamp(1.6rem, 4vh, 3rem);
      }
      .scrub__head {
        display: flex;
        align-items: baseline;
        gap: 1.2rem;
      }
      .scrub__head h2 {
        font-size: var(--fs-h2);
        max-width: 18ch;
      }
      .scrub__line {
        flex: 1;
        height: 2px;
        background: var(--paper-3);
        position: relative;
        overflow: hidden;
      }
      /* the rule fills in lockstep with the words — a progress read */
      .scrub__line i {
        position: absolute;
        inset: 0;
        display: block;
        background: var(--grad);
        transform: scaleX(0);
        transform-origin: left;
      }
      .scrub__body {
        font-family: var(--f-display);
        font-weight: 500;
        font-size: var(--fs-scrub);
        line-height: 1.28;
        letter-spacing: -0.015em;
        max-width: 30ch;
      }
      .scrub__body .sw {
        /* readable while unlit — the highlight still reads as a clear change */
        color: var(--qw-ink-45);
        transition: color 0.45s var(--ease);
      }
      .scrub__body .sw.is-lit {
        color: var(--text);
      }

      /* ==========================================================
         SERVICES — sticky heading (left) / scrolling detail (right)
         Kept as built: the left column parks while the three
         services move past it, and a three-segment marker fills as
         each one enters the reading band.
         ========================================================== */
      .svc {
        position: relative;
        z-index: 2;
        background: var(--ink);
        color: var(--on-ink);
        padding-block: var(--pad-block);
      }
      .svc__grid {
        display: grid;
        grid-template-columns: 5fr 7fr;
        gap: clamp(2rem, 6vw, 6rem);
      }
      .svc__aside {
        position: sticky;
        top: 22vh;
        align-self: start;
      }
      .svc__aside h2 {
        font-size: var(--fs-h2);
        max-width: 14ch;
        margin-bottom: 2.4rem;
      }
      .svc__marks {
        display: flex;
        gap: 0.5rem;
        width: 190px;
      }
      .svc__mark {
        flex: 1;
        height: 3px;
        background: var(--ink-3);
        position: relative;
        overflow: hidden;
      }
      .svc__mark::after {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--grad);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.6s var(--ease);
      }
      .svc__mark.is-on::after {
        transform: scaleX(1);
      }
      .svc__item {
        padding-bottom: clamp(3.5rem, 8vh, 6rem);
        opacity: 0;
        transform: translateY(38px);
        transition:
          opacity 0.9s var(--ease),
          transform 0.9s var(--ease);
      }
      .svc__item.is-in {
        opacity: 1;
        transform: none;
      }
      .svc__item:last-child {
        padding-bottom: 0;
      }
      .svc__shot {
        position: relative;
        overflow: hidden;
        aspect-ratio: 16 / 8;
        margin-bottom: 1.8rem;
        background: var(--ink-2);
      }
      .svc__shot img {
        width: 100%;
        height: 124%;
        object-fit: cover;
        transform: translateY(-9%);
        will-change: transform;
        filter: saturate(0.6) brightness(0.8);
        transition: filter 0.6s var(--ease);
      }
      .svc__item:hover .svc__shot img {
        filter: saturate(0.95) brightness(0.95);
      }
      .svc__item h3 {
        font-size: var(--fs-h3);
        margin-bottom: 0.9rem;
      }
      .svc__item p {
        color: var(--muted-ink);
        margin-bottom: 1.8rem;
      }

      /* ==========================================================
         HORIZONTAL BENTO
         The closing block travels sideways: a two-row bento grid
         pinned to the viewport, driven by vertical scroll, ending on
         the contact panel. Tiles have deliberately different spans
         and jobs — image plates, a mark plate, the action — so the
         rail reads as one built object rather than a card deck.
         ========================================================== */
      .hbento {
        position: relative;
        z-index: 2;
        height: 340vh;
        background: var(--paper);
      }
      .hbento__stage {
        position: sticky;
        top: 0;
        height: 100svh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: clamp(1rem, 3vh, 2rem);
        overflow: hidden;
      }
      .hbento__track {
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: clamp(0.6rem, 1vw, 1rem);
        height: min(62vh, 620px);
        padding-inline: var(--gutter);
        will-change: transform;
      }
      .cell {
        position: relative;
        overflow: hidden;
        background: var(--paper-2);
      }
      /* varied spans = bento rhythm; widths are viewport-relative so
         the rail always overflows and always has room to travel */
      .cell--tall {
        grid-row: span 2;
        width: 34vw;
      }
      .cell--wide {
        grid-row: span 1;
        width: 46vw;
      }
      .cell--sq {
        grid-row: span 1;
        width: 26vw;
      }
      .cell__img {
        width: 100%;
        height: 112%;
        object-fit: cover;
        /* duotone treatment — distinct from the service windows above */
        filter: grayscale(1) contrast(1.1) brightness(0.92);
        transform: translateY(-5%);
        will-change: transform;
        transition:
          transform 0.9s var(--ease),
          filter 0.7s var(--ease);
      }
      .cell--photo:hover .cell__img {
        filter: grayscale(0) contrast(1.02) brightness(1);
        transform: translateY(-5%) scale(1.04);
      }
      .cell--photo::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        z-index: 2;
        background: var(--grad);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.6s var(--ease);
      }
      .cell--photo:hover::before {
        transform: scaleX(1);
      }
      /* pointer spotlight — only ever a response to the user */
      .cell--photo::after {
        content: "";
        position: absolute;
        inset: 0;
        opacity: 0;
        transition: opacity 0.4s ease;
        background: radial-gradient(
          240px circle at var(--mx, 50%) var(--my, 50%),
          rgba(63, 238, 215, 0.24),
          transparent 62%
        );
      }
      .cell--photo:hover::after {
        opacity: 1;
      }
      .cell--mark {
        background: var(--ink-2);
        display: grid;
        place-content: center;
        padding: 1.4rem;
      }
      .cell--mark img {
        width: min(200px, 74%);
        opacity: 0.92;
      }
      /* travel indicator for the horizontal move */
      .hbento__bar {
        height: 2px;
        margin-inline: var(--gutter);
        background: var(--paper-3);
        position: relative;
        overflow: hidden;
      }
      .hbento__bar i {
        position: absolute;
        inset: 0;
        display: block;
        background: var(--grad);
        transform: scaleX(0);
        transform-origin: left;
      }

      /* ============================================================
         DOORS — the two link cards (Services / Contact), same
         component as who-we-are.html's closing CTA.
         ============================================================ */
      .doors {
        position: relative;
        z-index: 2;
        overflow: hidden;
        isolation: isolate;
        background: var(--ink);
        color: var(--paper);
        padding-block: var(--pad-block);
      }
      .doors::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-image: url(../img/079708da-0607-4eed-a532-a6233d639c0c.jpg);
        background-size: 440px;
        background-repeat: repeat;
        opacity: 0.14;
        mix-blend-mode: screen;
        pointer-events: none;
      }
      .doors__grid {
        position: relative;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: clamp(1rem, 2vw, 1.5rem);
      }
      .door {
        position: relative;
        overflow: hidden;
        isolation: isolate;
        border: 1px solid var(--line-dark);
        border-radius: 18px;
        padding: clamp(2.4rem, 4vw, 3.6rem);
        min-height: 320px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 2rem;
        transition: transform 0.5s var(--ease);
      }
      .door__glow {
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--grad);
        opacity: 0;
        transition: opacity 0.5s var(--ease);
      }
      .door:hover {
        transform: translateY(-6px);
      }
      .door:hover .door__glow {
        opacity: 0.16;
      }
      .door__sub {
        color: var(--cyan);
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.7rem;
      }
      .door h2 {
        font-size: var(--fs-h3);
        margin-bottom: 1rem;
      }
      .door p {
        color: var(--muted-ink);
      }
      .door__arrow {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: 1px solid var(--line-dark);
        display: grid;
        place-content: center;
        position: relative;
        overflow: hidden;
        isolation: isolate;
      }
      .door__arrow::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--grad);
        border-radius: 50%;
        transform: scale(0);
        transition: transform 0.45s var(--ease);
      }
      .door:hover .door__arrow::before {
        transform: scale(1);
      }
      .door__arrow svg {
        transition: transform 0.4s var(--ease);
      }
      .door:hover .door__arrow svg {
        transform: translateX(3px);
      }
      @media (max-width: 992px) {
        .doors__grid {
          grid-template-columns: 1fr;
        }
      }


/* ==========================================================
         RESPONSIVE
         Pinned behaviours are desktop-only. Below 860px the scrub
         section becomes a plain statement, the bento becomes a
         native swipe rail (better than a simulated one on touch),
         and the footer returns to normal flow.
         ========================================================== */
      @media (max-width: 1200px) {
        .hero__copy {
          grid-column: 6 / span 7;
        }
        .hero__title {
          grid-column: 1 / -1;
        }
        .svc__grid {
          grid-template-columns: 1fr;
        }
        .svc__aside {
          position: static;
        }
        .cell--tall {
          width: 52vw;
        }
        .cell--wide {
          width: 64vw;
        }
        .cell--sq {
          width: 40vw;
        }
      }
      @media (max-width: 992px) {
        .hero {
          position: relative;
        }
        .hero__copy {
          grid-column: 1 / -1;
          justify-self: start;
          /* stacked: the headline should lead, the lede follows it */
          grid-row: 2;
        }
        .hero__title {
          grid-row: 1;
        }
        /* Stacked, the text covers the whole frame instead of hugging the
           dark corners, so the scrim has to carry more of the contrast. */
        .hero__scrim {
          background: linear-gradient(
            185deg,
            rgba(12, 23, 48, 0.66) 0%,
            rgba(12, 23, 48, 0.58) 34%,
            rgba(12, 23, 48, 0.72) 70%,
            rgba(12, 23, 48, 0.9) 94%
          );
        }

        .scrub {
          height: auto;
        }
        .scrub__stage {
          position: static;
          height: auto;
          padding-block: var(--pad-block);
        }
        .scrub__body .sw {
          color: var(--text);
        }

        .hbento {
          height: auto;
          padding-block: var(--pad-block);
        }
        .hbento__stage {
          position: static;
          height: auto;
          overflow: visible;
        }
        .hbento__track {
          height: 66vh;
          transform: none !important;
          overflow-x: auto;
          overflow-y: hidden;
          scroll-snap-type: x mandatory;
          -webkit-overflow-scrolling: touch;
          scrollbar-width: none;
        }
        .hbento__track::-webkit-scrollbar {
          display: none;
        }
        .cell {
          scroll-snap-align: start;
        }
        .cell--tall {
          width: 72vw;
        }
        .cell--wide {
          width: 80vw;
        }
        .cell--sq {
          width: 56vw;
        }
        .hbento__bar {
          display: none;
        }

      }
      @media (max-width: 560px) {
        .hero__rail span:first-child {
          display: none;
        }
      }
      /* Short-viewport laptops (13"-ish windows with browser chrome):
         at full width the hero's fixed 100svh box is tall enough for the
         nav gap + copy panel + two-line title, but not with room left for
         the rail — "Scroll" ends up pinned flush to the fold. Tighten the
         vertical rhythm so the rail keeps clear space beneath it instead
         of relying on the grid's minmax(0,1fr) fallback to save it. */
      @media (min-width: 993px) and (max-height: 840px) {
        .hero__inner {
          padding-block: clamp(4.5rem, 9vh, 6.5rem) clamp(1rem, 3vh, 1.75rem);
          gap: clamp(1rem, 2vh, 1.8rem) var(--gutter);
        }
        .hero__copy {
          padding: clamp(1.1rem, 1.6vw, 1.5rem) clamp(1.3rem, 2vw, 1.8rem);
        }
        .hero__copy p {
          margin-bottom: 1.1rem;
        }
        .hero__title {
          font-size: clamp(2.4rem, 5.4vw, 4.8rem);
        }
      }

      /* ==========================================================
         REDUCED MOTION — everything resolves to its end state
         ========================================================== */
      @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;
        }
        .word__in {
          transform: none !important;
        }
        .hero__plate {
          clip-path: none !important;
        }
        .hero {
          position: relative;
        }
        .svc__item {
          opacity: 1 !important;
          transform: none !important;
        }
        .scrub {
          height: auto;
        }
        .scrub__stage {
          position: static;
          height: auto;
          padding-block: var(--pad-block);
        }
        .scrub__body .sw {
          color: var(--text);
        }
        .hbento {
          height: auto;
          padding-block: var(--pad-block);
        }
        .hbento__stage {
          position: static;
          height: auto;
          overflow: visible;
        }
        .hbento__track {
          overflow-x: auto;
          transform: none !important;
        }
      }

