/* =========================================================
   Zlichs | Agentic AI Solutions
   ---------------------------------------------------------
   Design system
   - Colour: exactly three brand colours, ink #031211, ivory #EBE4D3
     and electric teal #00AEBB (plus transparent tints of them).
     Teal text is only used on ink; on ivory, teal is a fill (buttons,
     highlights, panels) with ink text on top, which keeps contrast high.
   - The logo and the Z mark are always black (ink).
   - Type: Geist for everything, Geist Mono for small labels.
     Bodoni Moda italic is reserved for single brand words because
     it echoes the high-contrast Didone "Z" in the Zlichs logo.
   - Shape: pills for interactive elements, 28px radius for panels,
     20px for media inside panels.
   - Spacing: 8px base; sections use --space-section.
   ========================================================= */

:root {
  --ink: #031211;
  --ivory: #ebe4d3;
  --teal: #00aebb;

  --text: var(--ink);
  --text-muted: rgba(3, 18, 17, 0.68);
  --on-dark-muted: rgba(235, 228, 211, 0.68);
  --on-teal-muted: rgba(3, 18, 17, 0.84);
  --line: rgba(3, 18, 17, 0.14);
  --line-dark: rgba(235, 228, 211, 0.16);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;

  --fs-display: clamp(48px, 8.4vw, 148px);
  --fs-h2: clamp(44px, 6.6vw, 112px);
  --fs-h3: clamp(30px, 3.4vw, 54px);
  --fs-lead: clamp(18px, 1.45vw, 22px);
  --fs-body: 17px;
  --fs-small: 14px;

  --radius-panel: 28px;
  --radius-media: 20px;
  --gutter: clamp(16px, 4vw, 56px);
  --space-section: clamp(96px, 14vw, 200px);
  --header-h: 76px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* z-index scale */
  --z-header: 40;
  --z-menu: 35;
  --z-cursor: 60;
  --z-progress: 70;
  --z-grain: 80;
  --z-loader: 100;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--teal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.work :focus-visible, .quotes :focus-visible, .contact :focus-visible { outline-color: var(--teal); }

.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 200; background: var(--ink); color: var(--ivory); padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 12px; }

.display {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.94;
}
.brand-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.hero__title { isolation: isolate; }
.hero__title .brand-italic { position: relative; }
.hero__title .brand-italic::after {
  content: ""; position: absolute; z-index: -1; left: -0.06em; right: -0.02em; bottom: 0.1em; height: 0.36em;
  background: var(--teal); border-radius: 0.05em;
  transform-origin: left; transition: transform 1.2s var(--ease-out);
}
.anim .hero__title .brand-italic::after { transform: scaleX(0); }
.anim.hero-in .hero__title .brand-italic::after { transform: scaleX(1); }

