/* ============================================================
   Alfcode — refined design system
   ============================================================ */

:root {
  /* Surfaces — deep navy-black */
  --bg: #080a11;
  --bg-1: #0d1019;
  --bg-2: #121622;
  --bg-3: #191e2c;

  /* Foreground */
  --fg: #f4f6f9;
  --fg-2: #bcc2cc;
  --fg-3: #7b828f;
  --fg-4: #565d6a;

  /* Lines */
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.22);

  /* Accent — brand gold primary, brand blue secondary */
  --accent: #e6c552;
  --accent-2: #f1d268;
  --accent-deep: #c8a838;
  --cyan: #5b8cf0;
  --cyan-deep: #2f5fc4;
  --accent-soft: rgba(230, 197, 82, 0.14);
  --cyan-soft: rgba(91, 140, 240, 0.13);
  --glow: rgba(230, 197, 82, 0.40);

  /* theme scrims */
  --veil-rgb: 5, 5, 5;
  --scrim: rgba(5, 5, 6, 0.72);
  --scrim-solid: rgba(7, 7, 9, 0.96);

  /* Type */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', monospace;

  /* Radii */
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --container: 1280px;
  --wide: 1440px;
  --pad: clamp(20px, 5vw, 56px);
}

/* ---- Light theme ---- */
[data-theme="light"] {
  --bg: #f7f6f1;
  --bg-1: #ffffff;
  --bg-2: #f0efe8;
  --bg-3: #e6e4da;
  --fg: #122142;
  --fg-2: #3c4658;
  --fg-3: #6b7280;
  --fg-4: #9aa1ac;
  --line: rgba(18, 33, 66, 0.10);
  --line-2: rgba(18, 33, 66, 0.16);
  --line-3: rgba(18, 33, 66, 0.28);
  --accent: #d8b441;
  --accent-2: #e6c552;
  --accent-deep: #b0892c;
  --cyan: #214c9e;
  --cyan-deep: #173a80;
  --accent-soft: rgba(216, 180, 65, 0.18);
  --cyan-soft: rgba(33, 76, 158, 0.10);
  --glow: rgba(216, 180, 65, 0.30);
  --veil-rgb: 247, 246, 241;
  --scrim: rgba(247, 246, 241, 0.80);
  --scrim-solid: rgba(250, 249, 245, 0.97);
}
[data-theme="light"] body { color: var(--fg-2); }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  background-color: var(--bg);
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.006em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  color: var(--fg);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h1, h2 { font-family: var(--display); letter-spacing: -0.035em; }

p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

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

::selection { background: var(--accent); color: #0b0f1a; }

/* ---- Accessibility ---- */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: 0; left: -9999px;
  z-index: 2000;
  background: var(--accent);
  color: #0b0f1a;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 0 0 var(--r-s) 0;
}
.skip-link:focus { left: 0; }

/* ---- Custom cursor (desktop) ---- */
@media (hover: hover) and (pointer: fine) {
  html.js body { cursor: none; }
  .cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--cyan);
    transition: width .2s var(--ease), height .2s var(--ease), background .2s;
  }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1px solid var(--line-3);
    transition: width .25s var(--ease), height .25s var(--ease), border-color .25s, background .25s;
  }
  .cursor-ring.hover {
    width: 56px; height: 56px;
    border-color: var(--accent);
    background: rgba(45, 98, 255, 0.08);
  }
  .cursor-dot.hover { width: 4px; height: 4px; }
}

/* ---- Shared layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.container.wide { max-width: var(--wide); }

.section { position: relative; padding: clamp(72px, 11vw, 132px) 0; }
.section-divider { border-top: 1px solid var(--line); }

/* Eyebrow */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow);
}

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
em.serif { font-style: italic; }

/* Section head two-column */
.sec-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
@media (min-width: 900px) {
  .sec-head { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 48px; }
}
.sec-head h2 {
  font-size: clamp(32px, 5vw, 54px);
  margin-top: 18px;
}
.sec-head .lede {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--fg-2);
  max-width: 46ch;
}

/* Section headings reveal by a tight mask-up that trails the eyebrow.
   `.motion-head` (added in motion.js) clips the h2 so the lines rise from
   under an edge; it still rides main.js's `.reveal.in` and its `.d1` delay,
   which is what lands it just behind the eyebrow. */
