/* ─── CASE STUDY STORY LAYOUT ────────────────────────────────────
   Shared by the case studies (Warmlyn, TRU): side nav, results fan,
   brief, user flow, journey map, flow by flow, edge cases, learnings
   and more work.
   Uses the site.css tokens. case.css repurposes --accent for the v1
   tokens, so the green here is named --olive.
   ─────────────────────────────────────────────────────────────── */

:root {
  --olive: #4B5320;
  --olive-soft: rgba(75, 83, 32, 0.12);
  --tint-sage: #DCE4CF;
  --tint-sand: #EFE5CF;
  --tint-olive: #E2E6CC;
}
[data-theme="dark"] {
  --olive: #8C9A55;
  --olive-soft: rgba(140, 154, 85, 0.16);
  --tint-sage: #263022;
  --tint-sand: #352E1F;
  --tint-olive: #2B301A;
}
.wl { --radius-lg: 6px; }


/* ─── LAYOUT ─────────────────────────────────────────────────── */

.wl {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  padding-top: clamp(56px, 7vw, 96px);
}

.wl-nav { position: sticky; top: 32px; display: flex; flex-direction: column; }
.wl-nav__title { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 12px; }
.wl-nav a {
  position: relative;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-3);
  transition: color 200ms var(--ease), padding 300ms var(--ease);
}
.wl-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 1px;
  background: var(--olive);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
.wl-nav a:hover { color: var(--ink-2); }
.wl-nav a.is-active { color: var(--ink); padding-left: 10px; }
.wl-nav a.is-active::before { opacity: 1; }

.wl-body { min-width: 0; }
.wl-sec { padding-bottom: clamp(72px, 9vw, 120px); scroll-margin-top: 24px; }

.wl-title { font-size: clamp(36px, 5vw, 64px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.wl-lede { margin-top: 18px; max-width: 680px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--ink-2); }
.wl-h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; max-width: 720px; }
.wl-h3 { margin-top: 48px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.wl-p { margin-top: 12px; max-width: 660px; color: var(--ink-2); }
.wl-note { margin-top: 18px; max-width: 680px; font-size: 14px; color: var(--ink-3); }

/* ─── OVERVIEW ───────────────────────────────────────────────── */

.wl-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.wl-meta > div { padding: 16px 0; }
.wl-meta dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.wl-meta dd { font-size: 14.5px; line-height: 1.45; }
.wl-status { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--olive); vertical-align: 0.1em; }

/* Stack as a quiet row of icons */
.wl-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 20px; }
.wl-stack__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.wl-stack__icons { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-stack__icons li {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.wl-stack__icons img { width: 18px; height: 18px; }
.wl-stack__icons li::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease), translate 200ms var(--ease);
}
.wl-stack__icons li:hover::after { opacity: 1; translate: -50% 0; }
[data-theme="dark"] .wl-stack__icons img.mono { filter: invert(1); }
.wl-stack__link { margin-left: auto; font-size: 14px; font-weight: 500; text-decoration: underline dotted 1.5px; text-underline-offset: 4px; }
.wl-stack__link:hover { color: var(--accent-ink); }

/* ─── RESULTS: fanned, tinted cards ──────────────────────────── */

