/* ---------- Fonts ---------- */
@font-face {
  font-family: "GT Walsheim Pro";
  src: url("../fonts/GTWalsheimPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GT Walsheim Pro";
  src: url("../fonts/GTWalsheimPro-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Futura Extra Black";
  src: url("../fonts/Futura-Extra-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Colour */
  --color-text: #fff;
  --color-text-muted: rgb(255 255 255 / 0.75); /* ≥ 4.8:1 on the brightest background (WCAG AA) */
  --color-text-faint: rgb(255 255 255 / 0.28);
  --color-navy: #042067;
  --color-navy-deep: #03174a;
  --color-blue-light: #01558f; /* matches the shader's deepened highlight */
  --color-sign-off: rgb(255 255 255 / 0.7);
  --color-line: rgb(255 255 255 / 0.18);
  --color-glass: rgb(26 22 20 / 0.42);

  --gradient-fallback: linear-gradient(to bottom left, var(--color-blue-light) 0%, var(--color-navy) 76%) top / 100% 52.25rem no-repeat;

  /* Typography */
  --font-body: "GT Walsheim Pro", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Futura Extra Black", "Futura", "Arial Black", sans-serif;

  --fs-body: clamp(1rem, 0.912rem + 0.3756vw, 1.375rem);       /* 16 → 20 @1440 */
  --fs-lead: clamp(1.25rem, 1rem + 0.28vw, 1.5rem);             /* 20 → 20 @1440 */
  --fs-small: clamp(0.9375rem, 0.871rem + 0.2817vw, 1.25rem);   /* 15 → 18 @1440 */
  --fs-detail: clamp(0.9375rem, 0.85rem + 0.2vw, 1.125rem);     /* 15 → 16 @1440 */
  --fs-nav: clamp(1rem, 1.25vw, 1.375rem);                      /* 18 @1440 */
  --fs-h2: clamp(1.25rem, 1.03rem + 0.939vw, 2.125rem);         /* 20 → 30 @1440 */
  --fs-h3: clamp(1.0625rem, 1.25vw, 1.375rem);                  /* 18 @1440 */
  --fs-label: clamp(0.625rem, 0.55rem + 0.25vw, 0.9375rem);     /* 10 → 12.4 @1440 */
  --fs-hero: clamp(1.75rem, 8.5vw, 3.5rem);                     /* ~32 @375: full column width now the video thumbnail is hidden */

  --lh-body: 1.45;
  --lh-tight: 1.1;

  /* Layout */
  --margin: clamp(1.25rem, 5.78vw - 0.2rem, 5rem);              /* 20 → 80 */
  --gutter: clamp(1rem, 1.667vw, 1.5rem);                       /* 16 → 24 */
  --page-top: clamp(1.25rem, 5.28vw, 5.5rem);                   /* 76 @1440 */
  --space-section: clamp(5rem, 11.11vw, 11rem);                 /* 160 @1440 */
  --space-block: clamp(3rem, 5.6vw, 6rem);                      /* 80 @1440 */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;

  /* Components */
  --logo-w: clamp(5.5rem, 23vw, 8rem);
  --logo-ratio: 147 / 56;
  --logo-go-center: 0.269;  /* vertical centre of "GO" within the Lottie frame */
  --header-h: 3.5rem;  /* "GO" + menu icon sit centred in the bar */
  --thumb-w: clamp(5.75rem, 23vw, 11rem);
  --thumb-ratio: 195 / 230;
  --video-ratio: 195 / 230;  /* change to the real video's ratio when added, e.g. 9 / 16 */
  --project-ratio: 1600 / 886;  /* project screenshots (≈1.8:1) */
  --logo-scale: 1;
  --logo-gap: clamp(2rem, 3vw, 3rem);
  --marquee-duration: 42s;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.35s;
}

@supports (rotate: atan2(1px, 1px)) {
  :root {
    --gradient-angle: atan2(52.25rem, 100vw);
    --gradient-hero: linear-gradient(
      calc(180deg + var(--gradient-angle)),
      var(--color-blue-light) 0,
      var(--color-navy) calc(79.56rem * cos(var(--gradient-angle)))
    );
  }
}

@media (min-width: 64rem) {
  :root {
    --fs-hero: clamp(2.5rem, 4.722vw, 5.5rem);                  /* 68 @1440 */
    --logo-w: clamp(6.25rem, 10vw, 10.5rem);                    /* 144 @1440, "GO" ≈ 54px */
    --thumb-w: clamp(9rem, 13.54vw, 15rem);                     /* 195 @1440 */
    --logo-scale: 0.8;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--color-navy);
 
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--color-text);
  /* Transparent so the fixed shader canvas behind the page shows through */
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Shader background ---------- */
.shader-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Fallback (and first paint) before WebGL draws */
  background: linear-gradient(90deg, var(--color-navy) 60%, #01558f 92%, #0b336a 100%);
}

.shader-bg__canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}

.shader-bg.is-ready .shader-bg__canvas {
  opacity: 1;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--color-text);
  color: var(--color-navy);
}

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

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-text);
  color: var(--color-navy);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--duration) var(--ease-out);
}

