/* E3 cold-grey components, shared by every E3 page.
   Plain CSS (no @apply) so it can be a shared file next to the Tailwind CDN.
   Values mirror assets/js/tailwind-config.js; DESIGN.md is the source of truth. */

:root {
  --ink: #1D1D1F;
  --ink-hover: #3A3A3C;
  --muted: #6E6E73;
  --quiet: #86868B;
  --surface: #F4F4F4;
  --surface-2: #EDEDF0;
  --surface-3: #E2E2E6;
  --hair: #E5E5EA;
  --accent: #1F4FD8;
  --page: #FFFFFF;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Base. `html body` outranks Tailwind preflight, which loads later. */
html body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: #FFFFFF; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }

/* Nav bar: sticky, see-through with blur; solid while the mobile menu is open */
.bar { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, rgb(244 244 244 / .1) 0%, rgb(244 244 244 / 0) 25%); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.bar.is-open { background: var(--surface); box-shadow: none; }
.bar-in { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 600; font-size: 20px; letter-spacing: -.02em; white-space: nowrap; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-link { color: var(--muted); text-decoration: none; transition: color .2s var(--ease); }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; padding: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.menu-btn:hover { background: var(--surface-3); }
.menu-btn svg { transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
.menu-btn .i-close, .menu-btn[aria-expanded="true"] .i-menu { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }
@media (max-width: 720px) { .nav { display: none; } .menu-btn { display: inline-flex; } }

/* Full-screen mobile sheet */
.sheet { position: absolute; left: 0; right: 0; top: 64px; height: calc(100svh - 64px); background: var(--surface); overflow-y: auto; overscroll-behavior: contain; animation: e3SheetIn .35s var(--ease); }
.sheet[hidden] { display: none; }
@media (min-width: 721px) { .sheet { display: none !important; } }
.sheet-in { max-width: 1200px; min-height: 100%; margin: 0 auto; box-sizing: border-box; padding: 16px 24px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.sheet-link { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--hair); font-size: 32px; font-weight: 600; letter-spacing: -.03em; text-decoration: none; animation: e3LinkIn .5s var(--ease) both; }
.sheet-link svg { color: var(--muted); }
.sheet-link:nth-child(2) { animation-delay: .04s; }
.sheet-link:nth-child(3) { animation-delay: .08s; }
.sheet-foot { margin-top: auto; padding-top: 40px; display: flex; flex-direction: column; gap: 16px; animation: e3LinkIn .5s .12s var(--ease) both; }
.sheet-mail { align-self: center; color: var(--muted); text-decoration: none; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 16px; line-height: 1.2; transition: background-color .2s var(--ease); }
.pill-ink { background: var(--ink); color: #FFFFFF; }
.pill-ink:hover { background: var(--ink-hover); }
.pill-white { background: #FFFFFF; }
.pill-white:hover { background: #FCFCFC; }
.pill-grey { background: var(--surface-2); }
.pill-grey:hover { background: var(--surface-3); }
.pill-sm { min-height: 40px; padding: 0 16px; }

/* Inline screen chip inside a headline */
.chip { display: inline-block; width: 1.42em; height: .84em; border-radius: .2em; overflow: hidden; vertical-align: -.05em; margin: 0 .04em; background: #FFFFFF; box-shadow: 0 0 0 1px rgb(29 29 31 / .08); }
.chip img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Tiles */
.tile { display: block; position: relative; overflow: hidden; background: var(--surface); border-radius: 28px; }
.lift { position: absolute; inset: 0; display: block; transition: transform .5s var(--ease); }
a.tile:hover .lift { transform: translateY(-6px); }

/* Type helpers */
.two-tone { margin: 0; font-weight: 600; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; }
.two-tone span { color: var(--quiet); }
.label { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.cap { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--muted); }
.muted { color: var(--muted); }
.proof { color: var(--accent); font-weight: 600; }

/* Experience row */
.xp { list-style: none; margin: 0; padding: 0; }
.xp li { display: grid; grid-template-columns: 120px 1fr; gap: 4px 24px; padding: 20px 0; border-top: 1px solid var(--hair); }
.xp li:last-child { border-bottom: 1px solid var(--hair); }
@media (max-width: 560px) { .xp li { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { margin-top: 176px; background: var(--surface); }
.site-foot-in { max-width: 1200px; margin: 0 auto; padding: 96px 24px 40px; }
.flink { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 500; letter-spacing: -.015em; text-decoration: none; text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.flink:hover { text-decoration-line: underline; }
.flink svg { color: var(--muted); transition: transform .2s var(--ease); }
.flink:hover svg { color: var(--ink); transform: translate(2px, -2px); }

/* ---------- Case study ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cs-hero { margin-top: -64px; padding: 160px 0 64px; background: var(--surface); }
.cs-title { margin: 16px 0 0; font-weight: 600; font-size: clamp(36px, 4.6vw, 64px); line-height: 1.06; letter-spacing: -.04em; max-width: 22ch; text-wrap: balance; }
.cs-facts { margin: 56px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 24px 48px; }
.cs-facts > div { padding-top: 20px; border-top: 1px solid var(--surface-3); }
.cs-facts dt { margin: 0 0 8px; }
.cs-facts dd { margin: 0; }
.cs-facts ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cs-cover { margin-top: 48px; aspect-ratio: 16 / 9; }
.cs-cover img, .shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Full-bleed cover band. The cover PNG has wide empty margins, so on phones the image is scaled past the band and its margins are cropped. */
.cs-band { background: var(--surface-3); min-height: clamp(320px, 52vw, 720px); display: flex; align-items: center; justify-content: center; padding: 48px 24px; overflow: hidden; }
.cs-band img { display: block; width: 100%; max-width: 1100px; height: auto; }
@media (max-width: 720px) {
  .cs-band { min-height: 0; padding: 16px 0; }
  .cs-band img { flex: none; width: 150%; max-width: none; }
}

.cs-section { padding-top: 144px; }
.cs-section > .two-tone { max-width: 26ch; }
.cs-sub { margin: 72px 0 0; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; max-width: 40ch; text-wrap: balance; }
.cs-sub-cap { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; line-height: 1.5; letter-spacing: 0; color: var(--muted); text-wrap: pretty; }
.cs-sub-cap a { color: var(--ink); text-underline-offset: 3px; }
.cs-sub-cap a:hover { color: var(--ink-hover); }
.prose { margin-top: 24px; max-width: 68ch; }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose ol, .prose ul { margin: 0 0 16px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.prose ol { list-style: decimal; }
.prose ul { list-style: disc; }
.prose li::marker { color: var(--muted); }
.prose .lead-in { margin: 24px 0 8px; font-weight: 600; }

/* Decision block: label column + answer, hairline rows. Stacks on narrow screens. */
.decide { margin: 32px 0 0; max-width: 820px; }
.decide > div { display: grid; grid-template-columns: 120px 1fr; gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--hair); }
.decide > div:last-child { border-bottom: 1px solid var(--hair); }
.decide dt { font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--muted); }
.decide dd { margin: 0; }
.decide strong { font-weight: 600; }
@media (max-width: 640px) { .decide > div { grid-template-columns: 1fr; } }

.cards { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: 28px; padding: 32px; display: flex; flex-direction: column; gap: 8px; }
.card p { margin: 0; color: var(--muted); }
.cards.insights { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.insight-n { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.04em; color: var(--quiet); margin-bottom: 16px; }
.insight-go { margin-top: auto; color: var(--ink); text-decoration: none; }
.cards.insights .card > p:last-of-type { margin-bottom: 20px; }
.insight-go-text { display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.insight-go-text span { text-decoration-line: underline; text-decoration-color: var(--hair); text-underline-offset: 4px; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s var(--ease); }
.insight-go svg { flex: none; color: var(--muted); transition: transform .2s var(--ease), color .2s var(--ease); }
.insight-go:hover .insight-go-text span { text-decoration-color: currentColor; }
.insight-go:hover svg { color: var(--ink); transform: translate(2px, -2px); }

.stat { background: var(--surface); border-radius: 28px; padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.stat-num { font-size: clamp(40px, 4.4vw, 56px); font-weight: 600; line-height: 1; letter-spacing: -.04em; color: var(--accent); }
.stat-num.is-word { font-size: clamp(40px, 4.4vw, 50px); line-height: 1.05; letter-spacing: -.04em; }
.stat p { margin: 0; color: var(--muted); }

.shot { margin: 32px 0 0; aspect-ratio: 16 / 9; }
.shot img { mix-blend-mode: multiply; }
.shot.is-free { aspect-ratio: auto; }
.shot.is-free img { height: auto; }
.shot.is-raw img { mix-blend-mode: normal; }
.shot video { display: block; width: 100%; height: auto; }
.shot-play { position: absolute; right: 16px; bottom: 16px; z-index: 2; min-height: 44px; color: var(--ink); box-shadow: 0 0 0 1px var(--hair); }
.shot-play:focus-visible { border-radius: 999px; }
.shot-play .i-play, .shot-play[aria-pressed="true"] .i-pause { display: none; }
.shot-play[aria-pressed="true"] .i-play { display: inline; }
.shot.is-raw::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hair); pointer-events: none; }

/* Back to top: fixed bottom-right, shows after one screen of scroll (site.js). */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 48px; height: 48px; border: 0; padding: 0; border-radius: 999px; background: var(--ink); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 20px rgb(29 29 31 / .18); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s, background-color .2s var(--ease); }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--ink-hover); }
.to-top:focus-visible { border-radius: 999px; }
@media (max-width: 720px) { .to-top { right: 16px; bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Image zoom: case-study images open full screen on a dark veil; click outside, the close button or Esc closes (site.js). */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline-offset: -4px; }
.zoom { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 72px 24px 24px; border: 0; background: transparent; display: none; align-items: center; justify-content: center; overflow: hidden; }
.zoom[open] { display: flex; animation: e3ZoomFade .25s var(--ease); }
.zoom::backdrop { background: rgb(0 0 0 / .82); animation: e3ZoomFade .25s var(--ease); }
.zoom img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; background: #FFFFFF; cursor: default; animation: e3ZoomIn .3s var(--ease); }
.zoom-close { position: fixed; top: 16px; right: 16px; width: 48px; height: 48px; border: 0; padding: 0; border-radius: 999px; background: rgb(255 255 255 / .14); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .2s var(--ease); }
.zoom-close:hover { background: rgb(255 255 255 / .26); }
.zoom-close:focus-visible { outline-color: #FFFFFF; border-radius: 999px; }
@keyframes e3ZoomFade { from { opacity: 0; } }
@keyframes e3ZoomIn { from { opacity: 0; transform: scale(.96); } }
@media (max-width: 720px) { .zoom { padding: 72px 12px 12px; } .zoom img { border-radius: 8px; } }
@media (prefers-reduced-motion: reduce) { .zoom[open], .zoom::backdrop, .zoom img { animation: none; } }
/* Role walkthrough: a tab row of steps (each names a role) above one clip per step (site.js).
   Every step has a hairline above it; the open step's fills in ink with its clip's progress, then the next step opens. Scrolls sideways inside itself on narrow screens. */
.roles-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 24px; }
.roles-step { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 0 0; border: 0; border-top: 2px solid var(--hair); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s var(--ease); }
.roles-step:hover { border-top-color: var(--quiet); }
/* Progress: the open step's line fills in ink as its clip plays (--p, 0–1, set by site.js). */
.roles-step::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; }
.roles-step[aria-selected="false"]::before { display: none; }
.roles-step:focus-visible { outline-offset: 6px; }
.roles-who { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.roles-what { color: var(--muted); line-height: 1.5; }
.roles-step[aria-selected="true"] .roles-what { color: var(--ink); }
/* Clip panel: a 16:9 surface tile; the uncropped clip sits centred 64px in (16px on phones), with a hairline edge. */
.roles-panel, .shot.is-inset { margin: 0; padding: 64px; display: flex; align-items: center; justify-content: center; }
.roles-panel[hidden] { display: none; }
.roles-panel video, .shot.is-inset video { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 12px; background: var(--page); box-shadow: 0 0 0 1px var(--hair); }
@media (max-width: 720px) { .roles-panel, .shot.is-inset { padding: 16px; } .roles-panel video, .shot.is-inset video { border-radius: 8px; } }
.shot.is-embed { aspect-ratio: auto; margin: 0; padding: 64px; }
.shot.is-embed iframe { display: block; width: 100%; height: 640px; border: 0; border-radius: 12px; background: var(--page); box-shadow: 0 0 0 1px var(--hair); }
@media (max-width: 720px) { .shot.is-embed { padding: 16px; } .shot.is-embed iframe { height: 600px; border-radius: 8px; } }
@media (max-width: 900px) {
  .roles-steps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: -24px; padding-right: 24px; }
  .roles-steps::-webkit-scrollbar { display: none; }
  .roles-step { flex: 0 0 200px; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) { .roles-step { transition: none; } .roles-step[aria-selected="true"]::before { transform: none; } }

.shots { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.shots .shot { margin: 0; }

.cs-next { margin-top: 176px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: end; padding-top: 32px; border-top: 1px solid var(--hair); }
.cs-next a { text-decoration: none; }
.cs-next-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; text-align: right; max-width: 40ch; }
.cs-next-card .label { transition: color .2s var(--ease); }
.cs-next-card:hover .label { color: var(--muted); }
@media (max-width: 560px) { .cs-next { flex-direction: column-reverse; align-items: start; } .cs-next-card { align-items: flex-start; text-align: left; } }

@keyframes e3SheetIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes e3LinkIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-link, .sheet-foot { animation: none; }
  .menu-btn svg, .lift, .pill, .flink svg, .nav-link { transition: none; }
  a.tile:hover .lift { transform: none; }
}
