/* =========================================================
   Ellie Kim — Portfolio
   ---------------------------------------------------------
   1. Tokens (colors, fonts) — edit these to restyle
   2. Base
   3. Top navigation, contact popover
   4. Home: hero, filter, project cards
   5. Case study (product template)
   6. Case study (visual template)
   7. Play page
   8. About
   9. Footer / CTA
   10. Utilities, motion, responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #fafaf9;
  --surface: #f1f1ee;
  --card: #ffffff;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #74746f;
  --line: #e7e6e2;
  --accent: #5b4cff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --dock: rgba(22, 22, 24, 0.9);
  --good: #22c55e;

  /* One typeface everywhere: Inter */
  --font-sans: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: var(--font-sans);

  --max: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --r-sm: 10px;
  --r: 18px;
  --r-lg: 28px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d0d0e;
  --surface: #18181a;
  --card: #141416;
  --ink: #f3f3f0;
  --ink-2: #d0d0cc;
  --muted: #94948f;
  --line: #2a2a2d;
  --accent: #8f86ff;
  --dock: rgba(38, 38, 42, 0.82);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.serif { color: var(--accent); }
.mono { font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }

/* Dark-mode switch: circular reveal (see js/main.js) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- 3. Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--max); height: 96px; margin: 0 auto; padding: 14px var(--gutter) 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; justify-self: start; }

/* Dark pill navigation */
.nav-links {
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: var(--dock);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16);
}
.nav-links a, .nav-links button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 17px; border-radius: 999px; border: 0; background: none;
  color: rgba(255, 255, 255, 0.72); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .2s, color .2s;
}
.nav-links svg { width: 16px; height: 16px; flex: none; }
.nav-links a:hover, .nav-links button:hover { color: #fff; }
.nav-links [aria-current="page"], .nav-links button[aria-expanded="true"] { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center;
  transition: transform .2s var(--ease), border-color .2s;
}
.theme-toggle:hover { transform: rotate(-15deg); border-color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--good); margin-right: 6px; vertical-align: 1px;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center;
  transition: transform .2s var(--ease), border-color .2s;
}
.theme-toggle:hover { transform: rotate(-15deg); border-color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* Contact popover (drops down from the Contact button) */
.contact-pop {
  position: fixed; top: 100px; left: 16px; z-index: 60;
  width: min(360px, calc(100vw - 32px));
  transform: translateY(-10px) scale(.97); transform-origin: top right;
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), transform .35s var(--ease), visibility .25s;
  background: var(--dock);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px; padding: 22px; color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.contact-pop.open { opacity: 1; visibility: visible; transform: none; }
.contact-pop .who { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), #ff8ab3);
  display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff;
}
.contact-pop .who strong { display: block; font-weight: 500; font-size: 15px; }
.contact-pop .who span { font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.contact-pop p { font-size: 14px; color: rgba(255, 255, 255, 0.75); margin: 16px 0 14px; }
.copy-row { display: flex; gap: 6px; }
.copy-row code {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px;
  background: rgba(255, 255, 255, 0.92); color: #111;
  padding: 11px 12px; border-radius: 12px;
}
.copy-btn {
  border: 0; border-radius: 12px; padding: 0 16px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 500;
  min-width: 82px; transition: background .2s, transform .15s;
}
.copy-btn:active { transform: scale(.96); }
.copy-btn.copied { background: var(--good); }
.contact-pop .links { display: flex; gap: 16px; margin-top: 14px; font-size: 13px; }
.contact-pop .links a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.contact-pop .links a:hover { color: #fff; }
.pop-close {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px;
  border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff;
  display: grid; place-items: center;
}

/* ---------- 4. Home ---------- */
.hero { text-align: center; padding: clamp(48px, 8vw, 104px) 0 clamp(64px, 8vw, 104px); }
.hero .eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(30px, 3.8vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0 auto;
}
.intro { display: flex; align-items: flex-start; justify-content: center; gap: 22px; margin: 30px auto 0; max-width: 620px; text-align: left; }
.hero .intro .sub { margin: 0; max-width: none; }

/* Small dot animation: an accent dot hops around a 3×3 grid while the grid twinkles */
.dots {
  position: relative; flex: none; margin-top: 4px;
  display: grid; grid-template-columns: repeat(3, 9px); gap: 7px;
}
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  animation: dotTwinkle 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.16s);
}
.dots b {
  position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 16px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: dotHop 6s infinite;
}
@keyframes dotTwinkle {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes dotHop {
  0%, 10%   { transform: translate(0, 0); }
  16%, 26%  { transform: translate(16px, 0); }
  32%, 42%  { transform: translate(32px, 16px); }
  48%, 58%  { transform: translate(16px, 32px); }
  64%, 74%  { transform: translate(0, 16px); }
  80%, 90%  { transform: translate(16px, 16px); }
  100%      { transform: translate(0, 0); }
}
.dots b { animation-timing-function: cubic-bezier(.6, 0, .2, 1); }

.work-head { display: flex; flex-direction: column; align-items: center; }
.work-head h2 { font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -0.03em; font-weight: 600; margin: 0 0 24px; }
.hero h1 .serif { letter-spacing: -0.02em; }
.hero .sub { color: var(--muted); font-size: clamp(15px, 1.3vw, 17px); margin: 26px auto 0; max-width: 46ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}

/* Hero word reveal + rotating word */
.split-word { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(8px); animation: wordIn .9s var(--ease) forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; filter: blur(0); } }
.rotator { display: inline-grid; vertical-align: bottom; overflow: hidden; padding: 0 .06em .08em; margin-bottom: -.08em; }
.rotator > span { grid-area: 1 / 1; color: var(--accent); transform: translateY(110%); opacity: 0; transition: transform .7s var(--ease), opacity .5s; }
.rotator > span.on { transform: none; opacity: 1; }
.rotator > span.off { transform: translateY(-110%); opacity: 0; }

