/* ==========================================================================
   Nour Mohsen — Portfolio
   Design tokens → base → layout → components → pages → motion
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  --bg: #f5f4f0;
  --bg-2: #ebe9e3;
  --surface: #ffffff;
  --ink: #121211;
  --ink-2: #4b4a46;
  --ink-3: #67655f;
  --line: rgba(18, 18, 17, 0.12);
  --line-strong: rgba(18, 18, 17, 0.22);
  --accent: #ff5a1f;
  --ok: #1f9d55;
  --invert-bg: #121211;
  --invert-ink: #f5f4f0;

  /* Project palettes */
  --recall: #2c6870;
  --recall-soft: #dcebec;
  --recall-bright: #5db8c4;
  --reloop: #1e6b45;
  --reloop-soft: #dcefe3;
  --fits: #1d2a44;
  --fits-soft: #e3e6ec;
  --fits-accent: #3b5a8c;
  --on-c: #fff; /* text on an accent-colored chip */
  --accent-text: #b83a0b; /* the orange accent, dark enough for small text */
  --accent-invert: #ff5a1f; /* accent on dark panels (light mode) */
  --art-soft: #f1e4de;

  --font-sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Literata", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --radius-lg: 32px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 68px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e;
    --bg-2: #181816;
    --surface: #1b1b19;
    --ink: #f2f1ec;
    --ink-2: #b9b7b0;
    --ink-3: #9a9891;
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(255, 255, 255, 0.2);
    --invert-bg: #f2f1ec;
    --invert-ink: #121211;
    --recall: #5db8c4;
    --reloop: #4cb782;
    --fits-accent: #8ea8d8;
    --on-c: #0f0f0e;
    --accent-text: #ff5a1f;
    --accent-invert: #b83a0b; /* accent text on the light CTA panel in dark mode */
    --recall-soft: #15292b;
    --reloop-soft: #132a1d;
    --fits-soft: #181d28;
    --art-soft: #2a1f1a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0e;
  --bg-2: #181816;
  --surface: #1b1b19;
  --ink: #f2f1ec;
  --ink-2: #b9b7b0;
  --ink-3: #9a9891;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --invert-bg: #f2f1ec;
  --invert-ink: #121211;
  --recall: #5db8c4;
  --reloop: #4cb782;
  --fits-accent: #8ea8d8;
  --on-c: #0f0f0e;
    --accent-text: #ff5a1f;
    --accent-invert: #b83a0b; /* accent text on the light CTA panel in dark mode */
  --recall-soft: #15292b;
  --reloop-soft: #132a1d;
  --fits-soft: #181d28;
  --art-soft: #2a1f1a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.025em; font-optical-sizing: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.02em; text-transform: uppercase; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 140px); }
.section--tight { padding-block: clamp(48px, 7vw, 88px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.h-display { font-size: clamp(2.4rem, 4.7vw, 4.6rem); line-height: 0.98; letter-spacing: -0.045em; font-weight: 600; }
.h-1 { font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; }
.h-2 { font-size: clamp(1.9rem, 3.8vw, 3.1rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 600; }
.h-3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 62ch; }

/* ---------- Buttons & pills ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--h); padding-inline: 22px; border-radius: 999px;
  font-weight: 500; font-size: 0.97rem; letter-spacing: -0.01em;
  border: 1px solid var(--line-strong);
  transition: transform 0.35s var(--ease), background-color 0.25s, color 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--sm { --h: 38px; padding-inline: 16px; font-size: 0.9rem; }
.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn:hover .arrow--down { transform: translateY(3px); }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-2);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok);
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3.2); opacity: 0; } }

.tag {
  display: inline-flex; align-items: center; height: 28px; padding-inline: 11px;
  border-radius: 999px; border: 1px solid var(--line); font-size: 0.8rem; color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.link-u {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease);
}
.link-u:hover { background-size: 100% 1px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  transition: transform 0.45s var(--ease), background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 700; letter-spacing: -0.04em;
  transition: transform 0.5s var(--ease), border-radius 0.5s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-8deg); border-radius: 50%; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 30px); font-size: 0.95rem; }
.nav__links a:not(.btn) { color: var(--ink-2); transition: color 0.2s; }
.nav__links a:not(.btn):hover, .nav__links a[aria-current="page"] { color: var(--ink); }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); transition: border-color 0.2s, transform 0.4s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); transform: rotate(20deg); }
.theme-toggle svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .nav__links .hide-sm { display: none; }
  .nav__links { gap: 16px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: calc(var(--nav-h) + clamp(40px, 7vw, 90px)); padding-bottom: clamp(56px, 8vw, 100px); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero__intro { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.hero__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.hero__title { margin-bottom: 28px; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero__title .line > span { display: inline-block; animation: rise 1.1s var(--ease-out) both; }
.hero__title .line:nth-child(2) > span { animation-delay: 0.08s; }
.hero__title .line:nth-child(3) > span { animation-delay: 0.16s; }
.hero__title .serif { font-size: 0.98em; }
.hero__lead { margin-bottom: 36px; animation: fadeUp 1s 0.35s var(--ease-out) both; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; animation: fadeUp 1s 0.45s var(--ease-out) both; }
.hero__facts {
  margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: clamp(20px, 4vw, 48px);
  animation: fadeUp 1s 0.55s var(--ease-out) both;
}
.hero__facts dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 4px; }
.hero__facts dd { margin: 0; font-size: 0.95rem; color: var(--ink); }

@keyframes rise { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Hero device stage */
.stage { position: relative; height: clamp(440px, 46vw, 600px); perspective: 1600px; animation: fadeIn 1.2s 0.3s var(--ease-out) both; }
.stage__glow {
  position: absolute; inset: 10% 5%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--recall-bright) 35%, transparent), transparent 70%);
  filter: blur(30px); opacity: 0.7;
}
.stage__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.8s var(--ease-out); }
.stage .slot { position: absolute; top: 50%; left: 50%; }
.stage .slot--a { width: clamp(150px, 15vw, 210px); transform: translate(-128%, -46%) rotate(-8deg); z-index: 1; }
.stage .slot--b { width: clamp(185px, 18.5vw, 255px); transform: translate(-50%, -50%); z-index: 3; }
.stage .slot--c { width: clamp(150px, 15vw, 210px); transform: translate(28%, -42%) rotate(8deg); z-index: 2; }
.stage .float { animation: float 7s ease-in-out infinite; }
.stage .slot--a .float { animation-delay: -2s; }
.stage .slot--c .float { animation-delay: -4.5s; }
.stage__chip {
  position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.25); font-size: 0.82rem; font-weight: 500;
  animation: float 6s ease-in-out infinite;
}
.stage__chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.stage__chip--1 { left: 2%; top: 12%; animation-delay: -1s; }
.stage__chip--2 { right: 0; bottom: 14%; animation-delay: -3s; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stage { height: 420px; margin-top: 8px; }
  .stage .slot--a { width: 140px; }
  .stage .slot--b { width: 175px; }
  .stage .slot--c { width: 140px; }
}
@media (max-width: 480px) {
  .hero__facts { grid-template-columns: 1fr 1fr; }
  .stage { height: 360px; }
  .stage .slot--a, .stage .slot--c { width: 118px; }
  .stage .slot--b { width: 150px; }
  .stage__chip { font-size: 0.75rem; padding: 7px 11px; }
}

