/* =========================================================
   Mayowa — Portfolio
   Visual language blended from: Landor (editorial scale, clip
   reveals), Lovi (soft gradient blobs, rounded calm cards),
   pleasecallmechamp / Speed Dial (playful serif + sans mix,
   stickers, marquees), instance.design & Bruce Cao (mono
   labels, grid, cursor), Rachel Chen (hover-card craft).
   ========================================================= */

:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6db;
  --fg: #111110;
  --fg-2: #5d5a53;
  --line: rgba(17, 17, 16, 0.14);
  --card: #ffffff;
  --accent: #ff5b2e;
  --accent-2: #3d5afe;
  --accent-3: #1b998b;
  --highlight: #ffe45c;
  --strip-bg: #efeeea;
  --strip-fg: #111110;
  --strip-line: rgba(17,17,16,.08);
  --blob-1: #ffb38a;
  --blob-2: #b9c3ff;
  --blob-3: #b8f2d8;
  --inverse-bg: #111110;
  --inverse-fg: #f4f1ea;

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --display: "Fraunces", "Times New Roman", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --nav-h: 76px;
}

:root[data-theme="dark"] {
  --highlight: #b8860b;
  --strip-bg: #232321;
  --strip-fg: #ffffff;
  --strip-line: rgba(255,255,255,.08);
  --bg: #0e0e0d;
  --bg-2: #181816;
  --fg: #f1ede4;
  --fg-2: #9c978c;
  --line: rgba(241, 237, 228, 0.14);
  --card: #1a1a18;
  --blob-1: #7a2e14;
  --blob-2: #222c78;
  --blob-3: #0f5143;
  --inverse-bg: #f1ede4;
  --inverse-fg: #0e0e0d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --highlight: #b8860b;
  --strip-bg: #232321;
  --strip-fg: #ffffff;
  --strip-line: rgba(255,255,255,.08);
  --bg: #0e0e0d;
  --bg-2: #181816;
  --fg: #f1ede4;
  --fg-2: #9c978c;
  --line: rgba(241, 237, 228, 0.14);
  --card: #1a1a18;
  --blob-1: #7a2e14;
  --blob-2: #222c78;
  --blob-3: #0f5143;
  --inverse-bg: #f1ede4;
  --inverse-fg: #0e0e0d;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}
html.is-loading body { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.muted { color: var(--fg-2); }

/* Grain overlay */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 4%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 2%); }
  80% { transform: translate(6%, 5%); }
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}

/* =================== PRELOADER =================== */
.preloader {
  position: fixed; inset: 0; z-index: 200; background: var(--inverse-bg); color: var(--inverse-fg);
  display: flex; align-items: flex-end; padding: var(--gutter);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease-io);
}
html:not(.js) .preloader { display: none; }
.preloader.is-done { clip-path: inset(0 0 100% 0); }
.preloader__inner { width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.preloader__word { display: flex; overflow: hidden; font-size: clamp(56px, 14vw, 220px); font-weight: 600; letter-spacing: -0.06em; line-height: 0.9; }
.preloader__word span { display: inline-block; transform: translateY(110%); animation: rise 0.9s var(--ease) forwards; }
.preloader__word span:nth-child(2) { animation-delay: 0.05s; }
.preloader__word span:nth-child(3) { animation-delay: 0.1s; }
.preloader__word span:nth-child(4) { animation-delay: 0.15s; }
.preloader__word span:nth-child(5) { animation-delay: 0.2s; }
.preloader__word span:nth-child(6) { animation-delay: 0.25s; }
.preloader__count { font-family: var(--mono); font-size: clamp(14px, 2vw, 20px); }
.preloader__bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.preloader__bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform 0.2s linear; }
@keyframes rise { to { transform: translateY(0); } }

/* =================== CURSOR =================== */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; }
/* 3D pencil cursor: the pencil tip is the hotspot (top-left of the image) */
html.pen-cursor, html.pen-cursor * { cursor: none !important; }
.cursor-dot { width: 60px; height: 43px; margin: -1px 0 0 -1px; }
.cursor-dot img { display: block; width: 60px; height: auto; transform-origin: 2px 2px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.3s; }
.cursor-dot.is-hover img { transform: rotate(-10deg) scale(1.1); }
.cursor-dot.is-press img { transform: rotate(6deg) scale(0.92); transition-duration: 0.12s; }
/* Context bubble ("View Project", "Drag", "Zoom") trails just below-right of the pencil tip */
.cursor {
  width: 0; height: 0; margin: 0; border-radius: 999px; opacity: 0;
  display: grid; place-items: center; background: var(--accent);
  transition: width 0.4s var(--ease), height 0.4s var(--ease), margin 0.4s var(--ease), opacity 0.3s;
}
.cursor__label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.4s var(--ease); white-space: nowrap; }
.cursor.is-label { width: 88px; height: 88px; margin: 34px 0 0 34px; opacity: 1; }
.cursor.is-label .cursor__label { opacity: 1; transform: scale(1); }
.cursor-dot.is-hidden img, .cursor.is-hidden { opacity: 0; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* =================== NAV =================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  transition: transform 0.6s var(--ease), background-color 0.4s, backdrop-filter 0.4s;
}
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; }
.nav__logo-mark {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fg); color: var(--bg); font-family: var(--serif); font-style: italic; font-size: 22px;
  transition: transform 0.6s var(--ease);
}
.nav__logo:hover .nav__logo-mark { transform: rotate(-360deg) scale(1.08); }
.nav__logo sup { font-size: 0.55em; margin-left: 1px; }
.nav__links { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); }
.nav__links a { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: background-color 0.3s, color 0.3s; }
.nav__links a:hover, .nav__links a.is-active { background: var(--fg); color: var(--bg); }
.nav__right { display: flex; align-items: center; gap: 12px; }

