/* Inter, self-hosted: the full font keeps its OpenType features (open digits) that Google Fonts strips */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/InterVariable.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("../fonts/InterVariable-Italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/EBGaramond-latin.woff2") format("woff2"); }

/* ==========================================================================
   Lucia Doran portfolio
   Layout: a floating pill nav over a single centred column; the work is
   the colour, the UI stays neutral. Case studies add a sticky milestone rail.
   ========================================================================== */

:root {
  /* Colour */
  --bg: #ffffff;
  --surface: #f5f5f7;          /* cards, learnings, placeholders */
  --surface-2: #ebebef;        /* placeholder stripes, hover fills */
  --icon-bg: #f2f2f2;          /* app-icon tiles in case studies */
  --icon-fg: #111;
  --fg: #0d0d12;
  --muted: #85858f;            /* secondary text, captions */
  --line: #e4e4ea;
  --shine: #8e8e9c;            /* travelling highlight on .shine borders */
  --accent: #2f3bf2;           /* CTA, cursor dot, focus */
  --on-accent: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --glass: rgba(255, 255, 255, 0.5);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --shadow: 0 12px 40px -12px rgba(13, 13, 18, 0.16);

  /* Type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-display: clamp(2rem, 5vw, 4.25rem);
  --fs-h1: clamp(2.25rem, 5vw, 4rem);
  --fs-h2: clamp(1.75rem, 3.4vw, 2.75rem);
  --fs-h3: clamp(1.15rem, 1.6vw, 1.35rem);
  --fs-lead: clamp(1.2rem, 2.1vw, 1.75rem);
  --fs-body: 1.125rem;
  --fs-small: 0.9375rem;
  --tight: -0.045em;

  /* Space & shape */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --max-text: 42rem;
  --radius-lg: clamp(24px, 4vw, 56px);
  --radius-md: clamp(18px, 2.4vw, 32px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101012;
    --surface: #1a1a1e;
    --icon-bg: #1a1a1e;
    --icon-fg: #f2f2f2;
    --surface-2: #232328;
    --fg: #f3f3f5;
    --muted: #8c8c96;
    --line: #2a2a30;
    --shine: rgba(255, 255, 255, .75);
    --accent: #6b74ff;
    --on-accent: #0b0b10;
    --nav-bg: rgba(26, 26, 30, 0.78);
    --glass: rgba(28, 28, 32, 0.45);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], :root.in-about {
  --shine: rgba(255, 255, 255, .75);
  --bg: #101012;
  --surface: #1a1a1e;
  --icon-bg: #1a1a1e;
  --icon-fg: #f2f2f2;
  --surface-2: #232328;
  --fg: #f3f3f5;
  --muted: #8c8c96;
  --line: #2a2a30;
  --accent: #6b74ff;
  --on-accent: #0b0b10;
  --nav-bg: rgba(26, 26, 30, 0.78);
  --glass: rgba(28, 28, 32, 0.45);
  --glass-edge: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  transition: background-color .7s var(--ease), color .7s var(--ease);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "zero"; /* open digits and slashed zeros everywhere */
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

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

/* ---------- Page transitions (Chrome, Edge, Safari 18+) ---------- */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .45s var(--ease) both; }
::view-transition-group(case-cover) { animation-duration: .6s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  z-index: 50;
  margin-top: 16px;
}
.nav__pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1080px;
  margin-inline: auto;
  padding: 10px 10px 10px 28px;
  border-radius: 999px;
  /* Frosted glass: content scrolls by, softly blurred, behind the bar */
  background: var(--glass);
  backdrop-filter: saturate(1.8) blur(14px);
  -webkit-backdrop-filter: saturate(1.8) blur(14px);
  box-shadow: var(--shadow);
  transition: padding .4s var(--ease), max-width .5s var(--ease);
}
/* Scrolled: the bar eases into a slightly smaller pill */
.nav.is-scrolled .nav__pill { max-width: 860px; padding: 6px 6px 6px 24px; }
.nav.is-scrolled .nav__logo .sig { height: 32px; }
.nav__logo { display: block; margin-right: auto; color: var(--fg); }
.nav__logo .sig { display: block; height: 42px; width: auto; transition: transform .5s var(--ease), height .4s var(--ease); }
/* The signature writes itself in, stroke by stroke, like a pen.
   Each <path> carries its own start (--d) and duration (--t). */
.sig path { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.js .sig path { animation: write var(--t) cubic-bezier(.45, 0, .55, 1) calc(var(--d) + .3s) both; }
@keyframes write { from { stroke-dashoffset: 1; } }
.nav__links { display: flex; gap: 4px; margin-right: auto; }
.nav__links a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  transition: background-color .25s var(--ease);
}
.nav__links a:hover { background: var(--surface); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--fg);   /* black in light mode, white in dark */
  color: var(--bg);
  font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.btn svg { transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px color-mix(in oklab, var(--fg) 60%, transparent); }
.btn:hover svg { transform: translateX(4px); }
.nav .btn { padding: 12px 20px; }

.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  transition: background-color .25s var(--ease), transform .5s var(--ease);
}
.icon-btn:hover { background: var(--surface); }
.theme-toggle:active { transform: rotate(40deg); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

@media (max-width: 640px) {
  .nav__pill { padding-left: 20px; }
  .nav__links { margin-right: 0; }
  .nav__links a { padding: 8px 10px; }
  .nav .btn { display: none; }
}

/* ---------- Home: landing (hero + logos fill the first screen) ---------- */

.landing {
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100svh - 96px - env(safe-area-inset-top, 0px));
  padding-bottom: clamp(32px, 6vh, 72px);
}

/* ---------- Home: hero ---------- */

.hero { padding-block: clamp(48px, 8vh, 120px) clamp(48px, 8vh, 96px); }
.hero__title {
  font-size: var(--fs-display);
  letter-spacing: var(--tight);
  line-height: 1.05;
}
.hero__title .w { display: inline-block; }
/* Fixed line breaks so the rotating word never reflows the rest of the headline */
.hero__line { display: block; white-space: nowrap; }
/* Phones: "people love using." drops to its own line so the longest word still fits */
@media (max-width: 639px) { .hero__tail { display: block; } }
.hero__lead {
  margin-top: clamp(24px, 3.5vw, 40px);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  max-width: none;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.4;
}
.hero__lead + .hero__lead { margin-top: 16px; }

