/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 18px 18px;
  background-attachment: fixed;
  color: var(--text);
  font: 400 17px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
/* Headings, subheadings and stats: Clash Display semi-bold (it is already tight, so no negative tracking) */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 2px; }

mark.todo { background: var(--todo); color: inherit; padding: 0 0.15em; border-radius: 3px; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 8px 16px; background: var(--text); color: var(--bg); z-index: 100; }
.skip-link:focus { top: 16px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.mono, .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.label { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.label .icon { width: 16px; height: 16px; }
.icon { width: 1em; height: 1em; flex: none; }
.dot { margin-inline: 6px; color: var(--faint); }
/* Headline keywords: same font as the heading, picked out in colour only */
.accent { font-style: normal; display: inline-block; transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1); }
.accent:hover { transform: rotate(-4deg) scale(1.06); }   /* Mimmo's keyword tilt */
@media (prefers-reduced-motion: reduce) { .accent { transition: none; } .accent:hover { transform: none; } }
em, i { font-style: normal; font-weight: 600; }
strong, b { font-weight: 600; }
.accent--1 { color: var(--accent-1); }
.accent--2 { color: var(--accent-2); }
.accent--3 { color: var(--accent-3); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent; transition: border-color 300ms;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { max-width: 1024px; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-inline: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.brand__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-strong); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); filter: grayscale(1); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; align-items: center; gap: 28px; }
.nav__link { font-size: 15px; line-height: 24px; color: var(--muted); transition: color 200ms; }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text); }

/* Theme switch: pill with a sliding thumb behind the active icon */
.theme-toggle {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  width: 48px; height: 24px; padding: 0 2px; flex: none;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); border-radius: 999px;
  background: var(--panel-strong); cursor: pointer;
}
.theme-toggle__thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transform: translateX(24px); transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle__icon { position: relative; width: 18px; height: 18px; padding: 3px; color: var(--muted); transition: color 300ms; }
.theme-toggle__icon--sun { color: var(--bg); }
:root[data-theme="dark"] .theme-toggle__thumb { transform: translateX(0); }
:root[data-theme="dark"] .theme-toggle__icon--moon { color: var(--bg); }
:root[data-theme="dark"] .theme-toggle__icon--sun { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__thumb { transform: translateX(0); }
  :root:not([data-theme="light"]) .theme-toggle__icon--moon { color: var(--bg); }
  :root:not([data-theme="light"]) .theme-toggle__icon--sun { color: var(--muted); }
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .theme-toggle__thumb { transition: none; } }
.brand, .nav__link { white-space: nowrap; }

/* Mobile header: hamburger + full-width menu (Mimmo pattern) */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 32px; height: 32px; padding: 6px 5px; background: none; border: 0; cursor: pointer; }
.nav-toggle__bar { display: block; width: 100%; height: 1.5px; background: var(--text); transition: transform 200ms, opacity 200ms; }
.site-header.nav-open .nav-toggle__bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-header.nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-mobile { display: none; flex-direction: column; padding: 8px var(--gutter) 20px; background: var(--bg); }
.site-header.nav-open { background: var(--bg); }
.site-header.nav-open .nav-mobile { display: flex; }
.nav-mobile__item { padding: 8px 0; font-size: 20px; font-weight: 500; letter-spacing: -0.015em; color: var(--text); transition: color 150ms; }
.nav-mobile__item:hover { color: var(--muted); }
@media (max-width: 767px) {
  .nav__list { display: none; }
  .nav-toggle { display: flex; }
  .nav { gap: 20px; }
  .site-header__inner { padding-inline: var(--gutter); }
}
@media (min-width: 768px) { .nav-mobile { display: none !important; } }

/* ==========================================================================
   Shared components
   ========================================================================== */

