/* ---------- Tokens ---------- */
:root {
  --ink: #0c0c0c;
  --ink-soft: rgba(12, 12, 12, 0.6);
  --paper: #ffffff;
  --paper-2: #f4f4f4;
  --blue: #0077cb;
  --red: #f9452d;
  --line: rgba(12, 12, 12, 0.12);

  --g-yellow: #ffb800;
  --g-orange: #ff7a1a;
  --g-lavender: #a9b4ff;
  --g-pink: #f7a3ff;
  --g-red: #ff3b2f;

  --font-sans: "Inter", system-ui, sans-serif;
  --font-display: "Bebas Neue", "Inter", sans-serif;

  --gutter: clamp(16px, 2.5vw, 36px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, blockquote { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Shared ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--red);
  border-right: 2px solid var(--red);
}
.eyebrow--light { color: #fff; }


/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: clamp(20px, 4.5vw, 96px);
  padding: 4px 8px 0;
  color: #fff;
  mix-blend-mode: normal;
  transition: background 0.3s, color 0.3s;
}
.header.is-solid { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); color: var(--ink); }
.logo {
  font-family: var(--font-display);
  font-size: 50px;
  line-height: 1;
  color: var(--red);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s;
}
.logo:hover { color: var(--blue); }
.header__nav { display: flex; gap: clamp(32px, 11vw, 150px); }
.header__nav a {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.header__nav a:hover { opacity: 0.6; }
.arrow-up { color: var(--red); font-size: 12px; }

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  transition: transform 0.2s, background-color 0.2s;
}
.btn-cv:hover { transform: translateY(-2px); background: var(--blue); }

/* The Menu button only exists on tablet and mobile, where the nav links are hidden */
.menu-toggle { display: none; align-items: center; gap: 20px; }
.menu-toggle__lines { display: grid; gap: 7px; width: 42px; }
.menu-toggle__lines span { height: 2px; background: currentColor; transition: transform 0.3s; }
.menu-toggle__label { font-family: var(--font-display); font-size: 50px; line-height: 1; }

/* ---------- Language switch ---------- */
.lang { display: flex; align-items: center; font-size: 14px; font-weight: 700; }
.lang button { padding: 6px 4px; opacity: 0.45; transition: opacity 0.2s; }
.lang button + button::before { content: "/"; margin-right: 8px; opacity: 0.45; }
.lang button:hover, .lang button[aria-pressed="true"] { opacity: 1; }

/* ---------- First-visit intro ---------- */
.intro { position: fixed; inset: 0; z-index: 100; }
.intro-seen .intro { display: none; }
html.intro-active { overflow: hidden; }
.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  transition: opacity 1.5s ease;
}
.intro.is-open { pointer-events: none; }
.intro.is-open::before { opacity: 0; }
.intro__half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  display: flex;
  justify-content: center;
  background: #e8200e;
  transition: transform 1.5s cubic-bezier(.7,0,.25,1);
}
.intro__half--top { top: 0; align-items: flex-end; padding: 0 16px 14px; }
.intro__half--bottom { bottom: 0; align-items: flex-start; padding-top: 22px; }
.intro.is-open .intro__half--top { transform: translateY(-100%); }
.intro.is-open .intro__half--bottom { transform: translateY(100%); }
.intro__text {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 64px);
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
}
.intro__text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(45%);
  animation: intro-letter 0.5s cubic-bezier(.2,.7,.2,1) forwards;
}
.intro__dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
@keyframes intro-letter { to { opacity: 1; transform: none; } }

/* ---------- Menu panel ---------- */
.menu {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  row-gap: 24px;
  min-height: 328px;
  padding: 40px;
  background: #e8200e;
  color: #fff;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.55s cubic-bezier(.7,0,.2,1), visibility 0s linear 0.55s;
}
.menu.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.55s cubic-bezier(.7,0,.2,1), visibility 0s;
}
.menu__close { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; justify-self: end; align-self: start; }
.menu__close-label { font-family: var(--font-display); font-size: 50px; line-height: 0.9; }
.menu__close-icon { position: relative; width: 42px; height: 12px; }
.menu__close-icon span { position: absolute; left: 0; top: 50%; width: 100%; height: 2px; background: currentColor; }
.menu__close-icon span:first-child { transform: rotate(14deg); }
.menu__close-icon span:last-child { transform: rotate(-14deg); }

.menu__contact { align-self: end; }
.menu__contact p { font-size: 18px; font-weight: 500; margin-bottom: 4px; }
.menu__contact a { font-size: clamp(26px, 3.2vw, 46px); font-weight: 600; letter-spacing: -0.04em; }
.menu__links { display: grid; justify-items: end; align-self: end; }
.menu__links a {
  position: relative;
  display: block;
  overflow: hidden;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.43;
  letter-spacing: -0.03em;
}
.menu__links a span, .menu__links a::after { display: block; transition: transform 0.4s cubic-bezier(.7,0,.2,1); }
.menu__links a::after { content: attr(data-label); position: absolute; left: 0; top: 100%; }
.menu__links a:hover span, .menu__links a:hover::after { transform: translateY(-100%); }

/* ---------- Flowing gradient (hero + footer) ----------
   The image is the static fallback; script.js warps it slowly on a WebGL canvas. */
.hero__bg, .footer__gradient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--g-lavender) center / cover no-repeat;
}
.hero__bg { background-image: url("assets/img/hero-background.jpg"); }
.footer__gradient { background-image: url("assets/img/footer-background.jpg"); }
.flow canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.flow canvas.is-ready { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
}
.hero__content {
  position: relative;
  min-height: inherit;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto auto auto;
  padding: 0 var(--gutter) var(--gutter);
}
.hero__since {
  grid-column: 1 / -1;
  align-self: end;
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
  line-height: 1;
}
.hero__since-big { font-size: 60px; letter-spacing: -0.02em; }