/* Split-text masks (built by JS) */
.line, .w { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.w { display: inline-block; vertical-align: top; }
.line__in, .w__in { display: inline-block; will-change: transform; }
.c { display: inline-block; transform-origin: 50% 100%; }

/* ---------- Loader ---------- */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  display: grid; place-items: center;
  background: var(--teal); color: var(--ink);
  animation: loader-fallback 0.6s 4s forwards;
}
.loader__logo { width: min(340px, 60vw); height: auto; clip-path: inset(0 100% 0 0); }
.loader__count {
  position: absolute; right: var(--gutter); bottom: calc(var(--gutter) * 0.6);
  font-size: clamp(64px, 12vw, 180px); font-weight: 600; letter-spacing: -0.06em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
@keyframes loader-fallback { to { opacity: 0; visibility: hidden; } }

/* ---------- Chrome: progress, grain, cursor ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: var(--z-progress); pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--teal); transform: scaleX(0); transform-origin: 0 50%; }

.grain {
  position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none; opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-label {
  position: fixed; left: 0; top: 0; z-index: var(--z-cursor);
  width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal); color: var(--ink); font-weight: 600; font-size: 15px;
  pointer-events: none; transform: scale(0); opacity: 0;
}

/* ---------- Buttons & links ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 28px; border-radius: 999px;
  font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: color 0.45s var(--ease-out), transform 0.2s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn__label { position: relative; z-index: 1; }
.btn__fill {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%); z-index: 0;
  width: 0; height: 0; border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s var(--ease-out), height 0.6s var(--ease-out);
}
.btn:hover .btn__fill, .btn:focus-visible .btn__fill { width: 260%; height: 600%; }
.btn--ink { background: var(--ink); color: var(--ivory); }
.btn--ink .btn__fill { background: var(--teal); }
.btn--ink:hover, .btn--ink:focus-visible { color: var(--ink); }
.btn--teal { background: var(--teal); color: var(--ink); }
.btn--teal .btn__fill { background: var(--ink); }
.btn--teal:hover, .btn--teal:focus-visible { color: var(--ivory); }
.contact .btn--teal .btn__fill { background: var(--ivory); }
.contact .btn--teal:hover, .contact .btn--teal:focus-visible { color: var(--ink); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 600; position: relative; padding: 6px 0;
}
.link-arrow::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: currentColor;
  transform: scaleX(0.3); transform-origin: left; transition: transform 0.6s var(--ease-out);
}
.link-arrow:hover::after { transform: scaleX(1); }
.link-arrow i { font-style: normal; transition: transform 0.6s var(--ease-out); }
.link-arrow:hover i { transform: rotate(-45deg); }

/* Text roll on hover */
.roll { display: inline-flex; overflow: hidden; vertical-align: top; }
.roll > span { position: relative; display: inline-block; transition: transform 0.6s var(--ease-out); }
.roll > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
.roll:hover > span, .roll:focus-visible > span { transform: translateY(-100%); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  transition: transform 0.7s var(--ease-out), color 0.4s;
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(235, 228, 211, 0.84);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity 0.4s, background 0.4s;
}
.header.is-scrolled::before { opacity: 1; }
.header.is-hidden { transform: translateY(-110%); }
.header__inner { display: flex; align-items: center; gap: 40px; height: var(--header-h); }
.header__logo { position: relative; display: block; }
.header__logo img { height: 30px; width: auto; transition: opacity 0.4s; }
.nav { display: flex; gap: 30px; margin-left: auto; font-weight: 500; font-size: 15px; }
.header__cta { height: 46px; padding: 0 22px; font-size: 15px; }
.burger { display: none; }

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--teal); color: var(--ink);
  display: flex; align-items: flex-end; padding-bottom: 48px;
  clip-path: inset(0 0 100% 0); transition: clip-path 0.7s var(--ease-in-out);
}
.menu.is-open { clip-path: inset(0 0 0 0); }
.menu__nav { display: grid; gap: 4px; }
.menu__nav a {
  font-size: clamp(40px, 11vw, 72px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05;
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.menu.is-open .menu__nav a { opacity: 1; transform: none; }
.menu.is-open .menu__nav a:nth-child(2) { transition-delay: 0.05s; }
.menu.is-open .menu__nav a:nth-child(3) { transition-delay: 0.1s; }
.menu.is-open .menu__nav a:nth-child(4) { transition-delay: 0.15s; }
.menu.is-open .menu__nav a:nth-child(5) { transition-delay: 0.2s; }
.menu.is-open .menu__nav a:nth-child(6) { transition-delay: 0.25s; }
.menu__cta { font-family: var(--serif); font-style: italic; font-weight: 500; }

/* ---------- Hero: particle words ---------- */
.hero {
  position: relative; min-height: 100dvh; overflow: hidden;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 32px) 0 clamp(36px, 5vw, 64px);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero__inner { position: relative; z-index: 1; width: 100%; }
.hero__eyebrow { display: inline-block; background: var(--teal); color: var(--ink); padding: 7px 14px; border-radius: 999px; margin-bottom: clamp(20px, 3vw, 36px); }
.hero__title {
  font-size: var(--fs-display); font-weight: 600; letter-spacing: -0.055em; line-height: 0.92;
}
.hero__title .brand-italic { padding-right: 0.06em; }
.hero__stage { margin-top: 0.06em; }
.hero__fallback { font-size: var(--fs-display); font-weight: 600; letter-spacing: -0.055em; line-height: 0.95; }
.particles .hero__stage { height: clamp(72px, 16.5vw, 272px); }
.particles .hero__fallback { display: none; }
.hero__foot {
  margin-top: clamp(32px, 4vw, 56px);
  display: grid; grid-template-columns: auto minmax(0, 440px) auto; justify-content: space-between; align-items: end; gap: 40px;
}
.hero__lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--text-muted); max-width: 32ch; }
.hero__ctas { display: flex; align-items: center; gap: 28px; }
.hero__words { display: none; gap: 24px; }
.particles .hero__words { display: flex; }
.hero__word { position: relative; padding-bottom: 10px; font-weight: 600; font-size: 15px; opacity: 0.6; transition: opacity 0.4s; }
.hero__word:hover { opacity: 0.75; }
.hero__word.is-active { opacity: 1; }
.hero__word i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); overflow: hidden; }
.hero__word i::after { content: ""; position: absolute; inset: 0; background: var(--teal); transform: scaleX(0); transform-origin: left; }
.hero__word.is-active i::after { animation: bar var(--word-ms, 3600ms) linear forwards; }