.skip-link:focus {
  transform: none;
}


.content:focus {
  outline: none;
}

/* Lenis smooth scroll */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* Keep the scrollbar's space reserved while scrolling is locked (menu / video
   modal), so the layout — and the fixed menu icon — doesn't shift sideways. */
html {
  scrollbar-gutter: stable;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ---------- Shared type ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.section-subtitle {
  margin-top: clamp(0.75rem, 1.9vw, 1.75rem);
  font-size: var(--fs-small);
}

.text-link,
.contact__email-label {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: currentColor;
  transition: text-decoration-color var(--duration) var(--ease-out), opacity var(--duration) var(--ease-out);
}


@media (hover: hover) {
  .text-link:hover,
  .contact__email:hover .contact__email-label {
    text-decoration-color: transparent;
  }
}

.contact__email {
  position: relative;
  display: inline-grid;
  vertical-align: bottom;
  overflow: hidden;
  /* room for the underline and descenders inside the clipping box */
  padding-block: 0.1em 0.2em;
  margin-block: -0.1em -0.2em;
  font: inherit;
  text-align: left;
}

.contact__email > * {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
}


.contact__email-done {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: max-content;
  font-size: 0.72em;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  transform: translateY(110%);
  opacity: 0;
}

.contact__email-done svg {
  width: 0.85em;
  height: 0.85em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 0.4s var(--ease-out) 0.15s;
}

.contact__email.is-copied .contact__email-label {
  transform: translateY(-110%);
  opacity: 0;
}

.contact__email.is-copied .contact__email-done {
  transform: none;
  opacity: 1;
}

.contact__email.is-copied .contact__email-done svg {
  stroke-dashoffset: 0;
}

/* ==========================================================================
   Page layout
   Mobile first: a top bar + single column. From 64rem the 12-column grid
   takes over: sidebar on columns 1–3, content on 4–12.
   ========================================================================== */
.page {
  padding-inline: var(--margin);
}

/* ---------- Sidebar / top bar ---------- */
.sidebar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: var(--header-h);
  padding: 1.125rem var(--margin) 0;
}


.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgb(4 32 103 / 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.sidebar.is-scrolled::before {
  opacity: 1;
}

.is-menu-open .sidebar::before {
  opacity: 0;
}

.brand {
  position: relative;
  z-index: 2;
  display: block;
  border-radius: var(--radius-sm);
}

.brand__logo {
  display: block;
  width: var(--logo-w);
  aspect-ratio: var(--logo-ratio);
}

.brand__logo svg {
  display: block;
}

.menu-toggle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  /* Centre the icon on the "GO" line rather than on the whole logo frame */
  margin-top: calc(var(--logo-w) * 56 / 147 * var(--logo-go-center) - 1.375rem);
  margin-right: -0.5rem;
  border-radius: 50%;
}

.menu-toggle__icon {
  width: 1.75rem;
  height: 1.75rem;
}

/* ---------- Navigation ---------- */
.site-nav__list {
  --nav-item-h: calc(var(--fs-nav) * var(--lh-body) + 1.4rem);
  --nav-dash: 0.625rem;
  --nav-dash-h: 3px;
}

.site-nav__list li {
  position: relative;
}