/* ---------- Devices ---------- */
.phone {
  --r: 15%;
  position: relative; aspect-ratio: 9 / 19.5;
  border-radius: 15% / 6.9%;
  background: linear-gradient(145deg, #2a2a2a, #0b0b0b 40%, #1d1d1d);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 0 1px rgba(255,255,255,0.07),
    0 50px 80px -30px rgba(0,0,0,0.45),
    0 30px 40px -30px rgba(0,0,0,0.35);
  container-type: inline-size;
}
.phone::before {
  /* side button */
  content: ""; position: absolute; right: -2px; top: 24%; width: 3px; height: 12%; border-radius: 2px; background: #1a1a1a;
}
.phone__screen {
  position: absolute; inset: 1.55% 3.4%; overflow: hidden; background: #000;
  border-radius: 12cqw;
}
.phone__screen img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top;
}
/* Reel: crossfading screens */
[data-reel] > img { opacity: 0; transform: scale(1.04); transition: opacity 0.8s var(--ease), transform 1.2s var(--ease-out); }
[data-reel] > img.is-active { opacity: 1; transform: none; z-index: 1; }
[data-reel] > img:first-child { opacity: 1; transform: none; }
[data-reel].is-running > img:first-child:not(.is-active) { opacity: 0; transform: scale(1.04); }

