/* ============================================================
     FONT — Averta Std (single Regular weight).
     Declared across 300–800 so the browser maps every weight in
     the design to this face and synthesises the heavier cuts,
     rather than dropping out to a fallback family mid-page.
     ============================================================ */
@font-face {
  font-family: 'Averta Std';
  src: url('../fonts/AvertaStd-Regular.ttf') format('truetype');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
     THEME TOKENS
     Light is the default. The dark block below overrides only the
     tokens — no component rule is duplicated per theme.
     ============================================================ */
:root {
  color-scheme: light;

  /* Brand constants — the mark's own colours, never re-tinted */
  --brand-red: #E94F1D;
  --brand-orange: #F39202;
  --brand-blue: #00529E;
  --brand-sky: #6EC1E4;
  --brand-navy: #0D0A69;

  /* Brand mapped for contrast on this theme's surfaces */
  --red: #E94F1D;
  --orange: #F39202;
  --amber-deep: #B84413;
  /* accessible orange for small text */
  --blue: #00529E;
  --sky: #6EC1E4;
  --navy: #0D0A69;

  /* Surfaces & type */
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --surface-3: #F0F0F1;
  --ink: #0D0A69;
  --body: #54595F;
  --muted: #7A7A7A;
  --line: rgba(13, 10, 105, 0.10);
  --line-strong: rgba(13, 10, 105, 0.18);
  --grid: rgba(13, 10, 105, 0.045);
  --grid-thumb: rgba(13, 10, 105, 0.05);

  /* Gradients echoing the two halves of the mark */
  --grad-warm: linear-gradient(100deg, #E94F1D 0%, #F39202 100%);
  --grad-cool: linear-gradient(100deg, #6EC1E4 0%, #00529E 100%);
  --grad-full: linear-gradient(100deg, #E94F1D 0%, #F39202 34%, #6EC1E4 66%, #00529E 100%);
  /* Warm ramp for gradient *text*: the amber end stops short of #F39202,
       which only reaches 2.4:1 on white and fails even the 3:1 large-text bar. */
  --grad-warm-text: linear-gradient(100deg, #E94F1D 0%, #E08600 100%);

  /* Header */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-bg-solid: rgba(255, 255, 255, 0.94);
  --nav-shadow: 0 1px 20px rgba(13, 10, 105, 0.06);

  /* Hero washes */
  --wash-warm: rgba(243, 146, 2, 0.13);
  --wash-cool: rgba(110, 193, 228, 0.20);
  --wash-red: rgba(233, 79, 29, 0.06);

  /* Buttons */
  --btn-primary-bg: #00529E;
  --btn-primary-ink: #FFFFFF;
  --btn-primary-hover: #0D0A69;
  --btn-primary-shadow: rgba(0, 82, 158, 0.28);
  --btn-warm-bg: #CE4415;
  --btn-warm-ink: #FFFFFF;
  --btn-warm-hover: #AE3810;
  --btn-warm-shadow: rgba(206, 68, 21, 0.26);
  --btn-ghost-hover-bg: rgba(0, 82, 158, 0.05);

  /* Component accents */
  --chip-bg: rgba(0, 82, 158, 0.08);
  --ico-1: rgba(0, 82, 158, 0.09);
  --ico-2: rgba(243, 146, 2, 0.13);
  --ico-3: linear-gradient(135deg, rgba(233, 79, 29, 0.11), rgba(0, 82, 158, 0.11));
  --thumb-1: linear-gradient(140deg, #EAF4FB 0%, #FDF1E2 100%);
  --thumb-2: linear-gradient(140deg, #FDF1E2 0%, #EAF4FB 100%);
  --thumb-3: linear-gradient(140deg, #FDECE5 0%, #FDF6E8 100%);

  /* Dark band (Clients) — always dark in both themes */
  --band-bg: #0D0A69;
  --band-wash-1: rgba(0, 82, 158, 0.55);
  --band-wash-2: rgba(233, 79, 29, 0.20);
  --on-navy: #FFFFFF;
  --on-navy-muted: rgba(255, 255, 255, 0.68);
  --on-navy-line: rgba(255, 255, 255, 0.16);

  /* Inline-SVG inks */
  --svg-blue: #00529E;
  --svg-orange: #F39202;
  --svg-red: #E94F1D;
  --svg-sky: #6EC1E4;
  --svg-grid: rgba(13, 10, 105, 0.07);
  --svg-gap-line: rgba(13, 10, 105, 0.30);
  --svg-badge: #0D0A69;
  --svg-badge-ink: #FFFFFF;
  --svg-fill-op: 0.16;

  --selection-bg: rgba(243, 146, 2, 0.28);
  --selection-ink: #0D0A69;

  --shadow-sm: 0 1px 2px rgba(13, 10, 105, 0.05), 0 2px 8px rgba(13, 10, 105, 0.04);
  --shadow-md: 0 2px 4px rgba(13, 10, 105, 0.04), 0 12px 28px rgba(13, 10, 105, 0.08);
  --shadow-lg: 0 4px 8px rgba(13, 10, 105, 0.05), 0 24px 56px rgba(13, 10, 105, 0.12);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --maxw: 1180px;
  --font: 'Averta Std', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h: 74px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --red: #FF6B3D;
  --orange: #FFA828;
  --amber-deep: #FFB259;
  --blue: #4FA3E3;
  --sky: #8AD2F2;
  --navy: #F4F6FC;

  --surface: #0B0D1C;
  --surface-2: #11142A;
  --surface-3: #1A1E38;
  --ink: #F4F6FC;
  --body: #BFC5D8;
  --muted: #8E96AE;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --grid: rgba(255, 255, 255, 0.045);
  --grid-thumb: rgba(255, 255, 255, 0.055);

  --grad-warm: linear-gradient(100deg, #FF6B3D 0%, #FFB84D 100%);
  --grad-cool: linear-gradient(100deg, #8AD2F2 0%, #4FA3E3 100%);
  --grad-full: linear-gradient(100deg, #FF6B3D 0%, #FFA828 34%, #8AD2F2 66%, #4FA3E3 100%);
  --grad-warm-text: linear-gradient(100deg, #FF6B3D 0%, #FFB84D 100%);

  --nav-bg: rgba(11, 13, 28, 0.76);
  --nav-bg-solid: rgba(11, 13, 28, 0.94);
  --nav-shadow: 0 1px 22px rgba(0, 0, 0, 0.55);

  --wash-warm: rgba(243, 146, 2, 0.15);
  --wash-cool: rgba(0, 82, 158, 0.38);
  --wash-red: rgba(233, 79, 29, 0.11);

  --btn-primary-bg: #4FA3E3;
  --btn-primary-ink: #06192B;
  --btn-primary-hover: #7CBFEE;
  --btn-primary-shadow: rgba(79, 163, 227, 0.30);
  --btn-warm-bg: #FF6B3D;
  --btn-warm-ink: #2A1004;
  --btn-warm-hover: #FF8A64;
  --btn-warm-shadow: rgba(255, 107, 61, 0.28);
  --btn-ghost-hover-bg: rgba(79, 163, 227, 0.10);

  --chip-bg: rgba(79, 163, 227, 0.16);
  --ico-1: rgba(79, 163, 227, 0.15);
  --ico-2: rgba(255, 168, 40, 0.16);
  --ico-3: linear-gradient(135deg, rgba(255, 107, 61, 0.18), rgba(79, 163, 227, 0.18));
  --thumb-1: linear-gradient(140deg, #14203A 0%, #2A1D11 100%);
  --thumb-2: linear-gradient(140deg, #2A1D11 0%, #14203A 100%);
  --thumb-3: linear-gradient(140deg, #2B1710 0%, #2A2113 100%);

  --band-bg: #12163A;
  --band-wash-1: rgba(0, 82, 158, 0.50);
  --band-wash-2: rgba(233, 79, 29, 0.22);

  --svg-blue: #4FA3E3;
  --svg-orange: #FFA828;
  --svg-red: #FF6B3D;
  --svg-sky: #8AD2F2;
  --svg-grid: rgba(255, 255, 255, 0.09);
  --svg-gap-line: rgba(255, 255, 255, 0.35);
  --svg-badge: #F4F6FC;
  --svg-badge-ink: #0B0D1C;
  --svg-fill-op: 0.20;

  --selection-bg: rgba(255, 168, 40, 0.30);
  --selection-ink: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.55);
}

/* Brief cross-fade while the theme flips. The reduced-motion block
     at the end of this sheet overrides it for users who opt out. */
.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color .28s ease, border-color .28s ease, color .28s ease,
    fill .28s ease, stroke .28s ease, box-shadow .28s ease, opacity .28s ease !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--body);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.68;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* height:auto keeps the intrinsic aspect ratio whenever only a width is set,
     so the width/height attributes never stretch the mark. */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-ink);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* Accessibility ------------------------------------------------ */
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-ink);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: top .2s ease;
}

.skip:focus {
  top: 16px;
}

:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* Typography --------------------------------------------------- */
h1,
h2,
h3 {
  color: var(--ink);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

h1 {
  font-size: clamp(40px, 5.4vw, 68px);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(28px, 3.6vw, 42px);
}

h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin: 0 0 18px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad-warm);
  flex: none;
}

.eyebrow.cool {
  color: var(--blue);
}

.eyebrow.cool::before {
  background: var(--grad-cool);
}

.eyebrow.on-navy {
  color: #FFD9A8;
}

.eyebrow.on-navy::before {
  background: linear-gradient(100deg, #FF6B3D 0%, #FFB84D 100%);
}

.lede {
  font-size: 17.5px;
  color: var(--muted);
  max-width: 56ch;
  margin: 16px 0 0;
}

/* Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.2, .7, .3, 1), box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}

.btn .arw {
  transition: transform .18s cubic-bezier(.2, .7, .3, 1);
}

.btn:hover .arw {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-ink);
  box-shadow: 0 4px 14px var(--btn-primary-shadow);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--btn-primary-shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--blue);
  background: var(--btn-ghost-hover-bg);
  transform: translateY(-2px);
}

.btn-warm {
  background: var(--btn-warm-bg);
  color: var(--btn-warm-ink);
  box-shadow: 0 4px 14px var(--btn-warm-shadow);
}

.btn-warm:hover {
  background: var(--btn-warm-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--btn-warm-shadow);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
}

/* Scroll progress ---------------------------------------------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 60;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--grad-full);
}

/* Header ------------------------------------------------------- */
header.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 55;
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}

header.nav.scrolled {
  background: var(--nav-bg-solid);
  border-bottom-color: var(--line);
  box-shadow: var(--nav-shadow);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.brand img {
  width: 44px;
  height: auto;
  flex: none;
}

.brand-text {
  line-height: 1.15;
}

.brand-text b {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.055em;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

nav.links {
  display: flex;
  align-items: center;
  gap: 6px;
}

nav.links a.nl {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}

nav.links a.nl:hover {
  color: var(--ink);
  background: var(--surface-3);
}

nav.links a.nl[aria-current="true"] {
  color: var(--blue);
}

nav.links a.nl[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--grad-warm);
}

nav.links .btn {
  margin-left: 10px;
}

/* Icon buttons (theme + menu) */
.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.icon-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--surface-3);
}

.theme-toggle .ico-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .ico-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .ico-sun {
  display: block;
}

.menu-toggle {
  display: none;
}

.menu-toggle .bars line {
  transition: transform .25s cubic-bezier(.2, .7, .3, 1), opacity .18s ease;
  transform-origin: center;
}

.menu-toggle[aria-expanded="true"] .bars line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .bars line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .bars line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

#mobileMenu {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  background: var(--nav-bg-solid);
  border-top: 1px solid transparent;
  transition: grid-template-rows .32s cubic-bezier(.2, .7, .3, 1), border-color .2s ease;
}

#mobileMenu.open {
  grid-template-rows: 1fr;
  border-top-color: var(--line);
}

.mm-inner {
  min-height: 0;
  overflow: hidden;
}

.mm-pad {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-pad a.ml {
  padding: 13px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mm-pad a.ml span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
}

.mm-pad .btn {
  margin-top: 18px;
}

/* Sections ----------------------------------------------------- */
section {
  padding: 112px 0;
  position: relative;
}

.section-head {
  max-width: 660px;
  margin-bottom: 56px;
}

.divider {
  height: 1px;
  background: var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ===================== HERO ===================== */
.hero {
  padding: calc(var(--nav-h) + 84px) 0 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, var(--wash-warm), transparent 62%),
    radial-gradient(820px 520px at 92% 4%, var(--wash-cool), transparent 62%),
    radial-gradient(620px 420px at 68% 88%, var(--wash-red), transparent 66%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 74% 68% at 50% 24%, #000 30%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 74% 68% at 50% 24%, #000 30%, transparent 82%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 60px;
  align-items: center;
}

/* "for" carries the brand warm ramp as its own colour.
     Falls back to solid brand red where background-clip:text is unsupported,
     so the word can never render transparent. */
.hero h1 em {
  font-style: normal;
  white-space: nowrap;
  display: inline-block;
  color: var(--red);
}

@supports ((-webkit-background-clip:text) or (background-clip:text)) {
  .hero h1 em {
    background: var(--grad-warm-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero-sub {
  margin-top: 24px;
  font-size: 18px;
  color: var(--muted);
  max-width: 52ch;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 58px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.hero-meta div {
  position: relative;
}

.hero-meta div+div {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.hero-meta b {
  display: block;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  background: var(--grad-cool);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  width: fit-content;
}

.hero-meta div:first-child b {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-meta span {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  display: block;
}

/* Trace card */
.trace-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 22px 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.trace-card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--grad-full);
}

.trace-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
}

.trace-legend {
  display: flex;
  gap: 16px;
}

.trace-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--body);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.dot.cool {
  background: var(--svg-blue);
}

.dot.warm {
  background: var(--svg-orange);
}

.trace-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.trace-caption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
  letter-spacing: 0.04em;
}

.trace-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.1s cubic-bezier(.4, 0, .2, 1) .3s forwards;
}

.trace-path.delay {
  animation-delay: .65s;
}

.trace-fill {
  opacity: 0;
  animation: fadein 1.1s ease 1.5s forwards;
}

.trace-gap {
  opacity: 0;
  animation: fadein .9s ease 1.9s forwards;
}

.trace-pt {
  opacity: 0;
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) 2.1s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fadein {
  to {
    opacity: 1;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.4);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===================== ABOUT ===================== */
.intro-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}

.intro-copy p {
  font-size: 17px;
  line-height: 1.78;
  margin: 0 0 20px;
  color: var(--body);
}

.intro-copy strong {
  color: var(--ink);
  font-weight: 700;
}

.lineage {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}

.lineage-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background-color .18s ease;
}

.lineage-row:last-child {
  border-bottom: none;
}

.lineage-row:hover {
  background: var(--surface);
}

.lineage-row.is-us {
  background: var(--surface);
  box-shadow: inset 4px 0 0 0 var(--orange);
}

.lineage-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lineage-row.is-us .lineage-tag {
  color: var(--amber-deep);
}

.lineage-name {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.lineage-desc {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 1px;
  line-height: 1.5;
}

/* ===================== CAPABILITIES ===================== */
.band {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.cap-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 28px 34px;
  position: relative;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease, border-color .22s ease;
}

.cap-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.cap-card.c1::before {
  background: var(--grad-cool);
}

.cap-card.c2::before {
  background: var(--grad-warm);
}

.cap-card.c3::before {
  background: var(--grad-full);
}

.cap-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.cap-card:hover::before {
  transform: scaleX(1);
}

.cap-ico {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  transition: scale .28s cubic-bezier(.2, 1.3, .5, 1), rotate .28s cubic-bezier(.2, 1.3, .5, 1);
}

.cap-card:hover .cap-ico {
  scale: 1.09;
  rotate: -4deg;
}

.cap-card.c1 .cap-ico {
  background: var(--ico-1);
}

.cap-card.c2 .cap-ico {
  background: var(--ico-2);
}

.cap-card.c3 .cap-ico {
  background: var(--ico-3);
}

.cap-num {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cap-card h3 {
  margin-bottom: 12px;
}

.cap-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

/* ===================== WORK ===================== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.work-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease, border-color .22s ease;
}

.work-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.work-thumb {
  height: 168px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.work-thumb.t1 {
  background: var(--thumb-1);
}

.work-thumb.t2 {
  background: var(--thumb-2);
}

.work-thumb.t3 {
  background: var(--thumb-3);
}

.work-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-thumb) 1px, transparent 1px), linear-gradient(90deg, var(--grid-thumb) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .7;
}

/* Every thumbnail mark scales as one unit on hover, whatever its medium. */
.work-thumb svg,
.work-thumb .wt-logo,
.work-thumb .dl-mark {
  position: relative;
  z-index: 1;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.work-thumb svg {
  width: 62%;
  height: auto;
}

.work-card:hover .work-thumb svg,
.work-card:hover .work-thumb .wt-logo,
.work-card:hover .work-thumb .dl-mark {
  transform: scale(1.05);
}

/* Supplied logo artwork */
.wt-logo {
  display: block;
  width: auto;
}

/* The Why Lens ships as an opaque JPEG with a navy mark, so it needs a light
     plate to stay legible on the dark theme rather than sitting bare. */
.wt-logo.wl {
  width: 76%;
  border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 6px 18px rgba(0, 0, 0, 0.12);
}

.wt-logo.jb {
  width: 74%;
}

/* Deeplight wordmark lockup — mirrors the platform's own nav mark:
     semibold, tight tracking, with the vertical head-line beneath it.
     The rule is anchored to the "l" glyph itself (see .dl-l) rather than
     centred on the word, so it stays under the letter at any font metrics. */
.dl-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
  /* reserves the out-of-flow rule: 4px gap + 36px */
}

.dl-word {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

.dl-l {
  position: relative;
}

.dl-l::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  width: 3px;
  height: 36px;
  margin-left: -1.5px;
  background: var(--ink);
}

.work-body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.work-kicker {
  display: inline-block;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--chip-bg);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  margin-bottom: 14px;
  transition: background-color .22s ease, color .22s ease;
}

.work-card:hover .work-kicker {
  background: var(--btn-ghost-hover-bg);
  color: var(--red);
}

.work-body h3 {
  margin-bottom: 10px;
}

.work-body p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 20px;
  flex: 1;
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue);
}

.work-link .arw {
  transition: transform .18s cubic-bezier(.2, .7, .3, 1);
}

.work-card:hover .work-link {
  color: var(--red);
}

.work-card:hover .work-link .arw {
  transform: translate(3px, -3px);
}

/* ===================== PROCESS / FLOW ===================== */
/* Built as a responsive grid rather than v2's fixed 1080px SVG: SVG <text>
     cannot reflow, so the stage labels would be unreadable on a phone. */
.flow-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 34px;
}

/* .flow-node owns the grid cell, the connectors and the staggered entrance.
     .flow-card owns the hover lift — kept on separate elements so the entrance
     delay can never leak into the hover transition. */
.flow-node {
  position: relative;
  opacity: 0;
  translate: 0 18px;
  transition: opacity .55s ease calc(var(--i) * 90ms),
    translate .55s cubic-bezier(.2, .7, .3, 1) calc(var(--i) * 90ms);
}

.flow.in .flow-node {
  opacity: 1;
  translate: 0 0;
}

.flow-node:nth-child(1) {
  --i: 0;
}

.flow-node:nth-child(2) {
  --i: 1;
}

.flow-node:nth-child(3) {
  --i: 2;
}

.flow-node:nth-child(4) {
  --i: 3;
}

.flow-node:nth-child(5) {
  --i: 4;
}

.flow-node:nth-child(6) {
  --i: 5;
}

.flow-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 16px 20px;
  transition: translate .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease, border-color .22s ease;
}

.flow-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-cool);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

.flow-node:hover .flow-card,
.flow-node.is-linked .flow-card {
  translate: 0 -4px;
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.flow-node:hover .flow-card::before,
.flow-node.is-linked .flow-card::before {
  transform: scaleX(1);
}

.flow-node.is-first .flow-card {
  border-left: 3px solid var(--orange);
  padding-left: 14px;
}

.flow-node.is-first .flow-card::before {
  background: var(--grad-warm);
}

/* Forward connector: track fills left-to-right, arrowhead brightens and nudges. */
.flow-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -34px;
  width: 34px;
  height: 2px;
  transform: translateY(-50%);
  background-color: var(--line-strong);
  background-image: linear-gradient(90deg, var(--blue), var(--blue));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size .32s cubic-bezier(.2, .7, .3, 1);
}

.flow-node::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -34px;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--blue);
  opacity: .45;
  transition: opacity .25s ease, translate .32s cubic-bezier(.2, .7, .3, 1);
}

.flow-node:hover::after,
.flow-node.is-linked::after {
  background-size: 100% 100%;
}

.flow-node:hover::before,
.flow-node.is-linked::before {
  opacity: 1;
  translate: 5px 0;
}

.flow-node:last-child::after,
.flow-node:last-child::before {
  content: none;
}

.flow-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
  transition: color .22s ease;
}