/* Rolling text (pleasecallmechamp / Framer style). JS wraps [data-text] into .roll */
.roll { display: inline-block; position: relative; overflow: hidden; vertical-align: top; height: 1.5em; line-height: 1.5em; }
.roll__a, .roll__b { display: block; transition: transform 0.55s var(--ease); }
.roll__b { position: absolute; left: 0; top: 100%; }
a:hover .roll__a, a:hover .roll__b, button:hover .roll__a, button:hover .roll__b { transform: translateY(-100%); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center;
  transition: background-color 0.3s, transform 0.4s var(--ease);
}
.theme-toggle:hover { background: var(--fg); }
.theme-toggle__sun {
  width: 16px; height: 16px; border-radius: 50%; background: var(--fg);
  box-shadow: inset -5px -3px 0 0 var(--bg);
  transition: box-shadow 0.5s var(--ease), background-color 0.3s, transform 0.6s var(--ease);
}
.theme-toggle:hover .theme-toggle__sun { background: var(--bg); box-shadow: inset -5px -3px 0 0 var(--fg); }
:root[data-theme="dark"] .theme-toggle__sun { box-shadow: inset 0 0 0 0 var(--bg); transform: rotate(180deg); }
:root[data-theme="dark"] .theme-toggle:hover .theme-toggle__sun { box-shadow: inset 0 0 0 0 var(--fg); }

.menu-btn {
  display: none; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 500;
}
.menu-btn__lines { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); position: relative; }
.menu-btn__lines i { position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--fg); transition: transform 0.5s var(--ease), top 0.5s var(--ease); }
.menu-btn__lines i:first-child { top: 11px; }
.menu-btn__lines i:last-child { top: 16px; }
.menu-open .menu-btn__lines i:first-child { top: 13.5px; transform: rotate(45deg); }
.menu-open .menu-btn__lines i:last-child { top: 13.5px; transform: rotate(-45deg); }

/* Nav colours flip while the overlay is open */
.menu-open .nav { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--inverse-fg); }
.menu-open .nav__logo-mark { background: var(--inverse-fg); color: var(--inverse-bg); }
.menu-open .menu-btn { background: var(--inverse-fg); color: var(--inverse-bg); }
.menu-open .menu-btn__lines { background: var(--inverse-bg); }
.menu-open .menu-btn__lines i { background: var(--inverse-fg); }
.menu-open .theme-toggle { border-color: color-mix(in srgb, var(--inverse-fg) 25%, transparent); }
.menu-open .theme-toggle__sun { background: var(--inverse-fg); box-shadow: inset -5px -3px 0 0 var(--inverse-bg); }