/* Browser frame with auto-scrolling page */
.browser {
  border-radius: 14px; overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 50px 90px -40px rgba(0,0,0,0.45);
}
.browser__bar {
  height: 34px; display: flex; align-items: center; gap: 6px; padding-inline: 12px;
  background: color-mix(in srgb, var(--bg-2) 70%, var(--surface)); border-bottom: 1px solid var(--line);
}
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.browser__bar i:nth-child(1) { background: #ff5f57; } .browser__bar i:nth-child(2) { background: #febc2e; } .browser__bar i:nth-child(3) { background: #28c840; }
.browser__url {
  margin-left: 10px; flex: 1; max-width: 260px; height: 22px; border-radius: 6px; background: var(--bg);
  font-size: 0.72rem; color: var(--ink-3); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.browser__view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; container-type: size; background: #fff; }
.browser__view img { position: absolute; top: 0; left: 0; width: 100%; height: auto; animation: pageScroll 22s ease-in-out infinite alternate; animation-play-state: paused; }
.is-visible .browser__view img, .browser.is-visible .browser__view img { animation-play-state: running; }
@keyframes pageScroll { 0%, 8% { transform: translateY(0); } 92%, 100% { transform: translateY(calc(-100% + 100cqh)); } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding-block: 18px; }
.marquee__track { display: flex; width: max-content; gap: 48px; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; gap: 48px; font-size: clamp(1.1rem, 2vw, 1.5rem); letter-spacing: -0.02em; color: var(--ink-2); white-space: nowrap; }
.marquee__item::after { content: "✦"; font-size: 0.7em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section heads ---------- */
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(36px, 5vw, 64px); flex-wrap: wrap; }
.sec-head .h-2 { margin-top: 14px; max-width: 18ch; }
.sec-head p { max-width: 42ch; }

/* ---------- Work cards ---------- */
.work-list { display: grid; gap: clamp(56px, 8vw, 104px); }
.work-card { display: block; position: relative; }
.work-card__visual {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9.2; background: var(--tint, var(--bg-2));
  isolation: isolate;
  transition: border-radius 0.6s var(--ease);
}
.work-card__visual::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
}
.work-card__devices { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2.4vw, 32px); transition: transform 0.9s var(--ease-out); }
.work-card__devices .phone { width: clamp(108px, 18%, 230px); transition: transform 0.9s var(--ease-out); }
.work-card__devices .phone:nth-child(1) { transform: translateY(9%); }
.work-card__devices .phone:nth-child(3) { transform: translateY(-7%); }
.work-card:hover .work-card__devices .phone:nth-child(1) { transform: translateY(4%); }
.work-card:hover .work-card__devices .phone:nth-child(2) { transform: translateY(-4%); }
.work-card:hover .work-card__devices .phone:nth-child(3) { transform: translateY(-12%); }
.work-card:hover .work-card__visual { border-radius: calc(var(--radius-lg) + 12px); }
.work-card__devices .browser { width: 62%; transition: transform 0.9s var(--ease-out); }
.work-card__devices .browser + .phone { width: 15%; margin-left: -7%; transform: translateY(14%); z-index: 2; }
.work-card:hover .work-card__devices .browser { transform: translateY(-2%) scale(1.01); }
.work-card__badge {
  position: absolute; top: 18px; left: 18px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 0.78rem; font-weight: 500; border: 1px solid var(--line);
}
.work-card__info { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(16px, 3vw, 40px); align-items: start; padding-top: 26px; }
.work-card__num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); padding-top: 8px; }
.work-card__title { font-size: clamp(1.6rem, 2.8vw, 2.3rem); letter-spacing: -0.035em; line-height: 1.08; font-weight: 600; margin-bottom: 10px; }
.work-card__title .serif { color: var(--ink-2); }
.work-card__desc { color: var(--ink-2); max-width: 58ch; margin-bottom: 16px; }
.work-card__outcomes { display: grid; gap: 6px; margin-bottom: 18px; font-size: 0.95rem; }
.work-card__outcomes li { display: flex; gap: 10px; }
.work-card__outcomes li::before { content: "→"; color: var(--accent); }
.work-card__cta {
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; transition: background 0.3s, color 0.3s, transform 0.5s var(--ease), border-color 0.3s;
}
.work-card:hover .work-card__cta { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: rotate(-45deg); }
@media (max-width: 700px) {
  .work-card__visual { aspect-ratio: 4 / 3.6; border-radius: var(--radius); }
  .work-card__info { grid-template-columns: 1fr; gap: 6px; }
  .work-card__cta { display: none; }
  .work-card__devices .phone { width: 27%; }
  .work-card__devices .phone:nth-child(3) { display: none; }
  .work-card__devices .browser { width: 80%; }
  .work-card__devices .browser + .phone { width: 24%; margin-left: -18%; }
}

/* Cursor label */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 0.85rem; font-weight: 500; white-space: nowrap;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) translate(-50%, -50%) scale(0);
  transition: transform 0.35s var(--ease-out), opacity 0.2s; opacity: 0;
}
.cursor.is-on { opacity: 1; transform: translate3d(var(--x), var(--y), 0) translate(-50%, -50%) scale(1); }
@media (hover: none) { .cursor { display: none; } }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.principle { background: var(--bg); padding: clamp(22px, 2.6vw, 32px); display: flex; flex-direction: column; gap: 14px; min-height: 280px; transition: background 0.3s; }
.principle:hover { background: var(--surface); }
.principle__num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-3); }
.principle__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); margin-top: auto; }
.principle h3 { font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.25; }
.principle p { color: var(--ink-2); font-size: 0.95rem; }
.principle__proof { font-size: 0.82rem; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 12px; }
@media (max-width: 960px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } .principle { min-height: 0; } }

/* ---------- Toolkit ---------- */
.toolkit { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); }
.toolkit__col { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.toolkit__col h3 { font-size: 1rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.toolkit__col h3 span { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--accent)); }
.toolkit__col ul { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .toolkit { grid-template-columns: 1fr; } }