/* Five small lines between one link's marker and the next */
.site-nav__ticks {
  position: absolute;
  top: calc(var(--nav-item-h) / 2);
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  width: var(--nav-dash);
  height: var(--nav-item-h);
  pointer-events: none;
}

.site-nav__ticks span {
  width: 0.3125rem;
  height: 1px;
  border-radius: 4px;
  background-color: var(--color-text);
  opacity: 0.3;
}

.site-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--nav-item-h);
  padding-left: calc(var(--nav-dash) + 1.5rem);
  font-size: var(--fs-nav);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration) var(--ease-out);
}

.site-nav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--nav-dash);
  height: var(--nav-dash-h);
  margin-top: calc(var(--nav-dash-h) / -2);
  border-radius: 4px;
  background-color: currentColor;
  transform-origin: left center;
  transition: transform var(--duration) var(--ease-out), background-color var(--duration) var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link:focus-visible,
.site-nav__link.is-active {
  color: var(--color-text);
}

.site-nav__link:hover::before,
.site-nav__link.is-active::before {
  transform: scaleX(1.4);
}

/* ---------- Nav actions: book a call, LinkedIn, copy email ---------- */
.nav-actions {
  display: grid;
  justify-items: start;
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
  margin-top: clamp(1.75rem, 3vw, 2.75rem);
}

.nav-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.25rem;
  font-size: var(--fs-detail);
  line-height: 1.2;
  text-align: left;
  color: var(--color-text);
  text-decoration: none;
  opacity: 0.88;
  transition: opacity var(--duration) var(--ease-out);
}

.nav-action:hover,
.nav-action:focus-visible {
  opacity: 1;
}

.nav-action__icon {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  fill: currentColor;
  transition: transform var(--duration) var(--ease-out);
}

.nav-action:hover .nav-action__icon {
  transform: translateY(-1px) scale(1.08);
}

/* Copy email: the label and icon roll over to a "copied" state */
.nav-action__icon-swap,
.nav-action__label-swap {
  display: grid;
}

.nav-action__icon-swap > *,
.nav-action__label-swap > * {
  grid-area: 1 / 1;
}

.nav-action__label-swap {
  overflow: hidden;
  /* Room for descenders inside the clipping box */
  padding-block: 0.15em;
  margin-block: -0.15em;
}

.nav-action__label {
  transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
}

.nav-action__label--copied {
  transform: translateY(110%);
  opacity: 0;
}

.nav-action__icon--check {
  transform: scale(0.4) rotate(-20deg);
  opacity: 0;
  transition: transform 0.45s var(--ease-out), opacity 0.3s var(--ease-out);
}

.nav-action__icon--check .nav-action__tick {
  fill: none;
  stroke: var(--color-navy);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 12;
  stroke-dashoffset: 12;
  transition: stroke-dashoffset 0.4s var(--ease-out) 0.15s;
}

.nav-action__icon--mail {
  transition: transform 0.45s var(--ease-out), opacity 0.3s var(--ease-out);
}

.nav-action--copy.is-copied {
  opacity: 1;
}

.is-copied .nav-action__label:not(.nav-action__label--copied) {
  transform: translateY(-110%);
  opacity: 0;
}

.is-copied .nav-action__label--copied {
  transform: none;
  opacity: 1;
}

.is-copied .nav-action__icon--mail {
  transform: scale(0.4);
  opacity: 0;
}

.is-copied .nav-action__icon--check {
  transform: none;
  opacity: 1;
}

.is-copied .nav-action__tick {
  stroke-dashoffset: 0;
}