html.js .sec-head h2.motion-head {
  clip-path: inset(-0.1em -0.1em -0.1em -0.1em);
  transition:
    opacity .7s var(--ease-out),
    transform .8s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path .8s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .sec-head h2.motion-head:not(.in) {
  opacity: 0;
  transform: translateY(16px);
  clip-path: inset(0 0 102% 0);
}
html.js .sec-head h2.motion-head.in {
  opacity: 1;
  transform: none;
  clip-path: inset(-0.1em -0.1em -0.1em -0.1em);
}

/* A 1px accent hairline draws in beneath each section head as it enters.
   motion.js adds `.has-rule`, then `.rule-in` when the head intersects. */
.sec-head.has-rule { position: relative; }
.sec-head.has-rule::after {
  content: "";
  position: absolute;
  left: 0; bottom: calc(-1 * clamp(20px, 3vw, 36px));
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--line-2) 60%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s var(--ease-out) .12s;
}
.sec-head.has-rule.rule-in::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .sec-head.has-rule::after { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s, color .18s, transform .12s, box-shadow .25s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent);
  color: #0b0f1a;
  box-shadow: 0 0 0 0 var(--glow);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 8px 30px -8px var(--glow); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--line-3); background: rgba(255,255,255,0.03); }
.btn-ghost:active { transform: scale(0.98); }

.arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow, .link:hover .arrow { transform: translate(2px, -2px); }

/* ============================================================
   NAV
   ============================================================ */
/* Floating glass-pill nav (shared style with the /apps page) */
.nav {
  position: fixed;
  top: 14px; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: top .4s var(--ease);
}
.nav.scrolled .nav-inner {
  background: var(--scrim-solid);
  border-color: var(--line-2);
  box-shadow: 0 16px 50px -18px rgba(0, 0, 0, 0.65);
}
.nav-inner {
  pointer-events: auto;
  max-width: calc(100% - 2 * var(--pad));
  height: 56px;
  padding: 0 10px 0 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  background: var(--scrim);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 12px 40px -18px rgba(0, 0, 0, 0.55);
  transition: background .3s var(--ease), box-shadow .3s, border-color .3s;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { height: 26px; width: auto; display: block; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
.footer-brand .brand-logo { height: 30px; }

.nav-links { display: none; align-items: center; gap: clamp(16px, 1.8vw, 26px); }
.nav-links a {
  font-size: 14px;
  color: var(--fg-3);
  font-weight: 450;
  letter-spacing: -0.01em;
  position: relative;
  transition: color .2s;
}
.nav-links a:hover { color: var(--fg); }
/* The underline scales from a left origin so the active indicator reads as
   a continuous rule sliding between sections rather than a width snap.
   Outgoing links collapse and incoming links grow on the same eased curve,
   so the highlight appears to travel as you scroll. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .42s var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--fg); }
.nav-links a.active::after { transform: scaleX(1); }

/* Lock background scroll while the mobile menu is open */
body.menu-open { overflow: hidden; }

.nav-cta { display: none; }
@media (min-width: 920px) {
  .nav-links, .nav-cta { display: flex; }
}

/* mobile toggle */
.nav-toggle {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--fg); position: relative; transition: .3s var(--ease); }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--fg); transition: .3s var(--ease);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open span::after { top: 0; transform: rotate(-45deg); }
@media (min-width: 920px) { .nav-toggle { display: none; } }