/* Filter pill */
.filter-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: clamp(36px, 5vw, 56px); }
.filter {
  position: relative; display: inline-flex; padding: 6px; gap: 2px;
  border-radius: 999px; background: var(--card);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--card), var(--card)),
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, #ff8ab3 55%, transparent), color-mix(in srgb, #4cc9f0 55%, transparent));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 6px 30px color-mix(in srgb, var(--accent) 12%, transparent);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.filter::-webkit-scrollbar { display: none; }
.filter button {
  position: relative; z-index: 1; border: 0; background: none;
  padding: 10px 20px; border-radius: 999px; font-size: 15px; white-space: nowrap;
  color: var(--muted); transition: color .25s;
}
.filter button sup { font-family: var(--font-mono); font-size: 10px; margin-left: 3px; opacity: .7; }
.filter button.active { color: var(--bg); }
.filter-indicator {
  position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: 0;
  background: var(--ink); border-radius: 999px;
  transition: transform .45s var(--ease), width .45s var(--ease);
}
.count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* Project cards */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(40px, 5vw, 64px) clamp(16px, 2.4vw, 32px); }
.card { display: block; text-decoration: none; color: inherit; }
.card[hidden] { display: none; }
.card.enter { animation: cardIn .6s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

.card-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; border-radius: var(--r);
  background: var(--surface);
  transition: clip-path .5s var(--ease), border-radius .5s var(--ease);
  clip-path: inset(0 round var(--r));
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-media { clip-path: inset(10px round calc(var(--r) - 4px)); }
.card:hover .card-media img { transform: scale(1.06); }

.badges { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; transition: transform .5s var(--ease); }
.card:hover .badges { transform: translate(8px, 8px); }
.badge {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.82); color: #111;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 18px; }
.card-title { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; margin: 0; }
.card-type { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card-desc { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-2); }

/* Custom "view" cursor over cards (desktop only) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-size: 13px; font-weight: 500;
  transform: translate3d(-200px, -200px, 0) scale(0);
  transition: transform .35s var(--ease), opacity .2s;
  opacity: 0;
}
.cursor.show { opacity: 1; }

/* ---------- 5. Case study — product template ---------- */
.back-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  text-decoration: none; font-size: 14px; transition: border-color .2s, transform .2s var(--ease);
}
.back-pill:hover { border-color: var(--ink); transform: translateX(-3px); }

.cs-hero {
  --p: var(--accent);
  position: relative; margin: 8px var(--gutter) 0;
  border-radius: var(--r-lg);
  background:
    radial-gradient(1200px 500px at 85% 0%, color-mix(in srgb, var(--p) 22%, transparent), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, color-mix(in srgb, var(--p) 12%, transparent), transparent 60%),
    var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}
.cs-hero-inner {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 56px) clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center;
}
.app-icon {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--p), color-mix(in srgb, var(--p) 55%, #fff));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--p) 35%, transparent);
}
.pill {
  display: inline-block; font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--p, var(--accent)) 14%, transparent);
  color: color-mix(in srgb, var(--p, var(--accent)) 80%, var(--ink));
  font-weight: 500;
}
.cs-hero h1 {
  font-size: clamp(32px, 4.2vw, 56px); line-height: 1.06; letter-spacing: -0.04em;
  font-weight: 600; margin: 16px 0 0;
}
.cs-hero .lead { color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); margin: 20px 0 0; max-width: 46ch; }
.kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.kpi {
  font-size: 14px; padding: 8px 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.kpi b { color: var(--p); font-weight: 600; }
.cs-hero-media img { border-radius: var(--r); width: 100%; box-shadow: 0 30px 80px color-mix(in srgb, var(--p) 25%, transparent); }

.cs-meta {
  max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px) clamp(28px, 4vw, 48px);
  display: grid; grid-template-columns: repeat(4, 1fr) 1.4fr; gap: 24px;
}
.cs-meta > div { border-top: 1px solid var(--line); padding-top: 14px; }
.cs-meta dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.cs-meta dd { margin: 0; font-size: 15px; }
.contrib { display: grid; gap: 7px; }
.contrib-row { display: grid; grid-template-columns: 76px 1fr 38px; align-items: center; gap: 10px; font-size: 13px; }
.contrib-bar { height: 5px; border-radius: 9px; background: var(--surface); overflow: hidden; }
.contrib-bar i { display: block; height: 100%; background: var(--p); border-radius: 9px; width: 0; transition: width 1.2s var(--ease); }
.in .contrib-bar i, .contrib-bar i.go { width: var(--w); }
.contrib-row span:last-child { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: right; }

/* Body with sticky table of contents */
.cs-body { display: grid; grid-template-columns: 180px 1fr; gap: clamp(24px, 5vw, 80px); padding-top: clamp(56px, 8vw, 104px); }
.toc { position: sticky; top: 96px; align-self: start; display: grid; gap: 2px; }
.toc a {
  display: block; padding: 6px 12px; border-radius: 8px; font-size: 14px;
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); background: var(--surface); border-left-color: var(--p, var(--accent)); }

.cs-content { min-width: 0; }
.cs-sec { padding-bottom: clamp(72px, 10vw, 128px); scroll-margin-top: 88px; }
.sec-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--p, var(--accent)); margin: 0 0 16px;
}
.sec-title { font-size: clamp(24px, 2.9vw, 38px); line-height: 1.15; letter-spacing: -0.035em; font-weight: 600; margin: 0 0 22px; }
.sec-title .hl { color: var(--p, var(--accent)); }
.sec-title .dim { color: var(--muted); }
.cs-content p { max-width: 64ch; color: var(--ink-2); }
.cs-content p strong { color: var(--ink); }

