/* ==========================================================================
   Saif Ali — portfolio
   One stylesheet: tokens → base → layout → components → sections → pages.
   ========================================================================== */

/* Fonts ------------------------------------------------------------------ */
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* Tokens ----------------------------------------------------------------- */
:root {
  --navy-950: #0b0d18;
  --navy-900: #10142a;
  --navy-850: #151a30;
  --navy-800: #1b2039;
  --navy-card: #141828;
  --navy-line: #283050;
  --ivory: #f3f0e8;
  --ivory-200: #e9e6dc;
  --paper: #faf8f2;
  --lime: #d4ff63;
  --lime-soft: #e3ff9a;
  --cobalt: #656bff;
  --cobalt-band: #4d53e0;
  --cobalt-ink: #4a50d6;

  /* Light theme (default). Dark sections redefine these. */
  --bg: var(--ivory);
  --fg: #0b0d18;
  --fg-muted: #555a68;
  --fg-subtle: #676b78;
  --line: #d8d4c9;
  --accent: var(--cobalt-ink);
  --surface: var(--paper);

  /* Body text uses the device's own UI font: nothing to download, so text paints immediately. */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --fs-label: 0.75rem;
  --fs-small: 0.875rem;
  --fs-body: 1rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-h3: clamp(1.5rem, 1.25rem + 1vw, 2.125rem);
  --fs-h2: clamp(2.75rem, 1.6rem + 4.4vw, 6rem);
  --fs-hero: clamp(3.5rem, 1.2rem + 9.2vw, 9.25rem);

  --page: clamp(20px, 5vw, 88px);
  --max: 1440px;
  --section: clamp(96px, 11vw, 168px);
  --header: 80px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.2s;
  --dur: 0.45s;
  --dur-slow: 0.9s;
}

.intro, .tools, .contact, .site-footer, .site-header, .mobile-menu, .approach, .case-cover {
  --bg: var(--navy-950);
  --fg: #f3f0e8;
  --fg-muted: #b0b7cc;
  --fg-subtle: #8f98b4;
  --line: var(--navy-line);
  --accent: var(--lime);
  --surface: var(--navy-card);
}
.approach {
  --bg: var(--cobalt-band);
  --fg-muted: #dfe2ff;
  --fg-subtle: #dfe2ff;
  --line: #7b80ec;
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 8px); overflow-x: clip; }
body { margin: 0; background: var(--ivory); color: var(--fg); font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.65; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 450; line-height: 1.04; letter-spacing: -0.045em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a, button, input, textarea, summary, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: var(--lime); color: var(--navy-950); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.icon { width: 1.125em; height: 1.125em; flex-shrink: 0; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: 12px; padding: 12px 18px; border-radius: 999px; background: var(--lime); color: var(--navy-950); font-weight: 600; transform: translateY(-160%); transition: transform var(--dur) var(--ease-out); }
.skip-link:focus { transform: none; }
.scroll-progress { position: fixed; z-index: 60; inset: 0 0 auto; height: 2px; background: var(--lime); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

/* Layout ----------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--max) + var(--page) * 2); margin-inline: auto; padding-inline: var(--page); }
.section { padding-block: var(--section); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.16em; line-height: 1.4; text-transform: uppercase; color: var(--fg-subtle); }
.kicker-accent { color: var(--accent); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px 64px; margin-bottom: clamp(48px, 6vw, 88px); }
.section-head h2, .services-intro h2, .contact h2 { margin-top: 18px; font-size: var(--fs-h2); }
.section-intro { max-width: 380px; color: var(--fg-muted); font-size: var(--fs-lead); line-height: 1.6; }
.status-dot { position: relative; display: inline-block; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgb(212 255 99 / 0.5); animation: pulse 2.6s var(--ease-out) 4; }
@keyframes pulse { 70%, 100% { box-shadow: 0 0 0 9px rgb(212 255 99 / 0); } }

/* Buttons and links ------------------------------------------------------ */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 54px; padding: 0 26px; border-radius: 999px; font-size: 0.9375rem; font-weight: 550; line-height: 1.2; white-space: nowrap; transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.button .icon { transition: transform var(--dur) var(--ease-out); }
.button:hover .icon { transform: translate(3px, -3px); }
.button-primary[href="#work"]:hover .icon { transform: translateY(3px); }
.button:active { transform: scale(0.98); }
.button-primary { background: var(--lime); color: var(--navy-950); }
.button-primary:hover { background: var(--lime-soft); box-shadow: 0 10px 40px -10px rgb(212 255 99 / 0.55); }
.button-dark { background: var(--navy-950); color: var(--ivory); }
.button-dark:hover { background: var(--cobalt-ink); }
.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.9375rem; font-weight: 500; color: var(--fg); background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 100% 1px no-repeat; transition: background-size var(--dur) var(--ease-out), color var(--dur-fast); }
.text-link:hover { background-size: 0 1px; background-position: 100% calc(100% - 8px); color: var(--accent); }
.text-link .icon { transition: transform var(--dur) var(--ease-out); }
.text-link:hover .icon { transform: translate(2px, -2px); }

/* Header ----------------------------------------------------------------- */
.site-header { position: fixed; z-index: 50; inset: 0 0 auto; height: var(--header); display: flex; align-items: center; gap: 32px; padding-inline: var(--page); color: var(--fg); background: rgb(11 13 24 / 0.94); border-bottom: 1px solid rgb(255 255 255 / 0.07); transition: height var(--dur) var(--ease-out), background-color var(--dur); }
.site-header.is-scrolled { height: 68px; background: rgb(11 13 24 / 0.97); }
.wordmark { display: inline-flex; align-items: center; gap: 0.36em; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.06em; line-height: 1; white-space: nowrap; }
.wordmark-text > span { color: var(--lime); }
.brand-mark { display: grid; place-items: center; flex-shrink: 0; width: 1.3em; height: 1.3em; border-radius: 0.34em; background: var(--navy-950); color: var(--lime); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14); transition: transform var(--dur) var(--ease-out), box-shadow var(--dur); }
.brand-mark svg { width: 74%; height: 74%; }
.wordmark:hover .brand-mark { transform: rotate(-8deg); box-shadow: inset 0 0 0 1px var(--lime); }
.site-nav { display: flex; gap: 6px; margin-inline: auto; }
.site-nav a { position: relative; padding: 10px 14px; border-radius: 999px; font-size: 0.875rem; color: var(--fg-muted); transition: color var(--dur-fast), background-color var(--dur-fast); }
.site-nav a:hover { color: var(--fg); background: rgb(255 255 255 / 0.06); }
.site-nav a.is-active { color: var(--fg); }
.site-nav a.is-active::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--lime); }
.header-cta { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 4px 4px 18px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 999px; font-size: 0.875rem; font-weight: 500; transition: border-color var(--dur-fast), background-color var(--dur-fast); }
.header-cta-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--lime); color: var(--navy-950); transition: transform var(--dur) var(--ease-out); }
.header-cta:hover { border-color: var(--lime); }
.header-cta:hover .header-cta-icon { transform: rotate(45deg); }
.menu-toggle { display: none; }