/* =================== MENU OVERLAY =================== */
.menu { position: fixed; inset: 0; z-index: 105; pointer-events: none; visibility: hidden; }
.menu-open .menu { pointer-events: auto; visibility: visible; }
.menu__bg { position: absolute; inset: 0; background: var(--inverse-bg); clip-path: circle(0% at calc(100% - 60px) 38px); transition: clip-path 0.9s var(--ease-io); }
.menu-open .menu__bg { clip-path: circle(150% at calc(100% - 60px) 38px); }
.menu__inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--nav-h) + 24px) var(--gutter) var(--gutter); color: var(--inverse-fg); }
.menu__list li { overflow: hidden; border-bottom: 1px solid color-mix(in srgb, var(--inverse-fg) 15%, transparent); }
.menu__list a { display: flex; align-items: baseline; gap: 16px; font-size: clamp(40px, 9vw, 96px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; padding: 6px 0; transform: translateY(110%); transition: transform 0.8s var(--ease), color 0.3s; }
.menu__list a em { font-family: var(--serif); font-weight: 400; margin: 0 0.15em; }
.menu__list a .mono { opacity: 0.5; }
.menu__list a:hover { color: var(--accent); }
.menu-open .menu__list a { transform: translateY(0); }
.menu-open .menu__list li:nth-child(1) a { transition-delay: 0.25s; }
.menu-open .menu__list li:nth-child(2) a { transition-delay: 0.3s; }
.menu-open .menu__list li:nth-child(3) a { transition-delay: 0.35s; }
.menu-open .menu__list li:nth-child(4) a { transition-delay: 0.4s; }
.menu-open .menu__list li:nth-child(5) a { transition-delay: 0.45s; }
.menu__foot { display: flex; gap: 48px; flex-wrap: wrap; opacity: 0; transform: translateY(20px); transition: opacity 0.6s 0.5s, transform 0.6s 0.5s var(--ease); }
.menu-open .menu__foot { opacity: 1; transform: none; }
.menu__foot div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.menu__foot .mono { margin-bottom: 6px; }

.u-link { position: relative; display: inline-block; }
.u-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease); }
.u-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* =================== BUTTONS =================== */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 10px 0 26px;
  border-radius: 999px; font-weight: 500; font-size: 16px; overflow: hidden; isolation: isolate;
  transition: transform 0.4s var(--ease), color 0.4s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--accent); transform: translateY(101%); border-radius: 50% 50% 0 0;
  transition: transform 0.6s var(--ease), border-radius 0.6s var(--ease);
}
.btn:hover::before { transform: translateY(0); border-radius: 0; }
.btn__icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; transition: transform 0.5s var(--ease), background-color 0.3s, color 0.3s; }
.btn:hover .btn__icon { transform: rotate(-45deg); }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary .btn__icon { background: var(--bg); color: var(--fg); }
.btn--primary:hover { color: #fff; }
.btn--ghost { border: 1px solid var(--line); padding: 0 26px; }
.btn--ghost:hover { color: #fff; border-color: var(--accent); }
.btn--xl { height: 72px; font-size: 18px; padding-left: 32px; }
.btn--xl .btn__icon { width: 52px; height: 52px; font-size: 20px; }

/* =================== HERO (home) =================== */
.hero {
  position: relative; min-height: 100svh; padding: calc(var(--nav-h) + 28px) var(--gutter) 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden;
}
.hero__blobs, .page-blobs { position: absolute; inset: 0; z-index: -1; filter: blur(70px); opacity: 0.85; pointer-events: none; }
.page-blobs { height: 90vh; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.blob--1 { width: 46vw; height: 46vw; background: var(--blob-1); top: -10vw; right: -8vw; animation: float1 18s ease-in-out infinite; }
.blob--2 { width: 38vw; height: 38vw; background: var(--blob-2); bottom: -14vw; left: -10vw; animation: float2 22s ease-in-out infinite; }
.blob--3 { width: 28vw; height: 28vw; background: var(--blob-3); top: 30%; left: 40%; animation: float3 16s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(-8vw, 10vw) scale(1.15); } }
@keyframes float2 { 50% { transform: translate(10vw, -6vw) scale(0.9); } }
@keyframes float3 { 50% { transform: translate(-12vw, 6vw) scale(1.2); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(6px); } }

.hero__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 75%, transparent); border: 1px solid var(--line); font-size: 14px; font-weight: 500;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill em { font-family: var(--serif); font-size: 1.2em; }
.pill .muted { font-style: italic; }

.hero__stage { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: clamp(24px, 6vw, 80px) 0 clamp(8px, 2vw, 24px); }
.hero__name {
  font-family: var(--sans); font-size: clamp(64px, 23vw, 420px); font-weight: 700; letter-spacing: -0.08em; line-height: 0.8;
  text-align: left; user-select: none; -webkit-user-select: none; padding: 0 0.06em 0.2em 0; margin-top: -0.02em; max-width: 100%;
}
.hero__letters { display: inline-flex; align-items: flex-end; }
.nl { position: relative; display: inline-block; cursor: default; outline: none; }
.nl__clip { display: inline-block; }
.nl .ch { display: inline-block; transform: translateY(30%); opacity: 0; filter: blur(12px); transition: transform 1.1s var(--ease), opacity 0.8s var(--ease), filter 0.9s var(--ease), color 0.3s; transition-delay: calc(var(--i) * 70ms), calc(var(--i) * 70ms), calc(var(--i) * 70ms), 0s; }
.is-ready .nl .ch { transform: none; opacity: 1; filter: none; }
.nl:hover .ch, .nl:focus-visible .ch, .nl.is-open .ch { color: var(--lc); }

/* Sticky note pinned onto each letter */
.note {
  position: absolute; z-index: 20; top: -6%; left: 88%; width: min(270px, 78vw);
  padding: 18px 18px 18px; border-radius: 4px 4px 14px 4px;
  background: var(--nc); color: #1b1b1a; box-shadow: 0 2px 0 rgba(0,0,0,.04), 0 22px 40px -18px rgba(0,0,0,.45);
  font-family: var(--sans); font-size: 15px; line-height: 1.45; letter-spacing: -0.005em; font-weight: 500; text-align: left; white-space: normal;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; pointer-events: none; transform-origin: 20% 0;
  transform: rotate(calc(var(--tilt) * 2.5)) scale(0.6) translateY(16px);
  transition: opacity 0.25s var(--ease), transform 0.55s cubic-bezier(.34, 1.56, .64, 1);
}
.note::after { /* folded corner */
  content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 0 0 14px 0;
  background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--lc) 35%, var(--nc)) 50%);
}
.nl--end .note { left: auto; right: 88%; transform-origin: 80% 0; }
.nl.is-follow .note { right: auto; transform-origin: 0 0; }
.note__k { font-size: 30px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; color: var(--lc); }
.note__k::after { content: " ="; color: color-mix(in srgb, #1b1b1a 40%, transparent); font-weight: 600; }
.note__t { display: block; }
.nl:hover .note, .nl:focus-visible .note, .nl.is-open .note { opacity: 1; transform: rotate(var(--tilt)) scale(1) translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pronunciation line: plain text (no pill box), 20% larger, tucked close to the name */
.pill.pill--pron { font-size: clamp(25.2px, 2.16vw, 30.6px); padding: 0; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
.pill__dim { opacity: 0.45; }
/* Pronunciation pill sits right-aligned above the "wa" of the name */
.hero__namewrap { display: inline-flex; flex-direction: column; align-items: flex-end; max-width: 100%; }
/* Drop the line down onto the x-height of "wa" (lowercase tops sit ~0.18em below the cap of the M) */
.hero__namewrap { --name-fs: clamp(64px, 23vw, 420px); }
.hero__namewrap .pill--pron { margin-right: 0.5em; margin-bottom: clamp(-14px, -0.6vw, -4px); position: relative; z-index: 2; translate: 0 calc(var(--name-fs) * 0.14); }

/* Real-marker highlight: neon green at 30% opacity, slightly tilted, ragged ends and faint
   stroke texture. Text keeps the page's own colour, so contrast stays high in both themes. */
.hl {
  --hl: 57, 255, 20;
  position: relative; isolation: isolate; color: var(--fg); font-weight: 700;
  padding: 0 0.2em; margin: 0 -0.05em; background: none;
}
.hl::before {
  content: ""; position: absolute; z-index: -1; left: -0.15em; right: -0.25em; top: 0.12em; bottom: 0.02em;
  background:
    repeating-linear-gradient(0deg, rgba(var(--hl), 0) 0 2px, rgba(var(--hl), 0.06) 2px 3px),
    linear-gradient(90deg, rgba(var(--hl), 0.26), rgba(var(--hl), 0.3) 12%, rgba(var(--hl), 0.3) 88%, rgba(var(--hl), 0.24));
  border-radius: 0.25em 0.7em 0.35em 0.8em / 0.7em 0.3em 0.8em 0.45em;
  clip-path: polygon(2% 12%, 7% 0, 96% 6%, 100% 30%, 98% 72%, 100% 100%, 5% 94%, 0 70%, 3% 42%);
  transform: rotate(-1.6deg) skewX(-10deg) scaleX(0); transform-origin: left center;
  transition: transform 0.9s 1.2s cubic-bezier(.22,1,.36,1);
}
.is-ready .hl::before, html:not(.js) .hl::before { transform: rotate(-1.6deg) skewX(-10deg) scaleX(1); }

.hero__bottom { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px; }
.roles { font-size: clamp(34px, 5.6vw, 92px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.98; text-wrap: balance; }
/* Fixed-size slot for the typed roles: invisible copies of every role share one grid cell,
   so the box is always as wide/tall as the longest role and nothing below it shifts. */
.roles__type { display: grid; justify-items: start; align-items: start; }
.roles__type > .roles__live, .roles__type > .roles__sizer { grid-area: 1 / 1; }
.roles__sizer { visibility: hidden; padding-right: 0.13em; }
.roles__live { white-space: pre-wrap; }
.roles__type .caret { display: inline-block; vertical-align: -0.08em; width: 0.07em; height: 0.85em; margin-left: 0.06em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.roles__solver { display: block; }
.roles__solver .serif { font-weight: 400; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; flex: none; }
.ring__text { position: absolute; inset: 0; animation: spin 14s linear infinite; }
.ring__text svg { width: 100%; height: 100%; overflow: visible; }
.ring__text text { font-family: var(--mono); font-size: 9.4px; letter-spacing: 2.2px; fill: var(--fg); text-transform: uppercase; }
.ring__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-size: 18px; transition: transform 0.5s var(--ease), background-color 0.3s; }
.ring:hover .ring__icon { transform: scale(1.15) rotate(-45deg); background: var(--accent); color: #fff; }
.ring--arrow .ring__icon { animation: bob 2s ease-in-out infinite; }

/* Split letters */
.split .ch { display: inline-block; transform: translateY(105%) rotate(6deg); opacity: 0; transition: transform 1s var(--ease), opacity 0.6s var(--ease); transition-delay: calc(var(--i) * 22ms + var(--d, 0ms)); }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.split.is-in .ch { transform: none; opacity: 1; }

/* Generic reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }
html:not(.js) .reveal, html:not(.js) .split .ch, html:not(.js) .nl .ch { opacity: 1; transform: none; filter: none; }

/* =================== MARQUEE =================== */
.marquee { overflow: hidden; padding: 26px 0; background: var(--fg); color: var(--bg); transform: rotate(-2deg) scale(1.04); margin: 40px 0; }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; align-items: center; gap: 40px; padding-right: 40px; font-size: clamp(30px, 5.6vw, 80px); font-weight: 500; letter-spacing: -0.04em; white-space: nowrap; }
.marquee__group i { font-style: normal; color: var(--accent); font-size: 0.6em; display: inline-block; animation: spin 6s linear infinite; }

/* =================== SECTIONS =================== */
.section { padding: clamp(80px, 11vw, 150px) var(--gutter); position: relative; }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 32px; margin-bottom: clamp(40px, 6vw, 72px); }
.section__label { display: inline-flex; gap: 8px; align-items: center; color: var(--fg-2); margin-bottom: 24px; }
.section__label span { color: var(--accent); }
.section__title { font-size: clamp(44px, 8vw, 128px); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; }
.section__title .serif { font-weight: 400; }

/* =================== ABOUT (home) =================== */
.about__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.fill-text { font-size: clamp(24px, 3vw, 44px); line-height: 1.18; letter-spacing: -0.03em; font-weight: 500; }
.fill-text .fw { opacity: 0.18; transition: opacity 0.25s linear; }
.fill-text .fw.on { opacity: 1; }
.about__copy { display: flex; flex-direction: column; gap: 36px; align-items: flex-start; min-width: 0; }
.about__portrait { perspective: 1000px; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: calc(var(--radius) * 1.5); overflow: hidden;
  background: linear-gradient(160deg, var(--blob-1), var(--blob-2) 60%, var(--blob-3));
  transform-style: preserve-3d; transition: transform 0.6s var(--ease); max-width: 100%;
}
.portrait > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12) translateY(var(--py, 0px)); transition: transform 0.2s linear; }
.portrait__sticker {
  position: absolute; top: 7%; right: 7%; width: clamp(64px, 8vw, 96px); aspect-ratio: 1; border-radius: 50%;
  background: var(--card); display: grid; place-items: center; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
  transform: rotate(12deg) translateZ(70px); animation: wiggle 4s ease-in-out infinite;
}
.portrait__sticker img { width: 70%; height: 70%; object-fit: contain; }
@keyframes wiggle { 50% { transform: rotate(-8deg) translateZ(70px) translateY(-6px); } }
.portrait__tag {
  position: absolute; left: 6%; bottom: 6%; padding: 10px 16px; border-radius: 999px; background: var(--fg); color: var(--bg);
  font-weight: 600; font-size: 14px; transform: translateZ(50px);
}

/* =================== WORK =================== */
.work__toggle { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.work__toggle button { position: relative; z-index: 1; padding: 8px 18px; font-size: 14px; font-weight: 500; transition: color 0.4s; }
.work__toggle button.is-active { color: var(--bg); }
.work__toggle-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 999px; background: var(--fg); transition: transform 0.5s var(--ease), width 0.5s var(--ease); }
.work__head-right { display: flex; align-items: center; gap: 24px; }

.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(16px, 2.4vw, 32px); }
.project { opacity: 0; transform: translateY(60px); transition: opacity 1s var(--ease), transform 1s var(--ease); min-width: 0; }
.project.is-in { opacity: 1; transform: none; }
.work__grid[data-view="grid"] .project:nth-child(even) { margin-top: clamp(0px, 8vw, 120px); }
.work__grid[data-view="grid"] .project--wide { grid-column: 1 / -1; margin-top: 0; }

.project__link { display: flex; flex-direction: column; height: 100%; border-radius: calc(var(--radius) + 8px); background: var(--card); border: 1px solid var(--line); padding: 10px; transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.project__link:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); }
.project__media {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 20% 0%, var(--c2), var(--c1));
  display: grid; place-items: center; max-width: 100%;
}
.project__media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.35), transparent 40%); opacity: 0; transition: opacity 0.4s; z-index: 3; pointer-events: none; }
.project__link:hover .project__media::after { opacity: 1; }
.media-shot { width: 84%; border-radius: 12px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.45); transition: transform 0.9s var(--ease); transform: translateY(6%); }
.project__link:hover .media-shot { transform: translateY(0) scale(1.04); }
.media-stack { position: relative; width: 100%; height: 100%; }
.media-stack img { position: absolute; top: 50%; left: 50%; height: 74%; width: auto; max-width: none; border-radius: 12px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.45); transition: transform 0.9s var(--ease); }
.media-stack img:nth-child(1) { transform: translate(-115%, -46%) rotate(-8deg); }
.media-stack img:nth-child(2) { transform: translate(-50%, -54%); z-index: 2; }
.media-stack img:nth-child(3) { transform: translate(15%, -46%) rotate(8deg); }
.project__link:hover .media-stack img:nth-child(1) { transform: translate(-128%, -48%) rotate(-12deg); }
.project__link:hover .media-stack img:nth-child(2) { transform: translate(-50%, -58%) scale(1.04); }
.project__link:hover .media-stack img:nth-child(3) { transform: translate(28%, -48%) rotate(12deg); }