.mobile-menu {
  position: fixed;
  inset: 72px 0 0 0;
  background: var(--scrim-solid);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
  padding: 24px var(--pad) 34px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: .3s var(--ease);
  z-index: 999;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu a { font-size: 22px; color: var(--fg); padding: 12px 0; border-bottom: 1px solid var(--line); letter-spacing: -0.02em; }
.mobile-menu .btn { margin-top: 18px; justify-content: center; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#dotwave {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(var(--veil-rgb),0.55) 100%),
    linear-gradient(to bottom, rgba(var(--veil-rgb),0.35) 0%, transparent 22%, transparent 60%, var(--bg) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 120px var(--pad) 80px;
}
.hero-content { max-width: 880px; }
.hero h1 {
  font-size: clamp(46px, 8.2vw, 108px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin: 26px 0 0;
  color: var(--fg);
}
.hero h1 .hl { color: var(--accent); position: relative; }

/* ---- Hero headline: refined line-mask reveal + single sheen ----
   main.js still owns the `.reveal.in` toggle on the H1; `.motion-hero`
   only swaps the generic fade for a translate-under-overflow mask so the
   words rise from beneath a clip edge. The two `<br>`-split lines share
   one clip so they resolve as a single confident gesture. */
html.js .hero h1.motion-hero {
  clip-path: inset(-0.12em -0.12em -0.12em -0.12em);
  transition:
    opacity .8s var(--ease-out),
    transform .9s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path .9s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .hero h1.motion-hero:not(.in) {
  opacity: 0;
  transform: translateY(22px);
  clip-path: inset(0 0 102% 0);
}
html.js .hero h1.motion-hero.in {
  opacity: 1;
  transform: none;
  clip-path: inset(-0.12em -0.12em -0.12em -0.12em);
}

/* A single specular sheen sweeps the gold word once after it lands. The
   gradient is clipped to the text so only the glyphs catch the light; the
   class is removed in JS when the sweep ends, so there is no loop. */
.hero h1 .hl.sheen {
  background-image: linear-gradient(
    100deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 62%,
    transparent 100%);
  background-size: 240% 100%;
  background-repeat: no-repeat;
  background-position: 220% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: hl-sheen 1.2s var(--ease-out) forwards;
}
@keyframes hl-sheen {
  0%   { background-position: 220% 0; }
  100% { background-position: -120% 0; }
}

.hero-sub {
  font-size: clamp(17px, 1.9vw, 21px);
  color: var(--fg-2);
  max-width: 52ch;
  margin-top: 28px;
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

.scroll-cue {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--fg-4); text-transform: uppercase;
}
.scroll-cue .bar { width: 1px; height: 40px; background: linear-gradient(var(--line-3), transparent); position: relative; overflow: hidden; }
.scroll-cue .bar::after {
  content: ""; position: absolute; top: 0; left: 0; width: 1px; height: 14px; background: var(--cyan);
  animation: scrolldown 2.2s var(--ease) infinite;
}
@keyframes scrolldown { 0% { transform: translateY(-14px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(40px); opacity: 0; } }

/* ============================================================
   CLIENT LOGOS — quiet wall of trust under the hero
   A slow, seamless marquee that pauses on hover and fades at
   both edges. Logos are monochrome (currentColor) at low opacity
   so the strip stays calm in both themes; reduced motion turns it
   into a static centered row.
   ============================================================ */
.clients { padding: clamp(40px, 5vw, 64px) 0 clamp(8px, 1vw, 16px); }
.clients-label {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-4);
  text-align: center;
  margin-bottom: clamp(22px, 3vw, 34px);
}
.clients-marquee {
  position: relative;
  display: flex;
  width: 100%;
  overflow: hidden;
  /* Edge fade so logos dissolve in and out rather than clip hard. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.clients-marquee:hover .clients-track { animation-play-state: paused; }
.clients-track {
  list-style: none;
  display: flex;
  flex: none;
  align-items: center;
  gap: clamp(40px, 6vw, 84px);
  padding: 6px clamp(20px, 3vw, 42px) 6px 0;
  animation: clients-scroll 42s linear infinite;
  will-change: transform;
}
.client { flex: none; display: grid; place-items: center; }
/* The logos are external SVGs loaded via <img>, so their `currentColor`
   can't inherit the page color. Normalize each to a flat tone with a
   filter instead: white on dark, near-black on light. */
.client img {
  height: 26px;
  width: auto;
  opacity: 0.62;
  filter: brightness(0) invert(1);
  transition: opacity .3s var(--ease), filter .3s;
}
.client img:hover { opacity: 1; }
[data-theme="light"] .client img { filter: brightness(0); opacity: 0.5; }
/* Two identical tracks scroll left by exactly one track width for a seamless
   loop (the second set is aria-hidden in the markup). */
@keyframes clients-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .clients-marquee { justify-content: center; -webkit-mask-image: none; mask-image: none; }
  .clients-track { animation: none; }
  .clients-track[aria-hidden="true"] { display: none; }
  .clients-marquee:hover .clients-track { animation-play-state: paused; }
}

/* ============================================================
   SERVICES — refined feature rows
   ============================================================ */
#services { font-family: var(--display); }
.svc-list { border-top: 1px solid var(--line-2); }
.svc-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: clamp(24px, 3.2vw, 38px) clamp(10px, 2vw, 22px);
  border-bottom: 1px solid var(--line);
  align-items: center;
  transition: background .25s var(--ease);
}
.svc-row::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 2px; background: var(--accent);
  transition: height .3s var(--ease);
}
.svc-row::after {
  content: "→"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--fg-4); display: none;
  transition: color .3s, transform .3s var(--ease);
}
.svc-row:hover { background: linear-gradient(90deg, var(--accent-soft), transparent 58%); }
.svc-row:hover::before { height: 56%; }
.svc-row:hover::after { color: var(--accent); transform: translateY(-50%) translateX(5px); }
.svc-row:hover .svc-idx { color: var(--accent); }
.svc-row:hover .svc-ico { border-color: var(--accent); background: var(--accent-soft); }
@media (min-width: 800px) {
  .svc-row { grid-template-columns: 1.05fr 1.15fr; gap: 48px; padding-right: 48px; }
  .svc-row h3 { white-space: nowrap; }
  .svc-row::after { display: block; }
}
.svc-left { display: flex; align-items: center; gap: 20px; }
.svc-idx { font-family: var(--mono); font-size: 13px; color: var(--fg-4); letter-spacing: 0.06em; width: 22px; flex: none; transition: color .3s; }
.svc-ico {
  color: var(--accent); flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--bg-1);
  transition: border-color .3s, background .3s;
}
.svc-ico svg { width: 22px; height: 22px; }
.svc-row h3 { font-size: clamp(21px, 2.4vw, 29px); letter-spacing: -0.03em; }
.svc-desc { font-size: clamp(15px, 1.4vw, 17px); color: var(--fg-2); line-height: 1.55; max-width: 52ch; }