/* ---------- Art direction ---------- */
.art-grid { display: grid; grid-template-columns: 0.8fr 1.1fr 1.1fr; gap: clamp(12px, 1.6vw, 20px); align-items: start; }
.art-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.art-card img { width: 100%; transition: transform 1s var(--ease-out); }
.art-card:hover img { transform: scale(1.04); }
.art-card figcaption { padding: 16px 4px 0; }
.art-card figcaption strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.art-card figcaption span { font-size: 0.9rem; color: var(--ink-2); }
.art-card--plain { background: none; border-radius: 0; overflow: visible; }
.art-card--plain .art-card__img { border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.art-col { display: grid; gap: clamp(12px, 1.6vw, 20px); }
@media (max-width: 800px) { .art-grid { grid-template-columns: 1fr 1fr; } .art-grid > :first-child { grid-row: span 2; } }
@media (max-width: 520px) { .art-grid { grid-template-columns: 1fr; } }

/* ---------- About teaser ---------- */
.about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.about__photos { position: relative; aspect-ratio: 4 / 4.4; }
.about__photos figure { position: absolute; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,0.4); transition: transform 0.8s var(--ease-out); }
.about__photos figure img { width: 100%; height: 100%; object-fit: cover; }
.about__photos .p1 { width: 62%; height: 78%; left: 0; top: 0; transform: rotate(-3deg); }
.about__photos .p2 { width: 52%; height: 60%; right: 0; bottom: 0; transform: rotate(4deg); }
.about__photos:hover .p1 { transform: rotate(-5deg) translate(-6px, -6px); }
.about__photos:hover .p2 { transform: rotate(6deg) translate(6px, 6px); }
.about__photos figcaption {
  position: absolute; left: 10px; bottom: 10px; padding: 6px 10px; border-radius: 999px; font-size: 0.75rem;
  background: rgba(0,0,0,0.55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.about__body .h-2 { margin: 14px 0 22px; }
.about__body p + p { margin-top: 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 32px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.facts div { background: var(--bg); padding: 16px 18px; }
.facts dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 0.95rem; line-height: 1.4; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about__photos { max-width: 440px; } }

/* ---------- Contact CTA + footer ---------- */
.cta { background: var(--invert-bg); color: var(--invert-ink); border-radius: var(--radius-lg); padding: clamp(40px, 8vw, 100px) clamp(24px, 6vw, 80px); position: relative; overflow: hidden; }
.cta .eyebrow { color: color-mix(in srgb, var(--invert-ink) 72%, transparent); }
.cta__title { font-size: clamp(2.3rem, 6vw, 5.2rem); line-height: 1; letter-spacing: -0.045em; font-weight: 600; margin: 18px 0 36px; max-width: 14ch; }
.cta__title .serif { color: var(--accent-invert, var(--accent)); }
.cta .btn { border-color: color-mix(in srgb, var(--invert-ink) 30%, transparent); }
.cta .btn:hover { border-color: var(--invert-ink); }
.cta .btn--primary { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); }
.cta .btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cta__row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta__orb {
  position: absolute; right: -10%; top: -30%; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
  filter: blur(40px); opacity: 0.35; animation: orb 14s ease-in-out infinite alternate; pointer-events: none;
}
@keyframes orb { to { transform: translate(-20%, 30%) scale(1.2); } }
.copy-email[data-copied="true"] .copy-email__label::after { content: " — copied!"; }

.footer { padding-block: 40px 48px; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; color: var(--ink-3); font-size: 0.9rem; }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { color: var(--ink-2); }
.footer__links a:hover { color: var(--ink); }

/* ==========================================================================
   Case study
   ========================================================================== */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 70; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--accent); }

.cs-hero { padding-top: calc(var(--nav-h) + clamp(28px, 5vw, 64px)); }
.cs-back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 0.9rem; margin-bottom: 28px; transition: color 0.2s, gap 0.3s var(--ease); }
.cs-back:hover { color: var(--ink); gap: 12px; }
.cs-hero__top { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(24px, 4vw, 64px); align-items: end; margin-bottom: clamp(32px, 5vw, 56px); }
.cs-hero__title { margin: 14px 0 20px; }
.cs-hero__visual {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--tint);
  aspect-ratio: 16 / 8.2; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 28px);
}
.cs-hero__visual .phone { width: clamp(100px, 14%, 200px); animation: fadeUp 1s var(--ease-out) both; }
.cs-hero__visual .phone:nth-child(2) { animation-delay: 0.08s; translate: 0 -6%; }
.cs-hero__visual .phone:nth-child(3) { animation-delay: 0.16s; }
.cs-hero__visual .phone:nth-child(4) { animation-delay: 0.24s; translate: 0 -6%; }
.cs-hero__visual .phone:nth-child(5) { animation-delay: 0.32s; }
.cs-hero__visual .browser { width: 64%; }
.cs-hero__visual .browser + .phone { width: 14%; margin-left: -6%; translate: 0 12%; }
.cs-hero__visual > img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 800px) {
  .cs-hero__top { grid-template-columns: 1fr; }
  .cs-hero__visual { aspect-ratio: 4 / 3.4; }
  .cs-hero__visual .phone { width: 28%; }
  .cs-hero__visual .phone:nth-child(n+4) { display: none; }
  .cs-hero__visual .browser { width: 84%; }
  .cs-hero__visual .browser + .phone { width: 24%; margin-left: -16%; }
}

.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin-top: clamp(28px, 4vw, 48px); }
.meta div { background: var(--bg); padding: 20px 20px 20px 0; }
.meta div + div { padding-left: 20px; }
.meta dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 0.95rem; line-height: 1.45; }
@media (max-width: 760px) { .meta { grid-template-columns: 1fr 1fr; } .meta div, .meta div + div { padding: 16px 12px 16px 0; } .meta div:nth-child(even) { padding-left: 12px; } }