.project__body { display: flex; flex-direction: column; gap: 14px; padding: 18px 10px 12px; flex: 1; min-width: 0; }
.project__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.project__num { color: var(--fg-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); }
.tagstrip { position: relative; overflow: hidden; border-radius: 10px; background: var(--strip-bg); color: var(--strip-fg); border: 1px solid var(--strip-line); padding: 9px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.tagstrip__track { display: flex; width: max-content; animation: slide 28s linear infinite; }
.project__link:hover .tagstrip__track { animation-duration: 10s; }
.tagstrip__track span { display: inline-flex; align-items: center; gap: 12px; padding-right: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tagstrip__track span::after { content: "✦"; color: var(--accent); }
@keyframes slide { to { transform: translateX(-50%); } }
.project__title { font-size: clamp(20px, 1.9vw, 28px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
.project__desc { color: var(--fg-2); max-width: 60ch; }
.project__foot { margin-top: auto; padding-top: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 600; transition: background-color 0.3s, color 0.3s; }
.chip-btn b { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--fg); display: grid; place-items: center; font-size: 13px; transition: transform 0.5s var(--ease); }
.project__link:hover .chip-btn { background: var(--accent); color: #fff; }
.project__link:hover .chip-btn b { transform: rotate(-45deg); }
.soon { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.project--soon .project__link { cursor: default; }

.work__grid[data-view="grid"] .project--wide .project__link { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.work__grid[data-view="grid"] .project--wide .project__body { justify-content: center; padding: 24px; }

/* List view (Landor / instance style rows with follow image) */
.work__grid[data-view="list"] { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.work__grid[data-view="list"] .project { margin-top: 0 !important; }
.work__grid[data-view="list"] .project__link { display: block; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 0; position: relative; isolation: isolate; overflow: hidden; transition: color 0.4s; }
.work__grid[data-view="list"] .project__link:hover { transform: none; box-shadow: none; color: var(--bg); }
.work__grid[data-view="list"] .project__link::before { content: ""; position: absolute; inset: 0; background: var(--fg); transform: scaleY(0); transform-origin: bottom; transition: transform 0.6s var(--ease); z-index: -1; }
.work__grid[data-view="list"] .project__link:hover::before { transform: scaleY(1); }
.work__grid[data-view="list"] .project__media, .work__grid[data-view="list"] .tagstrip, .work__grid[data-view="list"] .project__desc, .work__grid[data-view="list"] .project__foot { display: none; }
.work__grid[data-view="list"] .project__body { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: clamp(20px, 3vw, 34px) 12px; transition: padding 0.6s var(--ease); }
.work__grid[data-view="list"] .project__top { display: contents; }
.work__grid[data-view="list"] .badge { grid-column: 3; grid-row: 1; color: var(--fg); }
.work__grid[data-view="list"] .project__title { grid-column: 2; grid-row: 1; font-size: clamp(20px, 2.8vw, 40px); letter-spacing: -0.04em; }
.work__grid[data-view="list"] .project__link:hover .project__body { padding-left: 32px; }
.work__grid[data-view="list"] .project__link:hover .project__num { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.hover-preview {
  position: fixed; top: 0; left: 0; z-index: 60; width: 360px; aspect-ratio: 4 / 3; pointer-events: none;
  margin: -135px 0 0 -180px; border-radius: 18px; overflow: hidden; transform: scale(0); transition: transform 0.5s var(--ease);
}
.hover-preview.is-on { transform: scale(1); }
.hover-preview__inner { position: absolute; inset: 0; }
.hover-preview .project__media { aspect-ratio: auto; height: 100%; border-radius: 0; }

/* =================== FUN PROJECTS (home) =================== */
.fun-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); perspective: 1200px; }
.fun-card { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: 8px; transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); transform-style: preserve-3d; }
.fun-card:hover { box-shadow: 0 30px 60px -30px rgba(0,0,0,.4); }
.fun-card__img { aspect-ratio: 1.08; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); max-width: 100%; }
.fun-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.fun-card:hover .fun-card__img img { transform: scale(1.06); }
.fun-card dl { margin: 8px 0 0; display: grid; gap: 4px; }
.fun-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); font-size: 14px; }
.fun-card dt { color: var(--fg-2); }
.fun-card dd { margin: 0; font-weight: 600; text-align: right; }
.center-cta { display: flex; justify-content: center; margin-top: clamp(40px, 5vw, 64px); }

/* =================== PAGE HERO (inner pages) =================== */
.page-hero { position: relative; padding: calc(var(--nav-h) + clamp(40px, 7vw, 100px)) var(--gutter) clamp(40px, 6vw, 80px); overflow: hidden; }
.back { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 32px; color: var(--fg-2); transition: color 0.3s, gap 0.4s var(--ease); }
.back:hover { color: var(--fg); gap: 14px; }
.page-title { font-size: clamp(38px, 6.4vw, 104px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; text-wrap: balance; max-width: 18ch; }
.page-title .serif { font-weight: 400; }
.lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; color: var(--fg-2); max-width: 68ch; }
.lead + .lead { margin-top: 1em; }
.page-hero .lead-wrap { margin-top: clamp(28px, 4vw, 48px); display: grid; gap: 1em; }

/* =================== CASE STUDY =================== */
.cs-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 72px); }
.cs-meta div { padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.cs-meta div:not(:nth-child(3n)) { border-right: 1px solid var(--line); }
.cs-meta div:not(:nth-child(3n+1)) { padding-left: 20px; }
.cs-meta dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 8px; }
.cs-meta dd { margin: 0; font-weight: 500; }