.panel { padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel__big { font-size: 18px; line-height: 1.7; }
/* Colour lives on icons only; label text stays muted */
.panel--problem .label .icon { color: var(--orange); }
.label--good .icon { color: var(--green); }

.button { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border: 0; border-radius: var(--radius); background: var(--panel-strong); color: var(--text); font: 500 15px var(--font-sans); cursor: pointer; transition: transform 150ms var(--ease), filter 150ms; }
.button:hover { transform: translateY(-1px); filter: brightness(0.97); }
.button--primary { background: var(--primary-fill); color: var(--on-primary); }

.stats { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.stat__value { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
/* Stats cycle through the palette: primary, blue, green */
.stat:nth-child(3n+1) .stat__value { color: var(--accent-1); }
.stat:nth-child(3n+2) .stat__value { color: var(--accent-2); }
.stat:nth-child(3n) .stat__value { color: var(--accent-3); }
.stat__label { margin-top: 4px; font-size: 14px; line-height: 1.35; color: var(--muted); max-width: 22ch; }
.stats--panel { padding: 28px 32px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stats--panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px 32px; }
.stats--panel .stat__label { max-width: 26ch; }

.section-title { display: flex; align-items: center; gap: 12px; font-size: 28px; line-height: 1.15; letter-spacing: 0; margin-bottom: 32px; }
.section-title .icon { width: 24px; height: 24px; color: var(--muted); }
.block { padding-block: 64px; }

/* ==========================================================================
   Homepage
   ========================================================================== */

.hero { display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: center; padding-block: 96px 64px; }
.hero__loc { display: flex; align-items: center; gap: 6px; }
.hero__loc .icon { width: 14px; height: 14px; color: var(--primary); }
.hero__title { margin-top: 20px; font-size: clamp(36px, 5vw, 50px); line-height: 1.1; letter-spacing: 0; }
.hero__title .accent { white-space: nowrap; }
.hero__title .accent:nth-of-type(1) { color: var(--accent-1); }
.hero__title .accent:nth-of-type(2) { color: var(--accent-2); }
.hero__title .accent:nth-of-type(3) { color: var(--accent-1); }
.hero__lede { margin-top: 24px; max-width: 46ch; font-size: 20px; line-height: 1.55; color: var(--muted); }
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.now-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.05); }
.status { display: flex; align-items: center; gap: 8px; color: var(--text); }
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: status-pulse 2s ease-out infinite; }
@keyframes status-pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .status__dot::after { animation: none; } }
.now-card ul { display: grid; gap: 12px; font-size: 15px; color: var(--muted); }
.now-card li { padding-left: 14px; position: relative; }
.now-card li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: 56px; } }

.work-list { display: grid; gap: 48px; }
.work-card { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: background 300ms; }
.work-card:hover { background: var(--panel-strong); }
.work-card--flip { grid-template-columns: 1fr 1.25fr; }
.work-card--flip .work-card__media { order: 2; }
.work-card__media { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 2px; background: var(--panel); }
.work-card__media > img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 700ms var(--ease); }
.work-card:hover .work-card__media > img { transform: scale(1.03); }
.work-card__body { display: flex; flex-direction: column; gap: 12px; padding: 20px 14px 20px 4px; }
.work-card--flip .work-card__body { padding: 20px 4px 20px 14px; }
.work-card__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.work-card__title { font-size: 20px; line-height: 1.3; letter-spacing: 0; transition: color 200ms var(--ease); }
.work-card__meta > span:last-child { flex: none; white-space: nowrap; }
.work-card:hover .work-card__title, .work-card:focus-visible .work-card__title { color: var(--primary); }
.work-card__summary { color: var(--muted); font-size: 16px; line-height: 1.55; }
.stats--card { margin-top: auto; padding-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stats--card .stat__value { font-size: 24px; }
.stats--card .stat__label { font-size: 14px; }
@media (max-width: 820px) {
  .work-card, .work-card--flip { grid-template-columns: 1fr; }
  .work-card--flip .work-card__media { order: 0; }
  .work-card__body, .work-card--flip .work-card__body { padding: 8px 10px 16px; }
}

.phone-strip { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; gap: 3%; padding: 6%; background: var(--panel-strong); }
.phone-strip img { height: 100%; width: auto; aspect-ratio: 375 / 812; object-fit: cover; object-position: top; border-radius: 10px; box-shadow: 0 10px 28px rgb(0 0 0 / 0.14); }

.logo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.logo-grid li { display: grid; place-items: center; height: 120px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--muted); text-align: center; padding: 12px; }
.logo-grid svg { height: 30px; width: auto; max-width: 70%; color: var(--text); opacity: 0.72; transition: opacity 200ms; }
.logo-grid li:hover svg { opacity: 1; }
.logo-grid svg[aria-label="Experian"] { height: 46px; }
.logo-grid svg[aria-label="UCL"] { height: 32px; }
@media (max-width: 640px) { .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .logo-grid svg[aria-label="UCL"] { height: 24px; } .logo-grid li { height: 88px; } .logo-grid svg { height: 20px; } .logo-grid svg[aria-label="Experian"] { height: 32px; } }