/* Mobile: the nav becomes a full-screen panel behind the top bar */
@media (max-width: 63.999rem) {
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Links start just under the top bar instead of centring in the screen */
    padding: calc(var(--header-h) + clamp(1.5rem, 5vh, 2.5rem)) var(--margin) 3rem;
    overflow-y: auto; /* short landscape phones can still reach every link */
    background: var(--gradient-hero, var(--gradient-fallback)), var(--color-navy);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.45s var(--ease-out), visibility 0s linear 0.45s;
  }

  .is-menu-open .site-nav {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.45s var(--ease-out), visibility 0s;
  }

  .site-nav__list {
    /* Rows stay at least 44px tall for comfortable tapping */
    --nav-item-h: clamp(2.75rem, 6.5vh, 3.5rem);
    --nav-dash: 0.75rem;
  }

  .site-nav__link {
    font-size: 1.25rem; /* 20px, same as the secondary links below */
    padding-left: calc(var(--nav-dash) + 1rem);
  }

  /* Anchor jumps without JS (and the skip link) clear the fixed top bar */
  .content > section[id] {
    scroll-margin-top: calc(var(--header-h) + 1.75rem);
  }

  .content > .work {
    scroll-margin-top: var(--header-h);
  }

  .faq .faq__question {
    font-size: 1.125rem; /* 18px */
  }

  .nav-actions {
    gap: 1.125rem;
    margin-top: clamp(2rem, 6vh, 3.5rem);
  }

  .nav-action {
    gap: 0.625rem;
    font-size: 1.25rem; /* 20px */
    padding-block: 0.4rem;
  }

  .nav-action__icon {
    width: 0.9em;
    height: 0.9em;
  }

  .sidebar .video-thumb--sidebar {
    display: none;
  }
}

/* ---------- Video thumbnail ---------- */
.video-thumb {
  position: relative;
  display: block;
  width: var(--thumb-w);
  aspect-ratio: var(--thumb-ratio);
  border-radius: var(--radius-sm);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1.25rem 2.5rem -1.5rem rgb(0 8 40 / 0.6);
}

.video-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.video-thumb__play {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: clamp(1.5rem, 13%, 2.25rem);
  min-width: 1.5rem;
  aspect-ratio: 1;
  translate: -50% 50%;
  border-radius: 50%;
  background: var(--color-text);
  transition: transform 0.5s var(--ease-out);
}

/* Play triangle */
.video-thumb__play::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 32%;
  height: 38%;
  translate: 12% 0;
  background: #1a1a1a;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Hidden while its zoomed copy is on screen */
.video-thumb.is-launching {
  visibility: hidden;
}

.video-thumb:hover .video-thumb__img {
  transform: scale(1.05);
}

.video-thumb:hover .video-thumb__play {
  transform: scale(1.15);
}

/* Video thumbnails hidden for now (sidebar + mobile hero). To bring them
   back, delete this block. */
.video-thumb[data-video-open] {
  display: none;
}

.hero .hero__intro {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------- Content column ---------- */
.content {
  padding-top: calc(var(--header-h) + clamp(2.5rem, 9vw, 3.5rem));
}

/* ---------- Hero ---------- */
.hero__intro {
  display: grid;
  grid-template-columns: var(--thumb-w) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(1.25rem, 3vw, 2rem);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-hero);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  max-width: 14em;
  text-wrap: balance;
}

/* Phones held upright: centre the headline over the centred lines below it */
@media (max-width: 47.999rem) and (orientation: portrait) {
  .hero__title {
    margin-inline: auto;
    text-align: center;
  }
}

/* ---------- Availability line ---------- */
.availability {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 0.6em;
  row-gap: 0.25rem;
  margin-top: clamp(1.5rem, 3.6vw, 3.25rem);
  font-size: var(--fs-nav);
  line-height: 1.3;
  text-align: center;
}

.availability__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

/* Green "online" dot with a soft, slow pulse */
.availability__dot {
  position: relative;
  flex-shrink: 0;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background-color: #2fd25a;
}

.availability__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: inherit;
  animation: availability-pulse 2.4s var(--ease-out) infinite;
}

@media (max-width: 63.999rem) {
  .availability {
    font-size: 0.9375rem; /* 15px: fits on one line on phones */
  }

  /* More breathing room around the logo marquee */
  .hero .clients {
    margin-top: clamp(3.5rem, 14vw, 5.5rem);
  }

  .hero + .work {
    margin-top: clamp(3.5rem, 14vw, 5.5rem);
  }
}

/* Very narrow phones: drop the divider and let "Hire me" take its own line */
@media (max-width: 22.5rem) {
  .availability__divider {
    display: none;
  }
}

@keyframes availability-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .availability__dot::after {
    animation: none;
    display: none;
  }
}

/* "Hire me": a waving hand pops up beside the link on hover / keyboard focus
   and vanishes instantly when the pointer leaves. It sits outside the text
   flow (absolute), so the centred line never shifts. */