.fan {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 36px;
  padding: 8px 0 12px;
}
.fan__card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  margin-inline: -10px;
  padding: 22px 22px 24px;
  border-radius: 6px;
  color: #F5F5F2;
  rotate: var(--r, 0deg);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
  transition: rotate 450ms var(--spring), translate 450ms var(--spring), z-index 0s;
}
.fan__card:hover { rotate: 0deg; translate: 0 -10px; z-index: 2; }
.fan__card--olive { background: linear-gradient(160deg, #5C6629, #3D4419); }
.fan__card--ink   { background: linear-gradient(160deg, #2C2C2A, #161615); }
.fan__card--sand  { background: linear-gradient(160deg, #A8946A, #7E6C49); }
.fan__card--sage  { background: linear-gradient(160deg, #7F8E5F, #586441); }
.fan__n { position: absolute; top: 14px; right: 18px; font-size: 54px; font-weight: 800; line-height: 1; opacity: 0.16; }
.fan__num { font-size: clamp(34px, 3.4vw, 46px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.fan__card h3 { margin-top: auto; padding-top: 28px; color: #F5F5F2; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.fan__card p { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: rgba(245, 245, 242, 0.78); }

/* ─── BRIEF: label on the left, the story on the right ───────── */

.brief { margin-top: 24px; }
.brief__row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 6px 32px;
  padding: 18px 0;
}
.brief__row dt { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5; color: var(--ink); }
.brief__row dd { max-width: 620px; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }

/* ─── USER FLOW ──────────────────────────────────────────────────
   Every pill is the same height, so the connectors sit exactly on
   the centre line: a 1px line that stops under a small arrowhead,
   with the tip 2px short of the next pill. */

.uflow {
  --h: 34px;      /* pill height */
  --gap: 30px;    /* space between pills in a row */
  --stub: 28px;   /* trunk-to-row connector */
  --wire: var(--ink-3);
  --tip: var(--ink-3);
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  width: max-content;
  padding: clamp(24px, 3vw, 36px);
}
.uflow__root span {
  display: inline-flex;
  align-items: center;
  height: var(--h);
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.uflow__rows {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-left: var(--stub);
  padding-left: var(--stub);
}
/* The trunk runs from the first row's centre to the last row's */
.uflow__rows::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(var(--h) / 2);
  bottom: calc(var(--h) / 2);
  width: 1px;
  background: var(--wire);
}
/* Root to trunk */
.uflow__rows::after {
  content: '';
  position: absolute;
  left: calc(var(--stub) * -1);
  top: 50%;
  width: var(--stub);
  height: 1px;
  background: var(--wire);
}
.uflow__row { position: relative; display: flex; align-items: center; gap: var(--gap); height: var(--h); }
/* Trunk into the row's first pill */
.uflow__row::before {
  content: '';
  position: absolute;
  left: calc(var(--stub) * -1);
  top: calc(var(--h) / 2);
  width: calc(var(--stub) - 4px);
  height: 1px;
  background: var(--wire);
}
.uflow__row::after,
.uflow__pill + .uflow__pill::after {
  content: '';
  position: absolute;
  top: calc(var(--h) / 2 - 4px);
  width: 6px;
  height: 9px;
  background: var(--tip);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.uflow__row::after { left: -8px; }
.uflow__pill {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  height: var(--h);
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 13px;
  white-space: nowrap;
}
/* Pill-to-pill connector: line, then the arrowhead */
.uflow__pill + .uflow__pill::before {
  content: '';
  position: absolute;
  top: calc(var(--h) / 2);
  right: calc(100% + 4px);
  width: calc(var(--gap) - 4px);
  height: 1px;
  background: var(--wire);
}
.uflow__pill + .uflow__pill::after { right: calc(100% + 2px); }
.uflow__pill--head { font-weight: 600; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.uflow__pill--key { box-shadow: 0 0 0 1.5px var(--olive), 0 1px 2px rgba(0, 0, 0, 0.05); }
.uflow__pill--done { background: var(--olive); color: #F5F5F2; box-shadow: none; }
.uflow__pill--alt { background: transparent; box-shadow: none; border: 1px dashed var(--ink-4); color: var(--ink-2); }

/* ─── JOURNEY MAP + EDGE CASES (tables) ──────────────────────── */

.jmap-wrap {
  margin-top: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}
.jmap, .edge { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.45; }
.jmap { min-width: 820px; }
.edge { min-width: 720px; }
.jmap th, .jmap td, .edge th, .edge td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.jmap tr:last-child > *, .edge tr:last-child > * { border-bottom: 0; }
.jmap thead th, .edge thead th {
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.jmap thead th:first-child, .edge thead th:first-child { color: var(--ink-3); font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.jmap tbody th { width: 120px; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.jmap td { color: var(--ink-2); }
.jmap__feel td { text-align: center; font-size: 12px; color: var(--ink-3); }
.jmap__feel span { display: block; font-size: 22px; line-height: 1.2; margin-bottom: 2px; }
.jmap__opp th, .jmap__opp td { background: var(--olive-soft); }
.jmap__opp td { color: var(--ink); font-weight: 500; }
.jmap__opp th { color: var(--accent-ink) !important; }

.edge tbody th { width: 30%; font-weight: 600; font-size: 14px; color: var(--ink); }
.edge td { color: var(--ink-2); }
.risk, .by { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.risk--high { background: rgba(194, 65, 12, 0.12); color: #C2410C; }
.risk--mid  { background: rgba(181, 162, 114, 0.22); color: #7E6C49; }
.risk--low  { background: var(--surface-2); color: var(--ink-2); }
[data-theme="dark"] .risk--high { color: #FB923C; }
[data-theme="dark"] .risk--mid { color: #D8C59A; }
.by { background: var(--olive-soft); color: var(--accent-ink); }

/* ─── FLOW BY FLOW: screens on top, the story underneath ─────── */

.flow { margin-top: clamp(48px, 6vw, 80px); }
.flow__media { min-width: 0; }
.flow__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line);
}
/* Frames take the recordings' own 16:9 shape so nothing is cropped */
.flow__frame:has(video) { aspect-ratio: 16 / 9; }
.flow__frame video { width: 100%; height: 100%; object-fit: contain; display: block; }
.flow__frame.is-empty {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, transparent 0 14px, var(--line) 14px 15px), var(--surface-2);
}
.flow__frame.is-empty span { font-family: var(--mono); font-size: 12px; padding: 6px 12px; border-radius: 4px; background: var(--surface); color: var(--ink-3); }
.flow__caption { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }

/* Recordings are just the video, at 720px, aligned with the text below */
.flow__media:has(> .flow__frame video) .flow__frame { width: 720px; max-width: 100%; }

/* Number and title share a line; the points sit underneath, two across */
.flow__text {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 12px;
  margin-top: 24px;
}
.flow__n { grid-column: 1; font-family: var(--mono); font-size: 13px; color: var(--accent-ink); }
.flow__text h3 { grid-column: 2; font-size: clamp(20px, 2.1vw, 26px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.flow__points {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px clamp(24px, 4vw, 48px);
  margin-top: 16px;
}
.flow__points li { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.flow__points b { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }

/* Flow 05: each point sits beside its own pair of notifications */
.split { margin-top: clamp(48px, 6vw, 80px); }
.split__head h3 { margin-top: 6px; font-size: clamp(20px, 2.1vw, 26px); font-weight: 600; letter-spacing: -0.03em; }
.split__row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: 28px;
}
.split__row--flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
.split__row--flip .split__copy { order: 2; }
.split__copy { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.split__copy b { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }

.toasts { display: flex; flex-direction: column; gap: 14px; }
.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 32px -16px rgba(0, 0, 0, 0.28);
}
.toast:nth-child(even) { margin-left: clamp(0px, 3vw, 28px); }
.toast:nth-child(odd) { margin-right: clamp(0px, 3vw, 28px); }
.reveal.visible .toast { animation: toast-in 650ms var(--spring) both; animation-delay: calc(var(--i) * 180ms + 200ms); }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(0.94); } }
.toast__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; }
.toast__icon svg { width: 18px; height: 18px; fill: none; stroke: #F5F5F2; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.toast__icon--olive { background: #4B5320; }
.toast__icon--sand  { background: #A8946A; }
.toast__icon--sage  { background: #7F8E5F; }
.toast__icon--ink   { background: #2C2C2A; }
.toast strong { display: block; font-size: 14.5px; font-weight: 600; }
.toast small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.toast time { align-self: start; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* A small celebratory burst as each notification lands */
.toast__burst {
  position: absolute;
  top: 18px;
  left: 30px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    0 -22px 0 -1px #B5A272, 18px -14px 0 -1px var(--olive), 24px 4px 0 -1px #C3B091,
    14px 20px 0 -1px #7F8E5F, -12px 20px 0 -1px #B5A272, -22px 2px 0 -1px var(--olive),
    -16px -16px 0 -1px #C3B091;
}
.reveal.visible .toast__burst { animation: burst 900ms var(--ease) both; animation-delay: calc(var(--i) * 180ms + 500ms); }
@keyframes burst {
  0%   { opacity: 0; transform: scale(0.2); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ─── PHONE SCREENS (mobile-app case studies) ────────────────── */

/* A swipeable strip of phones: four in view, the rest a swipe or an arrow away */
.slider--screens { margin-top: 0; }
.slider__track.screens {
  --gap: clamp(10px, 1.4vw, 16px);
  gap: var(--gap);
  margin: 0;
  justify-content: safe center;
  align-items: flex-start;
  scroll-snap-type: x mandatory;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 2.4vw, 28px) calc(clamp(20px, 3vw, 32px) + 20px);
  scroll-padding-inline: clamp(16px, 2.4vw, 28px);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 65%),
    var(--panel, var(--surface-2));
}
.screen {
  flex: 0 0 calc((100% - 3 * var(--gap)) / 4);
  max-width: 230px;
  aspect-ratio: 375 / 812;
  scroll-snap-align: start;
  border-radius: clamp(14px, 1.8vw, 24px);
  overflow: hidden;
  background: #111;
  box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04), 0 22px 40px -22px rgba(0, 0, 0, 0.5);
}
.screen:nth-child(even) { translate: 0 20px; }
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; pointer-events: none; }

/* Blank frames waiting for a screen */
.screen--empty, .web--empty {
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  background: repeating-linear-gradient(135deg, transparent 0 12px, var(--line) 12px 13px), var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.screen--empty span, .web--empty span {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  padding: 5px 9px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-3);
}

/* A wide web screenshot instead of phones */
/* The image keeps its own shape, so no width or height is needed in the HTML */
.flow__frame--shot { aspect-ratio: auto; }
.flow__frame--shot img { width: 100%; height: auto; display: block; }
.webs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.web { aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line); }
/* Any screenshot fills its thumbnail from the top, whatever its size */
.web img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* ─── BIG-TITLE CARDS (learnings) ────────────────────────────── */

.bigcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.bigcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 24px;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 400ms var(--spring), box-shadow 300ms var(--ease);
}
.bigcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.bigcard--sage { background: var(--tint-sage); }
.bigcard--sand { background: var(--tint-sand); }
.bigcard--olive { background: var(--tint-olive); }
.bigcard h3 { font-size: clamp(21px, 2vw, 26px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; max-width: 15ch; }
.bigcard p:last-child { margin-top: auto; padding-top: 22px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

/* ─── SLIDER: scrolls sideways when content is wider than the page ── */

.slider { position: relative; margin-top: 32px; }
.slider__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 4px 12px;
  margin: -4px;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__track:focus-visible { outline-offset: 2px; }
.slider__track > .uflow { border-radius: var(--radius-lg); background: var(--surface-2); }
.slider:not(.can-scroll) .slider__btn { display: none; }
.slider__btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  translate: 0 -50%;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transition: opacity 200ms var(--ease), scale 300ms var(--spring);
}
.slider__btn[data-dir="-1"] { left: -16px; }
.slider__btn[data-dir="1"] { right: -16px; }
.slider__btn:hover { scale: 1.08; }
.slider__btn:disabled { opacity: 0; pointer-events: none; }
.slider__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── MORE WORK ──────────────────────────────────────────────── */

.wl-more { padding-bottom: clamp(64px, 8vw, 104px); }
.wl-more__title { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.wl-more .cases { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .wl { grid-template-columns: minmax(0, 1fr); }
  .wl-nav { display: none; }
  .wl-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .who { grid-template-columns: minmax(0, 1fr); }
  .notes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slider--flow .slider__btn { display: none; }
}

/* Tablets: the same fanned deck, overlapped to fit. Tap a card to bring it forward. */
@media (min-width: 641px) and (max-width: 1100px) {
  .fan { --w: 46%; display: flex; align-items: center; padding: 20px 0 28px; }
  .fan__card {
    flex: 0 0 var(--w);
    min-height: 320px;
    margin-inline: 0;
    z-index: var(--z);
    cursor: pointer;
  }
  .fan__card:not(:first-child) { margin-left: calc((100% - 4 * var(--w)) / 3); }
  .fan__card:nth-child(1) { --z: 1; }
  .fan__card:nth-child(2) { --z: 4; }
  .fan__card:nth-child(3) { --z: 3; }
  .fan__card:nth-child(4) { --z: 2; }
  .fan__card:hover { rotate: var(--r, 0deg); translate: none; z-index: var(--z); }
  .fan__card.is-front { rotate: 0deg; translate: 0 -8px; z-index: 10; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6); }
}

@media (max-width: 860px) {
  /* Side by side and swipeable, with the next card peeking in */
  .bigcards {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .bigcards::-webkit-scrollbar { display: none; }
  .bigcard { flex: 0 0 clamp(260px, 46%, 340px); min-height: 220px; scroll-snap-align: start; }
  .bigcards .reveal { opacity: 1; transform: none; }
  .split__row, .split__row--flip { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .split__row--flip .split__copy { order: 0; }
  .flow__text { margin-top: 20px; }
  .screen { flex-basis: clamp(130px, 30%, 210px); }
}

@media (max-width: 640px) {
  .wl-meta { grid-template-columns: minmax(0, 1fr); }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job__line { font-size: 24px; }
  .wl-meta > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .wl-meta > div:last-child { border-bottom: 0; }
  .wl-stack__link { margin-left: 0; width: 100%; }
  .fan {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .fan::-webkit-scrollbar { display: none; }
  .fan__card { flex: 0 0 80%; min-height: 260px; margin-inline: 0; rotate: 0deg; translate: none; scroll-snap-align: start; box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.45); }
  .fan .reveal { opacity: 1; transform: none; }
  .bigcard { flex-basis: 80%; }
  .brief__row { grid-template-columns: minmax(0, 1fr); padding: 14px 0; }
  .flow__points { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 12px; }
  .brief__row dd { font-size: 15px; }
  .slider__btn[data-dir="-1"] { left: -10px; }
  .slider__btn[data-dir="1"] { right: -10px; }
  .toast:nth-child(n) { margin-inline: 0; }
  .toast time { display: none; }
  .slider__track.screens { margin-inline: calc(var(--gutter) * -1); border-radius: 0; box-shadow: none; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .screen { flex-basis: 44%; }
  .webs { grid-template-columns: 1fr 1fr; }
  .web:last-child { grid-column: span 2; aspect-ratio: 32 / 10; }
  .wl-more .cases { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* Folded phones (Galaxy Z Fold cover screen and similar) */
@media (max-width: 360px) {
  .wl-title { font-size: 32px; }
  .fan__card, .bigcard { padding: 18px; flex-basis: 86%; }
  .toast { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px; }
  .toast__icon { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.visible .toast, .reveal.visible .toast__burst { animation: none; }
}


/* ─── CASE STUDY v2: tags, who it's for, the job, survey notes ── */

/* Colourful pill tags above the title */
.wl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.wl-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1A1A1A;
  background: var(--t, #E8E6DF);
}
.wl-tag--pink   { --t: #F9C9DA; }
.wl-tag--yellow { --t: #FFE58A; }
.wl-tag--mint   { --t: #C9EBDD; }
.wl-tag--lilac  { --t: #DAD3FF; }
.wl-tag--sky    { --t: #C4E6FB; }
.wl-tag--peach  { --t: #FFD6C4; }

/* One calm panel colour behind every strip of screens */
:root { --panel: #CDEDE0; }
[data-theme="dark"] { --panel: #1F3A31; }
[data-theme="dark"] .slider__track.screens { background: var(--panel); }

/* What the research said: a row of handwritten-style notes */
.notes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.note {
  padding: 16px 16px 20px;
  border-radius: 4px;
  background: #FFF8E6;
  color: #2A2418;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 14px 26px -18px rgba(0, 0, 0, 0.35);
  rotate: var(--r, 0deg);
  transition: rotate 300ms var(--spring), translate 300ms var(--spring);
}
.note:nth-child(5n+1) { --r: -1.5deg; }
.note:nth-child(5n+2) { --r: 1deg; }
.note:nth-child(5n+3) { --r: -0.5deg; }
.note:nth-child(5n+4) { --r: 1.5deg; }
.note:nth-child(5n+5) { --r: -1deg; }
.note:hover { rotate: 0deg; translate: 0 -4px; }
.note b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: #E0457B; }
.note p { margin-top: 6px; font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.25; }
.notes__src { margin-top: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* Who it's for: two people, each with what they want and what gets in the way */
.who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.who__card { border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line); }
.who__head { padding: 18px 20px; background: var(--h, #F9C9DA); color: #1A1A1A; }
.who__head .who__name, .who__head .who__meta { color: #1A1A1A; }
.who__card:nth-child(2) .who__head { --h: #FFE58A; }
.who__meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.who__name { margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.who__body { padding: 18px 20px 22px; }
.who__line { font-size: 15.5px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.who__label { margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.who__list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.who__list li { position: relative; padding-left: 16px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.who__list li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }

/* "So the job was clear": the line everything after it answers to */
.job { margin-top: 28px; padding: clamp(22px, 3vw, 32px); border-radius: 16px; background: var(--olive); color: #F5F5F2; }
.job__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #DDF0B0; }
.job__line { color: #F5F5F2; margin-top: 10px; max-width: 24ch; font-size: clamp(24px, 2.8vw, 34px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; }
.job p:last-child { margin-top: 14px; max-width: 640px; font-size: 15px; line-height: 1.6; color: rgba(245, 245, 242, 0.82); }
[data-theme="dark"] .job { background: #2B301A; }

/* v2 pieces on smaller screens (kept after the base rules so they win) */
@media (max-width: 1100px) {
  .notes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .who { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .note p { font-size: 17px; }
  .job__line { font-size: 24px; }
  .slider__track.screens { border-radius: 0; }
}


/* ─── WHAT SHIPPED: static screens in device frames ─────────── */

.ship { margin-top: 28px; }
.slider__track.ship__track {
  gap: clamp(16px, 2vw, 28px);
  align-items: flex-end;
  margin: 0;
  padding: clamp(24px, 3vw, 40px);
  border-radius: 22px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.5), transparent 65%), var(--panel);
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(24px, 3vw, 40px);
}
[data-theme="dark"] .slider__track.ship__track { background: var(--panel); }
.ship__item { flex: none; scroll-snap-align: start; }
.ship__item figcaption { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

/* A phone: dark bezel, rounded screen, a little island on top */
.ship__item--phone { width: clamp(180px, 17vw, 230px); }
.phone {
  position: relative;
  aspect-ratio: 375 / 812;
  padding: 8px;
  border-radius: 34px;
  background: #0D0D0F;
  box-shadow: inset 0 0 0 1.5px #2C2C31, 0 1px 0 1px rgba(0, 0, 0, 0.04), 0 26px 44px -24px rgba(0, 0, 0, 0.55);
}
.phone::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  z-index: 1;
  width: 30%;
  height: 16px;
  translate: -50% 0;
  border-radius: 10px;
  background: #0D0D0F;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 27px; display: block; }

/* A browser window for the websites */
.ship__item--web { width: min(760px, 78vw); }
.browser { overflow: hidden; border-radius: 12px; background: #FFFFFF; box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04), 0 26px 44px -24px rgba(0, 0, 0, 0.45); }
.browser__bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #EEECE6; }
.browser__bar i { width: 9px; height: 9px; border-radius: 50%; background: #FF5F57; }
.browser__bar i:nth-child(2) { background: #FEBC2E; }
.browser__bar i:nth-child(3) { background: #28C840; }
.browser img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; display: block; }
.ship__hint { margin-top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ─── IMPACT: big numbers on a dark panel ────────────────────── */

.impact { margin-top: 28px; padding: clamp(24px, 4vw, 48px); border-radius: 22px; background: #151513; color: #F5F5F2; }
[data-theme="dark"] .impact { background: #1C1C1F; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.impact__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.impact__stats strong { display: block; font-size: clamp(44px, 6vw, 84px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.95; color: #DDF0B0; }
.impact__stats span { display: block; margin-top: 10px; max-width: 24ch; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.5; color: rgba(245, 245, 242, 0.7); }
.impact__src { margin-top: 24px; font-size: 13.5px; color: rgba(245, 245, 242, 0.6); }
.impact__more { margin-top: clamp(28px, 4vw, 44px); padding-top: clamp(24px, 3vw, 32px); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.impact__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #FFE58A; }
.impact__quote { margin-top: 10px; max-width: 20ch; font-size: clamp(28px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; color: #F5F5F2; }
.impact__more p:last-child { margin-top: 14px; max-width: 640px; font-size: 15px; line-height: 1.6; color: rgba(245, 245, 242, 0.78); }
.impact__note { margin-top: 18px; font-size: 13px; color: rgba(245, 245, 242, 0.55); }
.wl-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.wl-link:hover { text-decoration-color: var(--ink); }

@media (max-width: 640px) {
  .slider__track.ship__track { margin-inline: calc(var(--gutter) * -1); border-radius: 0; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .ship__item--phone { width: 44vw; }
  .phone { border-radius: 26px; padding: 6px; }
  .phone img { border-radius: 21px; }
  .phone::before { top: 11px; height: 12px; }
  .ship__item--web { width: 80vw; }
  .impact__stats { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