/* Data bars (funnel) */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); margin-top: 32px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head h4 { margin: 0; font-size: 15px; font-weight: 500; }
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 54px; gap: 14px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: var(--surface); border-radius: 10px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 10px; background: var(--p, var(--accent)); width: 0; transition: width 1.2s var(--ease); }
.in .bar-track i { width: var(--w); }
.bar-row b { font-family: var(--font-mono); font-size: 13px; font-weight: 500; text-align: right; }
.bar-row.faded .bar-track i { background: color-mix(in srgb, var(--p, var(--accent)) 35%, var(--surface)); }

.keypoint {
  margin-top: 28px; padding: 22px 24px; border-radius: var(--r);
  background: color-mix(in srgb, var(--p, var(--accent)) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--p, var(--accent)) 25%, transparent);
}
.keypoint .sec-label { margin-bottom: 8px; }
.keypoint p { margin: 0; }

/* Dark strategy panel */
.dark-panel {
  background: #111113; color: #f3f3f0; border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 56px);
}
.dark-panel .sec-title { color: #fff; }
.dark-panel p { color: rgba(255, 255, 255, 0.7); }
.hypo { display: grid; gap: 14px; margin-top: 36px; }
.hypo-row { display: grid; grid-template-columns: 1fr 28px 1.4fr; gap: 14px; align-items: stretch; }
.hypo-card { background: #1c1c1f; border: 1px solid #2b2b2f; border-radius: 16px; padding: 18px 20px; }
.hypo-card .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; }
.hypo-card h5 { font-size: 17px; font-weight: 500; margin: 8px 0 4px; color: #fff; }
.hypo-card p { font-size: 14px; margin: 6px 0 0; color: rgba(255, 255, 255, 0.72); }
.hypo-card .goal { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.hypo-card .goal b { color: var(--p); font-weight: 600; margin-left: 6px; }
.hypo-arrow { display: grid; place-items: center; color: rgba(255, 255, 255, 0.35); }

/* AS-IS / TO-BE */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.compare-card { border-radius: var(--r); padding: 22px; background: var(--surface); }
.compare-card.to-be { background: color-mix(in srgb, var(--p, var(--accent)) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--p, var(--accent)) 30%, transparent); }
.compare-card .tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.compare-card.to-be .tag { color: var(--p, var(--accent)); }
.compare-card ol { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 12px; }
.compare-card li { display: grid; grid-template-columns: 28px 1fr; font-size: 15px; }
.compare-card li span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.compare-card li small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.compare-card img { border-radius: 12px; width: 100%; }
.result-chip {
  display: inline-flex; align-items: baseline; gap: 10px; margin-top: 20px;
  padding: 10px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
}
.result-chip b { font-size: 22px; letter-spacing: -0.02em; color: var(--p, var(--accent)); }
.result-chip span { font-size: 14px; color: var(--muted); }

.figure { margin: 32px 0 0; }
.figure img { border-radius: var(--r); width: 100%; background: var(--surface); }
.figure figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; font-family: var(--font-mono); }

/* Results + insights */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.stat {
  border-radius: var(--r); padding: 24px; background: var(--card); border: 1px solid var(--line);
}
.stat .num { font-size: clamp(32px, 3.6vw, 48px); line-height: 1; letter-spacing: -0.045em; font-weight: 600; color: var(--p, var(--accent)); }
.stat .what { font-weight: 500; margin-top: 12px; }
.stat .note { color: var(--muted); font-size: 14px; margin-top: 4px; }
.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.insight { border-top: 2px solid var(--ink); padding-top: 16px; }
.insight .k { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.insight h5 { font-size: 18px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; margin: 8px 0; }
.insight p { font-size: 15px; color: var(--muted); margin: 0; }

/* Next project */
.next {
  display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: end;
  text-decoration: none; border-top: 1px solid var(--line); padding-top: 28px; margin-top: 32px;
}
.next .k { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.next strong { display: block; font-size: clamp(28px, 4vw, 56px); letter-spacing: -0.04em; font-weight: 500; line-height: 1.05; margin-top: 8px; transition: color .2s; }
.next:hover strong { color: var(--accent); }
.next img { border-radius: var(--r); aspect-ratio: 4/3; object-fit: cover; transition: transform .6s var(--ease); }
.next:hover img { transform: scale(1.03); }

/* ---------- 6. Case study — visual template ---------- */
.vis { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: clamp(24px, 4vw, 56px); padding-top: 12px; }
.vis-info { position: sticky; top: 92px; align-self: start; }
.vis-info h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 500; margin: 12px 0 18px; }
.vis-info > p { color: var(--muted); font-size: 15px; }
.vis-dl { display: grid; grid-template-columns: 96px 1fr; gap: 8px 16px; font-size: 14px; margin: 28px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.vis-dl dt { color: var(--muted); }
.vis-dl dd { margin: 0; }
.vis-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.vis-stats b { display: block; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.vis-stats span { font-size: 12px; color: var(--muted); }
.vis-media { display: grid; gap: 14px; }
.vis-media figure { position: relative; margin: 0; }
.vis-media img { width: 100%; border-radius: var(--r); background: var(--surface); }
.vis-media figure .badges { top: 14px; left: 14px; }
.vis-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 7. Play ---------- */
.play-head { padding: clamp(40px, 7vw, 88px) 0 28px; }
.play-head h1 { font-size: clamp(32px, 4vw, 52px); letter-spacing: -0.04em; font-weight: 500; margin: 0; line-height: 1.05; }
.play-head p { color: var(--muted); margin: 10px 0 24px; }
.chip-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter button { border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 999px; font-size: 14px; transition: all .2s; }
.chip-filter button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.board {
  position: relative; height: 1000px; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--card);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 18%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  touch-action: none;
}
.polaroid {
  position: absolute; width: 210px; padding: 10px 10px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: rotate(var(--rot, 0deg));
  cursor: grab; user-select: none; -webkit-user-select: none;
  transition: box-shadow .2s, opacity .3s, filter .3s;
}
.polaroid:hover { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14); }
.polaroid.dragging { cursor: grabbing; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2); transition: none; }
.polaroid img { border-radius: 3px; pointer-events: none; aspect-ratio: 1; object-fit: cover; width: 100%; }
.polaroid figcaption { font-family: var(--font-mono); font-size: 12px; line-height: 1.4; margin-top: 10px; color: var(--ink-2); }
.polaroid.dim { opacity: .18; filter: grayscale(1); }
.board-hint { position: absolute; right: 16px; bottom: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- 8. About ---------- */
.about-hero { padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 56px); }
.about-hero h1 { font-size: clamp(40px, 6.4vw, 92px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 500; margin: 0; max-width: 16ch; }
.about-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(28px, 6vw, 96px); }
.about-grid .portrait img { border-radius: var(--r-lg); width: 100%; background: var(--surface); }
.big-text { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.32; letter-spacing: -0.02em; margin: 0; }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; }
.skills h4 { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 400; margin: 0 0 10px; }
.skills ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 15px; }
.timeline { margin-top: clamp(56px, 8vw, 104px); }
.timeline-row { display: grid; grid-template-columns: 180px 1fr 1.5fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); font-size: 15px; }
.timeline-row:last-child { border-bottom: 1px solid var(--line); }
.timeline-row .yr { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

/* ---------- 9. CTA + footer ---------- */
.cta { padding: clamp(88px, 13vw, 168px) 0 clamp(48px, 7vw, 80px); text-align: center; }
.cta h2 { font-size: clamp(40px, 6.4vw, 92px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 500; margin: 0 auto 32px; max-width: 14ch; }
.cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-size: 15px; font-weight: 500;
  text-decoration: none; border: 1px solid var(--line); background: var(--card);
  transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-dark.copied { background: var(--good); border-color: var(--good); color: #fff; }

.footer { margin-top: clamp(96px, 12vw, 160px); border-top: 1px solid var(--line); padding: 22px 0; font-size: 13px; color: var(--muted); }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer .row { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- 10. Motion + responsive ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal, .split-word { opacity: 1; transform: none; filter: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 980px) {
  .cs-hero-inner { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: repeat(2, 1fr); }
  .cs-meta .contrib-wrap { grid-column: 1 / -1; }
  .cs-body { grid-template-columns: 1fr; }
  .toc { display: none; }
  .vis { grid-template-columns: 1fr; }
  .vis-info { position: static; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .portrait { max-width: 420px; }
  .timeline-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .work-grid { grid-template-columns: 1fr; }
  .filter button { padding: 9px 14px; font-size: 14px; }
  .compare, .stats3, .insights, .vis-pair { grid-template-columns: 1fr; }
  .hypo-row { grid-template-columns: 1fr; }
  .hypo-arrow { transform: rotate(90deg); height: 20px; }
  .bar-row { grid-template-columns: 1fr 54px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .next { grid-template-columns: 1fr; }
  .next img { display: none; }
  .skills { grid-template-columns: 1fr 1fr; }
  .nav-inner { grid-template-columns: auto 1fr auto; gap: 8px; height: 76px; padding-top: 10px; }
  .brand-name { display: none; }
  .nav-links { justify-self: center; padding: 4px; }
  .nav-links a, .nav-links button { padding: 8px 11px; font-size: 13px; }
  .nav-links svg { display: none; }
  .theme-toggle { width: 34px; height: 34px; }
  .intro { gap: 14px; }
  .cs-hero { margin: 4px 12px 0; }
  .cs-meta { grid-template-columns: 1fr 1fr; }

  /* Play board becomes a simple grid on phones */
  .board { height: auto !important; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; touch-action: auto; }
  .polaroid { position: static; width: auto; transform: none !important; cursor: default; }
  .board-hint { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* =========================================================
   v5 additions — real projects, case-study blocks, AI, about
   ========================================================= */

/* Photo avatar in nav + popover */
.avatar-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface); }
.avatar-img.sm { width: 44px; height: 44px; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); }

/* Footer text links (underlined, blue on hover) */
.footer .row { gap: 28px; }
.flink {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
  text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent);
  transition: color .25s, text-decoration-color .25s;
}
.footer a.flink, .about-links a.flink { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.flink:hover, .footer a.flink:hover { color: var(--link); text-decoration-color: var(--link); }
:root { --link: #2f6fe4; }
[data-theme="dark"] { --link: #5b9bff; }

/* Case-study hero (single column, wide image) */
.cs-hero-inner.single { display: block; padding-bottom: 28px; }
.cs-hero-inner.single .kpis { margin-top: 24px; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.tag-pill { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.cs-hero h1 { margin-top: 18px; }
.cs-hero .lead { max-width: 56ch; }
.cs-meta.m3, .cs-meta.m4 { grid-template-columns: repeat(4, 1fr); }
.cs-meta.m3 { grid-template-columns: repeat(3, 1fr); }
.cs-hero-img { padding: 0 clamp(20px, 4vw, 56px) clamp(20px, 4vw, 56px); }
.cs-hero-img img { width: 100%; border-radius: var(--r); background: var(--surface); }

/* Section text */
.sec-sub { font-size: clamp(16px, 1.3vw, 18px); color: var(--muted); margin: -8px 0 18px; max-width: 60ch; }
.sub-h { font-size: 18px; font-weight: 600; margin: 32px 0 8px; }
.cs-content > section > p { max-width: 64ch; color: var(--ink-2); }

/* Images */
.gallery { margin: 28px 0 0; display: grid; gap: 14px; }
.gallery.g2 { grid-template-columns: 1fr 1fr; }
.gallery.g3 { grid-template-columns: repeat(3, 1fr); }
.gallery img, .stack img { width: 100%; border-radius: var(--r); background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.gallery figcaption { grid-column: 1 / -1; font-size: 13px; color: var(--muted); text-align: center; }
.stack { display: grid; gap: 14px; margin-top: 28px; }

/* Lists */
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; max-width: 64ch; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: color-mix(in srgb, var(--p, var(--accent)) 16%, transparent);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--p, var(--accent)) 16%, transparent);
}
.ticks li::after { content: ""; position: absolute; left: 5px; top: calc(.45em + 5px); width: 6px; height: 6px; border-radius: 50%; background: var(--p, var(--accent)); }

/* Quote, focus, note */
.quote {
  margin: 32px 0; padding: 4px 0 4px 26px; border-left: 3px solid var(--p, var(--accent));
  font-size: clamp(18px, 1.9vw, 24px); line-height: 1.35; letter-spacing: -0.02em; font-weight: 500; max-width: 36ch;
}
.quote cite { display: block; margin-top: 12px; font-size: 14px; font-style: normal; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.focus {
  margin-top: 32px; padding: clamp(24px, 4vw, 44px); border-radius: var(--r-lg);
  background: #111113; color: #f3f3f0;
}
.focus .sec-label { color: var(--p, var(--accent)); filter: brightness(1.25); }
.focus p { color: #fff !important; font-size: clamp(18px, 2vw, 25px); line-height: 1.3; letter-spacing: -0.025em; font-weight: 500; margin: 0; max-width: 36ch !important; }
.note {
  margin-top: 32px; padding: 26px 28px; border-radius: var(--r);
  background: color-mix(in srgb, var(--p, var(--accent)) 7%, var(--card)); border: 1px dashed color-mix(in srgb, var(--p, var(--accent)) 40%, transparent);
}
.note-k { font-size: 13px; font-weight: 600; color: var(--p, var(--accent)); }
.note h4 { font-size: 20px; letter-spacing: -0.02em; margin: 8px 0 10px; font-weight: 600; }
.note p { font-size: 16px; }

/* Insight / problem cards */
.icards { display: grid; gap: 14px; margin-top: 28px; }
.icards.c2 { grid-template-columns: repeat(2, 1fr); }
.icards.c3 { grid-template-columns: repeat(3, 1fr); }
.icard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; transition: transform .3s var(--ease), border-color .3s; }
.icard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--p, var(--accent)) 50%, var(--line)); }
.icard .k { font-size: 13px; font-weight: 600; color: var(--p, var(--accent)); }
.icard h5 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 8px 0 6px; line-height: 1.25; }
.icard p { font-size: 15px !important; color: var(--muted) !important; margin: 0; }

/* Process steps */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.steps li { display: grid; gap: 10px; background: var(--surface); border-radius: var(--r); padding: 20px; }
.steps li > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--p, var(--accent)); color: #fff; }
.steps strong { font-weight: 600; }
.steps p { font-size: 14px !important; color: var(--muted) !important; margin: 4px 0 0; }

/* Feature rows (image + text, alternating) */
.feats { display: grid; gap: clamp(40px, 6vw, 72px); margin-top: 40px; }
.feat { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.feat:nth-child(even) .feat-text { order: 2; }
.feat.no-media { grid-template-columns: 1fr; }
.feat-num { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--p, var(--accent)); background: color-mix(in srgb, var(--p, var(--accent)) 12%, transparent); }
.feat h4 { font-size: clamp(20px, 2vw, 25px); letter-spacing: -0.03em; line-height: 1.15; margin: 14px 0 10px; font-weight: 600; }
.feat-media img { width: 100%; border-radius: var(--r); background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }

/* Video */
.video { margin-top: 28px; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.mp4s { margin-top: 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mp4s video { width: 100%; border-radius: var(--r-sm); background: #000; display: block; }

/* Visual template captions */
.vis-caption { padding: 24px 0 4px; }
.vis-caption h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.vis-caption p { margin: 0; color: var(--muted); max-width: 60ch; }
.vis-media .gallery { margin: 0; }
.vis-info .tag-row { margin-top: 20px; }
.vis-info h1 { margin-top: 12px; }
.vis-info > p { color: var(--ink-2); }

/* Prev / next pager */
.pager-wrap { padding: clamp(56px, 8vw, 104px) 0 0; border-top: 1px solid var(--line); margin-top: clamp(56px, 8vw, 96px); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 24px); }
.pager-card { display: grid; gap: 16px; text-decoration: none; color: inherit; }
.pager-img { overflow: hidden; border-radius: var(--r); aspect-ratio: 16 / 9; background: var(--surface); }
.pager-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pager-card:hover .pager-img img { transform: scale(1.04); }
.pager-text { display: grid; gap: 4px; }
.pager-card.pager-next .pager-text { text-align: right; justify-items: end; }
.pager-text .k { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); transition: color .2s, gap .3s var(--ease); }
.pager-card:hover .k { color: var(--link); gap: 12px; }
.pager-text strong { font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.03em; font-weight: 600; line-height: 1.15; }
.pager-text .t { font-size: 14px; color: var(--muted); }
.pager-all { text-align: center; margin-top: 36px; font-size: 15px; }

/* How I approach AI */
.ai { padding-top: clamp(96px, 12vw, 160px); }
.ai-head { max-width: 640px; }
.ai-head h2 { font-size: clamp(26px, 3vw, 40px); letter-spacing: -0.035em; line-height: 1.08; font-weight: 600; margin: 0 0 16px; }
.ai-lead { color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); margin: 0; }
.ai-flow { display: flex; align-items: center; gap: 10px; margin: 32px 0 28px; flex-wrap: wrap; }
.ai-flow span { font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.ai-flow i { flex: 0 1 40px; min-width: 16px; height: 1px; background: linear-gradient(90deg, var(--line), var(--accent)); }
.ai-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ai-card {
  position: relative; overflow: hidden; padding: 26px 24px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.ai-card::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); opacity: 0; transition: opacity .4s; }
.ai-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 12%, transparent); }
.ai-card:hover::after { opacity: 1; }
.ai-num { font-size: 13px; font-weight: 600; color: var(--accent); }
.ai-card h3 { font-size: 17px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; margin: 14px 0 10px; }
.ai-card p { margin: 0; font-size: 15px; color: var(--muted); }

/* About */
.about-intro { display: grid; grid-template-columns: minmax(260px, 400px) 1fr; gap: clamp(32px, 7vw, 112px); align-items: center; padding: clamp(48px, 7vw, 96px) 0 clamp(72px, 10vw, 140px); }
.polaroid-hero img { width: 100%; transform: rotate(-3deg); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .16)); transition: transform .6s var(--ease); }
.polaroid-hero:hover img { transform: rotate(0deg) scale(1.02); }
.about-text h1 { font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -0.035em; font-weight: 500; margin: 0 0 22px; line-height: 1.1; }
.about-text p { color: var(--ink-2); max-width: 60ch; }
.about-links { display: flex; gap: 24px; margin-top: 26px; font-size: 15px; }
.off-figma { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.off-text h2 { font-size: clamp(26px, 2.8vw, 36px); letter-spacing: -0.035em; line-height: 1.1; font-weight: 500; margin: 0 0 18px; }
.off-text p { color: var(--ink-2); max-width: 34ch; }
.collage img { width: 100%; display: block; }

@media (max-width: 980px) {
  .ai-grid { grid-template-columns: repeat(2, 1fr); }
  .about-intro, .off-figma { grid-template-columns: 1fr; }
  .polaroid-hero { max-width: 340px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .feat, .feat:nth-child(even) { grid-template-columns: 1fr; }
  .feat:nth-child(even) .feat-text { order: 0; }
  .cs-meta.m3, .cs-meta.m4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .gallery.g2, .gallery.g3, .icards.c2, .icards.c3, .steps, .mp4s { grid-template-columns: 1fr; }
  .gallery.g3 { grid-template-columns: 1fr 1fr; }
  .ai-grid { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager-card.pager-next .pager-text { text-align: left; justify-items: start; }
  .footer .row { gap: 20px; }
}
.ai-flow em { font-style: normal; font-size: 13px; color: var(--muted); margin-left: 8px; }
.cs-hero-img.narrow { display: flex; justify-content: center; }
.cs-hero-img.narrow img { max-width: 720px; }
.gallery img[src*="the-hive/"] , .stack img[src*="the-hive/"] { border: 0; background: none; }
.gallery.g1 img[src*="IG9SFp5O"] { max-width: 760px; margin: 0 auto; }
.play-sub { font-size: clamp(15px, 1.4vw, 18px); font-weight: 400; color: var(--muted); letter-spacing: -0.01em; margin: 12px 0 26px; }
.gallery.g1 img[src*="sblEjRMkfe"] { max-width: 560px; margin: 0 auto; }
.gallery.g1 img[src*="mid-high-fi"], .gallery.g1 img[src*="pqi-guidelines"], .gallery.g1 img[src*="pqi-sharepoint"] { max-width: 640px; margin: 0 auto; }

/* ---------- Hero skill tags placed by a cursor ---------- */
.hero { position: relative; overflow: hidden; padding-bottom: clamp(100px, 8vw, 112px); }
.hero .container { position: relative; z-index: 2; }
.htags { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.htag {
  position: absolute; left: 0; top: 0;
  opacity: 0; transform: scale(.35); transform-origin: 0 0;
  transition: opacity .2s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1);
}
.htag > span {
  display: block; white-space: nowrap;
  padding: 8px 17px; border-radius: 6px 999px 999px 999px;
  background: var(--c); color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 32%, transparent), 0 1px 2px rgba(0, 0, 0, .12);
}
.htag.in { opacity: 1; transform: scale(1); }
.htag.in > span { animation: tagFloat 7s ease-in-out infinite; animation-delay: var(--d); }
.htag.drag { transition: none; z-index: 5; }
.htag.drag > span { animation: none; transform: scale(1.06) rotate(-2deg); box-shadow: 0 16px 34px color-mix(in srgb, var(--c) 40%, transparent); }
@keyframes tagFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (hover: hover) and (pointer: fine) {
  .htag.in { pointer-events: auto; cursor: grab; }
  .htag.drag { cursor: grabbing; }
}

.hcursor {
  position: absolute; left: 0; top: 0; z-index: 6; width: 22px; height: 26px;
  opacity: 0; transition: transform .9s cubic-bezier(.65, 0, .35, 1), opacity .35s ease;
}
.hcursor.on { opacity: 1; }
.hcursor svg { display: block; width: 22px; height: 26px; fill: #111; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.hcursor i {
  position: absolute; left: -13px; top: -13px; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent);
  background: color-mix(in srgb, var(--ink) 6%, transparent); opacity: 0;
}
.hcursor.click i { animation: cursorRipple .5s ease-out; }
@keyframes cursorRipple { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.25); } }