.hire-link {
  position: relative;
}

.hire-link__wave {
  position: absolute;
  left: 100%;
  top: 50%;
  margin-left: 0.35em;
  font-size: 1.15em;
  line-height: 1;
  text-decoration: none;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.3);
  transform-origin: 30% 80%;
}

.hire-link__hand {
  display: inline-block;
  transform-origin: 70% 75%; /* pivot at the wrist */
}

@media (hover: hover) {
  .hire-link:hover .hire-link__wave {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: hire-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .hire-link:hover .hire-link__hand {
    animation: hire-wave 1.4s ease-in-out 0.2s infinite;
  }
}

.hire-link:focus-visible .hire-link__wave {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  animation: hire-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hire-link:focus-visible .hire-link__hand {
  animation: hire-wave 1.4s ease-in-out 0.2s infinite;
}

@keyframes hire-pop {
  from { opacity: 0; transform: translateY(-50%) scale(0.3) rotate(-20deg); }
  to   { opacity: 1; transform: translateY(-50%) scale(1) rotate(0); }
}

@keyframes hire-wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(16deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(16deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

/* Reduced motion: the hand still appears, just without popping or waving */
@media (prefers-reduced-motion: reduce) {
  .hire-link__wave,
  .hire-link__hand {
    animation: none !important;
  }
}

/* ---------- Clients marquee ---------- */
.clients {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(2.25rem, 7.2vw, 6.5rem);
}

.clients__label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}

.marquee {
  width: calc(100% + var(--margin) * 2);
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-duration) linear infinite;
}

/* WCAG 2.2.2 (Pause, Stop, Hide): the moving logos pause on hover, and the
   pause button below toggles them for keyboard and screen reader users. */
.marquee:hover .marquee__track,
.marquee.is-paused .marquee__track {
  animation-play-state: paused;
}

.clients {
  position: relative;
}

/* Hidden until it receives keyboard focus, then shows as a small pill */
.marquee-toggle {
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--color-text);
  color: var(--color-navy);
  font-size: var(--fs-detail);
  white-space: nowrap;
  transform: translateX(-50%);
  clip-path: inset(50%);
  opacity: 0;
}

.marquee-toggle:focus-visible {
  clip-path: none;
  opacity: 1;
  outline-color: var(--color-text);
}

.marquee__list {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--logo-gap);
  padding-right: var(--logo-gap);
}

/* Three identical lists: shifting by exactly one list loops seamlessly */
@keyframes marquee {
  to {
    transform: translate3d(calc(-100% / 3), 0, 0);
  }
}

.logo {
  width: auto;
  height: calc(var(--logo-h) * var(--logo-scale));
}

/* Per-logo optical heights (source pixels ÷ 16) */
.logo--enclave { --logo-h: 1.5rem; }
.logo--muse { --logo-h: 0.9375rem; }
.logo--madkudu { --logo-h: 1.4375rem; }
.logo--ordinary-folk { --logo-h: 1.0625rem; }
.logo--website-squirrel { --logo-h: 1.6875rem; }
.logo--candid-leap { --logo-h: 1.4375rem; }

/* ---------- Work ---------- */
.work {
  /* Vertical space the pinned section needs around a project card */
  --work-chrome: 13.5rem;
  margin-top: clamp(2.5rem, 3vw, 3rem);
}

.work__pin {
  padding-block: clamp(1.5rem, 2.8vw, 2.5rem);
}

.work__viewport {
  margin-top: clamp(2rem, 2.8vw, 2.5rem);
  margin-inline: calc(var(--margin) * -1);
  padding-inline: var(--margin);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--margin);
  scrollbar-width: none;
  container-type: inline-size;
  /* Images slide out past this edge: round the clip's top-left corner like
     the images so they leave the frame on a curve, not a hard straight cut */
  border-top-left-radius: var(--radius-sm);
}

.work__viewport::-webkit-scrollbar {
  display: none;
}

.work__track {
  display: flex;
  gap: clamp(1.5rem, 4vw, 4rem); /* breathing room to the right of each project */
  width: max-content;
}

.project {
  flex: 0 0 auto;
  /* The viewport's content box = the content column. On short landscape
     screens the card narrows so image + details stay comfortably in view. */
  width: min(100cqi, max(20rem, (100svh - 4rem) * 1600 / 886));
  scroll-snap-align: start;
}