.tldr { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); }
.tldr__card { padding: clamp(22px, 2.4vw, 30px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tldr__card h3 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.tldr__card h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.tldr__card p { font-size: 1.02rem; line-height: 1.5; }
.tldr__card ul { display: grid; gap: 8px; font-size: 0.98rem; }
.tldr__card li { display: flex; gap: 10px; line-height: 1.45; }
.tldr__card li::before { content: "→"; color: var(--c, var(--accent)); flex: none; }
@media (max-width: 860px) { .tldr { grid-template-columns: 1fr; } }

.cs-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.toc { position: sticky; top: calc(var(--nav-h) + 32px); font-size: 0.9rem; }
.toc p { margin-bottom: 14px; }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-3); transition: color 0.2s, border-color 0.2s; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--ink); }
@media (max-width: 1000px) { .cs-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.cs-body > section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.cs-body > section:first-child { border-top: 0; padding-top: 0; }
.cs-section__head { margin-bottom: clamp(28px, 4vw, 44px); }
.cs-section__head .h-2 { margin-top: 12px; max-width: 22ch; }
.prose { max-width: 66ch; color: var(--ink-2); }
.prose p + p { margin-top: 1em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h3 { color: var(--ink); margin: 1.8em 0 0.6em; font-size: 1.2rem; letter-spacing: -0.02em; }
.prose ul { display: grid; gap: 10px; margin-top: 1em; }
.prose ul li { position: relative; padding-left: 18px; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }

.hmw {
  margin-block: clamp(32px, 5vw, 56px); padding: clamp(28px, 4vw, 48px); border-radius: var(--radius-lg);
  background: var(--tint, var(--bg-2)); position: relative; overflow: hidden;
}
.hmw .mono { color: var(--c, var(--ink-3)); }
.hmw blockquote { font-family: var(--font-serif); font-size: clamp(1.7rem, 3.4vw, 2.8rem); line-height: 1.12; letter-spacing: -0.015em; margin-top: 14px; max-width: 26ch; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); margin-block: 40px; }
.stat { padding: clamp(22px, 2.6vw, 32px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat__num { font-size: clamp(2.8rem, 5.6vw, 4.6rem); line-height: 1; letter-spacing: -0.05em; font-weight: 600; color: var(--c, var(--ink)); font-variant-numeric: tabular-nums; }
.stat__label { margin-top: 12px; color: var(--ink-2); font-size: 0.97rem; line-height: 1.45; }
.stat__bar { height: 4px; border-radius: 4px; background: var(--bg-2); margin-top: 18px; overflow: hidden; }
.stat__bar i { display: block; height: 100%; width: var(--v); background: var(--c, var(--ink)); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.6s var(--ease-out) 0.2s; }
.is-visible .stat__bar i, .stat.is-visible .stat__bar i { transform: scaleX(1); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }

.insight {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  padding: 24px 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-block: 32px; max-width: 760px;
}
.insight__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--c, var(--accent)); color: var(--on-c); display: grid; place-items: center; font-size: 1.1rem; }
.insight > div > strong { display: block; font-size: 1.12rem; letter-spacing: -0.015em; margin-bottom: 4px; line-height: 1.35; }
.insight p { color: var(--ink-2); font-size: 0.97rem; }

.figure { margin-block: 36px; }
.figure__frame { border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.figure__frame img { width: 100%; }
.figure figcaption { margin-top: 12px; font-size: 0.88rem; color: var(--ink-3); }
.figure--wide { margin-inline: calc(-1 * clamp(0px, 4vw, 48px)); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 1.6vw, 20px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 20px); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }

/* Personas */
.personas { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: clamp(12px, 1.6vw, 20px); }
.persona { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.persona__head { display: flex; align-items: center; gap: 14px; }
.persona__avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--tint); color: var(--c); display: grid; place-items: center; font-weight: 600; overflow: hidden; flex: none; }
.persona__avatar img { width: 100%; height: 100%; object-fit: cover; }
.persona__name { font-weight: 600; letter-spacing: -0.01em; }
.persona__role { font-size: 0.85rem; color: var(--ink-3); }
.persona p { font-size: 0.95rem; color: var(--ink-2); }
.persona__need { font-size: 0.92rem; }
.persona__need b { font-weight: 600; }
.persona__shaped { margin-top: auto; padding: 14px 16px; border-radius: 14px; background: var(--tint); font-size: 0.92rem; line-height: 1.45; }
.persona__shaped .mono { display: block; color: var(--c); font-size: 0.68rem; margin-bottom: 6px; }
@media (max-width: 900px) { .personas { grid-template-columns: 1fr; } }

/* Decisions */
.decisions { display: grid; gap: 12px; counter-reset: d; }
.decision {
  display: grid; grid-template-columns: 56px 1fr 1fr; gap: clamp(16px, 3vw, 40px);
  padding: 26px 0; border-top: 1px solid var(--line); counter-increment: d;
}
.decision::before { content: counter(d, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); padding-top: 4px; }
.decision h3 { font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.3; }
.decision h3 small { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c, var(--accent-text)); margin-bottom: 8px; font-weight: 500; }
.decision p { color: var(--ink-2); font-size: 0.97rem; }
@media (max-width: 760px) { .decision { grid-template-columns: 1fr; gap: 8px; } }