@media (max-width: 720px) {
  .hero { padding-top: 92px; padding-bottom: 92px; }
  .htag > span { font-size: 12px; padding: 6px 12px; }
  .hcursor, .hcursor svg { width: 18px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .htag { transition: none; }
  .htag.in > span { animation: none; }
  .hcursor { display: none; }
}

/* ---------- Hero v2: more breathing room + dots and tags as one system ---------- */
.hero { padding-top: clamp(80px, 10vw, 148px); padding-bottom: clamp(128px, 11vw, 160px); }

/* Tags: quieter, so the headline stays the focus */
.htag > span {
  font-size: 13px; font-weight: 500; padding: 7px 15px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 22%, transparent);
}
@keyframes tagFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Dots: softer grid; the moving dot takes on each skill colour in turn */
.dots i { background: color-mix(in srgb, var(--ink) 12%, transparent); animation-duration: 3.2s; }
.dots b {
  color: #9747ff; background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent), 0 0 12px color-mix(in srgb, currentColor 45%, transparent);
  animation: dotHop 6s cubic-bezier(.6, 0, .2, 1) infinite, dotColor 4s steps(1, end) infinite;
  transition: color .4s ease, opacity .3s ease;
}
@keyframes dotColor { 0% { color: #9747ff; } 25% { color: #0d99ff; } 50% { color: #14ae5c; } 75% { color: #f24822; } }
/* While the cursor is out placing tags, the dot "becomes" the cursor */
.dots.away b { opacity: 0; }
.dots.away i { animation-play-state: paused; opacity: .5; }

@media (max-width: 720px) {
  .hero { padding-top: 116px; padding-bottom: 116px; }
  .htag > span { font-size: 12px; padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dots b { animation: none; }
}

.hcursor { transition: transform .75s cubic-bezier(.65, 0, .35, 1), opacity .35s ease; }

/* ---------- Hero v3: tags are dragged out of the dot grid ---------- */
.hblob {
  position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 999px;
  background: var(--c); z-index: 5; pointer-events: none;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 30%, transparent);
}
.htags.morph .htag { transform: none; transition: opacity .16s ease; }

@media (min-width: 721px) {
  /* The grid becomes a small palette: four coloured dots, one per skill */
  .dots.palette b { display: none; }
  .dots.palette i.c {
    background: var(--dc); opacity: 1; transform: none; animation: none;
    transition: background-color .35s ease, transform .35s ease, opacity .35s ease;
  }
  .dots.palette i.c.taken { background: color-mix(in srgb, var(--ink) 12%, transparent); transform: scale(.75); }
  /* After the tags are placed, each colour gently breathes in turn */
  .dots.palette.done i.c { animation: paletteBreathe 6s ease-in-out infinite; }
  .dots.palette.done i.c:nth-child(1) { animation-delay: 0s; }
  .dots.palette.done i.c:nth-child(3) { animation-delay: -4.5s; }
  .dots.palette.done i.c:nth-child(9) { animation-delay: -3s; }
  .dots.palette.done i.c:nth-child(7) { animation-delay: -1.5s; }
}
@keyframes paletteBreathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
  12% { transform: scale(1.25); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dc) 18%, transparent); }
  30% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}