/* ============================================================
   PROCESS — open columns with accent rule
   ============================================================ */
.steps { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step {
  position: relative;
  padding: 30px clamp(20px, 2.2vw, 34px) 8px 0;
  border-top: 1px solid var(--line-2);
}
.step::before {
  content: "";
  position: absolute; top: -1px; left: 0;
  width: 38px; height: 2px;
  background: var(--accent);
}
.step-idx { font-family: var(--mono); font-size: 30px; font-weight: 500; color: var(--fg-4); letter-spacing: -0.02em; }
.step-label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent-2); margin-top: 14px; }
.step h3 { font-size: 20px; margin: 8px 0 11px; letter-spacing: -0.02em; }
.step p { font-size: 14.5px; color: var(--fg-3); line-height: 1.55; max-width: 34ch; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(20px, 2.4vw, 28px) 8px;
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--cyan); }
.faq-mark { position: relative; width: 16px; height: 16px; flex: none; }
.faq-mark::before, .faq-mark::after {
  content: ""; position: absolute; background: var(--fg-3);
  left: 50%; top: 50%;
}
.faq-mark::before { width: 14px; height: 1.5px; transform: translate(-50%, -50%); }
.faq-mark::after { width: 1.5px; height: 14px; transform: translate(-50%, -50%); }
.faq-item[open] .faq-mark::after { display: none; }
.faq-item[open] summary { color: var(--cyan); }
.faq-item[open] .faq-mark::before { background: var(--cyan); }
.faq-body { padding: 0 8px clamp(22px, 2.4vw, 28px); }
.faq-body p { font-size: 16px; color: var(--fg-2); line-height: 1.6; max-width: 70ch; }

/* ============================================================
   WORK
   ============================================================ */
.work-grid { display: grid; grid-template-columns: 1fr; gap: clamp(18px, 2vw, 26px); }
@media (min-width: 760px) { .work-grid { grid-template-columns: 1fr 1fr; } }

/* Work → App Showcase cross-link */
.work-cta {
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.work-cta p { color: var(--fg-2); font-size: clamp(15px, 1.4vw, 18px); max-width: 52ch; }

.work-card {
  position: relative;
  border-radius: var(--r-l);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  isolation: isolate;
  /* Tilt vars driven by motion.js; default to flat so non-pointer and
     reduced-motion contexts simply never move. */
  --rx: 0deg; --ry: 0deg; --px: 0px; --py: 0px;
  transform-style: preserve-3d;
  transition: border-color .35s var(--ease), transform .5s var(--ease);
}
.work-card:hover { border-color: var(--line-2); }
/* While actively tilting we follow the pointer through the CSS vars on a
   short, damped settle; on leave the class drops and the .5s base transition
   eases it back to flat. perspective lives here so the 3D stays subtle. */
.work-card.tilting {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .12s linear, border-color .35s var(--ease);
}
.work-card.feat { grid-column: 1 / -1; }
.work-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.work-card.feat .work-media { aspect-ratio: 16 / 9; }
.work-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .8s var(--ease), filter .5s;
  transform: scale(1.02);
}
.work-card:hover .work-media img { transform: scale(1.06); }
/* Counter-parallax: while tilting, the image shifts opposite the tilt for a
   faint sense of depth between frame and content. Tracks the pointer on the
   same short settle. */
.work-card.tilting .work-media img {
  transform: scale(1.12) translate(var(--px), calc(var(--py) + var(--par-y, 0px)));
  transition: transform .12s linear;
}

/* Specular gloss: a soft radial highlight that follows the cursor across the
   media. Injected by motion.js, hidden from assistive tech, fades in only
   while tilting. */