/* Scroll-driven Work (pure CSS, no ScrollTrigger):
   - .work is made tall enough for the sideways travel (--work-height)
   - .work__pin sticks below the top bar while you scroll through it
     (position: sticky — native layout, so it can never get "stuck")
   - the track slides left in step with the page scroll, via a CSS
     scroll-driven animation over exactly that stretch of the page
   js/main.js only measures the numbers (--work-start/-travel/-height/-top)
   and adds .is-scroll-driven when the browser supports it, motion is
   allowed and the section fits on screen. Otherwise: native swipe row. */
@media (prefers-reduced-motion: no-preference) {
  .work.is-scroll-driven {
    height: var(--work-height);
  }

  .work.is-scroll-driven .work__pin {
    position: sticky;
    top: var(--work-top);
  }

  .work.is-scroll-driven .work__viewport {
    overflow: hidden;
    scroll-snap-type: none;
  }

  .work.is-scroll-driven .work__track {
    animation: work-slide linear both;
    animation-timeline: scroll(root block);
    animation-range: var(--work-start) calc(var(--work-start) + var(--work-travel));
  }
}

@keyframes work-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--work-travel))); }
}

.project__card {
  position: relative;
  height: 100%;
}

.project__card picture {
  display: block;
}

.project__image {
  width: 100%;
  aspect-ratio: var(--project-ratio);
  object-fit: cover;
  object-position: top center; /* crop from the bottom: keeps each site’s header and logo in view */
  border-radius: var(--radius-sm);
  background-color: var(--color-navy-deep);
  transition: transform 1s var(--ease-out);
}

.project__info {
  display: grid;
  grid-template-areas:
    "title"
    "text"
    "link";
  margin-top: 0.75rem;
  padding: clamp(1.25rem, 6vw, 1.75rem) clamp(1.25rem, 6vw, 1.75rem) clamp(1.5rem, 6vw, 2rem);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgb(255 255 255 / 0.03), rgb(0 10 40 / 0.35)), rgb(3 23 74 / 0.55);
}

.project__title {
  grid-area: title;
  font-size: var(--fs-lead);
  font-weight: 700;
  line-height: 1.3;
}

.project__text {
  grid-area: text;
  margin-top: 1.1rem;
  font-size: var(--fs-detail);
  line-height: 1.32;
}

.project__link {
  grid-area: link;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: clamp(2rem, 9vw, 3rem);
  font-size: var(--fs-lead);
  text-decoration: none;
}

.icon-external {
  width: 0.8em;
  height: 0.8em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--duration) var(--ease-out);
}

.project__link:hover .icon-external {
  transform: translate(2px, -2px);
}

/* Short phone screens (toolbars showing): tighten the card's spacing and
   crop the screenshot a little shorter, so the whole card fits under the top
   bar and the projects can slide in step with the page scroll. Text sizes
   are unchanged. */
@media (max-width: 47.999rem) and (max-height: 45rem) {
  .work__pin {
    padding-bottom: 0.75rem;
  }

  .work__viewport {
    margin-top: 1.5rem;
  }

  .project__image {
    aspect-ratio: 16 / 7.5;
  }

  .project__info {
    margin-top: 0.5rem;
    padding: 1rem 1.125rem 1.125rem;
  }

  .project__text {
    margin-top: 0.625rem;
  }

  .project__link {
    margin-top: 1.125rem;
  }
}

/* ---------- About ---------- */
.about {
  margin-top: var(--space-section);
}

.about__avatar {
  width: clamp(7.3rem, 8.1vw, 8.5rem);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.about .section-title {
  margin-top: clamp(1.75rem, 2.8vw, 2.5rem);
}

.about__body {
  max-width: 48em;
  margin-top: clamp(1.25rem, 2.4vw, 2.25rem);
}

.about__body p + p {
  margin-top: 1.45em;
}

.skills {
  margin-top: var(--space-block);
}

.skills__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-h3);
  line-height: var(--lh-tight);
}

.skills__list {
  display: grid;
  gap: clamp(0.85rem, 1.9vw, 1.7rem);
  margin-top: clamp(0.85rem, 1.9vw, 1.6rem);
}