.badge {
  position: absolute; z-index: 1; right: var(--gutter); top: calc(var(--header-h) + 40px);
  width: 132px; height: 132px; display: grid; place-items: center;
}
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 18s linear infinite; }
.badge text { font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.18em; fill: var(--ink); font-weight: 500; }
.badge__mark { width: 62px; height: 62px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; }
.badge__mark img { width: 30px; height: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: 2;
  background: var(--teal); color: var(--ink);
  padding: clamp(18px, 2vw, 28px) 0;
  transform: rotate(-2deg) scale(1.04);
}
.marquee-wrap { overflow: hidden; padding: clamp(16px, 3vw, 48px) 0; margin-top: clamp(-40px, -3vw, -16px); position: relative; z-index: 2; }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; align-items: center; gap: clamp(24px, 3vw, 48px); padding-right: clamp(24px, 3vw, 48px); }
.marquee span { font-size: clamp(40px, 6vw, 96px); font-weight: 600; letter-spacing: -0.045em; line-height: 1; white-space: nowrap; }
.marquee .outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.marquee b { color: var(--ink); font-size: clamp(24px, 3vw, 44px); }

/* ---------- Manifesto ---------- */
.manifesto { padding: var(--space-section) 0; }
.manifesto__grid { display: grid; grid-template-columns: 1fr 3.2fr; gap: clamp(24px, 4vw, 64px); }
.manifesto__z {
  position: sticky; top: calc(var(--header-h) + 40px); align-self: start;
  width: clamp(140px, 19vw, 300px);
}
.manifesto__z img { width: 100%; height: auto; }