.cs-cover { margin: 0 var(--gutter); border-radius: calc(var(--radius) * 1.5); overflow: hidden; background: radial-gradient(120% 100% at 20% 0%, var(--c2), var(--c1)); padding: clamp(24px, 6vw, 88px); display: grid; place-items: center; gap: 24px; }
.cs-cover img { width: 100%; max-width: 1200px; border-radius: 14px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.5); transform: translateY(var(--py, 0px)) scale(var(--ps, 1)); transition: transform 0.2s linear; }
.cs-cover--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
.cs-cover--pair img { max-height: 70vh; width: auto; max-width: 100%; justify-self: center; box-shadow: none; filter: drop-shadow(0 30px 40px rgba(0,0,0,.35)); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat__num { display: block; font-size: clamp(52px, 6.4vw, 100px); font-weight: 600; letter-spacing: -0.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__num .unit { color: var(--accent); font-family: var(--serif); font-style: italic; font-weight: 400; }
.stat p { color: var(--fg-2); margin-top: 12px; max-width: 30ch; }
.stats--band { margin: clamp(48px, 7vw, 96px) var(--gutter) 0; }

.cs-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: clamp(24px, 5vw, 80px); padding: clamp(56px, 8vw, 112px) var(--gutter); border-top: 1px solid var(--line); }
.cs-section__head { align-self: start; position: sticky; top: calc(var(--nav-h) + 24px); }
.cs-section__head h2 { font-size: clamp(28px, 3.2vw, 48px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; text-wrap: balance; }
.cs-section__head .mono { color: var(--accent); display: block; margin-bottom: 14px; }
.cs-body { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cs-body > p, .cs-body li { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.65; max-width: 68ch; }
.cs-body > p { color: color-mix(in srgb, var(--fg) 82%, var(--bg)); }
.cs-body h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; letter-spacing: -0.025em; margin-top: 18px; }
.cs-body h3:first-child { margin-top: 0; }
.cs-body ul { display: grid; gap: 10px; }
.cs-body ul li { position: relative; padding-left: 28px; }
.cs-body ul li::before { content: "✦"; position: absolute; left: 0; top: 0.1em; color: var(--accent); font-size: 0.9em; }
.cs-body ol { counter-reset: n; display: grid; gap: 10px; }
.cs-body ol li { counter-increment: n; position: relative; padding-left: 40px; }
.cs-body ol li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 0.25em; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.cs-body .note { font-weight: 600; }

.figure { margin: 18px 0 8px; }
.figure__frame { border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); cursor: zoom-in; max-width: 100%; }
.figure__frame img, .figure__frame video { width: 100%; display: block; transition: transform 1.2s var(--ease); }
.figure__frame:hover img { transform: scale(1.025); }
.figure figcaption { margin-top: 12px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-2); display: flex; gap: 10px; }
.figure figcaption::before { content: "↳"; color: var(--accent); }
.figure--video .figure__frame { cursor: default; display: grid; place-items: center; background: var(--fg); }
.figure--video video { max-height: 80vh; width: auto; max-width: 100%; }
.figure--pair figcaption { justify-content: space-between; }
.figure--pair figcaption::before { content: none; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 12px 0; }
.gallery .figure { margin: 0; }
.gallery .figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.gallery--videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery--videos .figure__frame { background: var(--bg-2); }
.gallery--videos video { max-height: none; width: 100%; }