/* Phones: only the dot animation, no cursor or tags */
@media (max-width: 720px) {
  .htags { display: none; }
  .hero { padding-top: clamp(72px, 16vw, 96px); padding-bottom: clamp(80px, 18vw, 100px); }
}
@media (prefers-reduced-motion: reduce) {
  .dots.palette.done i.c { animation: none; }
}
.hcursor { transition: transform .6s cubic-bezier(.65, 0, .35, 1), opacity .3s ease; }

/* ---------- Hero v4: smoother motion, palette lights up then gathers into one dot ---------- */
.hero { padding-bottom: clamp(150px, 13vw, 184px); }
.hcursor { transition: transform .72s cubic-bezier(.45, 0, .2, 1), opacity .4s ease; }
.htags.morph .htag { transition: opacity .24s ease; }
.hcursor.click i { animation: cursorRipple .7s cubic-bezier(.2, .7, .2, 1); }

@media (min-width: 721px) {
  .dots.palette i { transition: background-color .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1), opacity .5s ease, box-shadow .5s ease; }
  .dots.palette i.c.lit { transform: scale(1.3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dc) 20%, transparent); }
  .dots.palette i.c.off { background: color-mix(in srgb, var(--ink) 12%, transparent); transform: none; }
  .dots.palette i.center {
    background: var(--accent); opacity: 1; animation: none; transform: scale(1.15);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  .dots.palette.done i.c { animation: none; }
}
.gdot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--dc); pointer-events: none; }
@media (max-width: 720px) { .hero { padding-bottom: clamp(96px, 20vw, 112px); } }