/* Split-word entrance, played once on load */
.js .hero__title .w { animation: word-in .9s var(--ease) both; animation-delay: calc(var(--i) * 55ms + 120ms); }
@keyframes word-in { from { opacity: 0; transform: translateY(0.35em); filter: blur(6px); } }

/* Rotating word: deleted and typed letter by letter behind a blinking caret */
.rotator { white-space: nowrap; }
.rotator__caret {
  display: inline-block; width: 0.06em; height: 0.82em; margin-left: 0.04em;
  vertical-align: -0.04em; background: currentColor; border-radius: 1px;
  animation: caret-blink 1.05s steps(1) infinite;
}
.rotator.is-typing .rotator__caret { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* Typewriter headline: the caret sits in a zero-width box so it never pushes words to the next line */
.tw__rest { visibility: hidden; }
.tw__caret { position: relative; display: inline-block; width: 0; }
.tw__caret .rotator__caret { position: absolute; left: 0; bottom: 0.08em; }
[data-typewriter].is-typing .rotator__caret { animation: none; }
[data-typewriter].is-done .rotator__caret { opacity: 0; transition: opacity .6s var(--ease); animation: none; }

/* ---------- Home: logos (one row, equal gaps) ---------- */

.logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.logos li {
  position: relative;
  display: flex; align-items: center;
  color: var(--fg);
}
.logo-text { font-size: clamp(1rem, 2vw, 1.6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.logo { display: block; width: auto; height: var(--logo-h, 28px); }
/* Optical sizes so the four marks feel equally heavy */
.logo--adyen { --logo-h: clamp(20px, 3vw, 34px); }
.logo--bunq { --logo-h: clamp(19px, 2.8vw, 32px); }
.logo--lightspeed { --logo-h: clamp(17px, 2.5vw, 30px); }
.logo--briqs { --logo-h: clamp(18px, 2.6vw, 30px); }
.logo--wayflyer { --logo-h: clamp(15px, 2.2vw, 25px); }
.logo--factorial { --logo-h: clamp(17px, 2.4vw, 28px); }
@media (max-width: 560px) {
  .logos { gap: 12px; }
  .logo--adyen { --logo-h: 16px; }
  .logo--bunq { --logo-h: 15px; }
  .logo--lightspeed { --logo-h: 13px; }
  .logo--briqs { --logo-h: 13px; }
  .logo--wayflyer { --logo-h: 11px; }
  .logo--factorial { --logo-h: 12px; }
  .logos .logo-text { font-size: 0.9rem; }
}

/* ---------- Section headings ---------- */

.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.section-head h2 { font-size: var(--fs-h2); letter-spacing: -0.04em; }
/* Big serif section titles */
.work .section-head h2, .testimonials .section-head h2, .about-section .section-head h2 { font-family: "EB Garamond", Garamond, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
/* "Work": five times the landing hero title, with a thin rule underneath spanning the cards */
.work .section-head h2 {
  font-size: clamp(7.5rem, 17vw, 13.75rem); line-height: 0.9;
  flex: 1; padding-bottom: 0; border-bottom: 1px solid var(--fg);
}
.work .section-head--center { margin-bottom: clamp(16px, 2vw, 24px); }
/* "What people say" and "About": twice the landing hero title */
.testimonials .section-head h2, .about-section .section-head h2 { font-size: clamp(3.5rem, 6.8vw, 5.5rem); line-height: 1; }
.section-head--center { justify-content: center; text-align: center; margin-bottom: clamp(32px, 4vw, 56px); }

/* ---------- Case studies grid ---------- */

.work { padding-block: clamp(64px, 8vw, 120px) clamp(120px, 16vw, 240px); }
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 64px) 24px;
  margin: 0; padding: 0; list-style: none;
}
@media (max-width: 760px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Carousel (testimonials) ---------- */
.carousel__controls { display: flex; gap: 8px; }
.carousel__controls button {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface);
  transition: background-color .25s var(--ease), opacity .25s, transform .3s var(--ease);
}
.carousel__controls button:hover:not(:disabled) { background: var(--surface-2); transform: scale(1.06); }
.carousel__controls button:disabled { opacity: .35; cursor: default; }

.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 24px) / 2);
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin: 0; padding: 0; list-style: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.carousel__track.is-dragging a { pointer-events: none; }
.carousel__track > li { position: relative; scroll-snap-align: start; min-width: 0; }
.carousel__track--thirds { grid-auto-columns: calc((100% - 48px) / 3); }
@media (max-width: 1024px) { .carousel__track--thirds { grid-auto-columns: calc((100% - 24px) / 2); } }
@media (max-width: 760px) { .carousel__track, .carousel__track--thirds { grid-auto-columns: 86%; gap: 16px; } }

.carousel__progress {
  height: 2px; margin-top: 28px; border-radius: 2px;
  background: var(--line); overflow: hidden;
}
.carousel__progress span {
  display: block; height: 100%; width: 50%;
  background: var(--fg);
  transform-origin: left;
  transition: transform .3s var(--ease);
}

/* Card */
.card { display: block; }
.card__cover {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--tint, var(--surface));
  isolation: isolate;
}
.card__cover > img, .card__cover > video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.card:hover .card__cover > img, .card:hover .card__cover > video,
.card:hover .card__cover .ph { transform: scale(1.035); }
.card__meta {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-top: 20px; padding-inline: 8px;
}
.card__text { min-width: 0; }
.card__title {
  font-size: clamp(1.25rem, 2.2vw, 1.875rem);
  font-weight: 600; letter-spacing: -0.04em; line-height: 1.2;
}
.card__project {
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.8vw, 1.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.3;
  transition: color .3s var(--ease);
}
.card:hover .card__project { color: var(--fg); }
.card__year { margin-top: 6px; color: var(--muted); font-weight: 500; flex: none; }

.badge {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 10px; border-radius: 999px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 0.8125rem; font-weight: 600;
}
.badge--icon { width: 40px; height: 40px; padding: 0; justify-content: center; }
.badge--icon svg { width: 16px; height: 16px; }

/* ---------- Media placeholders ---------- */
/* Any .ph is a stand-in: replace the whole element with an <img> or <video>. */