.work-gloss {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: soft-light;
  background: radial-gradient(
    220px 220px at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.10) 40%,
    transparent 68%);
  transition: opacity .35s var(--ease);
}
.work-card.tilting .work-gloss { opacity: 0.7; }
@media (prefers-reduced-motion: reduce) {
  .work-card.tilting { transform: none; }
  .work-gloss { display: none; }
}
.work-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, #050608 0%, #050608 23%, rgba(5,6,8,0.6) 47%, rgba(5,6,8,0.12) 72%, transparent 100%);
}
.work-info {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  padding: clamp(22px, 2.6vw, 34px);
  z-index: 2;
}
.work-cat {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cyan);
  display: flex; align-items: center; gap: 8px;
}
.work-info h3 { font-size: clamp(22px, 2.4vw, 30px); margin: 12px 0 0; letter-spacing: -0.03em; }
.work-info p { font-size: 14.5px; color: var(--fg-2); margin-top: 8px; max-width: 42ch; }
.work-tag {
  position: absolute; top: clamp(16px,2vw,22px); right: clamp(16px,2vw,22px); z-index: 2;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--fg-2);
  background: rgba(10,11,13,0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  padding: 6px 11px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
}
.work-arrow {
  position: absolute; top: clamp(16px,2vw,22px); left: clamp(16px,2vw,22px); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10,11,13,0.55); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  color: var(--fg);
  opacity: 0; transform: translateY(-6px) scale(0.9);
  transition: .4s var(--ease);
}
.work-card:hover .work-arrow { opacity: 1; transform: translateY(0) scale(1); }
.work-arrow svg { width: 16px; height: 16px; }

/* ============================================================
   TECH STACK
   ============================================================ */
.tech-wrap { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 940px) { .tech-wrap { grid-template-columns: 280px 1fr; gap: 48px; align-items: start; } }
.tech-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 940px) { .tech-tabs { flex-direction: column; position: sticky; top: 100px; } }
.tech-tab {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-3);
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: .25s var(--ease);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
}
.tech-tab .c { font-family: var(--mono); font-size: 12px; color: var(--fg-4); }
.tech-tab:hover { color: var(--fg-2); }
.tech-tab.active { color: var(--fg); background: var(--accent-soft); border-left-color: var(--accent); }
.tech-tab.active .c { color: var(--accent-2); }

.tech-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(45,98,255,0.07), transparent 55%),
    var(--bg-1);
  padding: clamp(28px, 3vw, 44px);
  min-height: 300px;
}
.tech-panel .panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.tech-panel .panel-head h3 { font-size: 24px; }
.tech-panel .panel-head .meta { font-family: var(--mono); font-size: 12px; color: var(--fg-3); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--fg-2);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  padding: 11px 18px; border-radius: 999px;
  transition: .3s var(--ease);
  cursor: default;
}
.chip:hover { border-color: var(--line-3); transform: translateY(-2px); color: var(--fg); }
.chip .swatch { width: 9px; height: 9px; border-radius: 50%; }

/* ============================================================
   STATS + TESTIMONIALS
   ============================================================ */
.stats-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 820px) { .stats-band { grid-template-columns: repeat(4, 1fr); } }
/* Cells carry their own dividers (border-left / wrap-row border-top) so the
   outer content can sit flush with the container gutter (var(--pad)) and line
   up with the heading and quotes above and below at every width. */