.flow-node:hover .flow-num,
.flow-node.is-linked .flow-num {
  color: var(--amber-deep);
}

.flow-title {
  font-size: 17px;
  margin-bottom: 7px;
}

.flow-sub {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

/* Loop-back from Support to Discover. */
.flow-loop {
  position: relative;
  height: 46px;
  margin: 0 24px;
  border: 2px dashed var(--line-strong);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: border-color .28s ease;
}

.flow-loop::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -7px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--orange);
  transition: scale .28s cubic-bezier(.2, 1.5, .5, 1);
}

.flow-loop-label {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  background: var(--surface-2);
  padding: 0 14px;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--amber-deep);
  transition: color .28s ease;
}

/* Cycle made explicit: hovering Support (or the loop) lights the return
     path and the Discover node it feeds back into. */
.flow.loop-on .flow-loop {
  border-color: var(--orange);
}

.flow.loop-on .flow-loop::before {
  scale: 1.3;
}

.flow.loop-on .flow-loop-label {
  color: var(--red);
}

.flow.loop-on .flow-node.is-first .flow-card {
  border-color: var(--orange);
  box-shadow: var(--shadow-md);
  translate: 0 -4px;
}

.flow.loop-on .flow-node.is-first .flow-card::before {
  transform: scaleX(1);
}