.ph {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 6px;
  padding: 24px; text-align: center;
  color: var(--muted);
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.02em;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, color-mix(in oklab, var(--fg) 4%, transparent) 14px 15px),
    var(--tint, var(--surface));
  transition: transform 1.1s var(--ease);
}
.ph strong { color: var(--fg); font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
.ph svg { margin-bottom: 4px; opacity: .7; }

/* ---------- Testimonials ---------- */

.testimonials { padding-bottom: clamp(96px, 12vw, 176px); }
.carousel__footer { display: flex; align-items: center; gap: 24px; margin-top: 28px; }
.carousel__footer .carousel__progress { flex: 1; margin-top: 0; }
.quote-card {
  display: flex; flex-direction: column; gap: 28px;
  height: 100%; margin: 0;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  user-select: none;
}
.quote-card__person { display: flex; align-items: center; gap: 14px; }
.quote-card__person > span:last-child { display: grid; line-height: 1.35; min-width: 0; }
.quote-card__person strong { font-weight: 600; }
.quote-card__person > span:last-child > span { color: var(--muted); font-size: var(--fs-small); }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 16px; object-fit: cover;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.875rem; font-weight: 600;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .25);
}
.quote-card blockquote {
  margin: 0; flex: 1;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.45;
  color: var(--muted);
}
.quote-card blockquote strong { color: var(--fg); font-weight: 600; }
.quote-card__logo { color: var(--fg); }
.quote-card__logo .logo { --logo-h: 22px; }
.quote-card__logo .logo--lightspeed { --logo-h: 18px; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.footer__links a { color: var(--muted); font-weight: 500; transition: color .25s; }
.footer__links { align-items: center; }
.footer__links a:hover { color: var(--fg); }
.footer__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; transition: background-color .25s, color .25s, transform .35s var(--ease) !important; }
.footer__icon:hover { background: var(--surface); transform: translateY(-2px); }
.footer__icon svg { width: 20px; height: 20px; fill: currentColor; }
.footer small { color: var(--muted); font-size: var(--fs-small); }

/* ---------- Scroll reveal ---------- */

.js [data-reveal] {
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(28px); }

/* ---------- Cursor dot ---------- */

.cursor {
  position: fixed; left: 0; top: 0; z-index: 100;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  display: grid; place-items: center;
  color: var(--on-accent); font-size: 0.8125rem; font-weight: 600;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), opacity .3s, background-color .25s;
  opacity: 0;
}
.cursor.is-visible { opacity: 1; }
/* On hover the dot turns into a "difference" lens: white blended with difference inverts whatever is under it */
.cursor.is-link, .cursor.is-label, .cursor.is-arrow { background: #fff; color: #000; mix-blend-mode: difference; }
.cursor.is-link { width: 44px; height: 44px; margin: -22px 0 0 -22px; opacity: 1; }
.cursor.is-label { width: 84px; height: 84px; margin: -42px 0 0 -42px; opacity: 1; }
.cursor.is-arrow { width: 72px; height: 72px; margin: -36px 0 0 -36px; opacity: 1; }
.cursor__arrow { position: absolute; opacity: 0; transform: translate(-6px, 6px) scale(.6); transition: opacity .25s, transform .45s var(--ease); }
.cursor.is-arrow .cursor__arrow { opacity: 1; transform: none; }
.cursor span { opacity: 0; transition: opacity .2s; }
.cursor.is-label span { opacity: 1; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ==========================================================================
   Case study
   ========================================================================== */

.back {
  position: absolute; z-index: 60;
  top: calc(env(safe-area-inset-top, 0px) + 24px);
  left: max(24px, calc(env(safe-area-inset-left, 0px) + 16px));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px 12px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-weight: 600;
  transition: transform .35s var(--ease);
}
.back svg { transition: transform .35s var(--ease); }
.back:hover svg { transform: translateX(-3px); }
.case-top-actions {
  position: fixed; z-index: 60;
  top: calc(env(safe-area-inset-top, 0px) + 24px);
  right: max(24px, calc(env(safe-area-inset-right, 0px) + 16px));
}
.case-top-actions .icon-btn {
  background: var(--glass);
  backdrop-filter: saturate(1.8) blur(14px); -webkit-backdrop-filter: saturate(1.8) blur(14px);
  border: 0;
  box-shadow: var(--shadow);
}
/* Home: line the switch up with the nav, and keep the nav clear of it on narrower screens */
.nav + .case-top-actions, .case-top-actions:has(+ .nav) { top: calc(env(safe-area-inset-top, 0px) + 26px); }
@media (max-width: 1240px) { .case-top-actions ~ .nav .nav__pill { margin-right: 60px; } }
@media (max-width: 560px) { .nav + .case-top-actions, .case-top-actions:has(+ .nav) { top: calc(env(safe-area-inset-top, 0px) + 22px); } }

/* Case study: the back button and theme switch start on the cover's corners and stay pinned while scrolling */
.case-page .back, .case-page .case-top-actions { position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--hero-pad) + 20px); }
.case-page .back { left: calc(max(var(--hero-pad), env(safe-area-inset-left, 0px)) + 20px); }
.case-page .case-top-actions { right: calc(max(var(--hero-pad), env(safe-area-inset-right, 0px)) + 20px); }

/* Full-width cover with a little breathing room around it */
.case-hero {
  --hero-pad: clamp(12px, 1.6vw, 24px);
  padding: var(--hero-pad);
  padding-left: max(var(--hero-pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--hero-pad), env(safe-area-inset-right, 0px));
}
.case-page { --hero-pad: clamp(12px, 1.6vw, 24px); }
.case-hero__cover {
  position: relative;
  height: calc(100svh - 2 * var(--hero-pad) - env(safe-area-inset-top, 0px));
  max-width: 100%;
  min-height: 420px;
  max-height: 1100px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--tint, var(--surface));
  view-transition-name: case-cover;
}
.case-hero__cover > img, .case-hero__cover > video { width: 100%; height: 100%; object-fit: cover; }
/* YouTube cover: a muted, looping embed scaled to fill the frame like object-fit: cover */
.case-hero__yt { position: absolute; inset: 0; overflow: hidden; pointer-events: none; container-type: size; }
.case-hero__yt iframe {
  position: absolute; top: 50%; left: 50%; border: 0;
  width: max(100cqw, 177.78cqh); height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .8s var(--ease);
}
.case-hero__yt.is-ready iframe { opacity: 1; }
.case-hero__text {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: clamp(24px, 4vw, 56px);
  color: #fff;  /* sits on top of the cover image, in both themes */
  background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent);
}
.case-hero__company {
  font-size: clamp(3.5rem, 13vw, 11rem);
  font-weight: 600; letter-spacing: -0.06em; line-height: .9;
}
.case-hero__title { margin-top: 12px; font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.03em; }
.case-hero__role {
  display: inline-block; margin-bottom: clamp(16px, 2vw, 24px);
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: #0d0d12;
  font-size: var(--fs-small); font-weight: 600;
}
.js .case-hero__company { animation: word-in 1s var(--ease) .15s both; }
.js .case-hero__company[data-typewriter] { animation: none; }
.js .case-hero__title { animation: word-in 1s var(--ease) .3s both; }