/* Process steps */
.steps { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 0; position: relative; margin-block: 32px; }
.steps::before { content: ""; position: absolute; top: 19px; left: 20px; right: 20px; height: 1px; background: var(--line-strong); }
.step { position: relative; padding-right: 20px; }
.step__dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 0.75rem; margin-bottom: 16px; position: relative; }
.step h3, .step h4 { font-size: 1rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.step p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .steps::before { top: 20px; bottom: 20px; left: 19px; right: auto; width: 1px; height: auto; }
  .step { display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; }
  .step__dot { margin: 0; grid-row: span 2; }
}

/* Scrollytelling feature tour */
.tour { display: grid; grid-template-columns: minmax(240px, 0.8fr) 1fr; gap: clamp(32px, 6vw, 96px); }
.tour__sticky { position: sticky; top: calc(var(--nav-h) + 4vh); height: calc(100vh - var(--nav-h) - 8vh); display: flex; align-items: center; justify-content: center; }
.tour__stage { position: relative; width: min(290px, 100%); }
.tour__stage::before {
  content: ""; position: absolute; inset: -18% -30%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%);
}
.tour__screens > img { opacity: 0; transform: translateY(4%) scale(0.98); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease-out); }
.tour__screens > img.is-active { opacity: 1; transform: none; z-index: 1; }
.tour__steps { padding-block: 10vh 20vh; }
.tour__step { min-height: 68vh; display: flex; flex-direction: column; justify-content: center; }
.tour__step :is(.mono, h3, p) { transition: color 0.5s var(--ease); }
/* Inactive steps fade to a readable gray (not transparency) so they still pass contrast */
@media (min-width: 861px) { .tour__step:not(.is-active) :is(.mono, h3, p, .tour__why) { color: var(--ink-3); } .tour__step:not(.is-active) .tour__why { border-left-color: var(--line-strong); } }
.tour__step .mono { color: var(--c); margin-bottom: 12px; }
.tour__step h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 14px; }
.tour__step p { color: var(--ink-2); max-width: 46ch; }
.tour__step .tour__why { margin-top: 16px; font-size: 0.92rem; padding-left: 14px; border-left: 2px solid var(--c); color: var(--ink); max-width: 46ch; }
.tour__mobile-img { display: none; }
@media (max-width: 860px) {
  .tour { grid-template-columns: 1fr; }
  .tour__sticky { display: none; }
  .tour__steps { padding: 0; display: grid; gap: 56px; }
  .tour__step { min-height: 0; opacity: 1; }
  .tour__mobile-img { display: block; width: 62%; max-width: 240px; margin: 0 auto 24px; border-radius: 28px; border: 6px solid #111; box-shadow: 0 30px 50px -25px rgba(0,0,0,0.45); }
}

/* Dark band (Build chapter) */
.band { background: #0d1314; color: #eef3f2; border-radius: var(--radius-lg); padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px); position: relative; overflow: hidden; }
.band .eyebrow { color: #7fb6bc; }
.band .h-2 { color: #fff; }
.band .prose { color: #b8c7c6; }
.band .prose strong { color: #fff; }
.band__grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image: radial-gradient(rgba(255,255,255,0.12) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000, transparent 70%); mask-image: radial-gradient(ellipse at 70% 0%, #000, transparent 70%);
}
.band > * { position: relative; }

/* Pipeline diagram */
.pipeline { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; gap: 0; align-items: center; margin-block: 40px; }
.pipe-col { display: grid; gap: 10px; }
.pipe-node {
  padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; gap: 12px; font-size: 0.95rem;
}
.pipe-node b { font-weight: 600; }
.pipe-node small { display: block; color: #8ea6a4; font-size: 0.8rem; }
.pipe-node .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(93,184,196,0.16); color: var(--recall-bright); flex: none; font-size: 0.95rem; }
.pipe-core { padding: 22px; border-radius: 20px; background: linear-gradient(160deg, rgba(93,184,196,0.22), rgba(93,184,196,0.05)); border: 1px solid rgba(93,184,196,0.45); text-align: center; }
.pipe-core b { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.pipe-core p { font-size: 0.85rem; color: #b8c7c6; }
.pipe-core .rule { margin-top: 12px; display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(255,90,31,0.14); color: #ffb08f; font-size: 0.75rem; font-family: var(--font-mono); }
.pipe-link { width: clamp(28px, 4vw, 56px); height: 2px; position: relative; overflow: hidden; background: rgba(255,255,255,0.12); }
.pipe-link::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--recall-bright), transparent); animation: flow 1.8s linear infinite; }
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr; gap: 0; justify-items: stretch; }
  .pipe-link { width: 2px; height: 28px; margin-inline: auto; }
  .pipe-link::after { width: 100%; height: 40%; background: linear-gradient(180deg, transparent, var(--recall-bright), transparent); animation-name: flowY; }
  .pipe-col { grid-template-columns: 1fr 1fr; }
}
@keyframes flowY { from { transform: translateY(-100%); } to { transform: translateY(250%); } }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,0.1); border-radius: 18px; overflow: hidden; margin-block: 36px; border: 1px solid rgba(255,255,255,0.1); }
.metrics div { background: #0d1314; padding: 22px; }
.metrics b { display: block; font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.04em; color: #fff; line-height: 1; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.metrics span { font-size: 0.85rem; color: #8ea6a4; line-height: 1.4; display: block; }
@media (max-width: 760px) { .metrics { grid-template-columns: 1fr 1fr; } }

.chat-demo { max-width: 520px; display: grid; gap: 10px; margin-block: 28px; }
.bubble { padding: 12px 16px; border-radius: 18px; font-size: 0.95rem; line-height: 1.45; max-width: 85%; }
.bubble--me { justify-self: end; background: var(--recall-bright); color: #062124; border-bottom-right-radius: 6px; }
.bubble--ai { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-bottom-left-radius: 6px; }
.bubble--tool { justify-self: start; font-family: var(--font-mono); font-size: 0.72rem; color: #8ea6a4; padding: 4px 10px; background: none; border: 1px dashed rgba(255,255,255,0.18); }

/* Image gallery (horizontal) */
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 520px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.hscroll > * { scroll-snap-align: start; }
.hscroll img { border-radius: 16px; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; background: var(--bg-2); }

/* Phone row */
.phone-row { display: flex; gap: clamp(10px, 2vw, 24px); justify-content: center; padding: clamp(28px, 5vw, 56px) clamp(12px, 3vw, 32px); border-radius: var(--radius-lg); background: var(--tint); overflow: hidden; }
.phone-row .phone { width: clamp(90px, 17%, 200px); }
.phone-row .phone:nth-child(even) { transform: translateY(8%); }
@media (max-width: 600px) { .phone-row .phone:nth-child(n+4) { display: none; } .phone-row .phone { width: 30%; } }

/* Reflection */
.reflect { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 1.6vw, 20px); }
.reflect__card { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.reflect__card h3 { font-size: 1.1rem; margin-bottom: 14px; letter-spacing: -0.015em; }
@media (max-width: 760px) { .reflect { grid-template-columns: 1fr; } }

/* Next project */
.next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-lg); background: var(--tint); transition: border-radius 0.5s var(--ease); }
.next:hover { border-radius: calc(var(--radius-lg) + 14px); }
.next .h-1 { margin-top: 10px; }
.next .work-card__cta { width: 72px; height: 72px; }
.next:hover .work-card__cta { background: var(--ink); color: var(--bg); transform: rotate(-45deg); }

/* ---------- Reveal motion ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal--scale { transform: scale(0.96); }
.no-js .reveal { opacity: 1; transform: none; }

/* View-transition morph names */
.vt-recall { view-transition-name: recall-visual; }
.vt-reloop { view-transition-name: reloop-visual; }
.vt-fits { view-transition-name: fits-visual; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .browser__view img { animation: none; }
  @view-transition { navigation: none; }
}

@media (max-width: 400px) { .brand > span:last-child { display: none; } }

/* ==========================================================================
   Smart lightbox (all pages)
   ========================================================================== */
.is-zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 8, 8, 0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.25s; }
.lb-stage {
  position: absolute; inset: 0; padding: 64px 72px 72px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* Always fit inside the screen: never larger than the viewport, never upscaled past its own size */
.lb-img {
  display: block; width: auto; height: auto;
  max-width: min(100%, 1800px); max-height: 100%;
  object-fit: contain; border-radius: 8px; cursor: zoom-in;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
  user-select: none; -webkit-user-drag: none;
}
.lb-img.is-swapping { opacity: 0; transform: scale(0.985); }
.lightbox.is-zoomed .lb-img { transform: scale(2.2); cursor: zoom-out; border-radius: 0; box-shadow: none; transition: transform 0.35s var(--ease-out); }
/* Tall images (full-page screenshots, long posters): scroll instead of shrinking to a sliver */
.lightbox.is-tall .lb-stage { display: block; overflow-y: auto; overscroll-behavior: contain; }
.lightbox.is-tall .lb-img { max-height: none; width: min(100%, 980px); max-width: 980px; margin: 0 auto; cursor: default; }
.lightbox.is-tall .lb-hint { visibility: hidden; }

.lb-top { position: absolute; top: 0; left: 0; right: 0; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 14px 0 20px; color: rgba(255, 255, 255, 0.72); font-family: var(--font-mono); font-size: 0.75rem; pointer-events: none; z-index: 2; }
.lb-top > * { pointer-events: auto; }
.lb-count { min-width: 60px; }
.lb-hint { opacity: 0.6; }
.lb-top .lb-close { margin-left: auto; }
.lightbox.is-zoomed .lb-hint::after { content: " · move to pan"; }
.lb-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.15rem; z-index: 3;
  transition: background 0.2s, transform 0.3s var(--ease);
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) translateX(2px); }
.lightbox.is-single .lb-prev, .lightbox.is-single .lb-next, .lightbox.is-zoomed .lb-prev, .lightbox.is-zoomed .lb-next { display: none; }
.lb-cap {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2;
  max-width: min(720px, calc(100% - 32px)); margin: 0; text-align: center;
  color: rgba(255, 255, 255, 0.82); font-size: 0.88rem; line-height: 1.4;
  padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.45);
}
.lb-cap:empty { display: none; }
.lightbox.is-zoomed .lb-cap, .lightbox.is-tall .lb-cap { opacity: 0; pointer-events: none; }
.lb-spin { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; opacity: 0; animation: lbspin 0.8s linear infinite; pointer-events: none; }
.lightbox.is-loading .lb-spin { opacity: 1; transition: opacity 0.2s 0.15s; }
@keyframes lbspin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .lb-stage { padding: 56px 8px 64px; }
  .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; width: 42px; height: 42px; }
  .lb-prev:hover, .lb-next:hover { transform: none; }
  .lb-cap { bottom: 62px; }
  .lb-hint { display: none; }
}