/* ---------- 3D extruded logo (stacked masked layers) ---------- */
.x3d { position: relative; width: 100%; aspect-ratio: var(--ratio); perspective: 1100px; }
.x3d__stack { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.x3d__layer, .x3d__face {
  position: absolute; inset: 0;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.x3d--z .x3d__layer, .x3d--z .x3d__face { -webkit-mask-image: url(../assets/z-black.png); mask-image: url(../assets/z-black.png); }
.x3d--logo .x3d__layer, .x3d--logo .x3d__face { -webkit-mask-image: url(../assets/logo-black.png); mask-image: url(../assets/logo-black.png); }
.x3d__face { background: var(--ink); }
/* The Z gets teal sides; the footer logo (on teal) gets deep ink shadow sides. */
.x3d--z .x3d__layer { background: var(--teal); transform: translateZ(calc(var(--i) * -2.4px)); }
.x3d--z .x3d__layer:nth-child(-n + 3) { background: var(--ink); }
.x3d--logo .x3d__layer { background: var(--ink); opacity: calc(0.5 - var(--i) * 0.03); transform: translateZ(calc(var(--i) * -2.2px)); }
.manifesto__text {
  font-size: clamp(30px, 4.1vw, 64px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.08;
}
.manifesto__cols {
  margin-top: clamp(48px, 6vw, 88px);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 48px);
  max-width: 860px; color: var(--text-muted);
}

/* ---------- Services (sticky stack) ---------- */
.services { padding: 0 0 var(--space-section); }
.services__sub { margin-top: 20px; font-size: var(--fs-lead); color: var(--text-muted); max-width: 40ch; }
.stack { margin-top: clamp(48px, 6vw, 88px); display: grid; gap: 6vh; }
.stack__card {
  position: sticky; top: calc(var(--header-h) + 20px + var(--i) * 26px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 3vw, 48px);
  min-height: min(76vh, 660px);
  padding: clamp(24px, 3vw, 44px);
  border-radius: var(--radius-panel);
  transform-origin: 50% 0;
  overflow: hidden;
  box-shadow: 0 -1px 0 rgba(235, 228, 211, 0.06) inset, 0 30px 80px -40px rgba(3, 18, 17, 0.5);
}
.stack__card--teal { background: var(--teal); color: var(--ink); }
.stack__card--ink { background: var(--ink); color: var(--ivory); }
.stack__card--ivory { background: var(--ivory); color: var(--ink); border: 1.5px solid var(--ink); }
.stack__body { display: flex; flex-direction: column; }
.stack__shade { position: absolute; inset: 0; border-radius: inherit; background: var(--ink); opacity: 0; pointer-events: none; z-index: 2; }
.stack__num { opacity: 0.85; }
.stack__card h3 {
  margin-top: auto; font-size: clamp(40px, 5.6vw, 92px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.95;
}
.stack__card p { margin-top: 20px; font-size: var(--fs-lead); line-height: 1.45; max-width: 34ch; opacity: 0.86; }
.pills { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li {
  font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 999px;
  border: 1px solid currentColor; opacity: 0.9;
  transition: background 0.3s, color 0.3s;
}
.stack__card--teal .pills li:hover { background: var(--ink); color: var(--teal); }
.stack__card--ink .pills li:hover { background: var(--teal); color: var(--ink); border-color: var(--teal); }
.stack__card--ivory .pills li:hover { background: var(--ink); color: var(--ivory); }
.stack__media { border-radius: var(--radius-media); overflow: hidden; }
.stack__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.2s var(--ease-out); }
.stack__card:hover .stack__media img { transform: scale(1.12); }

/* ---------- Work (horizontal pan) ---------- */
.work { background: var(--ink); color: var(--ivory); }
.work__pin { min-height: 100dvh; display: flex; align-items: center; overflow: hidden; }
/* Without the scroll-driven pan (reduced motion or no JS), let people swipe the row. */
html:not(.anim) .work__pin { overflow-x: auto; scroll-snap-type: x proximity; }
html:not(.anim) .project { scroll-snap-align: center; }
.work__track {
  display: flex; align-items: center; gap: clamp(24px, 3vw, 48px);
  padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
  width: max-content; will-change: transform;
}
.work__intro { width: clamp(280px, 30vw, 460px); flex-shrink: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.work__intro p { margin-top: 24px; color: var(--on-dark-muted); font-size: var(--fs-lead); max-width: 26ch; }
.work__count { margin-top: 40px; color: var(--teal); }
.project { width: clamp(300px, 46vw, 760px); flex-shrink: 0; display: block; }
.project__media { aspect-ratio: 4 / 3; border-radius: var(--radius-media); overflow: hidden; background: var(--ink); }
.project__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transition: filter 0.6s; }
.project:hover .project__media img { filter: saturate(1.15) brightness(1.05); }
.project__meta { margin-top: 20px; display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; align-items: start; }
.project__meta h3 { font-size: clamp(24px, 2.2vw, 34px); font-weight: 600; letter-spacing: -0.035em; }
.project__meta p { grid-column: 1; color: var(--on-dark-muted); }
.tags { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tags li { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-dark); }

/* ---------- Process (timeline) ---------- */
.process { padding: var(--space-section) 0; }
.process__grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(40px, 6vw, 120px); }
.process__head { position: sticky; top: calc(var(--header-h) + 48px); align-self: start; }
.process__head p { margin-top: 24px; font-size: var(--fs-lead); color: var(--text-muted); max-width: 32ch; }
.timeline { position: relative; padding-left: 88px; }
.timeline__rail { position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline__rail span { display: block; width: 100%; height: 100%; background: var(--teal); transform: scaleY(0); transform-origin: top; }
.step { position: relative; padding: 0 0 clamp(64px, 9vw, 120px); }
.step:last-child { padding-bottom: 0; }
.step__dot {
  position: absolute; left: -88px; top: 0;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ivory); border: 1.5px solid var(--line); color: var(--text-muted);
  transition: background 0.5s var(--ease-out), color 0.5s, border-color 0.5s, transform 0.5s var(--ease-out);
}
.step.is-active .step__dot { background: var(--teal); border-color: var(--teal); color: var(--ink); transform: scale(1.08); }
.step h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.045em; line-height: 1; padding-top: 6px; }
.step p { margin-top: 16px; font-size: var(--fs-lead); line-height: 1.45; color: var(--text-muted); max-width: 36ch; }

/* ---------- Results (bento) ---------- */
.results { padding: 0 0 var(--space-section); }
.bento {
  margin-top: clamp(40px, 5vw, 72px);
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(220px, 20vw, 300px); gap: 16px;
}
.cell {
  position: relative; overflow: hidden; border-radius: var(--radius-panel);
  padding: clamp(24px, 2.4vw, 36px);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.cell strong { font-size: clamp(52px, 6.4vw, 108px); font-weight: 600; letter-spacing: -0.06em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.cell p { margin-top: 12px; font-weight: 500; max-width: 26ch; }
.cell--hero { grid-column: span 2; grid-row: span 2; color: var(--ivory); background: var(--ink); }
.cell--hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-out); }
.cell--hero:hover img { transform: scale(1.05); }
.cell--hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 18, 17, 0) 30%, rgba(3, 18, 17, 0.88) 100%); }
.cell--hero .cell__content { position: relative; z-index: 1; }
.cell--hero strong { font-size: clamp(64px, 9vw, 160px); }
.cell--ink { grid-column: span 2; background: var(--ink); color: var(--ivory); }
.cell--ink p { color: var(--on-dark-muted); }
.cell--teal { background: var(--teal); color: var(--ink); }
.cell--line { border: 1.5px solid var(--ink); }
.cell--line strong { color: var(--ink); }