/* Layout: one centred, wide column. Each section is at least a screen tall, so it reads like its own page. */
.case-layout { padding-block: clamp(32px, 6vw, 80px) clamp(64px, 9vw, 120px); }
.case-layout > article { max-width: 1120px; margin-inline: auto; }
/* Wide screens: the content sits between the pinned Back button (104px) and theme toggle (44px),
   with the same gap on both sides */
@media (min-width: 1100px) {
  .case-page { --side-gap: clamp(48px, 5vw, 96px); }
  .case-layout.wrap {
    max-width: none;
    padding-left: calc(max(var(--hero-pad), env(safe-area-inset-left, 0px)) + 20px + 104px + var(--side-gap));
    padding-right: calc(max(var(--hero-pad), env(safe-area-inset-right, 0px)) + 20px + 44px + var(--side-gap));
  }
  .case-layout > article { max-width: none; }
}
/* Text spans the full content column so nothing reads as left-aligned */
.case-layout .case-section h2, .case-section .lead, .case-section .prose, .case-section p,
.facts__wide dd, .media figcaption, .case-layout .points h3, .case-layout .points p { max-width: none; }
@media (min-width: 760px) { .case-section .prose { font-size: 1.125rem; } }

/* Sections */
.case-section {
  display: grid; gap: clamp(20px, 2.4vw, 32px); align-content: start;
  /* A fixed, generous gap (not a screen height), so the next section always peeks in above the fold */
  padding-block: clamp(48px, 8vh, 88px);
}
.case-section:last-child { padding-bottom: 0; }
/* A page that only holds media: centred vertically in the screen */
.case-section--media { align-content: center; }
.case-section--media .media { margin: 0; }
/* Photo carousel: drifts slowly to the left, pauses on hover so a photo can be looked at properly */
.marquee { overflow: hidden; }
/* Same width as the cover video: break out of the text column to the page edges minus the cover's padding */
.marquee.marquee--bleed, .shine--bleed { margin-inline: calc(var(--hero-pad) - var(--gutter)); }
@media (min-width: 1100px) {
  .marquee.marquee--bleed, .shine--bleed {
    margin-left: calc(-20px - 104px - var(--side-gap));
    margin-right: calc(-20px - 44px - var(--side-gap));
  }
}
.case-section--media { padding-bottom: clamp(32px, 5vh, 56px); }
.marquee { position: relative; }
.marquee__track {
  display: flex; gap: 16px; width: max-content;
  padding-right: 16px; /* makes both halves exactly equal, so the loop has no jump */
  will-change: transform;
}
/* Arrows: glass buttons over the photos' left and right edges, centred on the photo height */
.marquee__btn {
  position: absolute; z-index: 2;
  top: clamp(186px, calc(50svh - var(--hero-pad) - env(safe-area-inset-top, 0px) / 2 - 24px), 526px);
  display: none; place-items: center;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  color: var(--fg); background: var(--glass);
  backdrop-filter: saturate(1.8) blur(14px); -webkit-backdrop-filter: saturate(1.8) blur(14px);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .3s var(--ease);
}
.marquee__btn:hover { transform: scale(1.06); }
.marquee__btn:active { transform: scale(.96); }
.marquee__btn--prev { left: 20px; }
.marquee__btn--next { right: 20px; }
.js .marquee__btn { display: grid; }
.marquee__item { flex: none; margin: 0; display: grid; gap: 12px; }
/* Same height as the cover video */
.marquee__item .media__frame {
  height: calc(100svh - 2 * var(--hero-pad) - env(safe-area-inset-top, 0px));
  min-height: 420px; max-height: 1100px;
  width: auto; max-width: none; border-radius: var(--radius-lg);
}
.marquee__item figcaption { padding-inline: 4px; color: var(--muted); font-size: var(--fs-small); }
.marquee__item figcaption strong { color: var(--fg); font-weight: 600; }
.eyebrow {
  color: var(--muted);
  font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.case-section h2 { font-size: var(--fs-h2); letter-spacing: -0.04em; max-width: 22ch; }
.case-section h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
.prose { max-width: var(--max-text); display: grid; gap: 1em; }
.prose p { color: var(--muted); }
.prose p strong { color: var(--fg); font-weight: 600; }
.lead { font-size: var(--fs-lead); font-weight: 500; letter-spacing: -0.025em; line-height: 1.4; max-width: 34ch; }

/* Summary facts */
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  margin: 8px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line);
}
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: var(--fs-small); font-weight: 500; }
.facts dd { margin: 4px 0 0; font-weight: 500; letter-spacing: -0.01em; }
/* One row: a wider Company column, then Industry, Year and Press. Same type size throughout. */
/* Items sit at their own width and share the leftover space equally, so every gap between them is the same */
@media (min-width: 761px) {
  .facts:has(.facts__company) { display: flex; justify-content: space-between; gap: 40px; }
  .facts__company { flex: 0 1 38ch; }
  .facts:has(.facts__company) > div:not(.facts__company) { flex: none; }
}
@media (max-width: 760px) {
  .facts:has(.facts__company) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts__company { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .facts:has(.facts__company) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts__wide { grid-column: 1 / -1; }
.facts__wide dd { font-weight: 500; max-width: 60ch; }
.facts--three { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
@media (max-width: 640px) { .facts--three { grid-template-columns: minmax(0, 1fr); } }
.facts__links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.facts__links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (max-width: 640px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Two/three column point lists (problems, needs, trade-offs) */
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; margin: 8px 0 0; padding: 0; list-style: none; }
.points li { display: grid; gap: 8px; align-content: start; padding-top: 20px; border-top: 1px solid var(--line); min-width: 0; }
.points p { color: var(--muted); }

/* Quote (research) */
.quote {
  margin: 8px 0; max-width: 30ch;
  font-size: var(--fs-lead); font-weight: 500; letter-spacing: -0.025em; line-height: 1.35;
}
.quote footer { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); letter-spacing: 0; }

/* Media blocks */
.media { margin: 16px 0 0; display: grid; gap: 16px; }
.media__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--tint, var(--surface));
}
.media__frame--wide { aspect-ratio: 16 / 9; }
.media__frame--tall { aspect-ratio: 4 / 5; }
.media__frame > img, .media__frame > video { width: 100%; height: 100%; object-fit: cover; }
.media__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .media__row { grid-template-columns: minmax(0, 1fr); } }
.media figcaption { padding-inline: 4px; color: var(--muted); font-size: var(--fs-small); max-width: 60ch; }
.media figcaption strong { color: var(--fg); font-weight: 600; }