/* ---------- FAQ ---------- */
.faq {
  --faq-dash: 0.625rem;
  --faq-indent: calc(var(--faq-dash) + 1.25rem);
  margin-top: var(--space-section);
}

.faq__list {
  max-width: 48em;
  margin-top: clamp(1.75rem, 4vw, 3.5rem);
}

.faq__item + .faq__item {
  margin-top: clamp(0.5rem, 1vw, 0.75rem);
}

.faq__question {
  position: relative;
  display: block;
  padding: 0.6rem 0 0.6rem var(--faq-indent);
  font-size: 1.25rem; /* 20px */
  font-weight: 500; /* GT Walsheim Pro Medium */
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
  border-radius: 2px;
}

.faq__question::-webkit-details-marker {
  display: none;
}

/* The same dash as the nav markers; it stretches when the answer is open */
.faq__question::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.6rem + 0.675em);
  width: var(--faq-dash);
  height: 2px;
  margin-top: -1px;
  border-radius: 4px;
  background-color: currentColor;
  transform-origin: left center;
  transition: transform var(--duration) var(--ease-out);
}

.faq__question:hover::before,
.faq__item[open] > .faq__question::before {
  transform: scaleX(1.5);
}

.faq__answer {
  overflow: hidden;
  padding-left: var(--faq-indent);
}

.faq__answer p {
  font-size: var(--fs-detail);
  line-height: 1.5;
  color: rgb(255 255 255 / 0.85);
}

/* Space sits on the first and last paragraph so multi-paragraph answers stay tight */
.faq__answer p:first-child {
  padding-top: clamp(0.5rem, 1vw, 0.75rem);
}

.faq__answer p:last-child {
  padding-bottom: clamp(1.75rem, 4vw, 3.5rem);
}

.faq__answer p + p {
  margin-top: 0.75em;
}

.faq__answer strong {
  font-weight: 500; /* GT Walsheim Pro Medium, not a faux bold */
  color: #fff;
}

/* ---------- Contact ---------- */
.contact {
  margin-top: var(--space-section);
}

.contact__text {
  margin-top: clamp(1.25rem, 2vw, 1.75rem);
  font-size: var(--fs-lead);
}

/* ---------- Footer sign-off ---------- */
.site-footer {
  container-type: inline-size;
  margin-top: clamp(5rem, 10vw, 9rem);
  padding-bottom: clamp(3.5rem, 12vw, 6rem);
}

.sign-off {
  font-family: var(--font-display);
  font-weight: 900;
  /* The phrase is ~9.95em wide: fill ~88% of the column on mobile */
  font-size: calc(88cqi / 9.95);
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  color: var(--color-sign-off);
}

/* ==========================================================================
   Desktop: two-column layout with a sticky sidebar
   ========================================================================== */
@media (min-width: 64rem) {
  .page {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: var(--gutter);
  }

  .sidebar {
    grid-column: 1 / span 3;
    grid-row: 1 / -1;
    position: sticky;
    inset: auto;
    top: 0;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: 100vh;
    height: 100svh;
    padding: var(--page-top) 0 2rem;
    background: none;
  }

  .sidebar::before {
    display: none;
  }

  .menu-toggle,
  .video-thumb--hero {
    display: none;
  }

  .site-nav {
    margin-top: clamp(1.25rem, 2.2vw, 2.25rem);
  }

  .video-thumb--sidebar {
    /* Shrinks on short viewports so the sidebar never clips */
    width: max(6rem, min(var(--thumb-w), (100svh - 43rem) * 195 / 230));
    margin-top: clamp(1.5rem, 2.5vw, 2.25rem);
    flex-shrink: 0;
  }

  .content,
  .site-footer {
    grid-column: 4 / -1;
    min-width: 0;
  }

  .content {
    padding-top: var(--page-top);
  }

  .hero__intro {
    display: block;
    container-type: inline-size;
  }

  .hero__title {
    /* Tie to the column so the three-line break of the reference holds */
    font-size: min(var(--fs-hero), 7.13cqi);
    line-height: 1;
  }

  .marquee {
    width: 100%;
    margin-top: clamp(1.25rem, 1.9vw, 1.75rem);
  }

  .work {
    --work-chrome: calc(var(--page-top) + 9.5rem);
    margin-top: clamp(0.5rem, 0.8vw, 1rem);
  }

  /* While pinned, the "Work" heading sits level with the logo */
  .work__pin {
    padding-top: var(--page-top);
    padding-bottom: 1.5rem;
  }

  .work__viewport {
    /* Bleed to the right edge only: cards slide in from beyond the margin */
    margin-left: 0;
    padding-left: 0;
    scroll-padding-inline: 0;
  }

  .about__avatar {
    width: clamp(6.5rem, 8.125vw, 9rem);
  }

  .contact__text {
    font-size: var(--fs-body);
  }

  .site-footer {
    overflow: hidden;
    margin-top: clamp(6rem, 11vw, 11rem);
    padding-bottom: 0;
  }

  .sign-off {
    /* Fill the column and let the bottom of the letters run off the page */
    font-size: calc(98cqi / 9.95);
    text-align: left;
    margin-bottom: -0.17em;
  }
}