.flow-legend {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 34px;
}

.flow-legend li {
  border-top: 2px solid var(--line-strong);
  padding-top: 18px;
  transition: border-top-color .25s ease, translate .25s cubic-bezier(.2, .7, .3, 1);
}

.flow-legend li:hover,
.flow-legend li.is-linked {
  border-top-color: var(--orange);
  translate: 0 -3px;
}

.flow-legend .k {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 9px;
  transition: color .25s ease;
}

.flow-legend li:hover .k,
.flow-legend li.is-linked .k {
  color: var(--red);
}

.flow-legend p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ===================== CLIENTS (dark band, both themes) ========== */
.navy {
  background: var(--band-bg);
  color: var(--on-navy);
  position: relative;
  overflow: hidden;
}

.navy::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 420px at 88% 10%, var(--band-wash-1), transparent 62%),
    radial-gradient(620px 380px at 6% 96%, var(--band-wash-2), transparent 62%);
}

.navy h2,
.navy h3 {
  color: #fff;
}

.watermark {
  position: absolute;
  right: -70px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: auto;
  opacity: .07;
  pointer-events: none;
  user-select: none;
}

.clients-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-bottom: 34px;
}

.client-chip {
  border: 1px solid var(--on-navy-line);
  border-radius: var(--r-lg);
  padding: 26px 26px 28px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(6px);
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.client-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
}