.stat-cell { padding: clamp(34px, 4.5vw, 56px) clamp(22px, 3vw, 40px); }
@media (max-width: 819.98px) {
  .stat-cell { border-left: 1px solid var(--line); }
  .stat-cell:nth-child(2n+1) { border-left: 0; padding-left: var(--pad); }
  .stat-cell:nth-child(2n) { padding-right: var(--pad); }
  .stat-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (min-width: 820px) {
  .stat-cell { border-left: 1px solid var(--line); }
  .stat-cell:first-child { border-left: 0; padding-left: var(--pad); }
  .stat-cell:last-child { padding-right: var(--pad); }
}
.stat-cell .num { font-family: var(--mono); font-size: clamp(34px, 5vw, 56px); font-weight: 500; color: var(--fg); letter-spacing: -0.03em; }
.stat-cell .num .cy { color: var(--cyan); }
.stat-cell .lbl { font-size: 14px; color: var(--fg-3); margin-top: 10px; max-width: 22ch; }

.quotes { display: grid; grid-template-columns: 1fr; gap: clamp(16px, 2vw, 22px); margin-top: clamp(48px,6vw,72px); }
@media (min-width: 860px) { .quotes { grid-template-columns: 1fr 1fr; } }
.quote {
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: clamp(28px,3vw,40px);
  background: var(--bg-1);
  display: flex; flex-direction: column;
  transition: border-color .3s var(--ease), transform .4s var(--ease-out);
}
.quote:hover { border-color: var(--line-2); transform: translateY(-3px); }
.quote p { font-size: clamp(16px,1.6vw,19px); color: var(--fg); line-height: 1.55; letter-spacing: -0.015em; flex: 1; }
.quote .who { display: flex; align-items: center; gap: 13px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.quote .avatar {
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 14.5px;
  letter-spacing: 0.01em;
  background: linear-gradient(150deg, var(--accent), var(--cyan-deep));
  /* A faint inner ring + soft outer shadow so the avatar reads as a real
     chip. The tone gradient shows as a thin ring behind the portrait. */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 4px 12px -4px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
}
/* Portrait fills the chip; a 1.5px gap lets the tone ring read at the edge. */
.quote .avatar img {
  position: absolute;
  inset: 1.5px;
  width: calc(100% - 3px);
  height: calc(100% - 3px);
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
}
/* Distinct, restrained 2-stop gradients so six people don't look cloned. */
.quote .avatar.t1 { background: linear-gradient(150deg, #6d8df0, #2f4ea8); }
.quote .avatar.t2 { background: linear-gradient(150deg, #e6c552, #b07c2c); color: #1a130a; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28), 0 4px 12px -4px rgba(0,0,0,0.45); }
.quote .avatar.t3 { background: linear-gradient(150deg, #4fb8a4, #1f6f70); }
.quote .avatar.t4 { background: linear-gradient(150deg, #b884e6, #5b3aa0); }
.quote .avatar.t5 { background: linear-gradient(150deg, #ef8fa6, #b23f63); }
.quote .avatar.t6 { background: linear-gradient(150deg, #7d8ca0, #3a4658); }
.quote .who .name { color: var(--fg); font-size: 14.5px; font-weight: 500; }
.quote .who .role { color: var(--fg-3); font-size: 13px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: clamp(40px,6vw,72px); align-items: start; }
@media (min-width: 940px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-left h2 { font-size: clamp(40px,7vw,92px); line-height: 0.95; letter-spacing: -0.04em; margin-top: 18px; }
.contact-left h2 .serif { font-size: 1.08em; }
.contact-left .lede { margin-top: 26px; font-size: 18px; color: var(--fg-2); max-width: 40ch; }
.contact-meta { margin-top: 40px; display: flex; flex-direction: column; gap: 4px; }
.contact-meta a { display: inline-flex; align-items: center; gap: 9px; font-size: 17px; color: var(--fg); padding: 8px 0; width: fit-content; transition: color .25s; }
.contact-meta a:hover { color: var(--cyan); }
.contact-meta a svg { width: 15px; height: 15px; color: var(--fg-3); }

.form {
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--bg-1);
  padding: clamp(26px,3vw,40px);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-3); margin-bottom: 9px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  padding: 13px 15px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-4); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-toggle {
  font: inherit;
  font-size: 13.5px; color: var(--fg-3);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  transition: .2s var(--ease);
  user-select: none;
}
.chip-toggle:hover { border-color: var(--line-3); color: var(--fg-2); }
.chip-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.form .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }
.form-note { font-size: 12.5px; color: var(--fg-4); margin-top: 14px; text-align: center; }
.form-success {
  display: none; text-align: center; padding: 40px 10px;
}
.form-success.show { display: block; }
.form-success .check { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent); display: grid; place-items: center; color: var(--cyan); }
.form-success h3 { font-size: 22px; }
.form-success p { color: var(--fg-3); margin-top: 8px; font-size: 14.5px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: clamp(56px,7vw,90px) 0 40px; }
.footer-top { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 760px) { .footer-top { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 18px; }
.footer-brand p { font-size: 14.5px; color: var(--fg-3); max-width: 32ch; }
.footer-col h4 { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-4); font-weight: 500; margin-bottom: 18px; }
.footer-col a { display: block; font-size: 14.5px; color: var(--fg-3); padding: 6px 0; transition: color .2s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  margin-top: clamp(48px,6vw,72px); padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--fg-4);
}

/* ============================================================
   Reveal — entrance animations (JS-gated so no-JS users
   always see content; JS adds .in via IntersectionObserver)
   ============================================================ */
/* Refined spring: the transform uses a slightly-overshooting ease-out so
   content arrives with a confident settle, while opacity rides a calmer
   curve so nothing flickers. Distance is gentle (14px) and the stagger is
   tightened so groups feel cohesive rather than sequential. */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .7s var(--ease-out),
    transform .8s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; }
.reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; }

/* Optional variant: also clears a soft blur as it resolves. */
html.js .reveal--blur { filter: blur(6px); transition-property: opacity, transform, filter; }
html.js .reveal--blur.in { filter: blur(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ============================================================
   Nav actions + theme toggle
   ============================================================ */
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--fg-2);
  transition: border-color .2s, color .2s, background .2s;
  flex: none;
}
.theme-toggle:hover { border-color: var(--line-3); color: var(--fg); }
.theme-toggle svg { width: 18px; height: 18px; stroke-width: 1.8; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }

/* ============================================================
   Floating dock (WhatsApp + AI)
   ============================================================ */
.dock {
  position: fixed;
  right: clamp(16px, 3vw, 26px);
  bottom: clamp(16px, 3vw, 26px);
  z-index: 1200;
  display: flex; flex-direction: column; gap: 12px;
}
.dock-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer; border: none;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.55);
  transition: transform .15s var(--ease);
  color: #fff;
}
.dock-btn:hover { transform: translateY(-2px); }
.dock-btn:active { transform: scale(.95); }
.dock-btn.wa { background: #25d366; }
.dock-btn.wa svg { width: 28px; height: 28px; }
.dock-btn.ai { background: var(--accent); position: relative; color: #0b0f1a; }
.dock-btn.ai svg { width: 24px; height: 24px; position: absolute; }
.dock-btn.ai .i-x { display: none; }
.dock-btn.ai.open .i-spark { display: none; }
.dock-btn.ai.open .i-x { display: block; }

/* ============================================================
   AI chat panel
   ============================================================ */
.chat {
  position: fixed;
  right: clamp(16px, 3vw, 26px);
  bottom: calc(clamp(16px, 3vw, 26px) + 134px);
  z-index: 1190;
  width: min(380px, calc(100vw - 32px));
  height: min(540px, 70vh);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: 0 30px 80px -24px rgba(0,0,0,.6);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.chat-id { display: flex; align-items: center; gap: 11px; }
.chat-av { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, var(--cyan), var(--accent)); display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--display); }
.chat-name { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.chat-status { font-size: 11.5px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.chat-status i { width: 6px; height: 6px; border-radius: 50%; background: #36e0a0; }
.chat-close { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: var(--fg-3); cursor: pointer; display: grid; place-items: center; }
.chat-close:hover { color: var(--fg); background: var(--bg-3); }
.chat-close svg { width: 18px; height: 18px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 86%; padding: 11px 14px; border-radius: 15px; font-size: 14px; line-height: 1.5; }
.chat-msg.bot { align-self: flex-start; background: var(--bg-2); color: var(--fg); border-bottom-left-radius: 5px; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #0b0f1a; border-bottom-right-radius: 5px; }
.chat-msg.typing { display: flex; gap: 5px; align-items: center; }
.chat-msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); opacity: .5; animation: blink 1.2s infinite; }
.chat-msg.typing span:nth-child(2) { animation-delay: .2s; }
.chat-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
.chat-suggest { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 2px; }
.chat-suggest button { font-size: 13px; color: var(--accent-2); border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 7px 13px; cursor: pointer; transition: border-color .2s, background .2s; }
.chat-suggest button:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg-1); }
.chat-input input { flex: 1; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; color: var(--fg); font-family: var(--sans); font-size: 14px; outline: none; }
.chat-input input:focus { border-color: var(--accent); }
.chat-send { width: 42px; height: 42px; border-radius: 11px; border: none; background: var(--accent); color: #0b0f1a; display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-send svg { width: 18px; height: 18px; }

/* ============================================================
   SCROLL-LINKED MOTION (alfcode-scroll.js + Lenis)
   All of the following is JS-gated and fully inert under
   prefers-reduced-motion (the scroll module never runs, the
   word/tilt/parallax classes are never added, and the explicit
   reduced-motion block below neutralizes anything residual).
   ============================================================ */

/* Lenis: it keeps the real scroll position; this just opts the html
   into its height handling. Smooth-scroll CSS is turned off from JS
   (root.style.scrollBehavior='auto') while Lenis is active. */
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }

/* ---- 2. Scroll-progress bar: 2px, accent→cyan, above the nav ---- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 1100;            /* above nav (1000), below skip-link (2000) */
  pointer-events: none;
  background: transparent;
}
.scroll-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 38%, var(--cyan) 100%);
  will-change: transform;
}

/* ---- 3. Word-reveal: per-word clip + rise, JS-driven each frame ----
   The splitter keeps the real glyphs inside `.word-in`; `.word-clip`
   provides the overflow edge the word rises from. `.has-words` takes
   the block out of motion.js's clip-mask so the only motion is the
   per-word rise (no double animation). */
html.js .has-words { opacity: 1 !important; transform: none !important; clip-path: none !important; }
.word-clip {
  display: inline-flex;
  overflow: hidden;
  vertical-align: top;
  /* a hair of vertical padding so descenders/ascenders aren't clipped */
  padding: 0.06em 0.02em;
  margin: -0.06em -0.02em;
}
.word-in {
  display: inline-block;
  transform: translateY(100%);
  will-change: transform, opacity;
}
/* `.lede` is a flex/inline-flow paragraph; keep wrapping natural. */
.has-words { display: block; }

/* ---- 4. Card enter-tilt: composes WITH motion.js pointer tilt ----
   `.enter-tilt` carries scroll-driven `--enter-*` vars; motion.js's
   hover tilt uses the separate `--rx/--ry`. The base transform below
   folds both var sets together so they never overwrite each other.
   At rest (entered) the enter vars are neutral, so hover-tilt is clean. */
.work-card.enter-tilt,
.quote.enter-tilt {
  --enter-rx: 0deg;
  --enter-ty: 0px;
  --enter-op: 1;
}
html.js .work-card.enter-tilt {
  transform: perspective(1100px) translateY(var(--enter-ty)) rotateX(var(--enter-rx));
  opacity: var(--enter-op);
  /* JS writes the vars every frame; keep the property transition tight so
     a stray frame gap still eases rather than snaps. */
  transition: border-color .35s var(--ease), transform .12s linear, opacity .2s linear;
  will-change: transform, opacity;
}
/* When motion.js is actively pointer-tilting, its rule wins and folds the
   (by-then-neutral) enter vars in so the two never fight. */
html.js .work-card.enter-tilt.tilting {
  transform:
    perspective(1100px)
    translateY(var(--enter-ty))
    rotateX(calc(var(--rx) + var(--enter-rx)))
    rotateY(var(--ry));
  opacity: var(--enter-op);
  transition: transform .12s linear, border-color .35s var(--ease);
}
html.js .quote.enter-tilt {
  transform: perspective(1100px) translateY(var(--enter-ty)) rotateX(var(--enter-rx));
  opacity: var(--enter-op);
  transition: border-color .3s var(--ease), transform .12s linear, opacity .2s linear;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}
/* The quote's own hover lift still reads once it has settled flat. */
html.js .quote.enter-tilt:hover { transform: perspective(1100px) translateY(calc(var(--enter-ty) - 3px)) rotateX(var(--enter-rx)); }

/* ---- 5. Parallax layers ---- */
.parallax-img { will-change: transform; }
.work-media img.parallax-img {
  /* Slightly over-scale so the drift never exposes an edge inside the
     overflow:hidden frame. Composes with the existing scale on hover via
     the base transform here; hover scale lives in the .work-card rules. */
  transform: scale(1.08) translateY(var(--par-y, 0px));
}
/* Keep the hover zoom but preserve the parallax offset. */
.work-card:hover .work-media img.parallax-img { transform: scale(1.12) translateY(var(--par-y, 0px)); }
.parallax-hero { will-change: transform; }
.hero-veil.parallax-hero { transform: translateY(var(--par-y, 0px)); }
.hero-content.parallax-hero { transform: translateY(var(--par-y, 0px)); }

/* ---- 6. Velocity skew on large blocks ---- */
.vel-skew { will-change: transform; transform-origin: center top; }

/* ---- 7. JS-driven marquee (velocity-reactive) ----
   When the scroll module takes over, it tags the marquee `.js-marquee`
   and drives each track via transform. We then disable the CSS keyframe
   animation so the two don't compound; pause-on-hover is handled in JS,
   and the edge fade / seamless duplicate track stay exactly as before. */
.js-marquee .clients-track { animation: none; will-change: transform; }

/* ---- Reduced motion: hard off-switch for everything above ---- */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .word-clip { overflow: visible; padding: 0; margin: 0; display: inline; }
  .word-in { transform: none !important; opacity: 1 !important; display: inline; will-change: auto; }
  html.js .work-card.enter-tilt,
  html.js .quote.enter-tilt { transform: none !important; opacity: 1 !important; transition: border-color .35s var(--ease); will-change: auto; }
  .work-media img.parallax-img { transform: scale(1.02) !important; }
  .hero-veil.parallax-hero, .hero-content.parallax-hero { transform: none !important; }
  .vel-skew { transform: none !important; }
  .js-marquee .clients-track { transform: none !important; }
}