.rows { display: grid; gap: 8px; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.rows li div { display: grid; gap: 2px; }
.rows li span { color: var(--muted); }

.contact__panel .hero__actions { margin-top: 24px; }

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

.case { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); column-gap: 64px; padding-top: 32px; padding-bottom: 96px; }
.chapters { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; padding-top: 4px; }
.chapters__title { margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.chapters ol { display: grid; gap: 2px; }
.chapters ol a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid transparent; font-size: 14px; color: var(--muted); transition: color 200ms, border-color 200ms; }
.chapters ol a:hover { color: var(--text); }
.chapters ol a.is-active { color: var(--text); border-left-color: var(--accent-1); }
.chapters__back { display: inline-block; margin-top: 40px; font-size: 13px; color: var(--muted); }
/* Mobile chapter bar + dropdown (shown ≤860px) */
.toc-bar {
  display: none; position: sticky; top: var(--header-h); z-index: 30;
  align-items: center; justify-content: space-between;
  margin: 0 calc(var(--gutter) * -1) 24px; padding: 12px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: transparent; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.toc-bar__label { font-size: 14px; color: var(--muted); }
.toc-bar__toggle {
  display: inline-flex; align-items: center; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--radius); background: var(--panel-strong); color: var(--text);
  font: 500 12px/1 var(--font-sans, inherit); cursor: pointer; white-space: nowrap;
  transition: background 200ms, transform 200ms;
}
.toc-bar__toggle:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
.toc-bar__toggle:active { transform: scale(0.97); }
.toc-menu {
  display: none; position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 39;
  padding: 12px var(--gutter) 16px; background: var(--bg);
  border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgb(0 0 0 / 0.06);
}
.toc-menu ol { display: grid; }
.toc-menu a {
  display: block; padding: 4px 0 4px 12px; font-size: 14px; line-height: 1.4; color: var(--muted);
  border-left: 2px solid transparent; transition: color 150ms, border-color 150ms;
}
.toc-menu a:hover, .toc-menu a.is-active { color: var(--text); border-left-color: var(--accent-1); }

.case__main { min-width: 0; }
.back { font-size: 15px; color: var(--muted); }
.back:hover { color: var(--text); }
.case__tags { margin-top: 24px; font-size: 17px; color: var(--muted); }
.case__title { margin-top: 12px; font-size: 40px; line-height: 1.1; letter-spacing: 0; }
.case__sub { margin-top: 16px; font-size: 16px; color: var(--muted); line-height: 1.5; }
.case__meta { margin-top: 12px; font-size: 14px; color: var(--muted); }
.case__hero { margin-top: 40px; aspect-ratio: 16 / 10; overflow: hidden; padding: 0; }
.case__hero > img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.chapter { padding-top: 88px; }
.chapter__kicker { font-size: 14px; font-weight: 400; color: var(--muted); }
.chapter__title { display: flex; align-items: center; gap: 12px; margin-top: 6px; margin-bottom: 20px; font-size: 28px; line-height: 1.2; letter-spacing: 0; }
.chapter__title .icon { width: 22px; height: 22px; color: var(--accent-1); }