.client-chip .eyebrow {
  margin-bottom: 12px;
}

.client-chip .eyebrow.cool {
  color: #8FD3F0;
}

.client-chip .eyebrow.cool::before {
  background: linear-gradient(100deg, #8AD2F2 0%, #4FA3E3 100%);
}

.client-chip p {
  font-size: 14.5px;
  color: var(--on-navy-muted);
  margin: 10px 0 0;
  line-height: 1.65;
}

.brand-strip {
  border-top: 1px solid var(--on-navy-line);
  padding-top: 30px;
}

.brand-strip .lead {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--on-navy-muted);
  margin: 0 0 20px;
}

.brand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-list span {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  border: 1px solid var(--on-navy-line);
  border-radius: var(--r-pill);
  padding: 9px 20px;
  background: rgba(255, 255, 255, 0.04);
  transition: background-color .2s ease, border-color .2s ease;
}

.brand-list span:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);
}

/* ===================== CONTACT ===================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 60px;
  align-items: center;
}

.contact-grid .lede {
  max-width: 48ch;
}

.contact-cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 28px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-full);
}

.contact-card .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.contact-card .row:last-child {
  border-bottom: none;
}

.contact-card .row span {
  color: var(--muted);
  flex: none;
}

.contact-card .row b {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

/* ===================== FOOTER ===================== */
footer {
  background: linear-gradient(135deg, #12153D 0%, #0D2850 100%);
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 56px 0 44px;
}

:root[data-theme="dark"] footer {
  background: linear-gradient(135deg, #080A1C 0%, #0B1830 100%);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(20px, 1.6fr) minmax(220px, 1.2fr) .8fr .8fr;
  gap: 40px;
  align-items: start;
}

.footer-brand img {
  width: 52px;
  height: auto;
  margin-bottom: 18px;
}

.footer-brand img.footer-mt-logo {
  display: block;
  width: 225px;
  height: auto;
  margin: 12px 0 0;
}

.footer-legal {
  font-size: 13px;
  color: rgba(255, 255, 255, .68);
  line-height: 1.85;
  max-width: 460px;
  margin: 0;
}

.footer-memberships {
  padding: 0;
  margin: 0;
}

.footer-memberships .lead {
  margin-bottom: 14px;
}

.accreditation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.accreditation-link {
  min-height: 64px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  opacity: 1;
}

.accreditation-link:focus-visible {
  outline: 2px solid #8AD2F2;
  outline-offset: 3px;
}

.accreditation-link img {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 48px;
  height: auto;
  object-fit: contain;
}

.accreditation-link--mrs img {
  max-height: 54px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-nav .lead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(255, 255, 255, .92);
  margin: 0 0 4px;
}

.footer-nav a {
  font-size: 14.5px;
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  width: fit-content;
  transition: color .18s ease;
}

.footer-nav a:hover {
  color: #8AD2F2;
}

.footer-memberships .accreditation-link {
  width: 100%;
}

/* Membership & Accreditation layout */
.footer-memberships .accreditation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 16px;
  align-items: center;
}

.footer-memberships .accreditation-link {
  min-height: 0;
  padding: 0;
  width: auto;
}

.footer-memberships .accreditation-link:nth-child(1) {
  justify-content: flex-start;
}

.footer-memberships .accreditation-link:nth-child(2) {
  justify-content: flex-end;
}

.footer-memberships .accreditation-link:nth-child(3),
.footer-memberships .accreditation-link:nth-child(4) {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 76px;
}

.footer-memberships .accreditation-link img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
}