/* ---------- Hero v5: instant labels; phones get the same dot sequence ---------- */
.htags.morph .htag { transition: none; }
.dots.palette b { display: none; }
.dots.palette i { transition: background-color .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1), opacity .5s ease, box-shadow .5s ease; }
.dots.palette i.c { background: var(--dc); opacity: 1; transform: none; animation: none; }
.dots.palette i.c.taken, .dots.palette i.c.off { background: color-mix(in srgb, var(--ink) 12%, transparent); transform: none; box-shadow: none; }
.dots.palette i.c.lit { background: var(--dc); transform: scale(1.3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dc) 20%, transparent); }
.dots.palette i.center {
  background: var(--accent); opacity: 1; animation: none; transform: scale(1.15);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ---------- Phones: dots sit between the headline and the intro, centred ---------- */
@media (max-width: 720px) {
  .hero .intro { flex-direction: column; align-items: center; gap: 22px; margin-top: 28px; text-align: center; }
  .hero .intro .dots { margin-top: 0; }
  .hero .intro .sub { max-width: 30ch; margin: 0 auto; }
}
.nowrap { white-space: nowrap; }

/* Desktop: intro sentence centred on the dot grid; more room below the tags */
@media (min-width: 721px) {
  .hero .intro { align-items: center; }
  .hero .intro .dots { margin-top: 0; }
  .hero { padding-bottom: clamp(240px, 20vw, 272px); }
}

/* ---------- Tighter corners everywhere (covers + project graphics) ---------- */
:root { --r-sm: 6px; --r: 10px; --r-lg: 16px; }

/* ---------- Slightly wider project grid ---------- */
#work .container { max-width: calc(var(--max) + 120px); }

/* ---------- Hero content moved down ~1cm ---------- */
.hero { padding-top: clamp(118px, calc(10vw + 38px), 186px); }
@media (max-width: 720px) { .hero { padding-top: clamp(110px, calc(16vw + 38px), 134px); } }

/* ---------- Project cards v2: clean, Apple-like hover ---------- */
.work-grid { gap: clamp(36px, 4vw, 56px) clamp(14px, 1.6vw, 20px); }
.card-media {
  aspect-ratio: 4 / 3; border-radius: var(--r); clip-path: none; overflow: hidden;
  background: var(--surface);
  transition: transform .7s cubic-bezier(.22, 1, .36, 1), box-shadow .7s cubic-bezier(.22, 1, .36, 1);
  transform: translateZ(0);
}
.card-media img {
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1.001);
  transition: transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
.card:hover .card-media { clip-path: none; transform: scale(.985); box-shadow: 0 0 0 1px var(--line); }
.card:hover .card-media img { transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1.045); }

