/* Ibrahim Gouali — portfolio, "dock" version.
   Single screen: hero + dock; each dock icon opens a case panel behind a wave. */

:root {
  --page-bg: #ececeb;
  --page-fg: #161616;
  --page-top-glow: rgba(255, 255, 255, 0.72);
  --glass-light: #ffffff;
  --glass-dark: #000000;
  --glass-tint: #bbbbbc;
  --glass-reflex-dark: 1;
  --glass-reflex-light: 1;
  --glass-saturation: 150%;
  --dock-size: 54px;
  --case-width: min(1120px, calc(100vw - 72px));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  /* text strengths, all ≥ 4.5:1 on the page background */
  --t-strong: color-mix(in srgb, var(--page-fg) 94%, transparent);
  --t-body: color-mix(in srgb, var(--page-fg) 78%, transparent);
  --t-muted: color-mix(in srgb, var(--page-fg) 66%, transparent);
  --hair: color-mix(in srgb, var(--page-fg) 16%, transparent);
  /* used by the photo viewer */
  --font-body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --ease: var(--ease-out);
  --ink: #161616;
  --accent: #ffffff;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 8%, var(--page-top-glow), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #f4f4f3 0%, #efefee 36%, var(--page-bg) 100%);
  color: var(--page-fg);
  font-family: var(--font-body);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background 420ms var(--ease-out), color 320ms ease;
}

body[data-theme="dark"] {
  --page-bg: #000000;
  --page-fg: #f5f5f2;
  --page-top-glow: transparent;
  --glass-reflex-dark: 2;
  --glass-reflex-light: 0.3;
  --accent: #ffffff;
  background: #000000;
}

/* case studies are always shown on the light surface */
body[data-view]:not([data-view="home"]):not([data-view="about"]) {
  --page-bg: #ececeb;
  --page-fg: #161616;
  --page-top-glow: rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 50% 8%, var(--page-top-glow), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #f4f4f3 0%, #efefee 36%, var(--page-bg) 100%);
  transition: background 640ms var(--ease-out), color 320ms ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(100%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--page-fg); outline-offset: 3px; border-radius: 6px; }

/* ---------- cursor dot ---------- */
.cursor-dot { position: fixed; top: 0; left: 0; width: 7px; height: 7px; border-radius: 999px; background: #161616; pointer-events: none; opacity: 0; transform: translate(-50%, -50%); z-index: 100; transition: opacity 160ms ease; }
body[data-theme="dark"][data-view="home"] .cursor-dot,
body[data-theme="dark"][data-view="about"] .cursor-dot { background: #ffffff; }
.cursor-dot.is-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  [data-cursor="dot"], [data-cursor="dot"] * { cursor: none !important; }
}
html.viewer-open .cursor-dot { display: none; }
html.viewer-open[data-cursor="dot"] .viewer, html.viewer-open[data-cursor="dot"] .viewer * { cursor: auto !important; }
html.viewer-open[data-cursor="dot"] .viewer button { cursor: pointer !important; }
html.viewer-open[data-cursor="dot"] .viewer .vw-img { cursor: zoom-in !important; }
html.viewer-open[data-cursor="dot"] .viewer.zoomed .vw-img { cursor: grab !important; }

/* ---------- shell and wave ---------- */
.shell { height: 100vh; height: 100svh; position: relative; overflow: clip; }
.wave { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; visibility: hidden; will-change: opacity; contain: strict; }
.wave.is-active { opacity: 1; visibility: visible; z-index: 4; -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); }
.wave svg { width: 100%; height: 100%; display: block; transform: translateZ(0); }
.wave path { shape-rendering: geometricPrecision; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- top switcher ---------- */
.top { display: flex; justify-content: center; position: fixed; top: 40px; left: 0; right: 0; z-index: 3; pointer-events: none; }
.switcher {
  --seg-h: 28px; --seg-w: 32px;
  position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--hair); border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 24%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  overflow: hidden; pointer-events: auto;
}
.sw-btn {
  appearance: none; border: none; background: transparent; min-height: var(--seg-h); height: var(--seg-h); padding: 0 10px;
  display: inline-flex; position: relative; isolation: isolate; align-items: center; justify-content: center;
  border-radius: 999px; color: color-mix(in srgb, var(--page-fg) 72%, transparent);
  font-size: 0.8rem; line-height: 1; letter-spacing: 0.01em; cursor: pointer; z-index: 1;
  transition: color 220ms ease, background-color 220ms ease;
}
.sw-btn:active { transform: scale(0.97); transition: transform 120ms ease-out; }
.sw-btn::after { content: ""; position: absolute; inset: 2px; border-radius: 999px; background: transparent; transition: background-color 220ms ease; pointer-events: none; z-index: -1; }
@media (hover: hover) and (pointer: fine) {
  .sw-btn:hover { color: color-mix(in srgb, var(--page-fg) 92%, transparent); }
  .sw-btn:hover::after { background: color-mix(in srgb, var(--page-bg) 88%, transparent); }
}
.sw-btn:focus-visible { color: color-mix(in srgb, var(--page-fg) 92%, transparent); outline-offset: -2px; border-radius: 999px; }
.sw-btn:focus-visible::after { background: color-mix(in srgb, var(--page-bg) 88%, transparent); }
.sw-theme { width: var(--seg-w); min-width: var(--seg-w); padding: 0; }
.sw-theme::after { inset: 4px; }
.sw-sep { position: relative; }
.sw-sep::before { content: ""; position: absolute; left: -1px; top: 50%; width: 1px; height: 14px; background: color-mix(in srgb, var(--page-fg) 14%, transparent); transform: translateY(-50%); pointer-events: none; }
.sw-lang { padding-inline: 9px; margin-left: 6px; text-transform: lowercase; }
.sw-about { padding-inline: 8px; text-transform: lowercase; }
.sw-about[aria-current="page"] { color: color-mix(in srgb, var(--page-fg) 92%, transparent); }
.sw-about[aria-current="page"]::after { background: color-mix(in srgb, var(--page-bg) 92%, transparent); }
.sw-ico { width: 15px; height: 15px; position: absolute; color: currentColor; transition: opacity 220ms ease, transform 320ms var(--ease-out); }
.sw-ico.sun { opacity: 1; transform: scale(1) rotate(0deg); }
.sw-ico.moon { opacity: 0; transform: scale(0.72) rotate(-18deg); }
body[data-theme="dark"] .sw-ico.sun { opacity: 0; transform: scale(0.72) rotate(18deg); }
body[data-theme="dark"] .sw-ico.moon { opacity: 1; transform: scale(1) rotate(0deg); }