.footer-memberships .accreditation-link:nth-child(1) img {
  width: 160px;
}

.footer-memberships .accreditation-link:nth-child(2) img {
  width: 68px;
}

.footer-memberships .accreditation-link:nth-child(3) img,
.footer-memberships .accreditation-link:nth-child(4) img {
  width: 100%;
  max-width: 220px;
}

.footer-bottom {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .62);
}

.footer-rule {
  height: 3px;
  border-radius: 2px;
  background: var(--grad-full);
  width: 64px;
}

/* Reveal ------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2, .7, .3, 1), transform .7s cubic-bezier(.2, .7, .3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal[data-d="1"] {
  transition-delay: .08s;
}

.reveal[data-d="2"] {
  transition-delay: .16s;
}

.reveal[data-d="3"] {
  transition-delay: .24s;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width:1000px) {
  nav.links {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero-grid,
  .intro-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .cap-grid,
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Flow turns vertical: connectors rotate to point down, and the
       loop-back becomes a labelled pill instead of a U-bracket. */
  .flow-track {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Connector runs top-to-bottom, so the fill and the nudge rotate with it. */
  .flow-node::after {
    top: auto;
    bottom: -30px;
    right: auto;
    left: 30px;
    width: 2px;
    height: 30px;
    transform: none;
    background-image: linear-gradient(180deg, var(--blue), var(--blue));
    background-size: 100% 0%;
  }

  .flow-node:hover::after,
  .flow-node.is-linked::after {
    background-size: 100% 100%;
  }

  .flow-node::before {
    top: auto;
    bottom: -30px;
    right: auto;
    left: 26px;
    transform: none;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--blue);
    border-bottom: none;
  }

  .flow-node:hover::before,
  .flow-node.is-linked::before {
    translate: 0 5px;
  }

  .flow-loop {
    height: auto;
    margin: 30px 0 0;
    padding: 11px 18px;
    text-align: center;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--r-pill);
  }

  .flow-loop::before {
    content: none;
  }

  .flow-loop-label {
    position: static;
    transform: none;
    background: none;
    padding: 0;
    white-space: normal;
  }

  .flow-legend {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width:760px) {
  section {
    padding: 80px 0;
  }

  .hero {
    padding: calc(var(--nav-h) + 56px) 0 72px;
  }

  .cap-grid,
  .work-grid,
  .clients-top {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 26px;
  }

  .hero-meta div+div {
    padding-left: 0;
    border-left: none;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }

  .hero-meta b {
    font-size: 30px;
    margin-bottom: 4px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 34px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  /* No `bottom` here — it would over-constrain against the base rule's `top`. */
  .watermark {
    width: 280px;
    right: -60px;
  }

  .section-head {
    margin-bottom: 40px;
  }
}

@media (max-width:520px) {

  .wrap,
  .nav-inner,
  .mm-pad {
    padding-left: 20px;
    padding-right: 20px;
  }

  body {
    font-size: 16px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn,
  .contact-cta .btn {
    width: 100%;
  }

  .contact-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .brand img {
    width: 38px;
    height: auto;
  }

  .contact-card .row {
    flex-direction: column;
    gap: 2px;
  }

  .contact-card .row b {
    text-align: left;
  }

  .flow-legend {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }
}


/* ============================================================
     LEGAL PAGES
     ============================================================ */
.legal-hero {
  padding: calc(var(--nav-h) + 72px) 0 52px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.legal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 10% -10%, var(--wash-warm), transparent 62%),
    radial-gradient(700px 420px at 92% 0%, var(--wash-cool), transparent 62%);
}

.legal-hero h1 {
  font-size: clamp(32px, 4.4vw, 50px);
  margin-bottom: 14px;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.legal-nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--body);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 9px 18px;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease, translate .18s ease;
}