.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0; }
.quote { margin: 0; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; transition: transform 0.6s var(--ease); }
.quote:hover { transform: translateY(-4px) rotate(-0.6deg); }
.quote__title { font-weight: 600; font-size: 17px; }
.quote blockquote { margin: 0; color: var(--fg-2); line-height: 1.55; }
.quote figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; font-size: 14px; }
.quote__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 20px; flex: none; }
.quote--plain blockquote { color: var(--fg); font-weight: 500; }

.data-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.data-card { padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.data-card h4 { margin: 0; font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 500; }
.data-card p { margin: 0; line-height: 1.5; }
.data-card ul { display: grid; gap: 6px; font-size: 15px; }

.big-quote { font-size: clamp(24px, 2.6vw, 38px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 500; max-width: 30ch; }
.big-quote::before { content: "“"; display: block; font-family: var(--serif); font-size: 2.4em; line-height: 0.6; color: var(--accent); }
.emoji-row { font-size: 28px; letter-spacing: 6px; }

.cs-next { display: block; padding: clamp(64px, 10vw, 140px) var(--gutter); border-top: 1px solid var(--line); position: relative; overflow: hidden; isolation: isolate; transition: color 0.5s; }
.cs-next::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateY(101%); transition: transform 0.8s var(--ease); z-index: -1; }
.cs-next:hover { color: #fff; }
.cs-next:hover::before { transform: translateY(0); }
.cs-next .mono { display: block; margin-bottom: 20px; color: var(--fg-2); transition: color 0.5s; }
.cs-next:hover .mono { color: rgba(255,255,255,.8); }
.cs-next__title { font-size: clamp(32px, 5.6vw, 88px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; max-width: 20ch; text-wrap: balance; }
.cs-next__arrow { display: inline-block; transition: transform 0.6s var(--ease); }
.cs-next:hover .cs-next__arrow { transform: translateX(16px) rotate(-45deg); }
.ext-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; border-bottom: 1.5px solid currentColor; padding-bottom: 2px; align-self: flex-start; transition: color 0.3s; }
.ext-link:hover { color: var(--accent); }

/* =================== ABOUT PAGE =================== */
.about-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.about-hero .page-title { max-width: 14ch; }
.about-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: clamp(24px, 5vw, 80px); padding: clamp(48px, 7vw, 100px) var(--gutter); border-top: 1px solid var(--line); }
.about-body .copy .fill-text { font-size: clamp(24px, 2.8vw, 42px); line-height: 1.18; color: var(--fg); }
.about-body .copy { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.about-body .copy p { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.65; color: color-mix(in srgb, var(--fg) 82%, var(--bg)); max-width: 64ch; }
.about-body .copy a { color: var(--fg); font-weight: 600; border-bottom: 1.5px solid var(--accent); }
.about-body .copy a:hover { color: var(--accent); }

/* =================== FUN PAGE =================== */
.masonry { columns: 3 300px; column-gap: 16px; padding: 0 var(--gutter); }
.masonry .figure { break-inside: avoid; margin: 0 0 16px; }
.masonry .figure__frame { border-radius: var(--radius); }
.closing { text-align: center; padding: clamp(56px, 8vw, 100px) var(--gutter) 0; font-size: clamp(22px, 2.4vw, 34px); font-weight: 500; letter-spacing: -0.03em; }

/* =================== LIGHTBOX =================== */
.lb { position: fixed; inset: 0; z-index: 170; display: grid; place-items: center; padding: 64px 16px; background: color-mix(in srgb, #0b0b0a 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease); }
.lb.is-open { opacity: 1; pointer-events: auto; }
.lb img { max-width: min(1600px, 100%); max-height: 100%; border-radius: 12px; object-fit: contain; transform: scale(0.94); transition: transform 0.5s var(--ease); }
.lb.is-open img { transform: none; }
.lb__btn { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; display: grid; place-items: center; transition: background-color 0.3s; }
.lb__btn:hover { background: var(--accent); }
.lb__close { top: 12px; right: 12px; }
.lb__prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb__next { right: 12px; top: 50%; translate: 0 -50%; }
.lb__cap {
  position: absolute; left: 50%; bottom: 18px; translate: -50% 0; width: min(640px, calc(100% - 32px));
  padding: 14px 18px; border-radius: 16px; text-align: left;
  background: color-mix(in srgb, #0b0b0a 70%, transparent); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #f4f1ea;
  display: grid; gap: 4px;
}
.lb__count { color: rgba(255,255,255,.55); font-size: 11px; }
.lb__title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.lb__text { margin: 0; font-size: 14.5px; line-height: 1.5; color: rgba(244,241,234,.78); }
.lb__text:empty { display: none; }
.lb--rich { --lb-pb: 190px; padding-bottom: var(--lb-pb); }
.lb img { max-height: calc(100svh - 64px - var(--lb-pb, 64px)); }
.lb img { opacity: 0.4; transition: transform 0.5s var(--ease), opacity 0.35s var(--ease); }
.lb img.is-in { opacity: 1; }

/* =================== CONTACT =================== */
.contact { position: relative; background: var(--inverse-bg); color: var(--inverse-fg); border-radius: clamp(24px, 4vw, 56px) clamp(24px, 4vw, 56px) 0 0; overflow: hidden; margin-top: clamp(64px, 8vw, 120px); }
.contact__inner { padding: clamp(80px, 11vw, 150px) var(--gutter) var(--gutter); }
.contact .muted, .contact .section__label { color: color-mix(in srgb, var(--inverse-fg) 55%, transparent); }
.contact__title { font-size: clamp(40px, 7.4vw, 124px); font-weight: 500; letter-spacing: -0.055em; line-height: 0.98; max-width: 16ch; text-wrap: balance; }
.contact__title .serif { color: var(--accent); font-weight: 400; }
.contact__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin: clamp(40px, 6vw, 72px) 0; padding-bottom: clamp(40px, 6vw, 72px); border-bottom: 1px solid color-mix(in srgb, var(--inverse-fg) 18%, transparent); }
.contact__email { display: inline-flex; align-items: center; gap: 16px; font-size: clamp(20px, 3.4vw, 46px); font-weight: 500; letter-spacing: -0.04em; position: relative; text-align: left; min-width: 0; }
.contact__email span:first-child { overflow-wrap: anywhere; }
.contact__email::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: currentColor; transform: scaleX(0.2); transform-origin: left; transition: transform 0.6s var(--ease); }
.contact__email:hover::after { transform: scaleX(1); }
.contact__email-icon { font-size: 0.6em; opacity: 0.6; }
.contact .btn--primary { background: var(--inverse-fg); color: var(--inverse-bg); }
.contact .btn--primary .btn__icon { background: var(--inverse-bg); color: var(--inverse-fg); }
.contact .btn--primary:hover { color: #fff; }
.contact__grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--inverse-fg) 25%, transparent); font-weight: 500; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.social svg { width: 16px; height: 16px; }
.social:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.back-top { width: 60px; height: 60px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--inverse-fg) 30%, transparent); display: grid; place-items: center; font-size: 22px; transition: background-color 0.3s, color 0.3s; }
.back-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.contact__mega { display: flex; justify-content: space-between; font-size: clamp(80px, 25vw, 420px); font-weight: 600; letter-spacing: -0.07em; line-height: 0.85; margin-top: clamp(48px, 8vw, 120px); overflow: hidden; padding-bottom: 0.06em; }
.contact__mega span { display: inline-block; transform: translateY(var(--y, 40%)); transition: transform 0.2s linear, color 0.3s; }
.contact__mega span:hover { color: var(--accent); }
.contact__legal { position: relative; z-index: 1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* =================== TOAST =================== */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 180; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 500; font-size: 14px; transform: translate(-50%, calc(100% + 40px)); transition: transform 0.6s var(--ease); }
.toast.is-on { transform: translate(-50%, 0); }