.hero__title {
  grid-column: 1 / -1;
  grid-row: 2 / 4;
  font-weight: 700;
  font-size: clamp(64px, 13.5vw, 240px);
  line-height: 0.82;
  letter-spacing: -0.06em;
  margin-top: 0.15em;
}
.hero__line {
  display: block;
  width: fit-content;
  /* the gradient only paints inside the box: extend it below the descenders (g) */
  padding-bottom: 0.3em;
  margin-bottom: -0.3em;
  background: linear-gradient(100deg, #0047ff 0%, #0077cb 30%, #00b5d6 60%, #00c2c7 80%, #00733a 100%);
  background-size: 100vw 100%;
  background-attachment: fixed;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__line--2 { margin-left: auto; margin-right: -0.04em; margin-bottom: -0.16em; }
.hero__dot { display: inline-block; }

.hero__skills {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin: 0.6em 18vw 0 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.hero__location {
  grid-column: 1;
  grid-row: 4;
  margin-top: -2.4em;
  font-size: 16px;
  font-weight: 500;
}

/* ---------- Selected work ---------- */
.work { padding: 160px var(--gutter) 80px; }
.section-head { text-align: center; margin-bottom: 80px; }
.work__title {
  margin-top: 16px;
  font-size: clamp(48px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  row-gap: 64px;
  column-gap: 24px;
}
.case { display: block; }
.case--a { grid-column: 1 / 7; }
.case--b { grid-column: 8 / 13; }
.case--c { grid-column: 4 / 10; }
.case--d { grid-column: 1 / 7; }

.case__media {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  margin-bottom: 32px;
  background: var(--paper-2);
}
.case__media::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 28px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--red);
  border-right: 2px solid var(--red);
}
.case__media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.case--c .case__media img { aspect-ratio: 16 / 10; }
.case:hover .case__media img, .case:hover .case__media video { transform: scale(1.04); }

.case__client { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 12px; }
.case__dot { margin: 0 0.15em; }
.case__tags { position: absolute; top: 24px; left: 24px; right: 64px; z-index: 2; }
/* darker than the default dark pills so they stay legible on light images too */
.case__tags.tags--dark li { background: rgba(12, 12, 12, 0.55); border-color: rgba(255, 255, 255, 0.2); }
.case__desc { font-size: 16px; font-weight: 400; color: var(--ink-soft); line-height: 1.3; margin-bottom: 28px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}


/* Autoplay videos sit invisibly over their image and fade in only once
   they are actually playing, so a blocked video never shows a play button */
.media-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.media-video.is-playing { opacity: 1; }
.media-video::-webkit-media-controls,
.media-video::-webkit-media-controls-start-playback-button { display: none !important; }
.case-card .media-video { z-index: 0; }

/* ---------- What I bring ---------- */
.services { background: var(--ink); color: #fff; padding: 36px var(--gutter) 160px; }
.services__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 160px; }
.services__body { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: end; }
.services__detail { max-width: 240px; }
.services__detail-title { font-size: 16px; font-weight: 500; opacity: 0.6; margin-bottom: 20px; }
.services__detail-text { font-size: 22px; font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; transition: opacity 0.25s; }

.services__list li {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 16px 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #333;
  cursor: pointer;
  transition: color 0.35s;
}
.services__name {
  font-size: clamp(44px, 6.7vw, 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}
.services__num { font-size: 20px; font-weight: 700; padding-bottom: 0.4em; white-space: nowrap; }
.services__list li.is-active { color: #fff; }
.services__list li.is-active .services__num { color: var(--red); }
.services__list li.is-active .services__num b { color: #fff; }

/* ---------- Testimonial ---------- */
.quote { padding: 88px var(--gutter) 120px; }
.quote__eyebrow { display: flex; justify-content: flex-end; margin-bottom: 56px; }
.quote__body { max-width: 1200px; margin-left: auto; }
.quote__mark { fill: var(--red); float: left; margin: 10px 96px 0 0; }
.quote__text {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.03em;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--line);
}
.quote__text .w { opacity: 0.12; transition: opacity 0.4s; }
.quote__text .w.is-on { opacity: 1; }
.quote__author { padding-top: 24px; }
.quote__author cite { display: block; font-style: normal; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.quote__author span { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }

/* ---------- Clients ---------- */
.clients { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.clients__track { display: flex; width: max-content; animation: marquee 30s linear infinite; } /* duration set in script.js */
.clients__set { display: flex; }
.clients__cell {
  display: grid;
  place-items: center;
  width: 290px;
  height: 200px;
  border-right: 1px solid var(--line);
}
.clients__cell img { max-width: 110px; max-height: 64px; object-fit: contain; }
.clients__cell img.is-square { max-width: 100px; max-height: 100px; }
.clients:hover .clients__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Footer ---------- */
.footer {
  /* same white frame on all four sides */
  margin: 30px;
  padding: 60px 60px 60px;
  background: var(--paper-2);
}
.footer__statement {
  max-width: 32em;
  margin-bottom: 60px;
  font-size: clamp(18px, 1.4vw, 21px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: #0a0a0a;
}
.footer__gradient { position: relative; height: clamp(200px, 28vw, 400px); margin-bottom: 56px; }
.footer__label { font-size: 18px; font-weight: 500; margin-bottom: 6px; }
.footer__email { display: inline-block; font-size: clamp(22px, 2.2vw, 32px); font-weight: 600; letter-spacing: -0.05em; margin-bottom: 28px; }
.footer__email:hover { color: var(--red); }
.footer__copy { font-size: 16px; font-weight: 500; color: var(--ink-soft); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .header__nav { gap: 32px; }
  .header { gap: 24px; }
  .hero__skills { margin-right: 4vw; }
}

@media (max-width: 860px) {
  .header { grid-template-columns: 1fr auto auto; padding: 8px var(--gutter) 0; gap: 20px; }
  .intro__text { font-size: 6.6vw; }
  .header__nav, .btn-cv { display: none; }
  .menu-toggle { display: flex; }
  .logo, .menu-toggle__label { font-size: 36px; }
  .menu-toggle__lines { width: 32px; }
  .menu { grid-template-columns: 1fr; padding: 88px var(--gutter) 32px; row-gap: 40px; }
  .menu__close-label { font-size: 36px; }
  .menu__close { position: absolute; top: 16px; right: var(--gutter); }
  .menu__links { justify-items: start; order: 2; }
  .menu__contact { order: 3; }

  .hero__content { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto auto auto; }
  .hero__since-big { font-size: 44px; }
  .hero__title { grid-row: 2; font-size: 19vw; }
  .hero__skills { grid-column: 1; grid-row: 3; margin: 32px 0 24px; font-size: 16px; }
  .hero__location { grid-row: 4; margin-top: 0; }

  .work { padding-top: 100px; }
  .section-head { margin-bottom: 48px; }
  .work__grid { grid-template-columns: 1fr; }
  .case--a, .case--b, .case--c, .case--d { grid-column: 1; }
  .case__media { border-radius: 16px; }
  .case__client { font-size: 19px; }
  .case__tags { top: 14px; left: 14px; right: 40px; gap: 6px; }
  .case__tags li { padding: 6px 10px; font-size: 10px; }

  .services__body { grid-template-columns: 1fr; }
  .services__head { margin-bottom: 64px; }
  .services__detail { max-width: none; order: 2; }
  .services__num { font-size: 14px; }

  .quote__mark { float: none; display: block; margin: 0 0 24px; }
  .quote__eyebrow { justify-content: flex-start; }

  .clients__cell { width: 200px; height: 140px; }

  .footer { margin: 12px; padding: 40px 20px; }
  .footer__statement { margin-bottom: 32px; }
  .footer__gradient { margin-bottom: 40px; }
}

@media (max-width: 480px) {
  .header { gap: 14px; }
  .logo, .menu-toggle__label { font-size: 32px; }
  .menu-toggle__lines { width: 26px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .clients__track { animation: none; }
  .menu, .menu.is-open, .menu__links a span, .menu__links a::after { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .quote__text .w { opacity: 1; }
}

/* =========================================================
   About page
   ========================================================= */
.page-light { padding-top: 80px; }

.about-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 80px var(--gutter) 120px;
}
.about-intro__title {
  font-size: clamp(56px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
  margin-bottom: 120px;
}
.about-intro__lead {
  max-width: 34em;
  font-size: clamp(20px, 1.95vw, 28px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
/* same measure as the lead above (34em of the lead's font size) */
.about-intro__note { max-width: calc(34 * clamp(20px, 1.95vw, 28px)); margin-top: 32px; font-size: 20px; font-weight: 500; line-height: 1.4; color: var(--ink-soft); }


/* As a human */
.human { background: #1b1c1e; color: #fff; padding: 100px var(--gutter) 96px; }
.human__eyebrow {
  font-family: "Gambetta", Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 96px;
}
.human__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 110px); }
.human__col s { text-decoration-thickness: 1.5px; }
.human__col p + p { margin-top: 1.1em; }
.human__col p { font-size: clamp(19px, 1.67vw, 24px); line-height: 1.6; letter-spacing: 0.01em; }

/* bigger hover target on the in-text markers, without moving the text */
.fn::after { content: ""; position: absolute; inset: -10px -8px; }
.fn {
  position: relative;
  vertical-align: super;
  font-size: 0.6em;
  line-height: 1;
  padding: 0 2px;
  color: var(--red);
  cursor: default;
}
.human__notes {
  /* same columns as the paragraphs above (notes 1-4 left, 5-7 right); text columns,
     not grid rows, so a two-line note doesn't push down the note beside it */
  columns: 2;
  column-gap: clamp(32px, 7vw, 110px);
  margin: 80px 0 0;
  padding: 32px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
  counter-reset: fn;
}
.human__notes li {
  break-inside: avoid;
  margin-bottom: 8px;
  counter-increment: fn;
  font-family: "Gambetta", Georgia, serif;
  font-size: 20px;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s;
}
.human__notes li::before { content: counter(fn); color: var(--red); margin-right: 8px; }
.human__notes li.is-on { color: #fff; }

/* Desktop: the whole section fits in one screen, so type and spacing follow the viewport height too */
@media (min-width: 861px) {
  .human { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 54px); padding: clamp(24px, 5vh, 64px) var(--gutter); }
  .human__eyebrow { margin-bottom: clamp(16px, 3.5vh, 48px); font-size: 20px; }
  .human__col p { font-size: clamp(15px, min(1.3vw, 2.3vh), 22px); line-height: 1.5; }
  .human__col p + p { margin-top: 0.8em; }
  .human__notes { margin-top: clamp(16px, 3.5vh, 48px); padding-top: clamp(12px, 2.2vh, 24px); }
  .human__notes li { margin-bottom: 4px; font-size: clamp(15px, min(1.25vw, 2.3vh), 20px); }
}


/* Workstation photo */
.about-photo { margin: 0; padding: 0 var(--gutter) 96px; }
.about-photo__frame { position: relative; overflow: hidden; border-radius: 24px; }
.about-photo__frame img { width: 100%; height: clamp(360px, 58vw, 840px); object-fit: cover; object-position: center 45%; filter: grayscale(1); }
.about-photo__caption {
  display: flex;
  justify-content: space-between;
  padding: 16px 4px 0;
  font-size: 14px;
  font-weight: 500;
}

/* =========================================================
   Project detail (template)
   ========================================================= */
.page-case main { background: var(--paper-2); }

.case-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 10px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  color: #fff;
}
.case-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.55) 100%);
}
.case-hero::after {
  content: "";
  position: absolute;
  top: 96px;
  right: 30px;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--red);
  border-right: 2px solid var(--red);
}
/* Bright cover (DxC): darken the top too, so the white header links stay readable */
.case-hero--scrim::before {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0, rgba(0,0,0,0.25) 110px, rgba(0,0,0,0) 200px),
    linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.55) 100%);
}
.case-hero__content { position: relative; z-index: 2; padding: 0 clamp(16px, 2.5vw, 30px) 64px; max-width: 1000px; }
.case-hero__title {
  margin: 28px 0 32px;
  font-size: clamp(48px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.06em;
}
.case-hero__summary, .case-hero__year { font-size: 20px; font-weight: 500; line-height: 1.4; color: rgba(255, 255, 255, 0.7); }
.case-hero__summary { max-width: 26em; margin-bottom: 40px; }

.tags--dark li {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  color: #fff;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0;
  padding: 56px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.case-meta dt { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
.case-meta dd { margin: 0; font-size: 18px; font-weight: 500; }

.case-body { padding: 0 var(--gutter); }
.case-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 140px 0;
}
.case-block__label { font-size: 16px; font-weight: 500; color: var(--ink-soft); }
.case-block__text { font-size: clamp(20px, 1.95vw, 28px); font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; color: #0b0b0c; }
.case-block__note { margin-top: 24px; font-size: 18px; font-weight: 500; line-height: 1.4; color: var(--ink-soft); }
.case-block--stacked { grid-template-columns: 1fr; gap: 28px; padding-bottom: 80px; }
/* "Big Achievements": a big black title, a step below "More projects" */
.case-block--stacked .case-block__label {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--ink);
}

.case-figure { margin: 0; overflow: hidden; border-radius: 24px; }
.case-figure img { width: 100%; height: auto; }

.case-achievements { position: relative; overflow: hidden; border-radius: 24px; background: #0c0c0c; }
.case-video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
/* Play button over the poster; hidden once the video starts */
.case-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.case-video__play svg { margin-left: 4px; }
.case-video__play:hover { transform: translate(-50%, -50%) scale(1.06); background: #fff; }
.case-achievements.is-playing .case-video__play { opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .case-video__play { width: 64px; height: 64px; } }

/* Latest projects */
.case-more { padding: 140px var(--gutter) 120px; }
.case-more__title {
  font-size: clamp(48px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
  margin-bottom: 56px;
}
/* only published cases are listed here (no "Coming soon" ones); the cards share the width, however many there are */
.case-more__row { display: grid; grid-template-columns: 90px repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.case-more__all {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 28px 0;
  border-radius: 20px;
  background: var(--paper);
  transition: background 0.2s;
}
.case-more__all:hover { background: var(--ink); color: #fff; }
.case-more__all-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.case-more__corner { position: absolute; top: 28px; width: 8px; height: 8px; border-top: 2px solid var(--red); border-right: 2px solid var(--red); }

.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 600px;
  padding: 24px;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
}
.case-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.case-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.6) 100%); z-index: 1; }
.case-card::after { content: ""; position: absolute; top: 28px; right: 28px; z-index: 2; width: 8px; height: 8px; border-top: 2px solid var(--red); border-right: 2px solid var(--red); }
.case-card > ul, .case-card__text { position: relative; z-index: 2; }
.case-card:hover img, .case-card:hover video { transform: scale(1.04); }
.case-card__text h3 { font-size: clamp(26px, 2.5vw, 36px); font-weight: 600; letter-spacing: -0.04em; margin-bottom: 12px; }
.case-card__text p { max-width: 26em; font-size: 18px; font-weight: 500; line-height: 1.35; color: rgba(255, 255, 255, 0.7); }

/* Responsive: About + Project */
@media (max-width: 860px) {
  .page-light { padding-top: 60px; }
  .about-intro { padding: 48px var(--gutter) 80px; }
  .about-intro__title { margin-bottom: 48px; }
    
  .human { padding: 72px var(--gutter); }
  .human__eyebrow { margin-bottom: 48px; }
  .human__cols { grid-template-columns: 1fr; gap: 0; }
  /* one column: keep the paragraph rhythm across the two columns */
  .human__col + .human__col p:first-child { margin-top: 1.1em; }
  .human__notes { columns: 1; margin-top: 48px; }

  .about-photo { padding-bottom: 64px; }
  .about-photo__caption { flex-direction: column; gap: 4px; }

  .case-hero { margin: 0; border-radius: 0 0 16px 16px; }
  .case-hero__content { padding-bottom: 40px; }
  .case-meta { grid-template-columns: 1fr 1fr; padding: 40px var(--gutter); }
  .case-block { grid-template-columns: 1fr; gap: 16px; padding: 72px 0; }
  .case-block--stacked { gap: 20px; }
  .case-figure, .case-achievements { border-radius: 16px; }

  .case-more { padding: 96px var(--gutter) 80px; }
  .case-more__row { grid-template-columns: 1fr; }
  .case-more__all { order: 3; padding: 20px; justify-content: flex-start; align-items: center; }
  .case-more__all-label { writing-mode: horizontal-tb; transform: none; }
  .case-more__corner { top: 50%; right: 24px; transform: translateY(-50%); }
  .case-card { min-height: 420px; }
}

/* =========================================================
   404
   ========================================================= */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  min-height: calc(100svh - 80px);
  padding: 80px var(--gutter) 120px;
  text-align: center;
}
.not-found__code {
  font-family: var(--font-display);
  font-size: clamp(120px, 14vw, 200px);
  line-height: 0.85;
  margin-bottom: 40px;
}
.not-found__title { font-size: clamp(28px, 2.5vw, 36px); font-weight: 600; letter-spacing: -0.03em; margin-bottom: 16px; }
.not-found__text { font-size: 18px; font-weight: 500; color: var(--ink-soft); }
.not-found__link {
  margin-top: 40px;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  font-size: 16px;
  font-weight: 600;
  transition: color 0.2s;
}
.not-found__link:hover { color: var(--red); }

/* =========================================================
   Projects page
   ========================================================= */
.projects-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 80px var(--gutter) 72px;
}
.projects-head__title {
  font-size: clamp(56px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
}

.projects-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 40px;
  margin: 0 var(--gutter);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.projects-filters button {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.2s;
}
.projects-filters button:hover,
.projects-filters button[aria-pressed="true"] { color: var(--ink); }

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px 24px;
  padding: 48px var(--gutter) 140px;
}
.projects-grid .case__media img { aspect-ratio: 16 / 10; }
.projects-grid .case.is-hidden { display: none; }
.projects-grid .case.is-shown { animation: case-in 0.45s ease both; }
@keyframes case-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .projects-head { grid-template-columns: 1fr; gap: 20px; padding: 48px var(--gutter) 40px; }
  /* filters scroll sideways instead of wrapping onto many lines */
  .projects-filters { flex-wrap: nowrap; overflow-x: auto; gap: 28px; margin: 0; padding: 0 var(--gutter) 16px; scrollbar-width: none; }
  .projects-filters::-webkit-scrollbar { display: none; }
  .projects-filters button { flex: none; font-size: 18px; }
  .projects-grid { grid-template-columns: 1fr; gap: 56px; padding: 32px var(--gutter) 96px; }
}

/* Projects page: "Every project rewrites the process" */
.approach {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 40px;
  padding: 120px var(--gutter) 140px;
  background: var(--ink);
  color: #fff;
}
.approach__label { font-size: 16px; font-weight: 500; color: rgba(255, 255, 255, 0.6); }
.approach__content { max-width: 920px; }
.approach__lead {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 28px;
}
.approach__text { font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; line-height: 1.5; color: rgba(255, 255, 255, 0.6); }
.approach__text + .approach__text { margin-top: 20px; }

@media (max-width: 860px) {
  .approach { grid-template-columns: 1fr; gap: 20px; padding: 72px var(--gutter) 88px; }
}

/* About: CV tables (experience, education, languages) */
.cv { padding: 40px var(--gutter) 140px; }
.cv__title {
  margin-bottom: 72px;
  font-size: clamp(56px, 7.2vw, 104px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
}
.cv-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 40px; }
.cv-block + .cv-block { margin-top: 96px; }
.cv-block__label { font-size: 18px; font-weight: 500; color: var(--ink-soft); }
.cv-head, .cv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 10rem; gap: 32px; }
.cv-head { padding-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.cv-head > :last-child, .cv-row__year { text-align: right; }
.cv-row { padding: 32px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.cv-row:last-child { border-bottom: 0; }
.cv-row--short { padding: 22px 0; }
.cv-row__name { font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; letter-spacing: -0.02em; }
.cv-row__sub { color: var(--ink-soft); }
.cv-row__desc { font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--ink-soft); }
.cv-row__skills { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cv-row__year { font-size: 17px; font-weight: 500; white-space: nowrap; }

@media (max-width: 860px) {
  .cv { padding: 24px var(--gutter) 96px; }
  .cv__title { margin: 0 0 40px; }
  .cv-block { grid-template-columns: 1fr; gap: 16px; }
  .cv-block + .cv-block { margin-top: 64px; }
  .cv-head { display: none; }
  .cv-block__label { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .cv-row { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 24px 0; }
  .cv-row__name { grid-column: 1; grid-row: 1; }
  .cv-row__year { grid-column: 2; grid-row: 1; font-size: 15px; color: var(--ink-soft); }
  .cv-row__desc { grid-column: 1 / -1; font-size: 16px; }
  .cv-row__desc:empty { display: none; }
}

/* About: GIF that pops up from a footnote marker */
.fn-pop {
  position: absolute;
  z-index: 80;
  border-radius: 14px;
  background: #2a2b2d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.fn-pop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.fn-pop video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; opacity: 0; }
.fn-pop video.is-active { opacity: 1; }
.fn-pop__credit {
  position: absolute;
  top: 100%;
  right: 2px;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

/* About: Books marquee (same speed as the home logos) */
.books { padding: 0 0 120px; overflow: hidden; }
.marquee__track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee__set { display: flex; }
.books .marquee__set { gap: 16px; padding-right: 16px; }
.books img { display: block; height: 300px; width: auto; border-radius: 14px; outline: 1px solid rgba(12, 12, 12, 0.1); outline-offset: -1px; } /* the hairline keeps white covers from melting into the page */
.books__marquee:hover .marquee__track { animation-play-state: paused; }

@media (max-width: 860px) {
  .books { padding-bottom: 72px; }
  .books img { height: 220px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .books__marquee { overflow-x: auto; }
}

/* Home: logos block under the cases */
.logos { padding: 40px 0 120px; }
/* Eyebrow heading above a marquee (home logos, About books) */
.marquee-head { padding: 0 var(--gutter); margin-bottom: 40px; text-align: center; }
.marquee-head--left { text-align: left; }
@media (max-width: 860px) {
  .logos { padding: 24px 0 72px; }
  .marquee-head { margin-bottom: 24px; }
  .marquee-head .eyebrow { align-items: flex-start; text-align: left; }
  .marquee-head .eyebrow::before { flex: none; margin-top: 4px; }
}

/* Project detail: closing invite to talk about the case */
.case-invite { padding: 64px var(--gutter); background: #fff; }
.case-invite > * { max-width: 980px; }
.case-invite__eyebrow { margin-bottom: 24px; }
.case-invite__title { font-size: clamp(32px, 4vw, 56px); font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 24px; }
.case-invite__text { max-width: 36em; font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; line-height: 1.5; color: var(--ink-soft); margin-bottom: 36px; }
.case-invite__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.2s;
}
.case-invite__cta:hover { background: var(--blue); transform: translateY(-2px); }
.case-invite__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
@media (max-width: 860px) { .case-invite { padding: 48px var(--gutter); } }

/* Project detail: video playing inside a phone mockup.
   phone-frame.png is the phone cut out of mockup-phone.jpg (465x958); its screen
   sits at x 19-450, y 21-936. The phone keeps the size it had in the full photo
   (23.25% of the column). The recording (740x1390) has its own drawn device
   frame, so it is scaled and offset to show only the app inside that frame. */
.case-figure.mockup { overflow: visible; border-radius: 0; }
.mockup__device { position: relative; width: 23.25%; margin: 0 auto; }
:is(.case-row, .cs-section) .mockup__device { width: 48%; }
/* soft contact shadow, as if the phone were resting on a surface */
.mockup__device::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -5%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  filter: blur(10px);
  z-index: 0;
}
.mockup__frame { position: relative; z-index: 1; display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.14)); }
.mockup__screen {
  position: absolute;
  z-index: 2;
  /* a few px larger than the measured screen so no grey from the photo
     peeks out between the white screen and the black bezel */
  left: 3.44%;
  top: 1.36%;
  width: 93.76%;
  height: 97.18%;
  overflow: hidden;
  border-radius: 10.1% / 4.73%;
  background: #fff;
  container-type: inline-size;
}
/* Status bar drawn on top of the screen (time, island, signal, wifi, battery) */
.mockup__status {
  position: absolute;
  inset: 0 0 auto 0;
  height: 9.3cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7cqw 0 9cqw;
  color: #0c0c0c;
}
.mockup__time { font-size: 3.6cqw; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.mockup__island {
  position: absolute;
  top: 1.6cqw;
  left: 50%;
  width: 27cqw;
  height: 6.6cqw;
  border-radius: 999px;
  background: #0b0b0b;
  transform: translateX(-50%);
}
.mockup__icons { display: flex; align-items: center; gap: 1.3cqw; }
.mockup__icons svg { display: block; height: 2.6cqw; width: auto; fill: currentColor; }
/* The app recording below the status bar. It shows only the area inside the
   recording's own drawn frame (x 84-653, y 96-1312 of 740x1390). */
.mockup__app {
  position: absolute;
  left: 2.44%;
  top: 4.37%;
  width: 95.15%;
  height: 95.63%;
  overflow: hidden;
}
.mockup .media-video {
  inset: auto;
  left: -14.74%;
  top: -7.9%;
  width: 129.9%;
  height: auto;
  aspect-ratio: 740 / 1390;
  object-fit: fill;
  opacity: 1;
  border-radius: 0;
}

/* Project detail: text and image side by side, alternating sides.
   Row 1 = text left / image right, row 2 = image left / text right, ... */
.case-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding: 96px 0;
}
.case-row + .case-row { border-top: 1px solid var(--line); }
.case-row .case-block { display: block; padding: 0; }
.case-row .case-block__label { margin-bottom: 20px; }
.case-row .case-block__text { font-size: clamp(19px, 1.6vw, 24px); }
:is(.case-row, .cs-section) .case-figure { margin: 0; }
.case-row--flip .case-block { order: 2; }
.case-row--flip .case-figure { order: 1; }
:is(.case-row, .cs-section) .case-figure:not(.mockup) img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

@media (max-width: 860px) {
  .case-row { grid-template-columns: 1fr; gap: 32px; padding: 56px 0; }
  .case-row--flip .case-block, .case-row--flip .case-figure { order: 0; }
  :is(.case-row, .cs-section) .mockup__device { width: 62%; }
}

/* Case images that should not be cropped to 4:3 */
:is(.case-row, .cs-section) .case-figure.case-figure--natural img { aspect-ratio: auto; }
/* Tall annotated spec: show the top, open the full image on click */
:is(.case-row, .cs-section) .case-figure.case-figure--spec img { aspect-ratio: 1 / 1; object-position: top; }

/* Case pages: placeholders until the real images arrive */
.case-figure--placeholder,
.case-achievements--placeholder {
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(12, 12, 12, 0.04) 14px 15px), #e9e9e9;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
:is(.case-row, .cs-section) .case-figure--placeholder { aspect-ratio: 4 / 3; }
.case-achievements--placeholder { aspect-ratio: 16 / 9; }
/* Hero with a looping video over the cover image (McCain) */
.case-hero .case-hero__video { z-index: 0; }
/* Closing block with two text columns (DxC: Impact / What I learned) */
.case-closing { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); }
.case-closing__label { margin-bottom: 16px; font-size: 16px; font-weight: 500; color: var(--ink-soft); }
@media (max-width: 860px) {
  .case-closing { grid-template-columns: 1fr; gap: 48px; }
  .case-figure--placeholder, .case-achievements--placeholder { border-radius: 16px; }
}

/* Case images: slow, soft zoom on hover (the figure clips the overflow) */
:is(.case-row, .cs-section) .case-figure:not(.mockup):not(.case-figure--placeholder) { overflow: hidden; }
:is(.case-row, .cs-section) .case-figure:not(.mockup):not(.case-figure--placeholder) img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
:is(.case-row, .cs-section) .case-figure:not(.mockup):not(.case-figure--placeholder):hover img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  :is(.case-row, .cs-section) .case-figure img { transition: none; }
  :is(.case-row, .cs-section) .case-figure:hover img { transform: none; }
}

/* A case row with text only (no image): the text keeps the same column
   width as the text in the rows below, the other column stays empty */

/* Case image carousel (Herbalife: Discovery & Research) */
.case-carousel { position: relative; }
.case-carousel__viewport { overflow: hidden; border-radius: inherit; }
.case-carousel__track {
  display: flex;
  gap: 16px;
  transition: transform 0.7s cubic-bezier(.65,0,.25,1);
  touch-action: pan-y;
}
:is(.case-row, .cs-section) .case-figure.case-carousel img.case-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1229 / 803;
  object-fit: cover;
  border-radius: 24px;
}
:is(.case-row, .cs-section) .case-figure.case-carousel:hover img { transform: none; }
/* first time on screen: slide over a little to show the edge of the next image */
.case-carousel__track.is-peeking { animation: carousel-peek 1.6s cubic-bezier(.45,0,.25,1) 0.3s both; }
@keyframes carousel-peek {
  0%, 100% { transform: translateX(0); }
  45%, 60% { transform: translateX(-16%); }
}
.case-carousel__btn {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
  transition: opacity 0.2s, background-color 0.2s, transform 0.2s;
}
.case-carousel__btn svg { width: 20px; height: 20px; }
.case-carousel__btn--prev { left: 14px; }
.case-carousel__btn--next { right: 14px; }
.case-carousel__btn:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.case-carousel__btn:disabled { opacity: 0; pointer-events: none; }
.case-carousel__dots { position: absolute; left: 50%; bottom: 14px; display: flex; gap: 6px; transform: translateX(-50%); }
.case-carousel__dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); transition: background-color 0.2s, width 0.2s; }
.case-carousel__dots span.is-active { width: 18px; border-radius: 999px; background: #fff; }
@media (max-width: 860px) {
  :is(.case-row, .cs-section) .case-figure.case-carousel img.case-carousel__slide { border-radius: 16px; }
  .case-carousel__btn { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-carousel__track { transition: none; }
  .case-carousel__track.is-peeking { animation: none; }
}

/* Case image that is a cut-out device (transparent PNG): no frame, no shadow */
:is(.case-row, .cs-section) .case-figure.case-figure--device { overflow: visible; border-radius: 0; }
:is(.case-row, .cs-section) .case-figure.case-figure--device img {
  display: block;
  width: 72%;
  height: auto;
  aspect-ratio: auto;
  margin: 0 auto;
  border-radius: 0;
}
/* lighter zoom for the cut-out device, and never clipped (it can grow past its box) */
:is(.case-row, .cs-section) .case-figure.case-figure--device:not(.mockup):not(.case-figure--placeholder):hover img { transform: scale(1.03); }
@media (max-width: 860px) { :is(.case-row, .cs-section) .case-figure.case-figure--device img { width: 80%; } }
/* Soft round contact shadow under the tablet's lower-left corner (where it touches the surface) */
:is(.case-row, .cs-section) .case-figure.case-figure--device:not(.mockup) { position: relative; isolation: isolate; overflow: visible; }
:is(.case-row, .cs-section) .case-figure.case-figure--device::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 27%;
  top: 100.5%;
  width: 16%;
  height: 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
  filter: blur(6px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* =========================================================
   Long-form case (DxC): sticky contents on the left + labelled sections
   ========================================================= */
.page-case { --header-h: 58px; }
.cs-layout {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 2fr;
  column-gap: clamp(40px, 6vw, 96px);
  padding: 0 var(--gutter);
}

/* Contents (left column, follows the scroll) */
.cs-toc { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; padding: 56px 0; }
.cs-toc__title { margin-bottom: 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--ink-soft); }
.cs-toc__list { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.cs-toc a {
  display: block;
  margin-left: -1px;
  padding: 7px 0 7px 16px;
  border-left: 2px solid transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s, border-color 0.2s;
}
.cs-toc a:hover { color: var(--ink); }
.cs-toc a.is-active { color: var(--ink); font-weight: 600; border-left-color: var(--red); }

.cs-body { min-width: 0; }
.cs-section {
  padding: 48px 0;
  /* land just above the section label */
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.cs-section + .cs-section { border-top: 1px solid var(--line); }
.cs-section > .cs-section__label { margin-bottom: 20px; color: var(--ink-soft); }
.cs-section > :not(.cs-section__label) + * { margin-top: 40px; }
.cs-section__content > * + * { margin-top: 24px; }
.cs-section__content { max-width: 760px; }

.cs-heading { font-size: clamp(34px, 4vw, 60px); font-weight: 600; line-height: 1; letter-spacing: -0.05em; margin-bottom: 28px; }
.cs-subheading { padding-top: 16px; font-size: clamp(22px, 2vw, 28px); font-weight: 600; letter-spacing: -0.03em; }
.cs-lead { font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; line-height: 1.25; letter-spacing: -0.03em; }
.cs-text { font-size: clamp(17px, 1.3vw, 19px); font-weight: 400; line-height: 1.6; color: rgba(12, 12, 12, 0.75); }
.cs-text strong { font-weight: 600; color: var(--ink); }

/* Quote + North Star */
.cs-quote { margin: 48px 0 0; padding-left: 28px; border-left: 3px solid var(--red); }
.cs-quote p { font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; line-height: 1.3; letter-spacing: -0.03em; }
.cs-quote footer { margin-top: 16px; font-size: 14px; font-weight: 600; text-transform: uppercase; color: var(--ink-soft); }
.cs-section__content > .cs-callout { margin-top: 48px; }
.cs-callout { padding: clamp(28px, 3.5vw, 48px); border-radius: 24px; background: var(--ink); color: #fff; }
.cs-callout__label { margin-bottom: 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--g-yellow); }
.cs-callout__text { font-size: clamp(24px, 2.6vw, 38px); font-weight: 600; line-height: 1.15; letter-spacing: -0.04em; }

/* Insight cards */
.cs-insights, .cs-steps { margin: 0; padding: 0; list-style: none; }
.cs-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; counter-reset: insight; }
.cs-insights li { counter-increment: insight; padding: 28px; border-radius: 20px; background: #fff; }
.cs-insights li::before { content: "0" counter(insight); display: block; margin-bottom: 28px; font-size: 13px; font-weight: 600; color: var(--red); }
.cs-insights h4 { margin: 0 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.cs-insights p { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.cs-methods li { background: #fff; text-transform: none; font-size: 13px; }

/* Numbered decisions */
.cs-steps li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 36px 0; border-top: 1px solid var(--line); }
.cs-steps li:first-child { border-top: 0; padding-top: 0; }
.cs-steps__num { font-family: var(--font-display); font-size: 48px; line-height: 0.9; color: var(--red); }
.cs-steps h3 { margin-bottom: 12px; font-size: clamp(21px, 1.8vw, 26px); font-weight: 600; letter-spacing: -0.03em; }
.cs-steps p { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.6; color: rgba(12, 12, 12, 0.75); }
.cs-steps__figure { margin-top: 28px; aspect-ratio: 16 / 9; }

/* Stats */
.cs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; }
.cs-stats--inline { grid-template-columns: repeat(2, minmax(0, 260px)); padding-top: 16px; }
.cs-stats div { padding: 28px; border-radius: 20px; background: #fff; }
.cs-stats dt { font-size: clamp(44px, 5vw, 76px); font-weight: 600; line-height: 1; letter-spacing: -0.06em; }
.cs-stats dd { margin: 12px 0 0; font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ink-soft); }
.cs-section__content > .cs-stats + .cs-text { margin-top: 40px; }

/* What testing changed */
.cs-changes li { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--line); }
.cs-changes__status { justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.cs-changes__status--muted { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.cs-changes p { font-size: 17px; line-height: 1.5; color: rgba(12, 12, 12, 0.75); }
.cs-changes strong { font-weight: 600; color: var(--ink); }

/* Figures */
.cs-figure.case-figure--placeholder, .cs-figures .case-figure--placeholder { aspect-ratio: 16 / 10; }
.cs-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-figure--wide { margin: 0; }
.cs-figure--wide .case-figure--placeholder { aspect-ratio: 16 / 9; }
.cs-figure__media { overflow: hidden; }
.cs-figure__media img { display: block; width: 100%; height: auto; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
/* same slow, soft zoom as the other case images (no link to a bigger file: client data) */
.cs-figure__media:hover img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) { .cs-figure__media img { transition: none; } .cs-figure__media:hover img { transform: none; } }
.cs-figure--wide figcaption { margin-top: 14px; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.case-figure--placeholder span { padding: 0 16px; text-align: center; }

/* Reflections */
.cs-reflections { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 4vw, 64px); }
.cs-reflections h3 { margin-bottom: 14px; font-size: clamp(21px, 1.8vw, 26px); font-weight: 600; line-height: 1.2; letter-spacing: -0.03em; }
.cs-reflections p { font-size: 17px; line-height: 1.6; color: rgba(12, 12, 12, 0.75); }

@media (max-width: 860px) {
  .page-case { --header-h: 46px; }
  /* no room for the contents column: it becomes a bar fixed under the header,
     scrolling sideways (the active link is kept in view, see script.js) */
  .cs-layout { grid-template-columns: minmax(0, 1fr); }
  .cs-toc {
    top: var(--header-h);
    z-index: 40;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0;
    background: rgba(244, 244, 244, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .cs-toc__title { display: none; }
  .cs-toc__list { position: relative; display: flex; gap: 4px; padding: 8px var(--gutter); border-left: 0; overflow-x: auto; scrollbar-width: none; }
  .cs-toc__list::-webkit-scrollbar { display: none; }
  .cs-toc a { margin: 0; padding: 8px 14px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
  .cs-toc a.is-active { color: #fff; background: var(--ink); font-weight: 600; }
  .cs-section, .cs-body > [id] { scroll-margin-top: calc(var(--header-h) + 56px); }
  .cs-section { padding: 36px 0; }
  .cs-section > .cs-section__label { margin-bottom: 16px; }
  .cs-section > :not(.cs-section__label) + * { margin-top: 24px; }
  .cs-heading { margin-bottom: 20px; }
  .cs-insights, .cs-figures, .cs-reflections { grid-template-columns: 1fr; }
  .cs-stats { grid-template-columns: 1fr; }
  .cs-stats--inline { grid-template-columns: 1fr 1fr; }
  .cs-stats div { padding: 22px; }
  .cs-steps li { grid-template-columns: 1fr; gap: 12px; }
  .cs-changes li { grid-template-columns: 1fr; gap: 10px; }
  .cs-callout { border-radius: 16px; }
}

/* Cases not published yet (McCain, AI Hub): not clickable, faded image, "Coming soon" next to the year */
.case--soon { cursor: default; }
/* a white veil over the media (not opacity on the image and the video, which would show both layers at once) */
.case--soon .case__media::after {
  inset: 0;
  z-index: 1;
  width: auto;
  height: auto;
  border: 0;
  background: rgba(255, 255, 255, 0.55);
}
.case--soon:hover .case__media img, .case--soon:hover .case__media video { transform: none; }
.case__soon { color: var(--ink-soft); }

/* Herbalife in the long-form layout: images inside the numbered steps,
   and the tablet + phone side by side in Final product */
.cs-steps .case-figure { margin-top: 28px; }
.cs-section__content > .cs-text + .cs-steps { margin-top: 48px; }
.cs-steps .case-figure.case-figure--spec img { aspect-ratio: 4 / 3; }
.cs-figures--devices { align-items: center; }
.cs-figures--devices .case-figure.case-figure--device img { width: 92%; }
.cs-figures--devices .case-figure.case-figure--device::after { left: 22%; width: 20%; }
/* phone as tall as the tablet beside it (tablet 92% of its column, phone ~2.06x taller than wide) */
.cs-section .cs-figures--devices .mockup__device { width: 57%; }
@media (max-width: 860px) {
  .cs-figures--devices { gap: 40px; }
  .cs-figures--devices .case-figure.case-figure--device img { width: 80%; }
  .cs-section .cs-figures--devices .mockup__device { width: 50%; }
  .cs-figures--devices .case-figure.case-figure--device::after { left: 27%; width: 16%; }
}
/* header is 42px tall on small phones: the contents bar sits right under it, no gap */
@media (max-width: 480px) { .page-case { --header-h: 42px; } }
/* Square slides (DxC component library pages) */
:is(.case-row, .cs-section) .case-figure.case-carousel.case-carousel--square img.case-carousel__slide { aspect-ratio: 1 / 1; }

/* DxC Final product: four tools converging into one flow */
.cs-flow { display: grid; grid-template-columns: minmax(0, 1fr) clamp(48px, 8vw, 110px) minmax(0, 1.15fr); align-items: stretch; margin: 0; }
.cs-flow__label { margin-bottom: 14px; font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--ink-soft); }
.cs-flow__before, .cs-flow__after { display: flex; flex-direction: column; }
/* four equal rows with no gap, so each card's centre sits at 12.5 / 37.5 / 62.5 / 87.5% for the lines */
.cs-flow__before ul { flex: 1; display: grid; grid-template-rows: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; }
.cs-flow__before li { display: flex; flex-direction: column; justify-content: center; margin: 5px 0; padding: 14px 18px; border-radius: 14px; background: #fff; }
.cs-flow__before li.is-dxc { background: transparent; border: 1px dashed rgba(12, 12, 12, 0.25); }
.cs-flow strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cs-flow span { margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
.cs-flow__lines { width: 100%; height: calc(100% - 31px); margin-top: 31px; overflow: visible; }
.cs-flow__lines path { fill: none; stroke: rgba(12, 12, 12, 0.3); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cs-flow__after ol { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; margin: 5px 0; padding: 28px; border-radius: 20px; background: var(--ink); list-style: none; counter-reset: flow; }
.cs-flow__after li { display: flex; flex-direction: column; padding-left: 40px; position: relative; counter-increment: flow; }
.cs-flow__after li::before { content: "0" counter(flow); position: absolute; left: 0; top: 1px; font-size: 13px; font-weight: 600; color: var(--red); }
.cs-flow__after strong { color: #fff; font-size: 18px; }
.cs-flow__after span { color: rgba(255, 255, 255, 0.65); }
.cs-flow figcaption { grid-column: 1 / -1; margin-top: 16px; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
@media (max-width: 860px) {
  .cs-flow { grid-template-columns: 1fr; }
  .cs-flow__before ul { grid-template-rows: none; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cs-flow__before li { margin: 0; padding: 12px 14px; }
  /* the four lines become one arrow pointing down */
  .cs-flow__lines { display: none; }
  .cs-flow__after { margin-top: 44px; position: relative; }
  .cs-flow__after::before { content: ""; position: absolute; left: 50%; top: -36px; width: 1.5px; height: 26px; background: rgba(12, 12, 12, 0.3); }
  .cs-flow__after::after { content: ""; position: absolute; left: calc(50% - 4px); top: -14px; width: 8px; height: 8px; border-right: 1.5px solid rgba(12, 12, 12, 0.45); border-bottom: 1.5px solid rgba(12, 12, 12, 0.45); transform: rotate(45deg); }
  .cs-flow__after ol { padding: 22px; }
}

/* DxC Final product: animated walkthrough inside a desktop browser window */
.dx-demo { margin: 0; }
.dx-demo__window { overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(12, 12, 12, 0.08), 0 30px 60px -30px rgba(12, 12, 12, 0.35); }
.dx-demo__bar { position: relative; display: flex; align-items: center; justify-content: center; height: 34px; background: #ececec; border-bottom: 1px solid rgba(12, 12, 12, 0.08); }
.dx-demo__dots { position: absolute; left: 14px; display: flex; gap: 7px; }
.dx-demo__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dx-demo__dots i:nth-child(2) { background: #febc2e; }
.dx-demo__dots i:nth-child(3) { background: #28c840; }
.dx-demo__url { padding: 3px 40px; border-radius: 6px; background: #fff; font-size: 11px; color: var(--ink-soft); }
.dx-demo__screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; }
.dx-demo__shot { position: absolute; top: 0; left: 0; width: 100%; height: auto; opacity: 0; transform: scale(1.015); transition: opacity 0.6s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.dx-demo__shot.is-active { opacity: 1; transform: none; }
/* the tall form scrolls inside the screen; JS sets the distance and duration */
.dx-demo__shot[data-scroll].is-active { transform: translateY(var(--scroll-y, 0)); transition: opacity 0.6s ease, transform var(--scroll-t, 0s) cubic-bezier(.45,0,.35,1); }
/* the form's sidebar stays put while the form scrolls (the export is only one screen tall there) */
.dx-demo__pin { position: absolute; top: 0; left: 0; z-index: 1; width: calc(94 / 1600 * 100%); height: auto; opacity: 0; transition: opacity 0.6s ease; }
.dx-demo.is-pinned .dx-demo__pin { opacity: 1; }
.dx-demo__steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 16px; }
.dx-demo__steps button { height: 16px; padding: 6px 0; }
.dx-demo__steps span { display: block; height: 4px; border-radius: 2px; background: rgba(12, 12, 12, 0.12); overflow: hidden; position: relative; }
.dx-demo__steps span::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.dx-demo__steps button.is-done span::after { transform: scaleX(1); }
.dx-demo__steps button.is-active span::after { animation: dx-progress var(--step-t, 3s) linear forwards; }
.dx-demo.is-paused .dx-demo__steps button.is-active span::after { animation-play-state: paused; }
@keyframes dx-progress { to { transform: scaleX(1); } }
.dx-demo__caption { margin-top: 10px; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
@media (max-width: 860px) {
  .dx-demo__window { border-radius: 10px; }
  .dx-demo__bar { height: 24px; }
  .dx-demo__dots { left: 10px; gap: 5px; }
  .dx-demo__dots i { width: 7px; height: 7px; }
  .dx-demo__url { padding: 1px 24px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-demo__shot, .dx-demo__shot[data-scroll].is-active { transition: none; transform: none; }
  .dx-demo__steps button.is-active span::after { animation: none; transform: scaleX(1); }
}