.legal-nav a:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--btn-ghost-hover-bg);
  translate: 0 -2px;
}

.legal-nav a[aria-current="page"] {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-ink);
}

.legal-body {
  padding: 64px 0 96px;
}

.legal-grid {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 56px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}

.legal-toc .lead {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
}

.legal-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc a {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.legal-toc a:hover {
  color: var(--ink);
  border-left-color: var(--orange);
  background: var(--surface-3);
}

/* Section currently in view. Weight + a filled rule so it stays distinct
     from the hover state when the pointer is elsewhere in the list. */
.legal-toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--orange);
  border-left-width: 3px;
  background: var(--surface-3);
}

.legal-prose {
  max-width: 74ch;
  min-width: 0;
}

.legal-prose .intro {
  font-size: 17px;
  line-height: 1.75;
  color: var(--body);
  border-left: 3px solid var(--orange);
  padding-left: 22px;
  margin: 0 0 44px;
}

/* No scroll-margin-top here: html already sets scroll-padding-top, and the two
     stack (scrollport inset + target outset), parking the heading twice as far
     down as intended and breaking the table-of-contents highlight. */
.legal-prose h2 {
  font-size: 21px;
  margin: 44px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-prose h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.legal-prose h3 {
  font-size: 16px;
  margin: 26px 0 10px;
}

.legal-prose p {
  font-size: 15.5px;
  line-height: 1.78;
  margin: 0 0 16px;
  color: var(--body);
}

.legal-prose ul,
.legal-prose ol.num {
  margin: 0 0 18px;
  padding-left: 22px;
}

.legal-prose li {
  font-size: 15.5px;
  line-height: 1.75;
  margin-bottom: 9px;
  color: var(--body);
}

.legal-prose li::marker {
  color: var(--orange);
}

.legal-prose a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-prose a:hover {
  color: var(--red);
}

.legal-prose strong {
  color: var(--ink);
  font-weight: 700;
}

/* Defined-terms list */
.legal-defs {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}

.legal-defs div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.legal-defs div:last-child {
  border-bottom: none;
}

.legal-defs dt {
  font-weight: 700;
  color: var(--ink);
  font-size: 14.5px;
  margin: 0;
}

.legal-defs dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* Contact / details panel */
.legal-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 8px 26px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin: 0 0 20px;
}

.legal-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-full);
}

.legal-card .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.legal-card .row:last-child {
  border-bottom: none;
}

.legal-card .row span {
  color: var(--muted);
  flex: none;
}

.legal-card .row b {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

/* Cookie table */
.legal-table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.legal-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal-table thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.legal-table tbody tr:last-child td {
  border-bottom: none;
}

.legal-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--chip-bg);
  color: var(--blue);
  padding: 2px 7px;
  border-radius: 5px;
}

.legal-note {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin: 0 0 20px;
  background: var(--surface-2);
}

.legal-note p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.legal-note strong {
  color: var(--amber-deep);
}

@media (max-width:1000px) {
  .legal-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc ol {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 18px;
  }
}

@media (max-width:640px) {
  .legal-body {
    padding: 48px 0 72px;
  }

  .legal-toc ol {
    grid-template-columns: 1fr;
  }

  .legal-defs div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .legal-card .row {
    flex-direction: column;
    gap: 2px;
  }

  .legal-card .row b {
    text-align: left;
  }
}

/* Must stay last so it wins over .theme-anim's !important transitions. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .trace-path {
    stroke-dashoffset: 0 !important;
  }

  .trace-fill,
  .trace-gap,
  .trace-pt {
    opacity: 1 !important;
  }
}