/* ---------- Testimonials ---------- */
.quotes { background: var(--ink); color: var(--ivory); padding: var(--space-section) 0; }
.quotes__stage { display: grid; }
.quotes__stage { perspective: 1400px; }
.quote {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: rotateX(-32deg) translateY(30px); transform-origin: 50% 100%;
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), visibility 0.8s;
}
.quote.is-active { opacity: 1; visibility: visible; transform: none; }
.quote blockquote {
  font-size: clamp(30px, 4.4vw, 68px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.08; max-width: 22ch;
}
.quote figcaption { margin-top: 40px; display: flex; align-items: center; gap: 16px; color: var(--on-dark-muted); }
.quote figcaption strong { display: block; color: var(--ivory); font-weight: 600; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--teal); color: var(--ink); font-family: var(--mono); font-size: 15px; font-weight: 500;
}
.quotes__controls { margin-top: clamp(48px, 6vw, 80px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.quotes__bars { display: flex; gap: 10px; flex: 1; max-width: 420px; }
.quotes__bars button { flex: 1; height: 24px; display: flex; align-items: center; }
.quotes__bars span { display: block; width: 100%; height: 2px; background: var(--line-dark); position: relative; overflow: hidden; }
.quotes__bars span::after { content: ""; position: absolute; inset: 0; background: var(--teal); transform: scaleX(0); transform-origin: left; }
.quotes__bars [aria-selected="true"] span::after { animation: bar var(--quote-ms, 7000ms) linear forwards; }
.quotes__bars.is-paused [aria-selected="true"] span::after { animation: none; transform: scaleX(1); }
@keyframes bar { to { transform: scaleX(1); } }
.quotes__arrows { display: flex; gap: 12px; }
.circle {
  width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--line-dark); font-size: 20px;
  transition: background 0.4s var(--ease-out), color 0.4s, border-color 0.4s;
}
.circle:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }

/* ---------- Logos ---------- */
.logos { padding: var(--space-section) 0 calc(var(--space-section) * 0.6); }
.logos__title { font-size: clamp(24px, 2.4vw, 36px); font-weight: 500; letter-spacing: -0.03em; max-width: 22ch; }
.logos__grid {
  margin-top: clamp(32px, 4vw, 56px);
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.logos__grid li {
  aspect-ratio: 1.5; display: grid; place-items: center;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease-out);
}
.logos__grid i {
  width: 38px; height: 38px; background: var(--ink);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  transition: background 0.4s, transform 0.6s var(--ease-out);
}
.logos__grid li.flip { display: block; perspective: 700px; }
.flip__in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.8s var(--ease-out); }
.flip:hover .flip__in { transform: rotateY(180deg); }
.flip__front, .flip__back { position: absolute; inset: 0; display: grid; place-items: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip__back { transform: rotateY(180deg); background: var(--teal); color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

/* ---------- FAQ ---------- */
.faq { padding: 0 0 var(--space-section); }
.faq__grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(40px, 6vw, 120px); }
.faq__title { position: sticky; top: calc(var(--header-h) + 48px); align-self: start; }
.acc { border-top: 1px solid var(--line); }
.acc:last-child { border-bottom: 1px solid var(--line); }
.acc__q {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 0; font-size: clamp(19px, 1.7vw, 25px); font-weight: 500; letter-spacing: -0.025em;
  transition: color 0.3s;
}
.acc__q:hover i { background: var(--teal); }
.acc__q:hover i::before, .acc__q:hover i::after { background: var(--ink); }
.acc__q i {
  position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--ink);
  transition: background 0.4s, transform 0.6s var(--ease-out);
}
.acc__q i::before, .acc__q i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: var(--ivory);
  transform: translate(-50%, -50%);
}
.acc__q i::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.6s var(--ease-out); }
.acc__q[aria-expanded="true"] i { background: var(--teal); transform: rotate(180deg); }
.acc__q[aria-expanded="true"] i::before, .acc__q[aria-expanded="true"] i::after { background: var(--ink); }
.acc__q[aria-expanded="true"] i::after { transform: translate(-50%, -50%) rotate(0deg); }
.acc__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease-out); }
.acc__a > div { overflow: hidden; }
.acc__a p { padding: 0 64px 28px 0; color: var(--text-muted); max-width: 60ch; }
.acc__q[aria-expanded="true"] + .acc__a { grid-template-rows: 1fr; }

/* ---------- Contact ---------- */
.contact { position: relative; overflow: hidden; background: var(--ink); color: var(--ivory); padding: var(--space-section) 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
.contact > .wrap { position: relative; z-index: 1; }
.ring { position: absolute; z-index: 0; right: -4vw; top: 2%; width: min(50vw, 700px); aspect-ratio: 1; height: auto; pointer-events: none; }
.contact__title { font-size: var(--fs-display); font-weight: 600; letter-spacing: -0.055em; line-height: 0.92; }
.contact__title .brand-italic { color: var(--teal); padding-right: 0.06em; }
.contact__grid { margin-top: clamp(56px, 7vw, 112px); display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(40px, 7vw, 128px); }
.contact__info p { font-size: var(--fs-lead); color: var(--on-dark-muted); max-width: 30ch; }
.contact__mail {
  display: inline-block; margin-top: 28px; font-size: clamp(28px, 3vw, 44px); font-weight: 600; letter-spacing: -0.04em;
  position: relative; padding-bottom: 6px; overflow-wrap: anywhere;
}
.contact__mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--teal);
  transform-origin: right; transition: transform 0.7s var(--ease-out);
}
.contact__mail:hover::after { transform: scaleX(0); }
.contact__mail:hover { color: var(--teal); }
.socials { margin-top: 40px; display: flex; gap: 28px; color: var(--on-dark-muted); }
.socials a:hover { color: var(--ivory); }

.form { display: grid; gap: 28px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.field { display: grid; gap: 8px; }
.field label, .chips legend { font-size: var(--fs-small); font-weight: 500; color: var(--on-dark-muted); }
.field input, .field textarea {
  width: 100%; background: transparent; color: var(--ivory);
  border: 0; border-bottom: 1.5px solid var(--line-dark); border-radius: 0;
  padding: 10px 0; font: inherit; font-size: 19px; resize: vertical;
  transition: border-color 0.4s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); }
.field__error { display: none; font-size: var(--fs-small); color: var(--teal); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--teal); }
.field.is-invalid .field__error { display: block; }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { padding: 0; margin-bottom: 12px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-dark); font-size: 15px;
  transition: background 0.35s var(--ease-out), color 0.35s, border-color 0.35s, transform 0.2s;
}
.chips label:hover span { border-color: var(--ivory); }
.chips label:active span { transform: scale(0.96); }
.chips input:checked + span { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.chips input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 3px; }
.form .btn { justify-self: start; }
.form__status { min-height: 1.5em; font-weight: 500; color: var(--ivory); }