.prose { display: grid; gap: 20px; font-size: 17px; line-height: 1.7; }
.prose > p { max-width: 70ch; }
.prose em, .prose strong { font-weight: 600; color: var(--text); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.sub { display: flex; gap: 12px; align-items: baseline; margin-top: 28px; font: 500 13px/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.sub span { color: var(--faint); }
.lead { font-size: 20px; }
.bullets { display: grid; gap: 10px; padding-left: 20px; list-style: disc; }
.bullets li::marker { color: var(--faint); }
.quote { margin: 0; padding-left: 20px; border-left: 2px solid var(--accent-1); font-size: 26px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }

.outcomes { display: grid; }
.outcomes li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.outcomes li:last-child { border-bottom: 0; padding-bottom: 0; }
.outcomes li:first-child { padding-top: 0; }
.outcomes__icon { flex: none; color: var(--muted); }

.cards { display: grid; gap: 12px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card h4 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.card p { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
@media (max-width: 640px) { .cards--2, .cards--3 { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th { text-align: left; font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
th, td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 500; }

/* Figures */
.shot { margin: 12px 0; }
.shot > figcaption { margin-top: 12px; text-align: center; font-size: 14px; color: var(--muted); }
.shot__panel { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery { display: grid; gap: 16px; }
.gallery figure { margin: 0; }
.gallery img, .gallery video { width: 100%; border-radius: 3px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06); }
.gallery figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.gallery--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery--three, .gallery--squares { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery--phones { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.gallery--phones img { aspect-ratio: 375 / 812; object-fit: cover; object-position: top; border-radius: 10px; }
@media (max-width: 640px) {
  .gallery--two, .gallery--three { grid-template-columns: 1fr; }
  .gallery--phones, .gallery--squares { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot__panel { padding: 14px; }
}

/* Before / after */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.compare__side { margin: 0; display: grid; gap: 10px; }
.compare__tag { justify-self: start; padding: 3px 10px; border-radius: 999px; font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.compare__tag--before { background: var(--orange-fill); color: #fff; }
.compare__tag--after { background: var(--green-fill); color: var(--on-green); }
.compare__img img { width: 100%; border-radius: 3px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.08); }
.compare__img--phone { max-width: 220px; justify-self: center; width: 100%; }
.compare__img--phone img { aspect-ratio: 375 / 812; object-fit: cover; object-position: top; border-radius: 12px; }
.compare__side figcaption { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .compare { grid-template-columns: 1fr; } }

/* Desktop + mobile */
.devices { display: flex; align-items: flex-end; gap: 20px; }
.device__desktop { flex: 1 1 auto; min-width: 0; }
.device__desktop img { width: 100%; border-radius: 6px; border: 6px solid var(--text); border-bottom-width: 14px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.12); }
.device__phones { display: flex; gap: 12px; flex: none; }
.device__phone { width: 150px; }
.device__phone img { aspect-ratio: 375 / 812; object-fit: cover; object-position: top; border: 5px solid var(--text); border-radius: 18px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.14); }
@media (max-width: 640px) { .devices { flex-direction: column; align-items: stretch; } .device__phones { justify-content: center; } .device__phone { width: 42%; } }

/* User flows */
.flows { display: grid; gap: 24px; }
.flow .label { margin-bottom: 10px; }
.flow .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.flow--before .label::before { background: var(--orange); }
.flow--after .label::before { background: var(--green); }
.flow__track { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow__node { display: inline-grid; gap: 2px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-weight: 500; line-height: 1.3; }
.flow__node small { font-size: 12px; font-weight: 400; color: var(--muted); }
.flow__node--small { padding: 6px 10px; font-size: 13px; }
.flow--before .flow__node--hl { border-color: var(--before); background: color-mix(in srgb, var(--before) 10%, var(--surface)); }
.flow--after .flow__node--hl { border-color: var(--after); background: color-mix(in srgb, var(--after) 10%, var(--surface)); }
.flow__branch { display: inline-grid; gap: 6px; }
.flow__arrow { color: var(--faint); font-size: 14px; }

/* Layered diagram */
.stack { display: grid; gap: 16px; }
.stack__row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; align-items: center; }
.stack__label { font: 500 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stack__boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stack__box { display: grid; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.stack__box .label { margin: 0 0 4px; font-size: 10px; }
.stack__box strong { font-size: 16px; font-weight: 600; }
.stack__box small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.stack__box--me { border-color: var(--accent-1); }
@media (max-width: 560px) { .stack__row { grid-template-columns: 1fr; gap: 8px; } }

/* Recreated mobile mock */
.mock-pair { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }
.mock-phone { width: 240px; aspect-ratio: 375 / 760; overflow: hidden; background: #e7e4dc; color: #1b1b1b; border: 6px solid #111; border-radius: 26px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.15); font-size: 11px; line-height: 1.45; }
.mock-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 10px; background: #1f3b57; color: #fff; font-size: 11px; }
.mock-body { padding: 12px; display: grid; gap: 8px; }
.mock-crumb { font: 500 9px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: #6a6a6a; }
.mock-h { font-family: Georgia, serif; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.mock-btns { display: flex; gap: 6px; }
.mock-btn { padding: 5px 8px; border-radius: 4px; background: #d6d2c8; font-size: 10px; }
.mock-btn--dark { background: #1b1b1b; color: #fff; }
.mock-p { color: #444; }
.mock-label { margin-top: 4px; font-weight: 600; }
.mock-chip { justify-self: start; padding: 4px 8px; border: 1px solid #c9c4b8; border-radius: 4px; background: #f1eee7; }
.mock-cards { display: flex; gap: 8px; overflow: hidden; }
.mock-card { flex: 0 0 72%; display: grid; gap: 4px; padding: 6px; background: #fff; border-radius: 6px; }
.mock-card i { display: block; height: 54px; border-radius: 4px; background: linear-gradient(135deg, #3b6fb6, #7aa7e0); }
.mock-card small { color: #777; font-size: 9px; }
.mock-progress { height: 4px; border-radius: 4px; background: #d6d2c8; overflow: hidden; }
.mock-progress i { display: block; height: 100%; background: #1f3b57; }
.mock-list { display: grid; gap: 6px; }
.mock-list li { padding: 8px; background: #f1eee7; border-radius: 4px; }
.mock-list li::before { content: "○ "; }
.mock-list li.done::before { content: "● "; color: #1f3b57; }

/* Pager */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 96px; }
.pager a { display: grid; gap: 8px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: background 200ms; }
.pager a:hover { background: var(--panel-strong); }
.pager .label { margin: 0; }
.pager strong { font-weight: 500; font-size: 17px; line-height: 1.35; }
.pager__next { text-align: right; }
.pager__next .label { justify-content: flex-end; }

@media (max-width: 860px) {
  html { scroll-padding-top: calc(var(--header-h) * 2 + 16px); }
  .case { grid-template-columns: 1fr; padding-top: 0; }
  .chapters { display: none; }
  .toc-bar { display: flex; }
  .toc-menu.is-open { display: block; }
  .case__title { font-size: 32px; }
  .pager { grid-template-columns: 1fr; }
}

/* ==========================================================================
   About, footer, motion
   ========================================================================== */

/* About page: Mimmo-style contents rail + portrait intro */
.about { padding-top: 72px; }
.about__intro { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 40px; align-items: end; }
.about__kicker { font-size: 14px; color: var(--muted); }
.about__name { margin-top: 28px; font-size: 48px; font-weight: 600; line-height: 1.15; letter-spacing: 0; }
.about__role { margin-top: 12px; font-size: 15px; color: var(--muted); }
.about__lead { margin-top: 24px; font-size: 20px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.about__portrait { width: 200px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--panel-strong); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); filter: grayscale(1); }
.about__section { padding-top: 72px; }
.about__h2 { margin-bottom: 20px; font-size: 28px; font-weight: 600; letter-spacing: 0; }
.jobs { display: grid; gap: 8px; }
.job { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.job__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.job__head div { display: grid; gap: 2px; }
.job__head div span { color: var(--muted); }
.job__head .mono { flex: none; font-size: 13px; color: var(--muted); }
.job p { margin-top: 12px; font-size: 16px; color: var(--muted); }
.job p strong { color: var(--text); }
@media (max-width: 640px) { .job__head { flex-direction: column; gap: 6px; } }
.skill-list, .now-list { display: grid; gap: 10px; }
.skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill-list li, .now-list li { padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 860px) { .about { padding-top: 0; } }
@media (max-width: 640px) {
  .about__intro { grid-template-columns: 1fr; gap: 28px; }
  .about__portrait { order: -1; width: 112px; }
  .about__name { margin-top: 16px; font-size: 36px; }
  .skill-list { grid-template-columns: 1fr; }
}
.portrait { aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--panel-strong); }

.site-footer { padding-block: 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Copy-email confirmation toast */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 100;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 14px 24px 14px 20px; border-radius: 8px;
  background: color-mix(in srgb, var(--green-fill) 16%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.12);
  color: var(--text); font-size: 17px; line-height: 1.4;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 250ms, transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast__icon { flex: none; width: 20px; height: 20px; color: var(--green); }
.toast__text { overflow-wrap: anywhere; }
@media (max-width: 640px) { .toast { bottom: 20px; font-size: 15px; padding: 12px 18px 12px 16px; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity 150ms; transform: translate(-50%, 0); } }

/* Device mockup (Mimmo-style): desktop window + overlapping phone / side panel */
.mockup { position: relative; width: 100%; height: 100%; background: var(--panel-strong); overflow: hidden; }
.mockup img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mockup__desktop {
  position: absolute; left: 6%; top: 13%; width: 70%; aspect-ratio: 16 / 10.6;
  display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; background: #fff;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 18px 48px rgb(0 0 0 / 0.16);
  transition: transform 700ms var(--ease);
}
.mockup__bar { flex: none; display: flex; gap: 5px; align-items: center; height: 18px; padding: 0 9px; background: #f1f1ef; border-bottom: 1px solid rgb(0 0 0 / 0.06); }
.mockup__bar i { width: 6px; height: 6px; border-radius: 50%; background: #d4d4d0; }
.mockup__desktop img { flex: 1; min-height: 0; }
.mockup__mobile {
  position: absolute; right: 7%; top: 15%; width: 20%; aspect-ratio: 9 / 19.5;
  border: 4px solid #111112; border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 0 22px 50px rgb(0 0 0 / 0.24); transition: transform 700ms var(--ease);
}
.mockup__mobile--panel { border: 1px solid rgb(0 0 0 / 0.08); border-radius: 10px; width: 19%; aspect-ratio: 9 / 21; }
.mockup--phones { display: flex; justify-content: center; align-items: center; gap: 4%; }
.mockup__phone {
  width: 23%; aspect-ratio: 9 / 19.5; border: 4px solid #111112; border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.2); transition: transform 700ms var(--ease);
}
.mockup__phone:nth-child(2) { transform: translateY(-6%); }
.work-card:hover .mockup__desktop { transform: translateY(-2%); }
.work-card:hover .mockup__mobile { transform: translateY(-4%); }
.work-card:hover .mockup__phone:nth-child(2) { transform: translateY(-9%); }
.case__hero .mockup__mobile { border-width: 5px; border-radius: 26px; }
@media (max-width: 640px) {
  .mockup__mobile, .mockup__phone { border-width: 3px; border-radius: 12px; }
  .mockup__bar { height: 12px; padding: 0 6px; } .mockup__bar i { width: 4px; height: 4px; }
}
@media (prefers-reduced-motion: reduce) { .mockup__desktop, .mockup__mobile, .mockup__phone { transition: none; } }

.case__hero:has(.mockup) { padding: 0; }
.case__hero .mockup { background: transparent; }

/* Journey map */
.jm-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.jm { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(100px, 1fr)); gap: 6px; min-width: calc(64px + var(--cols) * 106px); }
.shot__panel:has(.jm-wrap) { padding: 16px; }
.jm__persona { margin-bottom: 18px; font-size: 15px; color: var(--muted); }
.jm__persona b { color: var(--text); font-weight: 600; }
.jm__label { align-self: start; padding-top: 10px; font: 400 11px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.jm__stage { display: grid; gap: 4px; padding: 10px 12px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; line-height: 1.25; }
.jm__stage span { font: 400 11px var(--font-mono); opacity: 0.6; }
.jm__cell { padding: 9px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.45; }
.jm__cell--quote { font-style: normal; color: var(--muted); }
.jm__cell--quote::before { content: "“"; } .jm__cell--quote::after { content: "”"; }
.jm__cell--pain { border-left: 3px solid var(--orange); }
.jm__cell--opp { border-left: 3px solid var(--green); }
.jm__feel { position: relative; height: 84px; padding: 10px 0; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); }
.jm__curve { width: 100%; height: 100%; overflow: visible; }
.jm__curve polyline { fill: none; stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.jm__axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.jm__dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; border: 2px solid var(--surface); }
.jm__curve { position: absolute; inset: 10px 0; width: 100%; height: calc(100% - 20px); }
.jm__dot--pos { background: var(--green); } .jm__dot--neg { background: var(--orange); } .jm__dot--mid { background: var(--faint); }

/* Swimlane user flow */
.lanes { display: grid; gap: 0; }
.lane { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px dashed var(--line); }
.lane:first-child { border-top: 0; padding-top: 0; }
.lane__label { font: 400 11px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.flow__node--decision { border-style: dashed; border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.flow__node--terminal { border-radius: 999px; background: var(--text); color: var(--bg); border-color: var(--text); }
@media (max-width: 640px) { .lane { grid-template-columns: 1fr; gap: 8px; } }

/* Step sequence (phones) */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.steps__phone { border: 3px solid #111112; border-radius: 16px; overflow: hidden; background: #fff; aspect-ratio: 375 / 812; box-shadow: 0 10px 26px rgb(0 0 0 / 0.12); }
.steps__phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.steps__title { display: flex; gap: 8px; align-items: baseline; margin-top: 12px; font-size: 14px; font-weight: 600; }
.steps__title span { font: 400 11px var(--font-mono); color: var(--muted); }
.steps__note { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* Let wide content (journey maps, step rows) scroll inside their panel, not the page */
.prose > *, .shot, .shot__panel { min-width: 0; }

/* 404 */
.notfound { padding-block: 120px 160px; }
.notfound__title { margin-top: 16px; font-size: clamp(36px, 5vw, 50px); }
.notfound__text { margin-top: 16px; font-size: 18px; color: var(--muted); }
.notfound .hero__actions { margin-top: 32px; }