body[data-view]:not([data-view="home"]):not([data-view="about"]) .top,
body[data-view]:not([data-view="home"]) .dock { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- hero ---------- */
.hero { height: 100%; display: grid; place-items: center; padding: 24px; text-align: center; position: relative; z-index: 1; }
.hero-in { display: grid; justify-items: center; justify-self: center; width: max-content; max-width: 100%; gap: 48px; transform: translateY(-66px); transition: opacity 280ms ease, transform 420ms var(--ease-out); will-change: opacity, transform; }
.who { display: grid; justify-items: center; gap: 16px; }
.avatar { appearance: none; border: 0; padding: 0; background: none; position: relative; width: 122px; height: 122px; border-radius: 50%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; transition: filter 320ms ease; }
body[data-theme="dark"] .avatar img { filter: grayscale(1) contrast(1.05); }
.avatar:focus-visible { border-radius: 50%; }
.bubble { position: absolute; bottom: 100%; left: 50%; translate: -50% 0; white-space: nowrap; pointer-events: none; z-index: 10; margin-bottom: 8px; opacity: 0; visibility: hidden; }
.bubble.is-active { visibility: visible; }
.bubble-in { background: var(--bubble-bg, #f0f0f0); color: var(--bubble-ink, #1a1a1a); padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); position: relative; letter-spacing: -0.3px; display: block; }
.bubble-in::after { content: ""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid var(--bubble-bg, #f0f0f0); }
body[data-theme="dark"] .bubble-in { --bubble-bg: #2a2a2a; --bubble-ink: #ffffff; }
.name { margin: 0; font-size: 1.12rem; line-height: 1.1; font-weight: 400; }

.title { margin: 0; display: grid; justify-items: center; justify-self: center; width: max-content; max-width: 100%; gap: 0; font-size: clamp(3.15rem, 1.0125vw + 2.4375rem, 3.975rem); line-height: 0.92; letter-spacing: normal; font-weight: 400; text-align: center; }
.line { display: block; width: max-content; max-width: 100%; text-align: center; white-space: nowrap; }
.line.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 0.12em; }
.line-copy { display: inline-block; opacity: 0; filter: blur(4px); transform: translateY(0.4em); animation: word-in 480ms var(--ease-soft) forwards; }
.line.with-icon .line-copy:first-child { animation-delay: 80ms; }
.line.with-icon .line-copy:last-child { animation-delay: 220ms; }
.icon-slot { appearance: none; border: 0; padding: 0; background: none; color: inherit; font: inherit; width: 1.08em; height: 0.92em; display: inline-flex; align-items: center; justify-content: center; overflow: visible; opacity: 0; transform: translateY(-0.5em) scale(0.82); animation: icon-in 500ms var(--ease-out) 720ms forwards, icon-pulse 3.2s ease-in-out 1380ms infinite; position: relative; cursor: pointer; }
.icon-slot svg { width: 0.92em; height: 0.92em; flex: 0 0 auto; display: block; pointer-events: none; }
.icon-slot:focus-visible { border-radius: 0.28em; outline-offset: 2px; }
.stagger { display: block; min-height: 1.05em; }
.stagger .w { display: inline-block; opacity: 0; filter: blur(4px); transform: translateY(0.4em); will-change: opacity, transform, filter; transition: opacity 480ms var(--ease-soft), transform 480ms var(--ease-soft), filter 480ms var(--ease-soft); }
.stagger .w + .w { margin-left: 0.26em; }
.stagger .w.in { opacity: 1; filter: blur(0); transform: translateY(0); }

.burst { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.pill { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px 10px; border-radius: 999px; background: var(--pill-bg); border: 1px solid color-mix(in srgb, var(--pill-ink) 12%, transparent); box-shadow: 0 14px 28px var(--pill-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.54); color: var(--pill-ink); font-size: 0.82rem; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; will-change: transform, opacity; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pill::before { content: ""; width: 7px; height: 7px; margin-right: 8px; border-radius: 999px; background: color-mix(in srgb, var(--pill-ink) 82%, white 18%); flex: 0 0 auto; }

.apps { display: none; }

body[data-view]:not([data-view="home"]) .hero { pointer-events: none; visibility: hidden; }
body[data-view]:not([data-view="home"]) .hero-in { opacity: 0; transform: translateY(-4px) scale(0.995); }

/* ---------- screen (cases + about) ---------- */
.screen { position: absolute; inset: 0; overflow-x: clip; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; z-index: 1; pointer-events: none; }
.screen-in { width: 100%; opacity: 0; transition: opacity 360ms var(--ease-out); will-change: opacity; }
body[data-view]:not([data-view="home"]) .screen { pointer-events: auto; }
body[data-view]:not([data-view="home"]) .screen-in { opacity: 1; }
.panel[hidden] { display: none !important; }

.back { appearance: none; border: 1px solid var(--hair); background: transparent; padding: 0 12px 0 10px; margin: 0; min-width: 74px; height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; color: color-mix(in srgb, var(--page-fg) 72%, transparent); font-size: 0.78rem; line-height: 1; letter-spacing: 0.01em; cursor: pointer; box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 26%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease; }
.back svg { width: 11px; height: 11px; flex: 0 0 auto; }
.back:hover, .back:focus-visible { color: color-mix(in srgb, var(--page-fg) 92%, transparent); border-color: color-mix(in srgb, var(--page-fg) 24%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 42%, transparent), 0 6px 20px color-mix(in srgb, #000000 8%, transparent); }
.back:focus-visible { border-radius: 999px; }
.back:active { scale: 0.97; }
.back.fixed { position: fixed; top: 56px; left: 50%; z-index: 5; transform: translateX(-50%); }
/* the fixed pill floats over pictures while scrolling: a light frosted fill keeps its label readable */
.back.fixed { background: color-mix(in srgb, #f1f1f0 82%, transparent); color: color-mix(in srgb, #161616 80%, transparent); }

/* case study */
.case { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding-bottom: 120px; }
.case-hero { width: min(940px, calc(100vw - 72px)); margin: 112px auto 64px; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; text-align: center; }
.case-logo { width: 80px; height: 80px; display: block; }
.case-logo.tile { border-radius: 28.8%; background: #fff; padding: 12px; object-fit: contain; box-shadow: inset 0 0 0 1px rgba(22, 22, 22, 0.08); }
.case-name { margin: 0; font-size: 1.12rem; line-height: 1.1; font-weight: 400; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--page-fg) 12%, transparent); background: color-mix(in srgb, var(--page-bg) 94%, transparent); color: color-mix(in srgb, var(--page-fg) 78%, transparent); font-size: 0.86rem; line-height: 1; letter-spacing: 0.01em; box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 24%, transparent); }
.kicker { margin: -4px 0 0; font-size: 0.8rem; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-muted); }
.summary { margin: 0; width: min(560px, 100%); font-size: clamp(1.08rem, 0.28vw + 1rem, 1.4rem); line-height: 1.28; letter-spacing: -0.01em; color: color-mix(in srgb, var(--page-fg) 92%, transparent); text-wrap: balance; }
.meta { margin: -2px 0 0; width: min(29rem, 100%); font-size: 0.8rem; line-height: 1.45; color: var(--t-body); }
.meta a, .prose a { text-decoration: underline; text-underline-offset: 0.12em; }

.headline-block { width: var(--case-width); margin: 0 auto; display: grid; justify-items: center; gap: 10px; text-align: center; }
.headline { margin: 0; max-width: min(100%, 20ch); font-size: clamp(3.4rem, 3vw + 1.8rem, 5.2rem); line-height: 0.9; font-weight: 700; letter-spacing: -0.035em; color: color-mix(in srgb, var(--page-fg) 98%, transparent); text-wrap: balance; }
.lede { margin: 18px 0 0; width: min(100%, 58rem); font-size: 1rem; line-height: 1.5; color: var(--t-body); }

.numbers { width: var(--case-width); margin: 56px auto 0; display: flex; justify-content: center; gap: clamp(32px, 8vw, 120px); text-align: center; }
.numbers div { display: grid; gap: 10px; justify-items: center; }
.numbers b { font-size: clamp(3.4rem, 3vw + 1.8rem, 5.2rem); line-height: 0.9; font-weight: 700; letter-spacing: -0.035em; }
.numbers span { font-size: 0.8rem; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-muted); max-width: 22ch; }

.frames { width: var(--case-width); margin: 64px auto 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.frames.two { grid-template-columns: 1fr 1fr; }
.frame { margin: 0; min-width: 0; background: #f4f2ed; border-radius: 8px; overflow: hidden; box-shadow: 0 18px 40px -34px rgba(15, 23, 42, 0.22); }
.frame img { width: 100%; height: auto; display: block; }
.frames.two .frame:last-child:nth-child(odd) { grid-column: 1 / -1; }
.frames.two .frame:last-child:nth-child(odd) img { aspect-ratio: 2 / 1; object-fit: cover; }

.facts { width: min(940px, calc(100vw - 72px)); margin: 64px auto 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px 20px; text-align: left; }
.facts div { display: grid; gap: 8px; align-content: start; }
.facts dt { font-size: 0.76rem; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-muted); }
.facts dd { margin: 0; font-size: 1rem; line-height: 1.25; color: color-mix(in srgb, var(--page-fg) 88%, transparent); }

.prose { width: min(940px, calc(100vw - 72px)); margin: 64px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 40px 56px; text-align: left; }
.prose.one { grid-template-columns: 1fr; max-width: 720px; }
.prose h3 { margin: 0 0 18px; font-size: clamp(1.08rem, 0.44vw + 0.84rem, 1.78rem); line-height: 1.1; font-weight: 700; color: color-mix(in srgb, var(--page-fg) 96%, transparent); }
.prose p, .prose li { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--t-body); }
.prose p + p { margin-top: 0.9em; }
.prose ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.7em; }
.prose ul li { padding-left: 18px; position: relative; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--page-fg) 60%, transparent); }
.steps { width: min(940px, calc(100vw - 72px)); margin: 64px auto 0; text-align: left; }
.steps h3 { margin: 0 0 22px; font-size: clamp(1.08rem, 0.44vw + 0.84rem, 1.78rem); line-height: 1.1; font-weight: 700; }
.steps ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; padding: 20px; border-radius: 8px; background: linear-gradient(180deg, rgba(250, 250, 248, 0.98), rgba(246, 246, 243, 0.96)); box-shadow: 0 14px 34px -26px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(255, 255, 255, 0.92) inset; display: grid; gap: 8px; align-content: start; }
.steps li::before { content: counter(s, decimal-leading-zero); font-size: 0.76rem; letter-spacing: 0.08em; color: var(--t-muted); }
.steps b { font-size: 1rem; line-height: 1.2; font-weight: 700; }
.steps span { font-size: 0.92rem; line-height: 1.45; color: var(--t-body); }
.closing { width: min(760px, calc(100vw - 72px)); margin: 72px auto 0; text-align: center; font-size: clamp(1.3rem, 0.9vw + 1rem, 2rem); line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; color: var(--t-strong); }
.case-foot { width: min(940px, calc(100vw - 72px)); margin: 42px auto 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.back.next { padding: 0 10px 0 12px; }

/* about */
body[data-view="about"] { background: var(--page-bg); }
body[data-theme="dark"][data-view="about"] { background: #000; }
.about-wrap { width: 100%; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 156px 24px 88px; text-align: left; }
.about { width: min(516px, 100%); margin: 0 auto; }
.about-copy { position: relative; width: 100%; color: var(--t-strong); }
.about-copy p { margin: 0; max-width: 100%; font-size: clamp(1.02rem, 0.08vw + 1rem, 1.1rem); line-height: 1.55; letter-spacing: -0.012em; }
.about-copy p + p { margin-top: 1.36em; }
.about-copy a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: text-decoration-color 160ms ease; }
.about-copy a:hover { text-decoration-color: currentColor; }
.tl { position: relative; display: block; inline-size: 0; max-width: 100%; overflow: hidden; white-space: nowrap; will-change: inline-size; }
.about-copy.is-typing .tl { animation: type-line var(--duration, 1s) steps(var(--chars, 20)) both var(--delay, 0s); }
.about-copy.is-revealed .tl { inline-size: var(--target-width, auto); }
.about-cta { margin-top: 1.36em; display: flex; flex-wrap: wrap; gap: 16px; opacity: 0; pointer-events: none; transition: opacity 280ms var(--ease-soft); }
.about-copy.is-revealed ~ .about-cta { opacity: 1; pointer-events: auto; }
.about-cta a { display: inline-flex; align-items: center; gap: 6px; color: var(--t-muted); font-size: clamp(0.9rem, 0.08vw + 0.88rem, 0.98rem); line-height: 1; letter-spacing: 0.01em; padding: 6px 0; transition: color 180ms ease; }
.about-cta a:hover, .about-cta a:focus-visible { color: var(--t-strong); text-decoration: underline; text-underline-offset: 3px; }
.about-cta svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* ---------- dock ---------- */
.glass-defs { position: absolute; width: 0; height: 0; pointer-events: none; }
.dock { position: fixed; left: 50%; bottom: 102px; transform: translateX(-50%); z-index: 2; }
.dock-glass {
  position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 12px; border-radius: 22px;
  background-color: color-mix(in srgb, var(--glass-tint) 15%, rgba(255, 255, 255, 0.16));
  -webkit-backdrop-filter: blur(10px) saturate(var(--glass-saturation));
  backdrop-filter: blur(10px) saturate(var(--glass-saturation));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 12%), transparent),
    inset 1.6px 2.4px 0 -1.6px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 82%), transparent),
    inset -1.4px -1.8px 0 -1.4px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 66%), transparent),
    inset -2px -5px 1px -4px color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 42%), transparent),
    inset -0.4px -1px 4px 0 color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 12%), transparent),
    inset 0 2px 3px -1px color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 16%), transparent),
    0 12px 28px 0 color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent);
}
.dock-glass::before { content: ""; position: absolute; inset: 3px; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--glass-light) calc(var(--glass-reflex-light) * 54%), transparent), inset 0 -1px 0 color-mix(in srgb, var(--glass-dark) calc(var(--glass-reflex-dark) * 6%), transparent); opacity: 0.62; }
.dock-track { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; height: var(--dock-size); position: relative; z-index: 1; }
.dock-item { position: relative; display: flex; justify-content: center; align-items: center; width: var(--dock-size); height: var(--dock-size); transition: width 0.45s var(--ease-soft); }
.dock-item.hover { width: calc(var(--dock-size) * 1.24); }
.dock-item.near { width: calc(var(--dock-size) * 1.12); }
.dock-item.far { width: calc(var(--dock-size) * 1.04); }
.dock-div { width: 8px; height: calc(var(--dock-size) * 0.78); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; pointer-events: none; }
.dock-div span { width: 1px; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--page-fg) 30%, transparent); box-shadow: 1px 0 0 color-mix(in srgb, #ffffff 32%, transparent); }
.dock-link { appearance: none; border: 0; background: none; position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; padding: 0; cursor: pointer; }
.dock-link:focus-visible { outline-offset: 2px; border-radius: 14px; }
.dock-tile { width: var(--dock-size); height: var(--dock-size); display: block; transition: filter 0.3s ease; }
.dock-tile img, .dock-tile svg { width: 100%; height: 100%; display: block; object-fit: contain; }
.dock-tile.white { border-radius: 28.8%; background: #fff; padding: 15%; box-shadow: inset 0 0 0 1px rgba(22, 22, 22, 0.08); }
@media (hover: hover) and (pointer: fine) { .dock-link:hover .dock-tile { filter: saturate(1.06) brightness(1.02); } }
.dock-link:active .dock-tile { transform: scale(0.93); transition: transform 120ms ease-out; }
.dock-label { position: absolute; bottom: calc(100% + 18px); padding: 6px 9px; border-radius: 999px; background: color-mix(in srgb, var(--page-fg) 88%, transparent); color: color-mix(in srgb, var(--page-bg) 96%, white); font-size: 0.7rem; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; opacity: 0; transform: translateY(6px); pointer-events: none; will-change: opacity, transform; transition: opacity 150ms var(--ease-soft), transform 150ms var(--ease-soft); }
.dock-item:hover .dock-label, .dock-item:focus-within .dock-label { opacity: 1; transform: translateY(-8px); }

@keyframes word-in { to { opacity: 1; filter: blur(0); transform: translateY(0); } }
@keyframes icon-in { 0% { opacity: 0; transform: translateY(-0.5em) scale(0.82); } 100% { opacity: 1; transform: translateY(0.04em) scale(1); } }
@keyframes icon-pulse { 0%, 100% { transform: translateY(0.04em) scale(1); } 35% { transform: translateY(0.01em) scale(1.08); } 70% { transform: translateY(0.06em) scale(0.98); } }
@keyframes type-line { from { inline-size: 0; } to { inline-size: var(--target-width, 100%); } }

/* ---------- tablet ---------- */
@media (max-width: 900px) {
  .top { top: 28px; }
  .switcher { --seg-h: 26px; --seg-w: 30px; }
  .sw-btn { font-size: 0.76rem; }
  .hero { padding: 22px; }
  .hero-in { gap: 38px; transform: translateY(-48px); }
  .avatar { width: 102px; height: 102px; }
  .name { font-size: 1rem; }
  .title { font-size: clamp(2.475rem, 1.2vw + 1.575rem, 3.15rem); line-height: 0.94; }
  .pill { padding: 8px 12px 9px; font-size: 0.76rem; }
  .pill::before { width: 6px; height: 6px; margin-right: 7px; }
  .about-wrap { padding: 142px 22px 72px; }
  .about { width: min(492px, 100%); }
  .about-copy p { font-size: 1rem; }
  .case { padding-bottom: 112px; }
  .case-logo { width: 68px; height: 68px; }
  .headline-block, .frames, .numbers { width: min(760px, calc(100vw - 48px)); }
  .frames { gap: 9px; }
  .case-hero, .facts, .prose, .steps, .case-foot { width: min(760px, calc(100vw - 48px)); }
  .prose { grid-template-columns: 1fr; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .top { top: 24px; }
  .switcher { --seg-h: 24px; --seg-w: 28px; }
  /* keep 44px touch targets without changing the look */
  .sw-btn::before { content: ""; position: absolute; inset: -10px -2px; }
  .sw-sep::before { inset: auto; left: -1px; top: 50%; width: 1px; height: 14px; }
  .sw-btn { padding-inline: 8px; font-size: 0.74rem; }
  .sw-ico { width: 13px; height: 13px; }
  .hero { place-items: start center; padding: 136px 20px 30px; overflow-y: auto; }
  .hero-in { width: min(100%, 344px); gap: 14px; transform: none; }
  .who { gap: 6px; }
  .avatar { width: 72px; height: 72px; }
  .name { font-size: 0.88rem; color: var(--t-body); }
  .title { margin-top: 14px; width: 100%; font-size: clamp(1.9rem, 1.7vw + 1.52rem, 2.28rem); line-height: 0.93; letter-spacing: -0.03em; }
  .line.with-icon { gap: 0.08em; }
  .apps { width: min(100%, 300px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; gap: 18px 12px; margin: 56px 0 0; padding: 0; list-style: none; }
  .app { appearance: none; border: 0; background: none; padding: 0; color: inherit; width: 100%; display: grid; justify-items: center; gap: 6px; cursor: pointer; }
  .app-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 28.8%; overflow: hidden; background: color-mix(in srgb, var(--page-bg) 96%, white 4%); box-shadow: 0 12px 24px rgba(15, 23, 42, 0.07), 0 2px 5px rgba(15, 23, 42, 0.05); transition: transform 220ms ease, box-shadow 220ms ease; }
  .app-icon img, .app-icon svg { width: 100%; height: 100%; display: block; object-fit: contain; }
  .app-icon.white { background: #fff; padding: 8px; }
  .app-label { display: block; max-width: 100%; font-size: 0.68rem; line-height: 1.15; text-align: center; color: var(--t-body); text-wrap: balance; }
  .app:active .app-icon { transform: scale(0.95); }
  .app:focus-visible { outline-offset: 4px; }
  body[data-theme="dark"] .app-icon { box-shadow: 0 18px 30px rgba(0, 0, 0, 0.34), 0 4px 10px rgba(0, 0, 0, 0.22); }
  .pill { padding: 7px 11px 8px; font-size: 0.72rem; }
  .pill::before { width: 5px; height: 5px; margin-right: 6px; }
  .back { min-width: 68px; height: 28px; padding: 0 10px 0 9px; gap: 5px; font-size: 0.74rem; position: relative; }
  .back::after { content: ""; position: absolute; inset: -9px 0; }
  .back svg { width: 10px; height: 10px; }
  .back.fixed { position: fixed; top: 34px; }
  .about-wrap { padding: 118px 32px 52px; }
  .about { width: min(100%, 29rem); }
  .about-copy p { font-size: 0.98rem; line-height: 1.5; }
  .about-copy p + p { margin-top: 1.24em; }
  .case { padding-bottom: 88px; }
  .case-hero { width: calc(100vw - 40px); margin: 96px auto 48px; }
  .case-logo { width: 60px; height: 60px; }
  .summary, .meta { width: min(100%, 20rem); }
  .meta { font-size: 0.76rem; line-height: 1.4; }
  .headline-block, .frames, .numbers, .facts, .prose, .steps, .case-foot, .closing { width: calc(100vw - 28px); }
  .facts, .prose, .steps, .closing { width: calc(100vw - 48px); }
  .headline { max-width: 12ch; font-size: clamp(2.4rem, 8vw, 3.2rem); }
  .lede { margin-top: 14px; font-size: 0.94rem; width: min(100%, 21rem); }
  .numbers { margin-top: 40px; gap: 24px; }
  .numbers b { font-size: clamp(2.4rem, 8vw, 3.2rem); }
  .frames { gap: 8px; margin-top: 48px; }
  .frames.two { grid-template-columns: 1fr; }
  .frames.two .frame:last-child:nth-child(odd) img { aspect-ratio: auto; }
  .facts { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .prose, .steps { margin-top: 48px; }
  .dock { display: none; }
}
@media (max-width: 640px) and (max-height: 700px) { .hero { padding-top: 104px; } .apps { margin-top: 36px; } }

@media (prefers-reduced-motion: reduce) {
  .stagger .w { filter: none; transform: none; transition: opacity 200ms ease; }
  .line-copy { animation: none; opacity: 1; filter: none; transform: none; }
  .icon-slot { animation: none; opacity: 1; transform: translateY(0.04em) scale(1); }
  .hero-in, .screen-in { transition: opacity 200ms ease; }
  .wave.is-active { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dock-item { transition: none; }
}

/* =========================================================
   Photo viewer (case pages)
   Text and icons on the dark backdrop ≥ 15:1; controls are 48px targets.
   ========================================================= */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.viewer {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #F4F3EE; overflow: hidden;
}
.viewer::backdrop { background: rgba(14, 15, 13, .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.viewer[open] { animation: vw-in .35s var(--ease); }
@keyframes vw-in { from { opacity: 0; } to { opacity: 1; } }
.viewer[open] .vw-img { animation: vw-pop .45s var(--ease); }
@keyframes vw-pop { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }
html.viewer-open { overflow: hidden; }

.vw-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 76px 88px 84px; touch-action: none; }
.vw-img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; user-select: none; -webkit-user-select: none;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); cursor: zoom-in; transform-origin: center center; will-change: transform;
}
.viewer.zoomed .vw-img { cursor: grab; border-radius: 0; }
.viewer.zoomed .vw-img:active { cursor: grabbing; }

.vw-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 3vw, 28px); pointer-events: none; }
.vw-top > * { pointer-events: auto; }
.vw-count { font: 500 15px/1 var(--font-body); color: #F4F3EE; font-variant-numeric: tabular-nums; }
.vw-tools { display: flex; gap: 8px; }
.vw-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .2s ease, transform .2s var(--ease);
}
.vw-btn:hover { background: rgba(255, 255, 255, .24); transform: scale(1.06); }
.vw-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.vw-nav { position: absolute; top: 50%; margin-top: -24px; }
.vw-prev { left: clamp(12px, 2.4vw, 28px); }
.vw-next { right: clamp(12px, 2.4vw, 28px); }
.viewer.zoomed .vw-nav { opacity: .35; }
.vw-cap { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(720px, calc(100% - 32px));
  text-align: center; font-size: 15px; line-height: 1.45; color: #E6E5DF; max-width: none; }
.viewer.zoomed .vw-cap { opacity: 0; transition: opacity .2s ease; }

@media (max-width: 700px) {
  .vw-stage { padding: 68px 12px 96px; }
  .vw-nav { top: auto; bottom: 18px; margin: 0; }
  .vw-prev { left: 16px; } .vw-next { right: 16px; }
  .vw-cap { bottom: 30px; width: calc(100% - 152px); font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .viewer[open], .viewer[open] .vw-img { animation: none; }
}
/* controls always sit above a zoomed picture */
.vw-stage { z-index: 1; }
.vw-top, .vw-nav, .vw-cap { z-index: 2; }
.vw-top { background: linear-gradient(rgba(14,15,13,.7), transparent); }

/* viewer v2: title in the top bar, picture fills the free space */
.vw-stage { padding: 84px 88px 28px; }
.vw-img { max-width: none; max-height: none; }
.vw-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 76px; }
.vw-top .vw-tools { justify-self: end; }
.vw-top .vw-cap {
  position: static; transform: none; width: auto; max-width: min(640px, 50vw); justify-self: center;
  font: 500 16px/1.35 var(--font-body); color: #F4F3EE; text-align: center;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.viewer.zoomed .vw-top .vw-cap { opacity: 1; }
@media (max-width: 700px) {
  .vw-top { grid-template-columns: 1fr auto; grid-template-areas: "count tools" "cap cap"; row-gap: 6px; padding-bottom: 10px; }
  .vw-count { grid-area: count; } .vw-top .vw-tools { grid-area: tools; } .vw-top .vw-cap { grid-area: cap; max-width: none; justify-self: start; text-align: left; font-size: 15px; }
  .vw-stage { padding: 128px 12px 88px; }
  .vw-nav { bottom: 20px; }
}

/* Text strengths are derived from --page-fg, so they must be computed on <body>,
   where the dark theme changes --page-fg (computed on :root they stayed dark). */
body {
  --t-strong: color-mix(in srgb, var(--page-fg) 94%, transparent);
  --t-body: color-mix(in srgb, var(--page-fg) 78%, transparent);
  --t-muted: color-mix(in srgb, var(--page-fg) 66%, transparent);
  --hair: color-mix(in srgb, var(--page-fg) 16%, transparent);
}

/* ---------- About: experience timeline (appears once the bio has finished typing) ---------- */
.about-xp { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--hair); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 420ms var(--ease-soft) 120ms, transform 520ms var(--ease-soft) 120ms; }
.about-copy.is-revealed ~ .about-xp { opacity: 1; transform: none; pointer-events: auto; }
.about-xp h3 { margin: 0 0 22px; font-size: 0.76rem; line-height: 1; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-muted); }
.about-xp .xp + h3 { margin-top: 44px; }
.xp { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.xp li { position: relative; padding-left: 22px; }
.xp li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--page-fg) 70%, transparent); }
.xp li:not(:last-child)::after { content: ""; position: absolute; left: 3px; top: calc(0.5em + 13px); bottom: -22px; width: 1px; background: var(--hair); }
.xp p { margin: 0; }
.xp-when { font-size: 0.8rem; line-height: 1.2; letter-spacing: 0.02em; color: var(--t-muted); font-variant-numeric: tabular-nums; }
.xp-role { margin-top: 6px !important; font-size: clamp(1.02rem, 0.08vw + 1rem, 1.1rem); line-height: 1.3; letter-spacing: -0.012em; color: var(--t-strong); }
.xp-co { margin-top: 2px !important; font-size: 0.94rem; line-height: 1.4; color: var(--t-muted); }
.xp-what { margin-top: 8px !important; font-size: 0.94rem; line-height: 1.5; color: var(--t-body); }
.xp.edu { grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.xp.edu li { padding-left: 0; }
.xp.edu li::before, .xp.edu li::after { content: none; }
.xp.edu .xp-role { margin-top: 0 !important; font-size: 0.98rem; }
@media (max-width: 640px) { .about-xp { margin-top: 44px; padding-top: 32px; } .xp.edu { grid-template-columns: 1fr; gap: 16px; } }
@media (prefers-reduced-motion: reduce) { .about-xp { transform: none; transition: opacity 200ms ease; } }
/* About now scrolls under the top switcher: a frosted fill keeps both readable */
body[data-view="about"] .switcher { background: color-mix(in srgb, var(--page-bg) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* ---------- avatar: its own picture in dark mode ---------- */
.avatar img { opacity: 0; transition: opacity 220ms ease; filter: none !important; }
body:not([data-theme="dark"]) .avatar .ph-light { opacity: 1; }
body[data-theme="dark"] .avatar .ph-dark { opacity: 1; }
/* the dark picture has a thin black rim around its circle: crop to the circle and scale it to fill */
.avatar .ph-dark { clip-path: circle(48.5%); scale: 1.031; }

/* ---------- project pages: Back / Next float at the bottom, then settle in place at the end ---------- */
.case-foot { position: sticky; bottom: 28px; z-index: 5; margin-top: 56px; pointer-events: none; }
.case-foot .back { pointer-events: auto; height: 36px; padding-inline: 14px; font-size: 0.82rem; color: color-mix(in srgb, #161616 82%, transparent); background: color-mix(in srgb, #f4f4f3 84%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 40%, transparent), 0 10px 26px -10px rgba(15, 23, 42, 0.28); }
.case-foot .back:hover, .case-foot .back:focus-visible { background: color-mix(in srgb, #ffffff 92%, transparent); color: #161616; box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 60%, transparent), 0 12px 28px -10px rgba(15, 23, 42, 0.34); }
.case-hero { margin-top: 88px; }
@media (max-width: 640px) {
  .case-foot { bottom: 18px; margin-top: 40px; }
  .case-foot .back { height: 40px; min-width: 0; padding-inline: 14px; font-size: 0.8rem; }
  .case-foot .back::after { inset: -2px 0; }
  .case-hero { margin-top: 64px; }
}

/* ---------- skill pills: an icon instead of the dot ---------- */
.pill::before { content: none; }
.pill { gap: 7px; padding: 8px 14px 8px 11px; }
.pill svg { flex: 0 0 auto; width: 15px; height: 15px; }
@media (max-width: 640px) { .pill { gap: 5px; padding: 7px 11px 7px 9px; } .pill svg { width: 13px; height: 13px; } }

/* ---------- opening a project: a sheet that grows out of the icon ---------- */
.zoomer { position: fixed; inset: 0; z-index: 6; pointer-events: none; will-change: clip-path, opacity; background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #f4f4f3 0%, #efefee 36%, #ececeb 100%); }
.zoomer-icon { position: fixed; will-change: transform, opacity; transform-origin: center; }
.zoomer-icon img, .zoomer-icon svg { width: 100%; height: 100%; display: block; object-fit: contain; }
.zoomer-icon.white { border-radius: 28.8%; background: #fff; padding: 0.5em; padding: 15%; }
/* while the sheet grows, the home screen drifts back, as app icons do */
.hero-in { transition: opacity 280ms ease, transform 420ms var(--ease-out), scale 520ms cubic-bezier(0.32, 0.72, 0, 1); }
.dock { transition: opacity 320ms ease, scale 520ms cubic-bezier(0.32, 0.72, 0, 1); transform-origin: 50% 50%; }
.top { transition: opacity 320ms ease; }
body.launching .hero-in { opacity: 0; scale: 0.94; }
body.launching .dock { opacity: 0; scale: 0.94; }
body.launching .top { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .hero-in, .dock, .top { transition: opacity 200ms ease; } }

/* ---------- dock: macOS-style magnification (sizes are driven from app.js through --s) ---------- */
.dock-track { align-items: flex-end; }
.dock-item, .dock-item.hover, .dock-item.near, .dock-item.far { width: calc(var(--dock-size) * var(--s, 1)); height: calc(var(--dock-size) * var(--s, 1)); transition: none; flex: 0 0 auto; }
.dock-tile { width: 100%; height: 100%; }
.dock-label { bottom: calc(100% + 14px); }
/* the home screen no longer shrinks away when a project opens */
body.launching .hero-in, body.launching .dock { opacity: 1; scale: 1; }

/* ---------- top bar on every page ---------- */
body[data-view]:not([data-view="home"]):not([data-view="about"]) .top { opacity: 1; visibility: visible; }
/* pages scroll under it: a frosted fill keeps it readable */
body[data-view]:not([data-view="home"]) .switcher { background: color-mix(in srgb, var(--page-bg) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
body[data-view]:not([data-view="home"]):not([data-view="about"]) .switcher { box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 40%, transparent), 0 8px 22px -12px rgba(15, 23, 42, 0.22); }

/* ---------- dark mode on project pages ---------- */
body[data-theme="dark"][data-view]:not([data-view="home"]):not([data-view="about"]) {
  --page-bg: #000000; --page-fg: #f5f5f2; --page-top-glow: transparent;
  background: #000000;
}
body[data-theme="dark"] .cursor-dot { background: #ffffff; }
body[data-theme="dark"] .frame { background: #141414; box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
body[data-theme="dark"] .steps li { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
body[data-theme="dark"] .badge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
body[data-theme="dark"] .case-foot .back { color: rgba(245, 245, 242, 0.9); background: color-mix(in srgb, #1c1c1e 82%, transparent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 26px -10px rgba(0, 0, 0, 0.6); }
body[data-theme="dark"] .case-foot .back:hover, body[data-theme="dark"] .case-foot .back:focus-visible { color: #ffffff; background: color-mix(in srgb, #2c2c2e 92%, transparent); }
body[data-theme="dark"] .case-logo.tile { box-shadow: none; }

/* top bar labels keep their own capitals (About, Fr) */
.sw-lang, .sw-about { text-transform: none; }

/* ---------- wave: page blur that grows with the wave and fades out above its edge ---------- */
.wave.is-active { -webkit-backdrop-filter: none; backdrop-filter: none; }
.wave-blur {
  position: fixed; inset: 0; z-index: 4; pointer-events: none; visibility: hidden;
  -webkit-backdrop-filter: blur(var(--b, 0px)) saturate(1.4); backdrop-filter: blur(var(--b, 0px)) saturate(1.4);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 var(--h0, 0%), transparent var(--h1, 0%));
  mask-image: linear-gradient(to top, #000 0%, #000 var(--h0, 0%), transparent var(--h1, 0%));
}
.wave-blur.is-active { visibility: visible; }
/* fine grain over the gradient hides colour steps (banding) */
.wave-grain { position: absolute; inset: 0; background-image: var(--grain); background-size: 160px 160px; opacity: 0.055; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .wave-blur { display: none; } }
/* grain only on the coloured part, not on the page above the wave */
.wave-grain { -webkit-mask-image: linear-gradient(to top, #000 0%, #000 calc(var(--hw, 0%) - 4%), transparent calc(var(--hw, 0%) + 6%)); mask-image: linear-gradient(to top, #000 0%, #000 calc(var(--hw, 0%) - 4%), transparent calc(var(--hw, 0%) + 6%)); }

/* once typed, lines can never be cut: they take their natural width and may wrap */
.about-copy.is-revealed .tl { inline-size: auto; overflow: visible; white-space: normal; }

/* project links under the role: just the links, spaced, no label or separators */
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 2px; font-size: 0.86rem; }
.meta a { padding: 6px 0; }

/* ---------- project pages: rise in while scrolling ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease-soft) var(--d, 0ms), transform 900ms var(--ease-soft) var(--d, 0ms); will-change: opacity, transform; }
.rv.in { opacity: 1; transform: none; }
.frames > .frame.rv { transform: translateY(34px) scale(0.985); }
.frames > .frame.rv.in { transform: none; }

/* ---------- pictures: shimmer placeholder, then a soft fade-in ---------- */
.frame { position: relative; isolation: isolate; }
.frame img { opacity: 0; filter: blur(14px); scale: 1.03; transition: opacity 600ms ease, filter 900ms var(--ease-soft), scale 1100ms var(--ease-soft); }
.frame.is-loaded img { opacity: 1; filter: none; scale: 1; }
.frame::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%) -150% 0 / 60% 100% no-repeat, #ebe9e4;
  animation: shimmer 1.4s ease-in-out infinite;
}
.frame.is-loaded::before { content: none; }
body[data-theme="dark"] .frame::before { background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%) -150% 0 / 60% 100% no-repeat, #161616; }
@keyframes shimmer { to { background-position: 250% 0, 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .rv, .frames > .frame.rv { transform: none; transition: opacity 200ms ease; }
  .frame img { filter: none; scale: 1; transition: opacity 200ms ease; }
  .frame::before { animation: none; }
}

/* ---------- phones: light wave (one painted sheet that only slides and fades) ---------- */
.wave-lite { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; visibility: hidden; contain: strict; }
.wave-lite.is-active { visibility: visible; }
.wl-sheet {
  position: absolute; left: -10%; right: -10%; top: 0; height: 130vh;
  transform: translate3d(0, 100vh, 0); will-change: transform, opacity; backface-visibility: hidden;
  background: linear-gradient(to bottom, var(--c2, #E4F6EE) 8vh, var(--c1, #9FDDC3) 30vh, var(--c0, #3BD39A) 85vh);
  border-radius: 50% 50% 0 0 / 18vh 18vh 0 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16vh); mask-image: linear-gradient(to bottom, transparent 0, #000 16vh);
}