/* Iterations: before/after style steps */
.steps { display: grid; gap: 40px; margin: 8px 0 0; padding: 0; list-style: none; }
.steps > li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.steps > li:nth-child(even) .media { order: -1; }
/* A step whose visual is two videos side by side: text on top, pair full width below */
.steps > li.steps__wide { grid-template-columns: minmax(0, 1fr); align-items: start; }
.steps > li.steps__wide .prose { max-width: 60ch; }
.media-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 20px); }
.media-pair .media { margin: 0; }
@media (max-width: 560px) { .media-pair { grid-template-columns: minmax(0, 1fr); } }
.steps .tag {
  display: inline-block; justify-self: start; margin-bottom: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); font-size: 0.8125rem; font-weight: 600;
}
@media (max-width: 760px) {
  .steps > li { grid-template-columns: minmax(0, 1fr); }
  .steps > li:nth-child(even) .media { order: 0; }
}

/* Outcome numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; margin: 8px 0 0; }
.stats div { min-width: 0; padding-top: 20px; border-top: 1px solid var(--line); }
/* Five stats: three on the first row, two on the second, so none is left alone */
.stats--five { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats--five > div { grid-column: span 2; }
.stats--five > div:nth-child(n+4) { grid-column: span 3; }
@media (max-width: 640px) { .stats--five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats--five > div, .stats--five > div:nth-child(n+4) { grid-column: auto; } }
/* Four points: two by two */
.points--pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .points--pairs { grid-template-columns: minmax(0, 1fr); } }
/* Needs: two columns (user / business), each with its points stacked under a subheading */
.needs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 8px; }
.needs__group { display: grid; gap: 16px; align-content: start; min-width: 0; }
.needs__title { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg); }
.points--stack { grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0; }
@media (max-width: 640px) { .needs { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.stats dd { margin: 0; font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { margin-top: 10px; color: var(--muted); font-size: var(--fs-small); }
.stats { display: grid; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }

/* Learnings cards (as in the reference) */
.learnings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 8px 0 0; padding: 0; list-style: none; }
.learnings li {
  display: grid; gap: 12px; align-content: start;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform .5s var(--ease);
}
.learnings li:hover { transform: translateY(-4px); }
.learnings p { color: var(--muted); }
@media (max-width: 900px) { .learnings { grid-template-columns: minmax(0, 1fr); } }

/* Prev / next project */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: clamp(64px, 8vw, 120px); }
.pager a {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: background-color .3s var(--ease);
}
.pager a:hover { background: var(--surface-2); }
.pager__text { display: grid; min-width: 0; flex: 1; }
.pager__text strong { font-weight: 600; }
.pager__text span { color: var(--muted); }
.pager__thumb { position: relative; width: 72px; height: 72px; flex: none; border-radius: 16px; overflow: hidden; background: var(--tint, var(--surface-2)); }
.pager__thumb > img { width: 100%; height: 100%; object-fit: cover; }
.pager a svg { flex: none; transition: transform .35s var(--ease); }
.pager__prev:hover svg { transform: translateX(-4px); }
.pager__next:hover svg { transform: translateX(4px); }
.pager__next { flex-direction: row-reverse; text-align: right; grid-column: -2; } /* stays on the right even when there is no previous project */
@media (max-width: 760px) { .pager { grid-template-columns: minmax(0, 1fr); } .pager__next { grid-column: auto; } .pager__thumb { display: none; } }

/* ---------- Password lock ---------- */

.lock {
  display: grid; place-items: center;
  min-height: 60vh; padding-block: 96px;
}
.lock form { display: grid; gap: 16px; width: min(100%, 380px); text-align: center; }
.lock h1 { font-size: var(--fs-h2); letter-spacing: -0.04em; }
.lock p { color: var(--muted); }
.lock__field { display: flex; gap: 8px; margin-top: 8px; padding: 6px; border-radius: 999px; background: var(--surface); }
.lock input {
  flex: 1; min-width: 0;
  padding: 0 16px; border: 0; background: transparent;
  font: inherit; color: var(--fg);
}
.lock input:focus { outline: none; }
.lock__field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.lock .btn { padding: 12px 20px; }
.lock__error { color: #d93636; font-size: var(--fs-small); min-height: 1.5em; }
.lock.is-shaking form { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- About ---------- */

.about-section { padding-block: clamp(64px, 8vw, 120px) max(65vh, 320px); } /* room to finish reading */
.about-section .section-head { margin-bottom: clamp(28px, 3.5vw, 48px); }
.about__portrait { position: relative; aspect-ratio: 4 / 5; width: 100%; max-width: 300px; margin: 0 auto clamp(56px, 8vw, 112px); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.about__portrait > img { width: 100%; height: 100%; object-fit: cover; }
/* Landscape video version: about the same area as the portrait photo */
.about__portrait--video { aspect-ratio: 3 / 2; max-width: 420px; }
.about__portrait > video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Full-width editorial copy; words light up as you read (see initAbout) */
.about__text { display: grid; gap: 1em; font-size: clamp(1.5rem, 3.2vw, 2.75rem); line-height: 1.22; font-weight: 500; letter-spacing: -0.025em; text-wrap: pretty; }
.about__text .rw { color: color-mix(in oklab, var(--fg) 22%, transparent); transition: color .9s var(--ease); }
.about__text .rw.is-read { color: var(--fg); }
@media (max-width: 860px) { .about__portrait { max-width: 240px; } .about__portrait--video { max-width: 340px; } }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
  .cursor { display: none; }
}

/* Context breathes: extra white space above and below */
#context { padding-block: clamp(96px, 16vh, 176px); }

/* User / business needs: compact points so the pair sits within one screen */
.needs .points--stack { gap: 16px; }
.needs .points li { gap: 4px; padding-top: 14px; }
/* Learnings use the same list style as the needs, without icons */
.points--plain { gap: 16px; }
.points--plain li { gap: 4px; padding-top: 14px; }
.needs .points h3, .points--plain h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.needs .points p, .points--plain p { font-size: 0.9375rem; line-height: 1.5; }

/* ---------- Home refinements (2026-10-16) ---------- */
/* Nav keeps its full height; it starts narrower and gets narrower still once you scroll */
.nav__pill { max-width: 760px; }
.nav.is-scrolled .nav__pill { max-width: 600px; padding: 10px 10px 10px 28px; }
.nav.is-scrolled .nav__logo .sig { height: 42px; }
@media (max-width: 640px) { .nav.is-scrolled .nav__pill { padding-left: 20px; } }

/* Intro and logos sit in a slightly narrower column, so the logos read smaller */
.landing .wrap { max-width: calc(1000px + 2 * var(--gutter)); }
.landing .hero__title { font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.15; text-wrap: pretty; }
.landing .logos { gap: 20px; }
.logo--adyen { --logo-h: clamp(18px, 2.5vw, 28px); }
.logo--bunq { --logo-h: clamp(17px, 2.3vw, 26px); }
.logo--lightspeed { --logo-h: clamp(15px, 2.1vw, 25px); }
.logo--briqs { --logo-h: clamp(16px, 2.2vw, 25px); }
.logo--wayflyer { --logo-h: clamp(13px, 1.85vw, 21px); }
.logo--factorial { --logo-h: clamp(15px, 2vw, 23px); }
@media (max-width: 560px) {
  .landing .logos { gap: 12px; }
  .logo--adyen { --logo-h: 16px; }
  .logo--bunq { --logo-h: 15px; }
  .logo--lightspeed { --logo-h: 13px; }
  .logo--briqs { --logo-h: 13px; }
  .logo--wayflyer { --logo-h: 11px; }
  .logo--factorial { --logo-h: 12px; }
}

/* Case study cards run the full page width with a small margin, like the case study cover */
.work.wrap {
  --hero-pad: clamp(12px, 1.6vw, 24px);
  max-width: none;
  padding-left: max(var(--hero-pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--hero-pad), env(safe-area-inset-right, 0px));
}
.work-grid { column-gap: var(--hero-pad); }

/* Testimonials: longer real quotes, so a calmer size and paragraph spacing */
.quote-card blockquote { display: grid; gap: 0.8em; align-content: start; font-size: clamp(1rem, 1.25vw, 1.125rem); letter-spacing: -0.01em; line-height: 1.55; }
.quote-card__logo { min-height: 22px; display: flex; align-items: center; }
.quote-card__logo .logo-text { font-size: 1.125rem; }
/* Placeholder wordmark until the real logo arrives */
.logo-text--ph { color: var(--muted); }
img.avatar { display: block; padding: 0; }
.quote-card__icon { display: block; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: inset 0 0 0 1px var(--line); }
.quote-card__wordmark { display: block; height: 32px; width: auto; }

/* Testimonials: full width (same margin as the case study cards), sliding continuously */
.testimonials { --hero-pad: clamp(12px, 1.6vw, 24px); }
.marquee--quotes { margin: 0; padding: 0 0 4px; list-style: none; }
.marquee--quotes .marquee__track { margin: 0; padding: 0 var(--hero-pad) 0 0; list-style: none; gap: var(--hero-pad); align-items: stretch; }
.marquee--quotes .marquee__track:first-child { padding-left: 0; }
.marquee--quotes .marquee__item { display: flex; width: clamp(300px, 31vw, 460px); }
.marquee--quotes .marquee__item:first-child { margin-left: var(--hero-pad); }
.marquee--quotes .quote-card { width: 100%; user-select: text; }
/* Each card hugs its own quote; shorter ones end earlier instead of leaving a gap */
.marquee--quotes .marquee__track { align-items: flex-start; }
.marquee--quotes .quote-card { height: auto; }
.marquee--quotes .quote-card blockquote { flex: none; }
@media (prefers-reduced-motion: reduce) { .marquee--quotes { overflow-x: auto; } }



/* Scroll hint: sits on the photo carousel, near the bottom of the first screen */
.scroll-hint {
  position: absolute; z-index: 2; left: 50%;
  top: calc(clamp(420px, calc(100svh - 2 * var(--hero-pad) - env(safe-area-inset-top, 0px)), 1100px) - 68px);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  color: #fff; font-size: var(--fs-small); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
  transition: transform .35s var(--ease), opacity .3s var(--ease);
}
.scroll-hint svg { filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .45)); }
.scroll-hint:hover { transform: translateX(-50%) translateY(-2px); }
.scroll-hint svg { animation: hint-bob 1.6s var(--ease) infinite; }
@keyframes hint-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint svg { animation: none; } }