.mobile-menu { position: fixed; z-index: 45; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: calc(var(--header) + 32px) var(--page) max(32px, env(safe-area-inset-bottom)); background: var(--navy-950); color: var(--fg); overflow-y: auto; overscroll-behavior: contain; }
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: grid; }
.mobile-menu nav a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3.25rem); letter-spacing: -0.05em; line-height: 1.1; }
.mobile-menu nav small { font-family: var(--font-sans); font-size: var(--fs-label); letter-spacing: 0.1em; color: var(--fg-subtle); }
.mobile-menu nav .mobile-menu-cta { color: var(--lime); border-bottom: 0; }
.mobile-menu-cta .icon { width: 0.7em; height: 0.7em; }
.mobile-menu-email { font-size: var(--fs-small); color: var(--fg-muted); overflow-wrap: anywhere; }
body.menu-open { overflow: hidden; }

/* Intro: hero, story and about share one sticky 3D scene ------------------- */
.intro { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; background: var(--navy-950); color: var(--fg); }
.intro > section { position: relative; z-index: 1; grid-column: 1; pointer-events: none; }
.hero { grid-row: 1; }
.story { grid-row: 2; }
.about { grid-row: 3; }
.scene { position: sticky; top: 0; z-index: 0; grid-column: 1; grid-row: 1 / 4; align-self: start; width: 100%; height: 100vh; height: 100svh; overflow: clip; pointer-events: none; animation: fade-in 0.8s 0.1s var(--ease-out) both; }
.scene-art { position: absolute; inset: 0; outline: none; pointer-events: none; touch-action: pan-y; }
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s; pointer-events: none; }
.scene-art.is-rendered .scene-canvas { opacity: 1; }
.art-fallback { position: absolute; left: 56%; top: 20%; width: 38%; height: 60%; transition: opacity 0.8s; pointer-events: none; }
.scene-art.is-rendered .art-fallback { opacity: 0; }
.art-hit-surface { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: pan-y; }
.art-hit-target { fill: transparent; pointer-events: fill; touch-action: none; cursor: grab; }
.art-hit-target:active { cursor: grabbing; }
.scene-art:focus-visible .scene-canvas { filter: drop-shadow(0 0 1.5px var(--lime)) drop-shadow(0 0 18px rgb(212 255 99 / 0.35)); }
.scene-art:focus-visible .art-fallback { filter: drop-shadow(0 0 10px rgb(212 255 99 / 0.45)); }
[data-experience-phase="dock"] .art-fallback { left: var(--dock-slot-left, 6%); top: var(--dock-slot-top, 20%); width: var(--dock-slot-width, 40%); height: var(--dock-slot-height, 60%); }

/* Hero */
.hero { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; padding-top: var(--header); }
.hero-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: clamp(40px, 8vh, 96px); pointer-events: none; }
.hero-inner > * { width: min(100%, 58%); pointer-events: auto; }
.hero-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: var(--fs-small); color: var(--fg-muted); }
.hero-role { padding-left: 14px; border-left: 1px solid var(--line); color: var(--fg-subtle); }
.hero-title { margin-top: clamp(20px, 3vh, 32px); font-size: var(--fs-hero); font-weight: 450; line-height: 0.94; letter-spacing: -0.07em; }
.hero-title .line { display: block; overflow: hidden; padding-block: 0.08em 0.12em; margin-block: -0.08em -0.12em; }
.hero-title .line-inner { display: inline-block; }
.hero-title .serif { font-size: 1.14em; line-height: 0.9; letter-spacing: -0.035em; padding-right: 0.08em; }
.hero-description { max-width: 34rem; margin-top: clamp(24px, 4vh, 40px); color: var(--fg-muted); font-size: var(--fs-lead); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: clamp(28px, 4vh, 40px); }
.hero-meta { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; border-top: 1px solid var(--line); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-subtle); pointer-events: none; }
.hero-meta > * { pointer-events: auto; }
.scroll-cue { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; color: var(--fg-muted); }
.scroll-cue-line { position: relative; width: 1px; height: 28px; overflow: hidden; background: var(--line); }
.scroll-cue-line::after { content: ""; position: absolute; inset: 0; background: var(--lime); transform: translateY(-100%); animation: cue 2.2s var(--ease-in-out) 4; }
@keyframes cue { 50% { transform: none; } 100% { transform: translateY(100%); } }