/* ==========================================================================
   Project cards — overlay layout (tablet and up, when there is height)
   ========================================================================== */
@media (min-width: 40rem) and (min-height: 40rem) {
  .project {
    /* Full column width, unless the viewport is too short to show it whole */
    width: min(100cqi, (100svh - var(--work-chrome)) * 1600 / 886);
  }

  .project__card {
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .project__image {
    border-radius: 0;
  }

  .project__card:hover .project__image {
    transform: scale(1.025);
  }

  .project__info {
    position: absolute;
    inset: auto clamp(1.25rem, 4%, 2.5rem) clamp(1.25rem, 6.5%, 2.75rem);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title link"
      "text text";
    align-items: center;
    column-gap: 1.5rem;
    margin: 0;
    padding: 1.5rem 1.6rem 1.6rem;
    border-color: rgb(255 255 255 / 0.14);
    border-radius: 0.625rem;
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
  }

  .project__title {
    font-size: var(--fs-body);
  }

  .project__text {
    margin-top: 1.25rem;
    font-size: var(--fs-detail);
    line-height: 1.25;
  }

  .project__link {
    margin: 0;
    font-size: var(--fs-body);
  }
}

/* ==========================================================================
   Intro video dialog
   ========================================================================== */
.video-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  overflow: hidden;
}

.video-modal::backdrop {
  background: transparent;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(3 18 60 / 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.video-modal__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 5rem var(--margin) 3rem;
  pointer-events: none;
}

.video-modal__frame {
  position: relative;
  width: min(100%, (100svh - 8rem) * 195 / 230);
  aspect-ratio: var(--video-ratio);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 2rem 5rem -1.5rem rgb(0 6 30 / 0.7);
  pointer-events: auto;
  transform-origin: 0 0;
}

.video-modal__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-modal__note {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  translate: -50% 0;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  font-size: var(--fs-detail);
  white-space: nowrap;
}

.video-modal.has-video .video-modal__note {
  display: none;
}

.video-modal__close {
  position: absolute;
  top: 1.25rem;
  right: var(--margin);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: rgb(255 255 255 / 0.06);
  transition: background-color var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.video-modal__close:hover {
  background: rgb(255 255 255 / 0.16);
  transform: rotate(90deg);
}

.video-modal__close svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

@media (min-width: 64rem) {
  /* The thumbnail travels across into the content column */
  .video-modal__stage {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    padding: 4rem var(--margin);
  }

  .video-modal__frame {
    grid-column: 4 / -1;
    justify-self: center;
    width: min(100%, (100svh - 8rem) * 195 / 230);
  }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
/* Hidden until GSAP reveals them (only when JS + motion are available) */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
  }

  .js [data-reveal="slide"] {
    opacity: 1;
    transform: translateY(2rem);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  /* Static, wrapped logo row instead of a moving marquee */
  .marquee {
    -webkit-mask-image: none;
    mask-image: none;
    width: 100%;
  }

  .marquee__track {
    animation: none;
    width: auto;
    justify-content: center;
  }

  .marquee__list {
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 0;
    row-gap: 1rem;
  }

  .marquee__list[aria-hidden="true"] {
    display: none;
  }
}