/* Typed-in heading: the ghost copy keeps the layout, the visible copy types over it */
.type { position: relative; display: block; }
.type__ghost { visibility: hidden; }
.type__out { position: absolute; inset: 0; }
.type.is-typing .rotator__caret { animation: none; }
.type.is-done .rotator__caret { opacity: 0; transition: opacity .6s var(--ease); animation: none; }

/* Findings: four tiles in one row (2 × 2 on tablet, stacked on phone), big figure first */
.eyebrow--block { margin-top: clamp(32px, 5vw, 64px); }
.findings {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
.findings li {
  display: grid; align-content: start; gap: 10px; min-width: 0;
  padding: clamp(20px, 2vw, 28px);
  border-radius: clamp(16px, 1.8vw, 24px); background: var(--surface);
}
.case-layout .findings p { max-width: none; }
.findings__label { color: var(--fg); font-size: var(--fs-small); font-weight: 600; }
.findings__value { margin-top: clamp(8px, 1.5vw, 20px); font-size: clamp(2.25rem, 3.6vw, 3.25rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--fg); }
.findings__text { color: var(--muted); font-size: var(--fs-small); line-height: 1.45; }
.js .findings li[data-reveal], .findings li {
  transition: opacity .9s var(--ease) calc(var(--d, 0) * 80ms), transform .9s var(--ease) calc(var(--d, 0) * 80ms),
    translate .4s var(--ease), box-shadow .4s var(--ease);
}
@media (hover: hover) {
  .findings li:hover { translate: 0 -6px; box-shadow: 0 14px 28px -18px rgba(0, 0, 0, .28); }
}
@media (prefers-reduced-motion: reduce) { .findings li:hover { translate: none; } }
/* Outcomes: five cards, three then two */
.findings--five { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.findings--five > li { grid-column: span 2; }
.findings--five > li:nth-child(n+4) { grid-column: span 3; }
.findings--five .findings__value { margin-top: 0; }
@media (max-width: 1024px) { .findings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .findings--five > li, .findings--five > li:nth-child(n+4) { grid-column: span 3; } .findings--five > li:last-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .findings, .findings--five { grid-template-columns: minmax(0, 1fr); } .findings--five > li, .findings--five > li:nth-child(n+4) { grid-column: auto; } }

/* Context diagram: who sells to whom (B2B2C), app icons joined by simple arrows */
.b2b2c { margin: clamp(16px, 3vw, 40px) 0 0; display: grid; gap: clamp(20px, 3vw, 32px); }
.b2b2c__flow { display: flex; align-items: flex-start; justify-content: center; margin: 0; padding: 0; list-style: none; }
.b2b2c__node { flex: none; display: grid; justify-items: center; gap: 12px; width: clamp(64px, 9vw, 112px); text-align: center; }
.b2b2c__icon { width: clamp(48px, 6vw, 72px); height: auto; aspect-ratio: 1; border-radius: 24%; object-fit: cover; display: grid; place-items: center;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--line); }
.b2b2c__name { font-size: var(--fs-small); font-weight: 600; line-height: 1.3; }
.b2b2c__arrow { flex: 0 1 clamp(24px, 4vw, 56px); min-width: 0; display: grid; place-items: center; height: clamp(48px, 6vw, 72px); color: var(--muted); }
.b2b2c__arrow svg { width: clamp(18px, 2vw, 24px); height: auto; }
.js .b2b2c__arrow svg { opacity: 0; transform: translateX(-8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.b2b2c.is-in .b2b2c__arrow svg { opacity: 1; transform: none; }
.b2b2c__arrow:nth-child(2) svg { transition-delay: .3s; } .b2b2c__arrow:nth-child(4) svg { transition-delay: .55s; } .b2b2c__arrow:nth-child(6) svg { transition-delay: .8s; }
@media (prefers-reduced-motion: reduce) { .js .b2b2c__arrow svg { opacity: 1; transform: none; transition: none; } }
@media (max-width: 560px) { .b2b2c__name { font-size: 0.75rem; } }
/* App icons: light grey tile, black glyph (same tile in the diagram and the needs list) */
.app-icon { background: var(--icon-bg); color: var(--icon-fg); }
.app-icon svg { width: 50%; height: 50%; }
.app-icon--img img { width: 58%; height: 58%; object-fit: contain; }
/* Needs: the same app icons as the Context diagram, so the players read as the same people */
.needs__item { display: flex !important; align-items: flex-start; gap: 16px; }
.needs__item > div { display: grid; gap: 4px; min-width: 0; }
.needs__icon {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 24%;
  box-shadow: inset 0 0 0 1px var(--line);
}
.needs__icon svg { width: 50%; height: 50%; }
.needs .points li.needs__item { gap: 16px; }
/* The two columns share rows, so items at the same position always start at the same height */
@media (min-width: 641px) {
  .needs { grid-template-rows: repeat(3, auto); row-gap: 0; }
  .needs__group { grid-row: span 3; grid-template-rows: subgrid; }
  .needs__group > .points { grid-row: span 2; display: grid; grid-template-rows: subgrid; }
}

/* Shine: a thin border with a soft highlight that slowly travels around the image */
@property --shine-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.shine {
  margin-block: 0; padding: 1.5px; border-radius: var(--radius-lg);
  background: conic-gradient(from var(--shine-angle), var(--line) 0deg 230deg, var(--shine) 290deg, var(--line) 350deg);
  animation: shine-spin 9s linear infinite;
}
.shine img { display: block; width: 100%; height: auto; border-radius: calc(var(--radius-lg) - 1.5px); }
@keyframes shine-spin { to { --shine-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .shine { animation: none; --shine-angle: 300deg; } }

/* Hotspots: pulsing dots on an image; each opens a short note about a design decision */
.hotspots { position: relative; }
.hotspot {
  position: absolute; left: var(--x); top: var(--y); z-index: 1;
  width: 28px; height: 28px; margin: -14px 0 0 -14px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(20, 20, 24, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer; display: grid; place-items: center;
}
.hotspot::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .35); transition: transform .3s var(--ease); }
.hotspot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .8); animation: hotspot-pulse 2.4s var(--ease) infinite; }
.hotspot:hover::before, .hotspot[aria-expanded="true"]::before { transform: scale(1.25); }
.hotspot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes hotspot-pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.hotspot__note {
  position: absolute; left: var(--x); top: var(--y); z-index: 2;
  width: min(280px, 72vw); margin: 22px 0 0 -24px; padding: 16px 18px;
  border-radius: 16px; background: var(--bg); color: var(--fg);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line);
  font-size: var(--fs-small); line-height: 1.45;
  animation: hotspot-in .3s var(--ease);
}
.hotspot__note[data-side="left"] { margin-left: calc(24px - min(280px, 72vw)); }
.hotspot__note[data-up] { margin-top: 0; transform: translateY(calc(-100% - 22px)); animation: none; }
.hotspot__note strong { display: block; margin-bottom: 4px; font-weight: 600; }
.case-layout .hotspot__note p { margin: 0; color: var(--muted); max-width: none; }
@keyframes hotspot-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .hotspot::after, .hotspot__note { animation: none; } }
@media (max-width: 560px) { .hotspot { width: 24px; height: 24px; margin: -12px 0 0 -12px; } .hotspot::before { width: 10px; height: 10px; } }