/* =================== RESPONSIVE =================== */
@media (max-width: 1024px) {
  .nav__links { display: none; }
  .menu-btn { display: inline-flex; }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 460px; }
  .fun-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-section, .about-body { grid-template-columns: 1fr; }
  .cs-section__head { position: static; }
  .about-hero { grid-template-columns: 1fr; }
  .about-hero .about__portrait { max-width: 420px; }
  .work__grid[data-view="grid"] .project--wide .project__link { grid-template-columns: 1fr; }
  .data-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --nav-h: 64px; --radius: 16px; }
  .nav__logo-text { display: none; }
  .hero { min-height: auto; gap: 24px; }
  .hero__stage { padding: 40px 0 24px; }
  .note { width: min(230px, 62vw); font-size: 13.5px; padding: 14px; top: 70%; }
  .note__k { font-size: 24px; }
  .hero__bottom { grid-template-columns: 1fr; }
  .hero__bottom .ring { display: none; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: space-between; }
  .btn--ghost { justify-content: center !important; }
  .work__grid { grid-template-columns: 1fr; }
  .work__grid[data-view="grid"] .project:nth-child(even) { margin-top: 0; }
  .work__grid[data-view="list"] .project__body { grid-template-columns: 32px minmax(0, 1fr); }
  .work__grid[data-view="list"] .badge { grid-column: 2; grid-row: 2; justify-self: start; }
  .fun-grid { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-meta div { border-right: 0 !important; padding: 16px 12px 16px 0 !important; }
  .cs-meta div:nth-child(odd) { border-right: 1px solid var(--line) !important; }
  .cs-meta div:nth-child(even) { padding-left: 12px !important; }
  .cs-cover { margin: 0 var(--gutter); padding: 16px; }
  .cs-cover--pair { grid-template-columns: 1fr 1fr; }
  .stat + .stat { padding-left: 0; border-left: 0; }
  .gallery, .gallery--videos, .quotes, .data-cards { grid-template-columns: 1fr; }
  .contact__row { flex-direction: column; align-items: flex-start; }
  .contact__row .btn { width: 100%; justify-content: space-between; }
  .menu__foot { gap: 32px; }
  .lb__prev, .lb__next { top: 12px; bottom: auto; translate: none; }
  .lb__prev { left: 12px; } .lb__next { left: 72px; right: auto; }
  .lb--rich { --lb-pb: 210px; }
  .lb__title { font-size: 16px; } .lb__text { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .grain { display: none; }
}

/* =================== SMALL FIXES =================== */
.nav__logo-mark { overflow: hidden; padding: 0; }
.nav__logo-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.nav__links a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.lb[hidden], .lb__btn[hidden] { display: none; }
/* Cut-out phone mockups bring their own frame: shadow the phone shape, not the image box */
.media-stack img[src*="bib-calendar"] { box-shadow: none; border-radius: 0; filter: drop-shadow(0 18px 22px rgba(0,0,0,.22)); }
.media-shot[src*="-device"] { box-shadow: none; border-radius: 0; width: auto; max-width: 92%; max-height: 90%; filter: drop-shadow(0 22px 26px rgba(0,0,0,.22)); }
/* Let cut-out device mockups size against the card's own box so tall ones never crop */
.project__media:has(.media-shot[src*="-device"]) { container-type: size; }
.media-shot[src*="-device"] { max-height: 82cqh; max-width: 88cqw; }
/* Cut-out device covers carry their own frames: no box, shadow follows the devices */
.cs-cover img[src*="-devices"] { width: auto; max-width: min(100%, 1100px); max-height: 78vh; border-radius: 0; box-shadow: none; filter: drop-shadow(0 30px 40px rgba(0,0,0,.25)); }

/* =================== UX CARDS =================== */
.fun-card--feature { grid-column: 1 / -1; padding: 8px; }
.fun-card__link { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(12px, 2vw, 28px); align-items: stretch; }
.fun-card__img--wide { aspect-ratio: 16 / 9; background: #0b0b0a; }
.fun-card__img--wide img { object-fit: cover; object-position: 30% 50%; }
.fun-card__body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; padding: clamp(8px, 2vw, 24px) clamp(4px, 1.2vw, 16px); min-width: 0; }
.fun-card__body dl { width: 100%; margin: 0; }
.fun-card__title { font-size: clamp(28px, 3.2vw, 48px); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.fun-card__desc { color: var(--fg-2); max-width: 46ch; }
.fun-card--feature:hover .chip-btn { background: var(--accent); color: #fff; }
.fun-card--feature:hover .chip-btn b { transform: rotate(-45deg); }

.gallery--cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery--cards .figure:first-child:nth-last-child(odd) { grid-column: auto; }
.gallery--cards .figure__frame, .gallery--pair .figure__frame { background: transparent; border: 0; border-radius: 22px; }
.gallery--cards figcaption { font-size: 11px; }
.gallery--pair { grid-template-columns: repeat(2, minmax(0, 260px)); gap: 16px; }
.theme-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.theme-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--t) 45%, var(--card)); border: 1px solid color-mix(in srgb, var(--t) 70%, transparent); font-size: 15px; }
.theme-list li span { font-family: var(--mono); font-size: 12px; color: var(--fg-2); white-space: nowrap; }
.cs-body .theme-list li { padding-left: 16px; }
.cs-body .theme-list li::before { content: none; }