/* ---------- Footer ---------- */
.footer { background: var(--teal); color: var(--ink); padding: 24px 0 32px; overflow: hidden; }
.footer__top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap;
  padding-top: 48px;
}
.footer__pitch { font-size: var(--fs-lead); color: var(--on-teal-muted); }
.footer__nav { display: flex; gap: 28px; flex-wrap: wrap; font-weight: 500; }
.footer__logo { margin-top: clamp(64px, 9vw, 140px); }
.footer__logo img { width: 100%; height: auto; }
.footer__logo .x3d { perspective: 1600px; }
.footer__bottom {
  margin-top: 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--fs-small); color: var(--on-teal-muted);
}

/* ---------- Reveal defaults (JS adds .anim when GSAP is ready) ---------- */
.anim [data-reveal] { opacity: 0; transform: translateY(40px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav, .header__cta { display: none; }
  .burger {
    display: grid; place-content: center; gap: 6px; margin-left: auto;
    width: 48px; height: 48px; border-radius: 50%; background: var(--ink); position: relative; z-index: calc(var(--z-menu) + 1);
  }
  .burger span { display: block; width: 20px; height: 1.5px; background: var(--ivory); transition: transform 0.5s var(--ease-out); }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .header.menu-open::before { opacity: 0; }
  .logos__grid { grid-template-columns: repeat(5, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell--hero { grid-column: span 2; grid-row: span 2; }
  .cell--ink { grid-column: span 2; }
}

@media (max-width: 860px) {
  :root { --header-h: 68px; --fs-body: 16px; }
  .header__logo img { height: 26px; }
  .hero__foot { grid-template-columns: 1fr; gap: 24px; }
  .hero__words { order: -1; }
  .hero__ctas { gap: 24px; }
  .badge { width: 92px; height: 92px; top: calc(var(--header-h) + 16px); }
  .badge text { font-size: 15px; }
  .badge__mark { width: 48px; height: 48px; }
  .badge__mark img { width: 24px; }
  .manifesto__grid { grid-template-columns: 1fr; }
  .manifesto__z { position: static; width: 120px; }
  .ring { width: 92vw; right: -38vw; top: 0; opacity: 0.55; }
  .manifesto__cols { grid-template-columns: 1fr; }
  .stack__card { grid-template-columns: 1fr; min-height: 0; top: calc(var(--header-h) + 12px + var(--i) * 16px); }
  .stack__media { aspect-ratio: 2 / 1; order: -1; }
  .stack__card h3 { font-size: clamp(32px, 9vw, 44px); }
  .stack__card p { font-size: 16px; margin-top: 12px; }
  .pills { margin-top: 18px; gap: 6px; }
  .pills li { font-size: 13px; padding: 6px 11px; }
  .stack__card h3 { margin-top: 24px; }
  .work__pin { display: block; min-height: 0; }
  .work__track { flex-direction: column; align-items: stretch; width: 100%; padding: var(--space-section) var(--gutter); gap: 56px; }
  .work__intro, .project { width: 100%; }
  .project__meta { grid-template-columns: 1fr; }
  .tags { grid-row: auto; grid-column: 1; justify-content: flex-start; margin-top: 10px; }
  .process__grid, .faq__grid, .contact__grid { grid-template-columns: 1fr; }
  .process__head, .faq__title { position: static; }
  .timeline { padding-left: 72px; }
  .timeline__rail { left: 21px; }
  .step__dot { left: -72px; width: 44px; height: 44px; font-size: 12px; }
  .bento { grid-auto-rows: minmax(200px, auto); gap: 12px; }
  .logos__grid { grid-template-columns: repeat(2, 1fr); }
  .logos__grid li { aspect-ratio: 2.2; }
  .logos__grid i { width: 32px; height: 32px; }
  .form__row { grid-template-columns: 1fr; }
  .quotes__controls { flex-direction: column; align-items: stretch; }
  .quotes__arrows { justify-content: flex-end; }
}

@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; }
  .cell--hero, .cell--ink { grid-column: auto; }
  .cell--hero { grid-row: span 1; min-height: 340px; }
  .hero__ctas { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .loader { display: none; }
  .badge svg { animation: none; }
}

/* While the site content loads from the server, editable sections stay hidden so
   visitors never see placeholder text flash and change. They always reappear
   after 3 seconds, even if a script fails. */
html.cms-pending [data-cms] { visibility: hidden; animation: cms-show 0s 3s forwards; }
@keyframes cms-show { to { visibility: visible; } }