/* ---------- Extra motion ---------- */
/* Images wipe up into place as they scroll in */
.p-imgs figure.reveal, .figure.reveal .figure__frame, .art-card.reveal .art-card__img, .hscroll.reveal > img {
  clip-path: inset(14% 0 0 0 round 14px); transition: clip-path 1.1s var(--ease-out), opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
}
.p-imgs figure.reveal.is-visible, .figure.reveal.is-visible .figure__frame, .art-card.reveal.is-visible .art-card__img, .hscroll.reveal.is-visible > img { clip-path: inset(0 0 0 0 round 14px); }
.p-imgs figure.reveal img, .figure.reveal .figure__frame img { transform: scale(1.08); transition: transform 1.6s var(--ease-out); }
.p-imgs figure.reveal.is-visible img, .figure.reveal.is-visible .figure__frame img { transform: none; }
.p-imgs figure.reveal.is-visible:hover img { transform: scale(1.02); }
/* Tilt targets */
.card__img, .tldr__card, .ix-poll__opt, .principle { transition: transform 0.5s var(--ease-out); will-change: transform; transform-style: preserve-3d; }
.btn--primary { transition: transform 0.35s var(--ease), translate 0.25s var(--ease-out), background-color 0.25s, color 0.25s, border-color 0.25s; }
/* Section numbers count in */
.cs-section__head .eyebrow::before { transform-origin: left; transform: scaleX(0); transition: transform 0.9s var(--ease-out) 0.2s; }
.cs-section__head.is-visible .eyebrow::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .p-imgs figure.reveal, .figure.reveal .figure__frame, .art-card.reveal .art-card__img, .hscroll.reveal > img { clip-path: none; }
  .p-imgs figure.reveal img, .figure.reveal .figure__frame img { transform: none; }
}