@media (max-width: 1024px) {
  .fun-card__link { grid-template-columns: 1fr; }
  .gallery--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .theme-list { grid-template-columns: 1fr; }
  .gallery--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.figure--card { max-width: 360px; }
.figure--card .figure__frame { background: transparent; border: 0; border-radius: 22px; }

/* =================== ABOUT PHOTO DECK =================== */
/* Photos sit in a pile like playing cards. On hover the pile fans out and the top card
   slides off, then tucks back in at the bottom, cycling automatically. */
.portrait--deck { overflow: visible; background: none; }
.portrait--deck > img.deck-card {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.45); background: var(--bg-2);
  z-index: calc(20 - var(--p, 0));
  transform: translate(calc(var(--p, 0) * var(--dx, 0px)), calc(var(--p, 0) * var(--dy, 0px)))
             rotate(calc(var(--p, 0) * var(--dr, 0deg))) scale(calc(1 - var(--p, 0) * var(--ds, 0)));
  opacity: var(--o, 1);
  transition: transform 0.7s cubic-bezier(.22,1,.36,1), opacity 0.45s var(--ease);
}
.portrait--deck > img.deck-card:not(:first-child) { --o: 0; }
.portrait--deck.is-deck > img.deck-card { --o: 1; --dx: 12px; --dy: -10px; --dr: 3.5deg; --ds: 0.035; }
.portrait--deck.is-deck > img.deck-card[style*="--p: 4"], .portrait--deck.is-deck > img.deck-card[style*="--p: 5"] { --o: 0; }
.portrait--deck > img.deck-card.is-out {
  z-index: 30; transition-duration: 0.55s;
  transform: translate(78%, -6%) rotate(16deg) scale(0.94);
}
.portrait--deck .portrait__sticker, .portrait--deck .portrait__tag { z-index: 40; }
@media (max-width: 720px) {
  .portrait--deck > img.deck-card.is-out { transform: translate(70%, -6%) rotate(12deg) scale(0.94); }
}
/* The name never shifts sideways when the pronunciation line is wider than it */
.hero__namewrap .hero__name { align-self: flex-start; }
@media (max-width: 720px) {
  /* On phones the larger line is wider than the space beside the "M": sit it just above the name */
  .hero__namewrap .pill--pron { translate: none; margin: 0 0 6px; align-self: flex-start; white-space: nowrap; font-size: min(25.2px, 6.6vw); }
}