/* Info chips that slide up inside the cover on hover */
.card-info {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden;
  opacity: 0; transform: translateY(10px);
  transition: opacity .45s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.card:hover .card-info, .card:focus-visible .card-info { opacity: 1; transform: none; }
.ci {
  flex: none; font-size: 12px; line-height: 1; padding: 7px 10px; border-radius: 6px;
  background: rgba(255, 255, 255, .82); color: #3a3a3a; white-space: nowrap;
  backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
.ci-strong { color: #111; font-weight: 600; }
.ci-desc { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ci-spacer { flex: 1; }
.card-title::after { content: none; }
.card .chips { display: none; }

/* Below the cover: just title + type (desc only where there is no hover) */
.card-meta { margin-top: 14px; }
.card-title { font-size: 17px; font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .card .card-desc { display: none; } }

/* Arrow cursor */
.cursor {
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  background: #111; color: #fff; font-size: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transition: opacity .25s ease;
}
.cursor svg { width: 20px; height: 20px; }
[data-theme="dark"] .cursor { background: #fff; color: #111; }
.card[data-cursor] { cursor: none; }
@media (hover: none), (pointer: coarse) { .card[data-cursor] { cursor: pointer; } }
@media (prefers-reduced-motion: reduce) { .card[data-cursor] { cursor: pointer; } .card-media, .card-media img { transition: none; } }
@media (max-width: 720px) { .card-info { display: none; } }
.ci-desc { color: #1d1d1f; }
.ci-desc { overflow: visible; text-overflow: clip; }
.gallery.g1 img[src*="ss-guidelines"] { max-width: 560px; margin: 0 auto; }

/* ---------- Project header: banner first, then title + details ---------- */
.ph { padding-top: 8px; }
.ph-banner { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.ph-banner img { width: 100%; display: block; max-height: 640px; object-fit: cover; }
.ph-banner.narrow { display: flex; justify-content: center; }
.ph-banner.narrow img { width: auto; max-width: 100%; max-height: 560px; object-fit: contain; }
.ph-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 5vw, 80px);
  padding: clamp(36px, 5vw, 60px) 0 clamp(8px, 2vw, 16px); border-bottom: 1px solid var(--line);
}
.ph-main h1 { font-size: clamp(32px, 4.2vw, 56px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 600; margin: 0; }
.ph-main .lead, .ph-main > p { color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); margin: 16px 0 0; max-width: 56ch; }
.ph-main .kpis { margin: 24px 0 28px; }
.ph-main .kpi b { color: var(--p); }
.ph-meta { margin: 0; display: grid; gap: 18px; align-content: start; padding-top: 6px; }
.ph-meta > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ph-meta > div:last-child { border-bottom: 0; }
.ph-meta dt { font-size: 13px; color: var(--muted); margin: 0; }
.ph-meta dd { margin: 0; font-size: 15px; }
.vis-flow { display: grid; gap: 16px; max-width: 980px; padding-top: clamp(40px, 6vw, 72px); }
.vis-flow .gallery { margin: 0; }
.vis-flow .vis-caption { padding: 28px 0 4px; }
@media (max-width: 860px) { .ph-grid { grid-template-columns: 1fr; gap: 20px; } }

/* video media in galleries & features */
.gallery video, .feat-media video { width: 100%; display: block; border-radius: var(--r); background: var(--surface); }
.gallery video { aspect-ratio: auto; }

/* hero tags: click to jump to that category */
.htag.in { pointer-events: auto; cursor: pointer; }
.htag.in > span { transition: box-shadow .25s ease, filter .25s ease; }
.htag.in:hover > span { filter: brightness(1.08); box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 45%, transparent), 0 1px 2px rgba(0, 0, 0, .12); }
.htag.drag { cursor: grabbing; }
#work { scroll-margin-top: 104px; }

/* hero: current workplace link */
.now-at { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s ease; }
.now-at:hover, .now-at:focus-visible { color: #0d99ff; text-decoration: none; }