/* ---------- Dates that stand out ---------- */
.card__when {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  padding: 5px 11px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
}
.year-mark { display: grid; justify-items: end; line-height: 0.8; }
.year-mark span {
  font-family: var(--font-sans); font-weight: 700; font-size: clamp(4.2rem, 10vw, 8rem); letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1.5px var(--c, var(--ink)); font-variant-numeric: tabular-nums;
}
.year-mark small { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-top: 10px; }
@media (max-width: 800px) { .year-mark { justify-items: start; } .year-mark span { font-size: 4.2rem; } }
.cs-year { display: grid; justify-items: end; gap: 10px; }
.cs-year .year-mark span { font-size: clamp(3.6rem, 8vw, 6.6rem); }

/* More Work: view toggle + timeline */
.filters__wrap { display: flex; align-items: center; gap: 14px; }
.filters__wrap .filters__row { flex: 1; min-width: 0; }
.views { display: inline-flex; flex: none; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.views button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 0.85rem; color: var(--ink-2); transition: background 0.25s, color 0.25s; }
.views button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.3); }
@media (max-width: 640px) { .filters__wrap { flex-direction: column; align-items: stretch; } .views { align-self: flex-start; } }
.tl-year { display: grid; grid-template-columns: 180px 1fr; gap: clamp(20px, 4vw, 48px); padding-top: clamp(40px, 6vw, 72px); position: relative; }
.tl-year::before { content: ""; position: absolute; left: 6px; top: clamp(40px, 6vw, 72px); bottom: -10px; width: 1px; background: var(--line-strong); }
.tl-year__mark { position: sticky; top: calc(var(--nav-h) + 90px); align-self: start; padding-left: 24px; }
.tl-year__mark::before { content: ""; position: absolute; left: 0; top: 18px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent); }
.tl-year__mark b { display: block; font-size: clamp(2.4rem, 4.5vw, 3.6rem); letter-spacing: -0.05em; line-height: 1; }
.tl-year__mark span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
#timeline .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .tl-year { grid-template-columns: 1fr; } .tl-year__mark { position: relative; top: 0; } #timeline .cards { grid-template-columns: minmax(0, 1fr); } }

.cs-topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 8px; }
.cs-topline .cs-back { margin-bottom: 0; align-self: flex-start; }
.cs-topline .year-mark span { font-size: clamp(3rem, 7vw, 5.6rem); }
@media (max-width: 640px) { .cs-topline { flex-direction: column-reverse; align-items: flex-start; } .cs-topline .year-mark { justify-items: start; } }
.work-card__when { top: 18px; right: 18px; font-size: 0.85rem; padding: 7px 13px; }