/* Live status dot next to the location line: a solid dot with a ring that pulses outwards */
.hero__live { display: flex; align-items: center; gap: 12px; }
.live-dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--fg); }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--fg); animation: live-pulse 2s var(--ease) infinite; }
@keyframes live-pulse { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; opacity: 0; } }

/* ---------- Highlights: looping cards under the logos ---------- */
.highlights { padding-block: clamp(48px, 7vw, 104px) 0; }
.marquee--highlights .marquee__track { margin: 0; padding: 0 16px 0 0; list-style: none; gap: 16px; }
.marquee--highlights .marquee__item { display: block; width: clamp(280px, 34vw, 500px); }
.hl-card {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 10 / 7; border-radius: var(--radius-md);
  background: var(--surface); color: var(--fg);
}
.hl-card--text { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.hl-card--stat { background: #0d0d12; color: #f3f3f5; }
.hl-card--accent { background: var(--accent); color: var(--on-accent); }
.hl-card__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hl-card__content { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(22px, 2.4vw, 36px); }
.hl-card__eyebrow { font-size: var(--fs-small); font-weight: 600; opacity: .7; }
.hl-card__stat { margin-top: auto; font-size: clamp(3rem, 6vw, 5rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.hl-card__caption { margin-top: 10px; max-width: 26ch; font-size: var(--fs-small); line-height: 1.4; opacity: .8; }
.hl-card__quote { font-size: clamp(1.15rem, 1.7vw, 1.5rem); line-height: 1.3; letter-spacing: -0.02em; max-width: 24ch; }
.hl-card__logo { margin-top: auto; width: auto; height: 20px; align-self: flex-start; }
/* Hover or keyboard focus: the card's content blurs and the overlay fades in */
.hl-card__media, .hl-card__content { transition: filter .5s var(--ease), transform .7s var(--ease); }
.hl-card__overlay {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  background: rgba(13, 13, 18, .28);
  opacity: 0; transition: opacity .4s var(--ease);
}
.hl-card__overlay > * { transform: translateY(8px); transition: transform .5s var(--ease); }
/* Ghost CTA: just the text and arrow, no outline or fill */
.hl-card__cta {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 4px;
  color: #fff; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}
.hl-card__cta svg { transition: transform .35s var(--ease); }
.hl-card__cta:hover svg, .hl-card:hover .hl-card__cta svg { transform: translateX(4px); }
.hl-card:hover .hl-card__media, .hl-card:hover .hl-card__content,
.hl-card:focus-within .hl-card__media, .hl-card:focus-within .hl-card__content { filter: blur(14px); transform: scale(1.06); }
.hl-card:hover .hl-card__overlay, .hl-card:focus-within .hl-card__overlay { opacity: 1; }
.hl-card:hover .hl-card__overlay > *, .hl-card:focus-within .hl-card__overlay > * { transform: none; }
@media (hover: none) { .hl-card__overlay { opacity: 1; place-items: end start; padding: 16px; background: linear-gradient(to top, rgba(13,13,18,.55), transparent 55%); } .hl-card__overlay > * { transform: none; } }
@media (prefers-reduced-motion: reduce) { .hl-card__media, .hl-card__content, .hl-card__overlay > * { transition: none; } }

/* ---------- Case study: design highlights bento grid ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.bento__card {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: clamp(220px, 22vw, 300px);
  padding: clamp(20px, 2vw, 28px); border-radius: clamp(16px, 1.8vw, 24px);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
}
.bento__card--wide { grid-column: span 2; }
.js .bento__card[data-reveal], .bento__card {
  transition: opacity .9s var(--ease) calc(var(--d, 0) * 80ms), transform .9s var(--ease) calc(var(--d, 0) * 80ms), translate .4s var(--ease), box-shadow .4s var(--ease);
}
@media (hover: hover) { .bento__card:hover { translate: 0 -6px; box-shadow: inset 0 0 0 1px var(--line), 0 14px 28px -18px rgba(0, 0, 0, .28); } }
.case-layout .bento p { max-width: none; }
.bento__label { color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
.bento__value { margin-top: auto; font-size: clamp(2.5rem, 4.4vw, 4rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--fg); }
.bento__caption { margin-top: 8px; color: var(--muted); font-size: var(--fs-small); line-height: 1.4; }
.bento__big { margin-top: auto; font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; color: var(--fg); }
.bento__arrow { display: inline-block; font-weight: 400; transition: transform .6s var(--ease); }
.bento__card:hover .bento__arrow { transform: translateX(6px); }

/* 6+ devices: little phones stand up one after another */
.bento__devices { display: flex; gap: 6px; align-items: flex-end; height: 40px; margin-top: 18px; }
.bento__devices span { width: 14px; height: 26px; border-radius: 4px; background: var(--fg); opacity: .18; transform: scaleY(.3); transform-origin: bottom; transition: transform .6s var(--ease), opacity .6s; }
.bento__devices span:nth-child(2n) { height: 34px; }
.bento__devices span:nth-child(3n) { height: 30px; width: 18px; }
.bento.is-on .bento__devices span { transform: none; opacity: .85; }
.bento__devices span:nth-child(1) { transition-delay: .2s; } .bento__devices span:nth-child(2) { transition-delay: .3s; } .bento__devices span:nth-child(3) { transition-delay: .4s; }
.bento__devices span:nth-child(4) { transition-delay: .5s; } .bento__devices span:nth-child(5) { transition-delay: .6s; } .bento__devices span:nth-child(6) { transition-delay: .7s; }

/* Information architecture: three tabs that light up in turn */
.bento__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding: 0; list-style: none; }
.bento__chips li { padding: 8px 16px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-size: clamp(0.95rem, 1.3vw, 1.15rem); font-weight: 500; letter-spacing: -0.02em; color: var(--fg); transition: background-color .4s var(--ease), color .4s var(--ease); }
.bento__chips li.is-active { background: var(--fg); color: var(--bg); }

/* Background updates: a progress bar that fills */
.bento__update { margin-top: 18px; max-width: 360px; }
.bento__update-row { display: flex; justify-content: space-between; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.bento__bar { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bento__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--fg); }

/* Languages: a greeting that changes */
.bento__hello { margin-top: 18px; height: 1.4em; overflow: hidden; font-size: 1.35rem; letter-spacing: -0.02em; font-weight: 500; color: var(--fg); }
.bento__hello span { display: inline-block; transition: transform .45s var(--ease), opacity .45s; }
.bento__hello span.is-out { transform: translateY(-100%); opacity: 0; }

/* 3 step setup: steps fill one after another */
.bento__steps { display: flex; align-items: center; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: none; }
.bento__steps li { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 0.8125rem; font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .4s var(--ease), color .4s var(--ease), box-shadow .4s; }
.bento__steps li + li { margin-left: 24px; position: relative; }
.bento__steps li + li::before { content: ""; position: absolute; right: 100%; width: 24px; height: 1.5px; background: var(--line); }
.bento__steps li.is-done { background: var(--fg); color: var(--bg); box-shadow: none; }

@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .bento { grid-template-columns: minmax(0, 1fr); } .bento__card--wide { grid-column: auto; } .bento__card { min-height: 0; } .bento__value, .bento__big, .bento__chips { margin-top: 24px; } }