/* Hero entrance runs in CSS from first paint; no script has to hide content first. */
@keyframes rise { from { transform: translateY(108%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade-in { from { opacity: 0; } }
.hero-title .line-inner { animation: rise 1s var(--ease-out) both; }
.hero-title .line:nth-child(2) .line-inner { animation-delay: 0.08s; }
.hero-title .line:nth-child(3) .line-inner { animation-delay: 0.16s; }
.hero-title .line:nth-child(4) .line-inner { animation-delay: 0.24s; }
.hero-eyebrow { animation: fade-up 0.8s var(--ease-out) both; }
.hero-description { animation: fade-up 0.9s 0.32s var(--ease-out) both; }
.hero-actions { animation: fade-up 0.9s 0.42s var(--ease-out) both; }
.hero-meta { animation: fade-in 1s 0.6s var(--ease-out) both; }

/* Story */
.story { display: flex; justify-content: flex-end; align-items: center; min-height: 112vh; min-height: 112svh; padding-block: 14svh 24svh; }
.story-copy { width: min(100%, 44%); pointer-events: auto; }
.story-title { margin-top: 22px; font-size: clamp(3rem, 1.6rem + 4.6vw, 6.25rem); line-height: 0.98; letter-spacing: -0.06em; }
.story-title .line { display: block; overflow: hidden; padding-block: 0.06em 0.14em; margin-block: -0.06em -0.14em; }
.story-title .line-inner { display: inline-block; }
.story-title .serif { font-size: 1.12em; }
.story-rule { display: block; width: 88px; height: 1px; margin: 36px 0; background: var(--lime); transform-origin: 0 50%; }
.story-body { max-width: 30rem; color: var(--fg-muted); font-size: var(--fs-lead); line-height: 1.7; }
.story-note { margin-top: 28px; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-subtle); }

/* About (the sculpture's landing place) */
.about { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(32px, 6vw, 112px); min-height: 100vh; min-height: 100svh; padding-block: calc(var(--header) + 48px) clamp(72px, 9vw, 128px); }
.about-art { display: flex; flex-direction: column; gap: 18px; }
.about-slot { height: min(64svh, 560px); min-height: 300px; }
.about-caption { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: var(--fs-small); color: var(--fg-subtle); }
.about-copy { pointer-events: auto; }
.about-title { margin-top: 18px; font-size: clamp(2.25rem, 1.4rem + 2.8vw, 4rem); line-height: 1.06; letter-spacing: -0.05em; }
.about-signature { margin-top: 18px; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.02em; color: var(--fg-muted); }
.about-signature .serif { font-size: 1.6rem; }
.about-bio { display: grid; gap: 16px; margin-top: 28px; max-width: 40rem; color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.75; }
.about-detail { padding-top: 16px; border-top: 1px solid var(--line); color: var(--fg-subtle); font-size: 1rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px 28px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.facts dt { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-subtle); }
.facts dd { margin-top: 6px; font-family: var(--font-display); font-size: 1.0625rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.chips, .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chips { margin-top: 28px; }
.chips li, .tags li { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.02em; color: var(--fg-muted); white-space: nowrap; }
.about-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 36px; }

/* Reduced motion keeps a still sculpture away from the story text. */
.reduced-motion [data-experience-phase="story"] .scene-art:not(:focus-within) { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { [data-experience-phase="story"] .scene-art:not(:focus-within) { opacity: 0; pointer-events: none; } }

/* Ticker ------------------------------------------------------------------ */
.ticker { position: relative; z-index: 2; margin: -28px -2% 0; padding: 22px 0 28px; overflow: hidden; background: var(--lime); color: var(--navy-950); transform: rotate(-1.4deg); }
.ticker-track { display: flex; width: max-content; }
.ticker-group { display: flex; flex-shrink: 0; align-items: center; gap: 40px; padding-right: 40px; white-space: nowrap; }
.ticker-group span { font-family: var(--font-display); font-size: clamp(3rem, 1.8rem + 5vw, 7rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.06em; }
.ticker-group .serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; }
.ticker-group i { font-size: 2.5rem; font-style: normal; color: #4f6421; }
.js .ticker-track { will-change: transform; }

/* Work -------------------------------------------------------------------- */
.work { background: var(--ivory); }
.project-list { display: grid; gap: clamp(56px, 7vw, 104px); }
.project-card { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 4.5vw, 72px); }
.project-media { position: relative; display: block; overflow: hidden; padding: clamp(18px, 4.2%, 56px); border-radius: var(--radius-lg); background: radial-gradient(120% 90% at 10% 0%, rgb(101 107 255 / 0.32), transparent 60%), var(--navy-900); isolation: isolate; }
.project-media picture, .case-cover picture { display: block; }
.project-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; border-radius: var(--radius-sm); box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.1); transition: transform 0.9s var(--ease-out); }
.project-media-cta { position: absolute; right: 22px; bottom: 22px; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--lime); color: var(--navy-950); font-size: var(--fs-small); font-weight: 550; opacity: 0; transform: translateY(10px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.project-card:hover .project-media img, .project-card:focus-within .project-media img { transform: translateY(-6px) scale(1.012); }
.project-card:hover .project-media-cta, .project-card:focus-within .project-media-cta { opacity: 1; transform: none; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-subtle); }
.project-meta span:first-child { color: var(--accent); }
.project-body h3 { margin-top: 16px; font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem); letter-spacing: -0.05em; }
.project-body h3 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size var(--dur) var(--ease-out); }
.project-body h3 a:hover { background-size: 100% 2px; }
.project-summary { margin-top: 18px; color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.7; }
.project-body .tags { margin-top: 24px; }
.project-links { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 24px; }
.project-next { display: grid; gap: 14px; justify-items: start; padding: clamp(32px, 5vw, 64px); border: 1px dashed #b9b4a6; border-radius: var(--radius-lg); transition: border-color var(--dur), background-color var(--dur); }
.project-next:hover { border-color: var(--cobalt-ink); background: var(--paper); }
.project-next-title { font-family: var(--font-display); font-size: clamp(2.25rem, 1.4rem + 3vw, 4.5rem); line-height: 1; letter-spacing: -0.055em; }
.project-next-text { max-width: 34rem; color: var(--fg-muted); font-size: 1.0625rem; }
.text-link-dark { color: var(--fg); }

/* Approach ---------------------------------------------------------------- */
.approach { position: relative; overflow: hidden; background: var(--cobalt-band); color: var(--fg); }
.approach::before { content: ""; position: absolute; width: 60vw; height: 60vw; right: -20vw; top: -30vw; border-radius: 50%; background: radial-gradient(circle, rgb(212 255 99 / 0.16), transparent 65%); pointer-events: none; }
.statement { position: relative; margin-top: 32px; max-width: 18em; font-family: var(--font-display); font-size: clamp(2.25rem, 1.2rem + 4vw, 5.5rem); font-weight: 450; line-height: 1.08; letter-spacing: -0.05em; }
.word { display: inline; }

/* Services ---------------------------------------------------------------- */
.services { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.services-intro { position: sticky; top: calc(var(--header) + 40px); }
.services-intro .section-intro { margin-top: 24px; }
.services-intro .text-link { margin-top: 20px; }
.service-list { counter-reset: service; border-top: 1px solid var(--line); }
.service { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: clamp(28px, 3vw, 40px) 0; border-bottom: 1px solid var(--line); }
.service-number { padding-top: 10px; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.12em; color: var(--fg-subtle); transition: color var(--dur-fast); }
.service h3 { font-size: var(--fs-h3); transition: transform var(--dur) var(--ease-out); }
.service p { margin-top: 12px; max-width: 34rem; color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.7; }
.service:hover .service-number { color: var(--accent); }
.service:hover h3 { transform: translateX(6px); }

/* Process ----------------------------------------------------------------- */
.process { background: var(--paper); }
.process-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 104px); align-items: start; }
.process-step { display: flex; flex-direction: column; justify-content: center; min-height: 64vh; padding-block: 48px; border-top: 1px solid var(--line); }
.process-index { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; color: var(--fg-subtle); transition: color var(--dur); }
.process-step h3 { margin-top: 18px; font-size: clamp(3rem, 2rem + 3.4vw, 5.5rem); letter-spacing: -0.06em; transition: color var(--dur); }
.has-stage .process-step:not(.is-active) h3 { color: #7d8190; }
.process-step > p { margin-top: 20px; max-width: 28rem; color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.7; }
.process-outcome { display: grid; gap: 6px; margin-top: 24px; max-width: 28rem; padding-left: 18px; border-left: 2px solid var(--cobalt); color: var(--fg-muted); font-size: 1rem; }
.process-outcome span { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.process-step.is-active h3 { color: var(--fg); }
.process-step.is-active .process-index { color: var(--accent); }

.process-stage { position: sticky; top: calc(var(--header) + 40px); height: min(580px, calc(100svh - var(--header) - 80px)); min-height: 440px; overflow: hidden; border-radius: var(--radius-lg); background: #e3e3ee; box-shadow: 0 40px 80px -40px rgb(11 13 24 / 0.25), inset 0 0 0 1px rgb(11 13 24 / 0.08); }
.process-stage::after { content: ""; position: absolute; z-index: 5; inset: auto 0 0; height: 3px; background: var(--cobalt); transform: scaleX(var(--process-progress, 0)); transform-origin: 0 50%; }
.process-panel { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 28px 32px; background: #e3e3ee; color: var(--navy-950); }
.js .process-panel:not(.is-active) { opacity: 0; visibility: hidden; }
.panel-top { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid rgb(11 13 24 / 0.12); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #565c78; }
.panel-status { display: inline-flex; align-items: center; gap: 8px; }
.panel-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt); }
.process-panel[data-scene="1"] { background: #e7e9df; }
.process-panel[data-scene="2"] { background: var(--navy-900); color: #c9d1ee; }
.process-panel[data-scene="2"] .panel-top { color: #9aa6c8; border-color: rgb(255 255 255 / 0.12); }
.process-panel[data-scene="3"] { background: #e1eacf; }
.scene-brief { position: relative; flex: 1; padding: 36px 8px 8px; }
.scene-kicker { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #565c78; }
.brief-question { margin-top: 16px; font-family: var(--font-display); font-size: clamp(3rem, 2rem + 2.6vw, 4.75rem); line-height: 1; letter-spacing: -0.06em; color: #262c4d; }
.brief-question em, .wire-hero em, .refine-title em { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; color: var(--cobalt-ink); }
.brief-lines { display: grid; gap: 14px; margin-top: 32px; font-size: 0.9375rem; color: #464c66; }
.brief-lines li { display: flex; gap: 16px; align-items: baseline; }
.brief-lines b { font-size: var(--fs-label); font-weight: 600; color: var(--cobalt-ink); }
.scene-design { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 16px 4px; }
.wire { padding: 22px; border-radius: 10px; background: var(--paper); box-shadow: 0 20px 40px -20px rgb(11 13 24 / 0.3), 0 0 0 1px rgb(11 13 24 / 0.08); transform: rotate(-2.5deg); }
.wire-nav { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid #e0ded6; }
.wire-nav b { margin-right: auto; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.06em; }
.wire-nav span { width: 26px; height: 3px; border-radius: 2px; background: #d3d1c6; }
.wire-nav i { font-style: normal; }
.wire-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; padding-top: 18px; }
.wire-hero > div:first-child { display: flex; flex-direction: column; align-items: flex-start; }
.wire-tiny { width: 48px; height: 3px; margin-bottom: 12px; border-radius: 2px; background: #b9b7aa; }
.wire-hero b { margin-bottom: 14px; font-family: var(--font-display); font-size: clamp(1.5rem, 1rem + 1.2vw, 2.25rem); font-weight: 450; line-height: 1.02; letter-spacing: -0.05em; }
.wire-line { width: 90%; height: 3px; margin-bottom: 6px; border-radius: 2px; background: #d6d4c8; }
.wire-line.short { width: 64%; }
.wire-hero > div > i { width: 52px; height: 16px; margin-top: 10px; border-radius: 999px; background: var(--lime); }
.wire-code { display: grid; place-items: center; min-height: 140px; border-radius: 6px; background: var(--navy-900); color: var(--lime); }
.wire-code code { font-family: ui-monospace, Consolas, monospace; font-size: clamp(1.75rem, 1rem + 2vw, 3rem); letter-spacing: -0.06em; }
.wire-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.wire-grid span { height: 30px; border-radius: 4px; background: #efede4; }
.scene-caption { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #565c78; }
.scene-code { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 16px 0; }
.code-tab { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid rgb(255 255 255 / 0.12); font-family: ui-monospace, Consolas, monospace; font-size: 0.8125rem; color: #aab6da; }
.code-tab i { padding: 2px 8px; border: 1px solid #44507a; border-radius: 4px; font-style: normal; font-size: var(--fs-label); }
.scene-code pre { margin: 0; padding: 22px 0; overflow: hidden; font-family: ui-monospace, Consolas, monospace; font-size: clamp(0.75rem, 0.6rem + 0.35vw, 0.9375rem); line-height: 2; color: #b7c2e4; }
.c-comment { color: #8592b8; }
.c-key { color: #b3b6ff; }
.c-fn { color: var(--lime); }
.c-str { color: #ffd9a8; }
.code-terminal { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.12); font-family: ui-monospace, Consolas, monospace; font-size: 0.8125rem; color: #aab6da; }
.code-terminal > span:first-child { color: var(--lime); }
.caret { width: 7px; height: 14px; margin-left: 2px; background: var(--lime); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.scene-refine { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 8px; }
.refine-title { font-family: var(--font-display); font-size: clamp(2.25rem, 1.5rem + 2vw, 3.5rem); line-height: 1.04; letter-spacing: -0.05em; color: #26331c; }
.refine-title em { color: #3f5a12; }
.refine-list { display: grid; margin-top: 28px; }
.refine-list li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid #c4cfb0; font-size: 0.9375rem; color: #3d4a2e; }
.refine-list i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #3f5a12; color: var(--lime); font-size: 0.75rem; font-style: normal; }

/* Tools ------------------------------------------------------------------- */
.tools { position: relative; overflow: hidden; background: var(--navy-900); color: var(--fg); }
.tools::before { content: ""; position: absolute; width: 720px; height: 720px; top: -440px; right: -160px; border-radius: 50%; background: radial-gradient(circle, rgb(101 107 255 / 0.18), transparent 68%); pointer-events: none; }
.tool-grid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; padding: 28px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background-color var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease-out); }
.tool-card:hover { background: var(--navy-800); box-shadow: inset 0 0 0 1px #5a62a8; transform: translateY(-4px); }
.tool-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #232a48; color: var(--lime); font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -0.04em; box-shadow: inset 0 0 0 1px #39405f; }
.tool-card h3 { margin-top: 28px; font-size: 1.875rem; letter-spacing: -0.045em; }
.tool-card > p { margin-top: 12px; color: var(--fg-muted); font-size: 1rem; line-height: 1.65; }
.tool-purpose { display: grid; gap: 6px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); color: var(--fg-subtle); font-size: 0.9375rem; line-height: 1.6; }
.tool-card > p + .tool-purpose { margin-top: 24px; }
.tool-purpose span { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.ai-panel { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px 64px; align-items: center; margin-top: 16px; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius); background: linear-gradient(135deg, #1a1f3c, #141828); box-shadow: inset 0 0 0 1px var(--line); }
.ai-text { margin-top: 16px; font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem); line-height: 1.4; letter-spacing: -0.02em; }
.ai-note { margin-top: 18px; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.16em; color: var(--fg-subtle); }
.ai-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ai-tools li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: rgb(255 255 255 / 0.04); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.9375rem; }
.ai-tools li span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #2a2d55; color: #c9c6ff; font-size: var(--fs-label); font-weight: 600; }

/* Contact ----------------------------------------------------------------- */
.contact { position: relative; overflow: hidden; background: var(--navy-850); color: var(--fg); }
.contact::before { content: ""; position: absolute; width: 900px; height: 900px; left: -420px; bottom: -560px; border-radius: 50%; background: radial-gradient(circle, rgb(212 255 99 / 0.1), transparent 66%); pointer-events: none; }
.contact-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(48px, 7vw, 120px); align-items: start; }
.contact h2 { font-size: clamp(3rem, 1.6rem + 3.6vw, 5.5rem); line-height: 0.98; }
.contact h2 .serif { display: block; }
.contact-text { margin-top: 28px; max-width: 30rem; color: var(--fg-muted); font-size: var(--fs-lead); line-height: 1.65; }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 40px; }
.email-link { display: inline-flex; align-items: center; gap: 14px; min-height: 48px; font-family: var(--font-display); font-size: clamp(1.25rem, 0.9rem + 1.2vw, 1.875rem); letter-spacing: -0.03em; overflow-wrap: anywhere; background: linear-gradient(var(--lime), var(--lime)) 0 100% / 0 2px no-repeat; transition: background-size var(--dur) var(--ease-out); }
.email-link:hover { background-size: 100% 2px; }
.email-link .icon { color: var(--lime); }
.copy-email { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-muted); font-size: var(--fs-small); transition: box-shadow var(--dur-fast), color var(--dur-fast); }
.copy-email:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--lime); }
.contact-socials { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; }
.contact-socials a { display: inline-flex; min-height: 44px; align-items: center; color: var(--fg-muted); transition: color var(--dur-fast); }
.contact-socials a:hover { color: var(--lime); }
.contact-form { padding: clamp(24px, 3.5vw, 44px); border-radius: var(--radius-lg); background: rgb(11 13 24 / 0.45); box-shadow: inset 0 0 0 1px var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.field { display: grid; gap: 10px; margin-bottom: 26px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { padding: 0; font-size: var(--fs-small); font-weight: 500; color: var(--fg); }
.field > label > span[aria-hidden="true"] { color: var(--lime); }
.field input, .field textarea { width: 100%; padding: 12px 0 14px; border: 0; border-bottom: 1px solid #46507a; border-radius: 0; background: transparent; color: var(--fg); font-size: 1.0625rem; line-height: 1.5; transition: border-color var(--dur-fast); }
.field textarea { min-height: 132px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #7f89a8; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--lime); box-shadow: 0 1px 0 0 var(--lime); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-bottom-color: #ff9b85; }
.field-error { font-size: var(--fs-small); color: #ffb4a1; }
.type-field legend { margin-bottom: 12px; }
.type-options { display: flex; flex-wrap: wrap; gap: 8px; }
.type-option { position: relative; }
.type-option input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.type-option span { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px #46507a; color: var(--fg-muted); font-size: var(--fs-small); transition: background-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast); }
.type-option:hover span { color: var(--fg); box-shadow: inset 0 0 0 1px #8f98b4; }
.type-option input:checked + span { background: var(--lime); color: var(--navy-950); box-shadow: none; font-weight: 550; }
.type-option input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 3px; }
.form-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 8px; }
.form-note { max-width: 18rem; font-size: var(--fs-small); color: var(--fg-subtle); }
.form-message { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 28px; padding: 16px 18px; border-radius: 12px; font-size: 0.9375rem; }
.form-message:focus { outline: none; }
.form-message.success { background: rgb(212 255 99 / 0.1); box-shadow: inset 0 0 0 1px rgb(212 255 99 / 0.4); color: #e8ffb8; }
.form-message.success .icon { color: var(--lime); margin-top: 2px; }
.form-message.error { background: rgb(255 155 133 / 0.1); box-shadow: inset 0 0 0 1px rgb(255 155 133 / 0.45); color: #ffd3c7; }
.contact-form button[disabled] { cursor: progress; opacity: 0.8; }
.contact-form[aria-busy="true"] .button .icon { animation: sending 1s var(--ease-in-out) infinite; }
@keyframes sending { 50% { transform: translate(3px, -3px); opacity: 0.4; } }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer ------------------------------------------------------------------ */
.site-footer { background: var(--navy-950); color: var(--fg); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 40px; padding-block: 72px 32px; }
.footer-brand p { margin-top: 14px; color: var(--fg-subtle); font-size: var(--fs-small); }
.footer-brand .wordmark { font-size: 2.25rem; }
.footer-col { display: grid; align-content: start; gap: 4px; }
.footer-col h2 { margin-bottom: 8px; font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-subtle); }
.footer-col a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; width: fit-content; color: var(--fg-muted); font-size: 0.9375rem; overflow-wrap: anywhere; transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--lime); }
.footer-bottom { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 28px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--fg-subtle); }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.motion-toggle, .back-to-top { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--fg-muted); font-size: var(--fs-small); transition: color var(--dur-fast); }
.motion-toggle:hover, .back-to-top:hover { color: var(--lime); }
.motion-toggle[disabled] { cursor: not-allowed; opacity: 0.7; }
.motion-indicator { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--lime); transition: background-color var(--dur-fast); }
.motion-indicator::after { content: ""; position: absolute; top: 3px; left: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy-950); transition: transform var(--dur) var(--ease-out); }
.motion-toggle[aria-pressed="true"] .motion-indicator { background: #3a4266; }
.motion-toggle[aria-pressed="true"] .motion-indicator::after { transform: translateX(-12px); background: var(--fg-muted); }

/* Case study -------------------------------------------------------------- */
.case { padding-top: calc(var(--header) + clamp(40px, 6vw, 80px)); background: var(--ivory); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: var(--fs-small); color: var(--fg-subtle); }
.breadcrumb li + li::before { content: "/"; margin-right: 10px; color: var(--line); }
.breadcrumb a { color: var(--fg-muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.breadcrumb a:hover { color: var(--accent); }
.case-hero .kicker { margin-top: clamp(32px, 5vw, 56px); }
.case-hero h1 { margin-top: 18px; max-width: 14ch; font-size: clamp(3.25rem, 1.6rem + 6vw, 8rem); line-height: 0.96; letter-spacing: -0.065em; }
.accent-dot { color: var(--cobalt-ink); }
.case-lead { margin-top: 28px; max-width: 42rem; color: var(--fg-muted); font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.6; }
.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 32px; }
.case-cover { margin-top: clamp(40px, 6vw, 72px); }
.case-cover img { width: 100%; border-radius: var(--radius-lg); background: var(--navy-900); padding: clamp(14px, 3vw, 44px); box-shadow: 0 40px 80px -40px rgb(11 13 24 / 0.45); }
.case-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; margin-top: clamp(40px, 6vw, 72px); padding-block: 28px; border-block: 1px solid var(--line); }
.case-facts dt { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-subtle); }
.case-facts dd { margin-top: 8px; font-size: 1.0625rem; }
.case-facts-wide { grid-column: span 2; }
.case-facts .tags { margin-top: 4px; }
.case-body { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 112px); padding-block: clamp(64px, 8vw, 120px); }
.case-aside { position: sticky; top: calc(var(--header) + 40px); align-self: start; }
.case-aside h2 { margin-top: 16px; font-size: clamp(2.25rem, 1.6rem + 2vw, 3.75rem); }
.case-text { display: grid; gap: 44px; }
.case-intro { font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem); line-height: 1.45; letter-spacing: -0.02em; }
.case-section h3, .case-demo h3 { font-size: 1.5rem; letter-spacing: -0.035em; }
.case-section p, .case-demo p { margin-top: 12px; color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.8; }
.case-demo { padding: 28px; border-radius: var(--radius); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.case-gallery figure:only-child, .case-gallery figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.case-gallery picture { display: block; }
.case-gallery img { width: 100%; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.case-gallery figcaption { margin-top: 12px; color: var(--fg-subtle); font-size: var(--fs-small); }
.case-end { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding-block: clamp(64px, 8vw, 120px); }
.case-next { display: grid; align-content: space-between; gap: 32px; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius-lg); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--dur); }
.case-next:hover { box-shadow: inset 0 0 0 1px var(--cobalt-ink); }
.case-next-title { font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem); letter-spacing: -0.05em; line-height: 1.05; }
.case-next .icon { width: 32px; height: 32px; color: var(--cobalt-ink); transition: transform var(--dur) var(--ease-out); }
.case-next:hover .icon { transform: translateX(6px); }
.case-cta { display: grid; align-content: space-between; justify-items: start; gap: 32px; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius-lg); background: var(--navy-950); color: var(--ivory); }
.case-cta h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); }
.case-cta .accent { color: var(--lime); }
.case-cta .button-dark { background: var(--lime); color: var(--navy-950); }
.case-cta .button-dark:hover { background: var(--lime-soft); }

/* 404 --------------------------------------------------------------------- */
.not-found { display: grid; align-content: center; justify-items: start; gap: 24px; min-height: 80vh; padding-block: calc(var(--header) + 64px) 96px; }
.not-found h1 { font-size: clamp(3.5rem, 2rem + 6vw, 8rem); line-height: 0.96; letter-spacing: -0.065em; }
.not-found p:not(.kicker) { max-width: 34rem; color: var(--fg-muted); font-size: var(--fs-lead); }
.not-found-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 8px; }

/* View transitions -------------------------------------------------------- */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 0.6s; animation-timing-function: var(--ease-out); }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --header: 68px; }
  .site-header.is-scrolled { height: 64px; }
  .site-nav, .header-cta { display: none; }
  .menu-toggle { position: relative; z-index: 2; display: grid; place-content: center; gap: 7px; width: 48px; height: 48px; margin: 0 -8px 0 auto; }
  .menu-toggle span { display: block; width: 26px; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--dur) var(--ease-out); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .menu-open .site-header { background: var(--navy-950); }

  .hero-inner > * { width: 100%; }
  .hero-inner { justify-content: flex-start; padding-top: clamp(40px, 10vh, 96px); }
  .hero-description { max-width: 30rem; }
  .hero-meta-note { display: none; }
  .story { justify-content: flex-start; align-items: flex-start; min-height: 130svh; padding-block: 10svh 0; }
  /* No panel behind the copy: the sculpture passes behind the letters themselves. A soft shadow keeps them legible. */
  .story-copy { position: sticky; top: calc(var(--header) + 24px); width: 100%; max-width: 34rem; padding-bottom: 48px; text-shadow: 0 1px 2px rgb(11 13 24 / 0.9), 0 0 24px rgb(11 13 24 / 0.85); }
  .story-rule { box-shadow: 0 0 12px rgb(11 13 24 / 0.9); }
  .hero-meta { min-height: 56px; }
  .about { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 24px; min-height: 0; padding-top: calc(var(--header) + 24px); }
  .about-slot { height: 46svh; min-height: 280px; max-height: 440px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .project-card { grid-template-columns: minmax(0, 1fr); }
  .project-media-cta { opacity: 1; transform: none; }
  .services { grid-template-columns: minmax(0, 1fr); }
  .services-intro { position: static; }
  .process-layout { grid-template-columns: minmax(0, 1fr); }
  .process-stage { display: none; }
  .process-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
  .process-step { min-height: 0; padding-block: 32px 40px; justify-content: flex-start; }
  .process-step h3 { color: var(--fg); }
  .ai-panel { grid-template-columns: minmax(0, 1fr); }
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-aside { position: static; }
  .case-end { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .hero-title { font-size: clamp(3.25rem, 16.5vw, 5.5rem); }
  .hero-inner { padding-block: 28px 20px; }
  .hero-eyebrow > span:nth-child(2) { display: none; }
  .hero-role { padding-left: 0; border-left: 0; color: var(--fg-muted); }
  .hero-title { margin-top: 16px; }
  .hero-description { margin-top: 20px; font-size: 1rem; line-height: 1.6; }
  .hero-actions { margin-top: 24px; gap: 8px 24px; }
  .hero-meta-year { display: none; }
  .tool-grid, .process-steps, .ai-tools { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .form-bottom .button { width: 100%; }
  .service { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .service-number { padding-top: 0; }
  .case-facts { grid-template-columns: minmax(0, 1fr); }
  .case-facts-wide { grid-column: auto; }
  .case-gallery { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); padding-top: 56px; }
  .ticker-group i { font-size: 1.75rem; }
}

@media (max-height: 560px) and (min-width: 601px) {
  .hero { min-height: 560px; }
  .about-slot { min-height: 220px; }
}

/* Motion preferences ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.reduced-motion { scroll-behavior: auto; }
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
.reduced-motion::view-transition-group(*), .reduced-motion::view-transition-old(*), .reduced-motion::view-transition-new(*) { animation: none !important; }

@media (forced-colors: active) {
  .button, .header-cta, .type-option span, .copy-email { border: 1px solid ButtonText; }
  .status-dot, .motion-indicator { forced-color-adjust: none; }
}

@media print {
  .site-header, .mobile-menu, .scene, .ticker, .scroll-progress, .process-stage, .contact-form, .footer-actions { display: none !important; }
  .intro, .tools, .contact, .site-footer, .approach { background: #fff !important; color: #000 !important; }
}

/* Without scroll-linked motion, the decorative process stage steps aside for the readable chapters. */
.reduced-motion .process-stage { display: none; }
.reduced-motion .process-layout { grid-template-columns: minmax(0, 1fr); }
.reduced-motion .process-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.reduced-motion .process-step { min-height: 0; padding-block: 32px 40px; justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) {
  .process-stage { display: none; }
  .process-layout { grid-template-columns: minmax(0, 1fr); }
  .process-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
  .process-step { min-height: 0; padding-block: 32px 40px; justify-content: flex-start; }
}


/* Devices without a capable GPU keep the still SVG signature: it rests beside the hero, steps aside for the
   story, and lands in the About slot. Hints about dragging are hidden because the still mark is not interactive. */
.no-webgl .hero-meta-note, .no-webgl .about-caption { display: none; }
.no-webgl .scene-art { transition: opacity 0.4s var(--ease-out); }
@media (min-width: 901px) { .no-webgl [data-experience-phase="story"] .scene-art { opacity: 0; } }
@media (max-width: 900px) {
  .no-webgl .art-fallback { left: 30%; top: auto; bottom: 7%; width: 40%; height: 24%; }
}
.no-webgl [data-experience-phase="dock"] .art-fallback { left: var(--dock-slot-left, 6%); top: var(--dock-slot-top, 20%); bottom: auto; width: var(--dock-slot-width, 40%); height: var(--dock-slot-height, 60%); }

/* Native motion support ---------------------------------------------------- */
@keyframes ticker { to { transform: translate3d(calc(-1 * var(--ticker-shift, 0px)), 0, 0); } }
.ticker-track.is-looping { animation: ticker var(--ticker-duration, 40s) linear infinite; }
.ticker-track.is-paused { animation-play-state: paused; }
.js .process-panel.is-leaving { visibility: visible; }
.process-stage::after { transition: transform 0.7s cubic-bezier(0.45, 0, 0.55, 1); }

/* Shaka, the playful assistant: the launcher and the cartoon. The chat window styles load later (assistant.css). */
.buddy { position: fixed; z-index: 44; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.buddy > * { pointer-events: auto; }
.buddy-launcher { display: block; width: 78px; height: 78px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; filter: drop-shadow(0 10px 18px rgb(11 13 24 / 0.35)); animation: buddy-float 3.2s var(--ease-in-out) infinite; -webkit-tap-highlight-color: transparent; }
.buddy-launcher:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 4px; }
.buddy-launcher[aria-expanded="true"] { animation: none; }
.buddy-art { display: block; width: 100%; height: 100%; overflow: visible; }
.buddy-art * { transform-box: fill-box; transform-origin: center; }
.buddy-shadow { fill: rgb(11 13 24 / 0.18); }
.buddy-figure { transform-origin: 50% 100%; animation: buddy-breathe 2.8s ease-in-out infinite; }
.buddy-body { fill: var(--lime); stroke: var(--navy-950); stroke-width: 3; }
.buddy-shine { fill: #fff; opacity: 0.55; }
.buddy-feet ellipse { fill: var(--cobalt); stroke: var(--navy-950); stroke-width: 3; }
.buddy-arm path { fill: none; stroke: var(--navy-950); stroke-width: 5; stroke-linecap: round; }
.buddy-arm circle { fill: var(--lime); stroke: var(--navy-950); stroke-width: 3; }
.buddy-arm-left { transform-origin: 100% 100%; transform: translate(0px, 0px) rotate(-118deg); }
.buddy-arm-right { transform-origin: 0% 100%; transform: translate(0px, 0px) rotate(118deg); }
.buddy-closed { fill: none; stroke: var(--navy-950); stroke-width: 3.5; stroke-linecap: round; opacity: 0; }
.buddy-antenna { fill: none; stroke: var(--navy-950); stroke-width: 3.5; stroke-linecap: round; transform-origin: 0% 100%; }
.buddy-eyes > ellipse { fill: #fff; stroke: var(--navy-950); stroke-width: 2.5; }
.buddy-pupils circle { fill: var(--navy-950); }
.buddy-glint { fill: #fff; }
.buddy-cheeks ellipse { fill: #ff7ab8; opacity: 0.55; }
.buddy-smile { fill: none; stroke: var(--navy-950); stroke-width: 3.5; stroke-linecap: round; }
.buddy-mouth { opacity: 0; transform: scaleY(0.2); }
.buddy-mouth > ellipse:first-child { fill: var(--navy-950); }
.buddy-tongue { fill: #ff7ab8; }
.buddy-hello { max-width: 220px; margin: 0; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--paper); color: var(--navy-950); font-size: var(--fs-small); line-height: 1.45; box-shadow: 0 12px 30px -10px rgb(11 13 24 / 0.45), 0 0 0 1px rgb(11 13 24 / 0.08); cursor: pointer; }
@keyframes buddy-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes buddy-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, 0.975); } }
@media (prefers-reduced-motion: reduce) { .buddy-launcher, .buddy-figure { animation: none; } }
.reduced-motion .buddy-launcher, .reduced-motion .buddy-figure { animation: none; }
@media (max-width: 600px) { .buddy-launcher { width: 64px; height: 64px; } }
@media print { .buddy { display: none; } }
