@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500&display=swap');

:root {
  --bg: #0d0d1a;
  --bg-raised: #13131f;
  --surface: #1c1c2a;
  --line: rgba(245, 243, 238, 0.10);
  --line-strong: rgba(245, 243, 238, 0.20);
  --text: #F5F3EE;
  --text-dim: #b0aec0;
  --text-faint: #8886a0;
  --accent: #E87060;
  --accent-dim: #8c3040;

  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: auto;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ===== LAVA LAMP BLOBS ===== */
.blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  will-change: transform;
  transition: background 0.8s ease, opacity 0.8s ease;
}

.blob-1 {
  width: 600px; height: 600px;
  background: #E87060;
  top: -200px; left: -150px;
  animation: blob1 26s ease-in-out infinite alternate;
}

.blob-2 {
  width: 700px; height: 700px;
  background: #7a1f72;
  bottom: -250px; right: -180px;
  animation: blob2 32s ease-in-out infinite alternate;
}

.blob-3 {
  width: 450px; height: 450px;
  background: #3d1060;
  top: 35%; left: 25%;
  animation: blob3 22s ease-in-out infinite alternate;
}

.blob-4 {
  width: 400px; height: 400px;
  background: #f0a07a;
  top: 15%; right: 5%;
  animation: blob4 28s ease-in-out infinite alternate;
}

.blob-5 {
  width: 350px; height: 350px;
  background: #b03060;
  bottom: 20%; left: 10%;
  animation: blob5 20s ease-in-out infinite alternate;
}

/* ── Per-project blob palettes ───────────────────────────── */
[data-project] .blob { opacity: 0.38; }

/* De Beers — burnt orange + deep sienna */
[data-project="debeers"] .blob-1 { background: #c45a08; }
[data-project="debeers"] .blob-2 { background: #7a2e04; }
[data-project="debeers"] .blob-3 { background: #e87020; }
[data-project="debeers"] .blob-4 { background: #a04010; }
[data-project="debeers"] .blob-5 { background: #3a1402; }

/* INEOS — bold olive + raw amber */
[data-project="ineos"] .blob-1 { background: #6a8c20; }
[data-project="ineos"] .blob-2 { background: #3a2808; }
[data-project="ineos"] .blob-3 { background: #8aaa28; }
[data-project="ineos"] .blob-4 { background: #c87820; }
[data-project="ineos"] .blob-5 { background: #4a6010; }

/* Soho House — clay + warm sand */
[data-project="sohohouse"] .blob-1 { background: #c4845a; }
[data-project="sohohouse"] .blob-2 { background: #8a5038; }
[data-project="sohohouse"] .blob-3 { background: #d4a07a; }
[data-project="sohohouse"] .blob-4 { background: #a86848; }
[data-project="sohohouse"] .blob-5 { background: #e0b890; }

/* Ahold — vivid teal + emerald */
[data-project="ahold"] .blob-1 { background: #00a888; }
[data-project="ahold"] .blob-2 { background: #006850; }
[data-project="ahold"] .blob-3 { background: #00d0a0; }
[data-project="ahold"] .blob-4 { background: #008060; }
[data-project="ahold"] .blob-5 { background: #20c890; }

/* SMG — electric blue */
[data-project="smg"] .blob-1 { background: #2850e8; }
[data-project="smg"] .blob-2 { background: #0820a8; }
[data-project="smg"] .blob-3 { background: #4878ff; }
[data-project="smg"] .blob-4 { background: #1040d0; }
[data-project="smg"] .blob-5 { background: #0c28c0; }

@keyframes blob1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(300px, 400px) scale(1.2); }
  100% { transform: translate(150px, 650px) scale(0.85); }
}

@keyframes blob2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-350px, -250px) scale(1.15); }
  100% { transform: translate(-180px, -500px) scale(1.25); }
}

@keyframes blob3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(280px, -300px) scale(0.8); }
  100% { transform: translate(-220px, 250px) scale(1.2); }
}

@keyframes blob4 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-200px, 350px) scale(1.25); }
  100% { transform: translate(-350px, 180px) scale(0.85); }
}

@keyframes blob5 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(250px, -280px) scale(1.2); }
  100% { transform: translate(450px, -180px) scale(0.9); }
}

.nav, .hero-scroll, .hero, .index, .strip, .footer,
.cs-hero, .cs-section, .cs-nav {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 48px;
  background: linear-gradient(to bottom, rgba(10,10,10,0.95), rgba(10,10,10,0));
  backdrop-filter: blur(2px);
}

.nav-mark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: baseline;
  gap: 36px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--text-dim);
  transition: color 0.2s ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ── Studio Up nav logo ── */
.nav-studioup {
  align-self: center;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.nav-studioup-logo {
  height: 20px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.65;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Hover: Studio Up gold at full strength (#E1B84A) */
.nav-studioup:hover .nav-studioup-logo {
  filter: brightness(0) invert(1) sepia(1) saturate(6) hue-rotate(8deg) brightness(1);
  opacity: 1;
}

[data-theme="light"] .nav-studioup-logo {
  filter: brightness(0);
  opacity: 0.65;
}

[data-theme="light"] .nav-studioup:hover .nav-studioup-logo {
  filter: brightness(0) sepia(1) saturate(3) hue-rotate(10deg) brightness(1.2);
  opacity: 1;
}

/* ===== HERO ===== */
.hero-bg-video + .hero-bg-video { display: none; }

.hero-bg-video {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  object-fit: cover;
  opacity: 0.01;
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 48px 80px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

#hero3d {
  position: absolute;
  opacity: 1;
  inset: 0;
  z-index: 0;
}

#hero3d canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.hero-cue {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 20;
}

.hero-cue.visible { opacity: 1; }

/* Scroll cue — falling line + dot */
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, rgba(245,243,238,0.7));
  animation: line-drop 1.8s ease-in-out infinite;
  transform-origin: top;
}

.scroll-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(245,243,238,0.7);
  margin-top: 4px;
  animation: dot-appear 1.8s ease-in-out infinite;
}

@keyframes line-drop {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

@keyframes dot-appear {
  0%, 35% { opacity: 0; transform: translateY(-4px); }
  55%      { opacity: 1; transform: translateY(0); }
  100%     { opacity: 0; transform: translateY(0); }
}

.hero-eyebrow {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-eyebrow.revealed {
  opacity: 1;
  transform: translateY(0);
}

.hero-type {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4.2vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0;
  text-align: center;
}

.hero-comma { color: var(--text); }

.hero-name { color: var(--text); }
.hero-name-sep { color: var(--accent); }

.hero-period {
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-period.visible {
  opacity: 1;
}

/* Typewriter cursor */
.type-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 4px;
  border-radius: 1px;
  animation: cursor-blink 0.65s step-end infinite;
  transition: opacity 0.4s ease;
}

.type-cursor--done {
  animation: none;
  opacity: 0;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Shine clipped to letter forms via background-clip: text */
.hero h1 .line {
  background: linear-gradient(
    110deg,
    var(--text) 0%,
    var(--text) 35%,
    #ffffff 50%,
    var(--text) 65%,
    var(--text) 100%
  );
  background-size: 400% 100%;
  background-position: 100% center;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lineShine 4.5s ease-in-out infinite;
}

.hero h1 .line em {
  background: linear-gradient(
    110deg,
    var(--text-dim) 0%,
    var(--text-dim) 35%,
    #ceccdc 50%,
    var(--text-dim) 65%,
    var(--text-dim) 100%
  );
  background-size: 400% 100%;
  background-position: 100% center;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lineShine 4.5s ease-in-out infinite;
}

@keyframes lineShine {
  0%   { background-position: 100% center; }
  40%  { background-position: 0% center; }
  100% { background-position: 100% center; }
}

.hero h1 em {
  font-style: normal;
  color: var(--text-dim);
}

.hero-sub {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 0 48px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.hero-stat-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: 42px;
  line-height: 1;
}

.hero-stat-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 6px;
}

/* ===== MY WORK CARD STACK ===== */
.my-work-scroll {
  border-bottom: 1px solid rgba(245, 243, 238, 0.06);
  position: relative;
  z-index: 1;
  background: transparent;
}

.my-work-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  text-align: center;
}

/* Top row — label sits above cards */
.my-work-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.my-work-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.my-work-sub {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
  white-space: nowrap;
}

/* Centred card stack — constrained width */
.my-work-stack {
  position: relative;
  width: min(68vw, 860px);
  aspect-ratio: 1.65 / 1;
  align-self: center;
}

/* Cards: all absolutely stacked inside .my-work-stack */
.my-work-card {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  will-change: transform, opacity;
  transform-origin: center center;
}

.my-work-card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.my-work-card:hover .my-work-card-img {
  transform: scale(1.03);
}

/* Info overlaid at bottom with gradient */
.my-work-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 60px 20px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.my-work-card-num {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(245, 243, 238, 0.5);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.my-work-card-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: #F5F3EE;
  flex: 1;
}

.my-work-card-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(245, 243, 238, 0.5);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ===== PROJECT INDEX (signature element) ===== */
.index { padding: 100px 0 60px; }

.index-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 64px 1fr 200px 160px 28px;
  align-items: center;
  gap: 24px;
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.row-index {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
}

.row-main { min-width: 0; }

.row-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 54px);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 6px;
  text-wrap: balance;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              letter-spacing 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left center;
}

.row:hover .row-title {
  color: var(--accent);
  transform: scale(1.04);
  letter-spacing: -0.02em;
}

.row-desc {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 520px;
  transition: color 0.3s ease;
}

.row:hover .row-desc { color: var(--text); }

.row-sector {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.row-type {
  font-size: 13px;
  color: var(--text-faint);
  text-align: right;
}

.row-lock {
  font-size: 14px;
  opacity: 0.45;
  margin-right: 4px;
}

.project-badge {
  display: inline-block;
  vertical-align: middle;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff4444;
  background: rgba(255,68,68,0.12);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,68,68,0.30);
  margin-left: 10px;
  position: relative;
  top: -2px;
}

/* On card thumbnails */
.my-work-card .project-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  top: auto;
  margin-left: 0;
  backdrop-filter: blur(6px);
}

.row-arrow {
  font-size: 22px;
  color: var(--text-faint);
  opacity: 0.5;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  text-align: right;
}

.row:hover .row-arrow {
  opacity: 1;
  transform: translateX(6px);
}

@media (max-width: 860px) {
  .row { grid-template-columns: 40px 1fr 24px; }
  .row-sector, .row-type { display: none; }
}

/* ===== SCROLL-JACKED WORK SECTION ===== */
.work-scroll {
  height: 380vh;
}

.work-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.work-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 52px;
}

.work-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.work-counter {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent);
  transition: opacity 0.3s ease;
}

.work-stage {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.work-card {
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered vertical offsets for visual rhythm */
.work-card:nth-child(1) { padding-top: 24px; }
.work-card:nth-child(2) { padding-top: 0px; }
.work-card:nth-child(3) { padding-top: 40px; }
.work-card:nth-child(4) { padding-top: 12px; }
.work-card:nth-child(5) { padding-top: 32px; }

.work-card-img {
  width: 155px;
  height: 215px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease;
}

.work-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(255,255,255,0.08) 0%, transparent 55%);
  border-radius: 18px;
}

.work-card:hover .work-card-img {
  transform: translateY(-6px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
}

.work-card-num {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.work-card-name {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.work-card:hover .work-card-name { color: var(--accent); }

.work-scroll-hint {
  margin-top: 48px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.work-scroll-hint::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--text-faint);
  display: inline-block;
}

.work-scroll-hint.visible { opacity: 1; }

/* ===== ABOUT / FOOTER STRIP ===== */
.strip {
  padding-top: 120px;
  padding-bottom: 120px;
  border-bottom: 1px solid var(--line);
}

.strip-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.strip-inner {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: center;
}

.strip-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
}

.strip-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.strip-photo-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(245,243,238,0.2);
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.strip p {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.5;
  max-width: 880px;
  color: var(--text-dim);
  margin: 0;
}

.strip p strong {
  color: var(--text);
  font-weight: 500;
}

.footer {
  padding-top: 56px;
  padding-bottom: 80px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 32px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.footer-links a {
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.footer-links a:hover { color: var(--text); border-bottom-color: var(--accent); }

.footer-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ===== CASE STUDY PAGE ===== */
.cs-hero {
  padding-top: 160px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0 80px;
}

.cs-hero .cs-back,
.cs-hero .cs-tags {
  grid-column: 1 / -1;
}

.cs-hero h1 {
  grid-column: 1;
  align-self: start;
}

.cs-hero .cs-meta-row {
  grid-column: 2;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  align-self: end;
  flex-direction: column;
}

.cs-back {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
}

.cs-back:hover { color: var(--accent); }

.cs-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.cs-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--text-dim);
}

.cs-hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 6.5vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  max-width: 1000px;
  text-wrap: balance;
}

.cs-meta-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 56px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
}

.cs-meta-item-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.cs-meta-item-value {
  font-size: 16px;
  color: var(--text);
}

.cs-section {
  padding-top: 80px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--line);
}

.cs-section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.cs-section-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.cs-section-body {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ── Exhibition strip: section 4 screens treatment ─────────────── */
.cs-section--screens {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  padding: 80px 0 100px;
}

.cs-section--screens .cs-img {
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.28);
}

.cs-section--screens .cs-img + .cs-img-grid,
.cs-section--screens .cs-img + .cs-img {
  margin-top: 120px;
}

.cs-section--screens .cs-img-grid + .cs-img {
  margin-top: 160px;
}

/* ── Staggered grid in screens section ──────────────────────── */
/* More gap between columns, items aligned to top so offset works */
.cs-section--screens .cs-img-grid {
  gap: 40px;
  align-items: start;
  position: relative;
  isolation: isolate;
}

/* Floating blobs in the two empty corners of the staggered grid */
.cs-section--screens .cs-img-grid::before,
.cs-section--screens .cs-img-grid::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

/* Top-right gap (above 4c) */
.cs-section--screens .cs-img-grid::before {
  width: 52%;
  aspect-ratio: 1;
  right: -4%;
  top: 4%;
  opacity: 0.55;
  animation: blob3 24s ease-in-out infinite alternate;
}

/* Bottom-left gap (below 4b) */
.cs-section--screens .cs-img-grid::after {
  width: 44%;
  aspect-ratio: 1;
  left: -4%;
  bottom: 6%;
  opacity: 0.42;
  animation: blob4 30s ease-in-out infinite alternate;
}

/* Per-project colours */
[data-project="debeers"]   .cs-section--screens .cs-img-grid::before { background: #c45a08; }
[data-project="debeers"]   .cs-section--screens .cs-img-grid::after  { background: #7a2e04; }

[data-project="ineos"]     .cs-section--screens .cs-img-grid::before { background: #8aaa28; }
[data-project="ineos"]     .cs-section--screens .cs-img-grid::after  { background: #c87820; }

[data-project="sohohouse"] .cs-section--screens .cs-img-grid::before { background: #c4845a; }
[data-project="sohohouse"] .cs-section--screens .cs-img-grid::after  { background: #8a5038; }

[data-project="ahold"]     .cs-section--screens .cs-img-grid::before { background: #00a888; }
[data-project="ahold"]     .cs-section--screens .cs-img-grid::after  { background: #006850; }

[data-project="smg"]       .cs-section--screens .cs-img-grid::before { background: #4878ff; }
[data-project="smg"]       .cs-section--screens .cs-img-grid::after  { background: #0820a8; }

/* Softer in light mode */
[data-theme="light"] .cs-section--screens .cs-img-grid::before { opacity: 0.30; }
[data-theme="light"] .cs-section--screens .cs-img-grid::after  { opacity: 0.22; }


/* 4a image (immediately after the section label) gets the same entrance */
.cs-section--screens .cs-section-label + .cs-img.reveal {
  transform: translateY(80px) translateX(14px) rotateZ(-5deg);
  transform-origin: bottom center;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-section--screens .cs-section-label + .cs-img.reveal.revealed {
  transform: translateY(0) translateX(0) rotateZ(0deg);
}

/* Card-stack entrance: rise from below-right with a tilt, like the homepage stack */
.cs-section--screens .cs-img-grid .cs-img.reveal {
  transform: translateY(80px) translateX(14px) rotateZ(-5deg);
  transform-origin: bottom center;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Second image enters 0.18s after the first */
.cs-section--screens .cs-img-grid .cs-img.reveal:nth-child(2) {
  transition-delay: 0.18s;
}

.cs-section--screens .cs-img-grid .cs-img.reveal.revealed {
  transform: translateY(0) translateX(0) rotateZ(0deg);
}

.cs-section--screens .cs-section-label {
  margin-bottom: 40px;
}

[data-theme="light"] .cs-section--screens .cs-img {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
}

.cs-section-body h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 40px);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.1;
  text-wrap: balance;
}

.cs-section-content {
  min-width: 0;
}

.cs-stat {
  margin-top: 48px;
}

.cs-stat-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.cs-stat-label {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 12px;
  max-width: 200px;
  line-height: 1.5;
}

.cs-section-body p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 720px;
  margin: 0 0 20px;
}

.cs-section-body p strong { color: var(--text); font-weight: 500; }

.cs-img {
  display: block;
  width: 100%;
  border-radius: 4px;
  margin-top: 32px;
}

.cs-section-inner .cs-img {
  border-radius: 4px 4px 50px 4px;
}

.cs-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.cs-img-grid .cs-img {
  margin-top: 0;
}

/* Cropped image preview — shows top portion, fades to bg, click opens full in lightbox */
.cs-img-crop {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px 4px 50px 4px;
  margin-top: 32px;
}

.cs-img-crop .cs-img {
  margin-top: 0;
  border-radius: 0;
  display: block;
  width: 100%;
  height: auto;
}


.cs-img--vignette {
  -webkit-mask-image:
    linear-gradient(to right,  transparent 0%,  black 18%, black 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0%,  black 12%, black 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right,  transparent 0%,  black 18%, black 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0%,  black 12%, black 88%, transparent 100%);
  mask-composite: intersect;
}

.cs-img--slide.reveal {
  transform: translateY(80px);
  transition: opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-img--glow {
  transition: filter 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cs-img--glow:hover {
  filter: drop-shadow(0 0 48px rgba(196, 132, 90, 0.55));
  transition: filter 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cs-pdf {
  display: block;
  width: 100%;
  max-width: 1600px;
  height: 800px;
  border: none;
  border-radius: 4px;
  margin-top: 32px;
}

/* ── Lightbox ───────────────────────────────────────────────── */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lb-overlay.lb-active {
  opacity: 1;
  pointer-events: all;
}

.lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.lb-overlay.lb-active .lb-img {
  transform: scale(1);
}

.lb-close {
  position: fixed;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  transition: color 0.15s;
}

.lb-close:hover {
  color: #fff;
}

/* ── Figma prototype embed ───────────────────────────────────── */
.cs-figma-embed {
  width: 100%;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cs-figma-embed iframe {
  width: 100%;
  max-width: 480px;
  height: 80vh;
  border: none;
  border-radius: 12px;
  display: block;
  background: var(--surface);
}

.cs-figma-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

.cs-figma-link:hover {
  color: var(--text);
}

/* ── Placeholder ─────────────────────────────────────────────── */
.cs-placeholder {
  margin-top: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 48px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  max-width: 720px;
}

.cs-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}

.cs-impact-cell {
  background: transparent;
  padding: 48px 48px 48px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.cs-impact-cell:first-child {
  padding-left: 0;
}

.cs-impact-cell:last-child {
  padding-right: 0;
  padding-left: 48px;
}

.cs-impact-cell:not(:first-child):not(:last-child) {
  padding-left: 48px;
}

.cs-impact-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(52px, 7vw, 110px);
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
}

.cs-impact-label {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

.cs-nav {
  padding: 64px 0 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-nav-next {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cs-nav-next-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  color: var(--text);
  margin-top: 10px;
}

.cs-nav-next:hover .cs-nav-next-title { color: var(--accent); }

/* ── Tablet ── */
@media (max-width: 900px) {
  .hero { padding-top: 100px; padding-bottom: 60px; }
  .hero-content { grid-template-columns: 1fr; gap: 48px; }
  .hero-ticker-wrap { display: none; }
  .my-work-sticky { gap: 24px; padding-top: 80px; }
  .my-work-stack { width: 90vw; aspect-ratio: 2 / 1; }

  .hero-sub { font-size: 17px; }
  .hero-stats { gap: 32px; }
  .strip { padding-top: 80px; padding-bottom: 80px; }
  .cs-hero { padding-top: 120px; padding-bottom: 60px; }
  .cs-meta-row { gap: 32px; }
  .cs-section { padding-top: 60px; padding-bottom: 60px; }
  .cs-nav {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
    padding-top: 48px;
    padding-bottom: 72px;
  }
  .footer { padding-top: 40px; padding-bottom: 60px; }
}

/* ── Mobile ── */
@media (max-width: 760px) {
  .wrap { padding-left: 24px !important; padding-right: 24px !important; }

  /* Sticky nav on mobile — avoids iOS visual-viewport jump */
  .nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    padding: 16px 24px;
    background: linear-gradient(to bottom, rgba(10,10,10,0.95), rgba(10,10,10,0));
    backdrop-filter: blur(2px);
    will-change: auto;
    transform: none;
  }

  /* Hero top padding can shrink since nav is now in flow */
  .hero { padding-top: 48px; }
  .cs-hero { padding-top: 40px; }

  /* Hide desktop nav links on mobile — replaced by hamburger menu */
  .nav-links { display: none !important; }

  /* Scrolljack section — reduce subtitle size to prevent overlap with cards */
  .my-work-sub { white-space: normal; font-size: 14px; }
  .my-work-sticky { gap: 32px; }
  .my-work-stack { aspect-ratio: 1.8 / 1; }

  /* About section paragraph */
  .strip p { font-size: 16px; }

  .index { padding-top: 60px; padding-bottom: 40px; }
  .row { grid-template-columns: 40px 1fr 24px; padding: 28px 0; }
  .row-sector, .row-type { display: none; }
  .strip { padding-top: 60px; padding-bottom: 60px; }
  .strip p { font-size: 18px; }
  .strip-inner { grid-template-columns: 1fr; gap: 40px; }
  .strip-photo { max-width: 240px; }

  /* Case study hero */
  .cs-hero { padding-top: 100px; padding-bottom: 48px; grid-template-columns: 1fr; }
  .cs-hero h1 { font-size: clamp(32px, 8vw, 56px); margin-bottom: 24px; }
  .cs-hero h1, .cs-hero .cs-meta-row { grid-column: 1; }
  .cs-hero .cs-meta-row { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; gap: 24px; }
  .cs-back { margin-bottom: 24px; }
  .cs-tags { flex-wrap: wrap; gap: 8px; }

  /* Sections */
  .cs-section { padding-top: 40px; padding-bottom: 40px; }
  .cs-section-inner { grid-template-columns: 1fr; gap: 20px; }
  .cs-section-body { position: static; }
  .cs-section h2 { font-size: clamp(22px, 5vw, 32px); }

  /* Screens section */
  .cs-section--screens { padding-top: 48px; padding-bottom: 64px; }
  .cs-section--screens .cs-img + .cs-img-grid,
  .cs-section--screens .cs-img + .cs-img { margin-top: 48px; }
  .cs-section--screens .cs-img-grid + .cs-img { margin-top: 48px; }
  .cs-section--screens .cs-img-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* Disable JS stagger offset on mobile — second image should sit below, not offset */
  .cs-section--screens .cs-img-grid .cs-img:nth-child(2) { margin-top: 0 !important; }
  /* Simpler entrance animation on mobile — no tilt */
  .cs-section--screens .cs-section-label + .cs-img.reveal,
  .cs-section--screens .cs-img-grid .cs-img.reveal {
    transform: translateY(40px);
  }
  .cs-section--screens .cs-section-label + .cs-img.reveal.revealed,
  .cs-section--screens .cs-img-grid .cs-img.reveal.revealed {
    transform: translateY(0);
  }

  /* Stats */
  .cs-stat { gap: 12px; }

  /* Impact grid */
  .cs-impact-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .cs-impact-cell { padding: 28px 20px; }
  .cs-impact-num { font-size: clamp(28px, 7vw, 48px); }

  /* Next project nav */
  .cs-nav { padding-top: 40px; padding-bottom: 64px; }
  .cs-nav-next-title { font-size: clamp(24px, 6vw, 40px); }

  /* Footer */
  .footer { padding-top: 32px; padding-bottom: 48px; }
  .footer-links { gap: 20px; font-size: 13px; }

  .cs-placeholder { padding: 32px 20px; }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
  .wrap { padding-left: 24px !important; padding-right: 24px !important; }
  .nav { padding: 16px 24px; }
  .nav-links { gap: 14px; font-size: 12px; }
  /* Hide less important nav items to prevent overflow */
  .nav-links a[href*="about"] { display: none; }

  .hero { padding-top: 80px; }
  .hero-sub { font-size: 15px; margin-bottom: 32px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hero-stat-num { font-size: 30px; }

  .row { padding: 22px 0; gap: 14px; }
  .row-title { font-size: 26px; }

  /* Case study */
  .cs-hero { padding: 88px 0 40px; }
  .cs-hero h1 { font-size: clamp(28px, 8.5vw, 44px); }
  .cs-hero .cs-meta-row { flex-direction: column; gap: 16px; }
  .cs-back { font-size: 13px; }

  .cs-section { padding: 32px 0; }
  .cs-section-label { font-size: 10px; margin-bottom: 20px; }

  .cs-impact-grid { grid-template-columns: 1fr; gap: 32px; }
  .cs-impact-cell,
  .cs-impact-cell:first-child,
  .cs-impact-cell:last-child,
  .cs-impact-cell:not(:first-child):not(:last-child) {
    padding: 0;
    border: none;
    align-items: center;
    text-align: center;
  }
  .cs-impact-num { font-size: 48px; }

  .cs-section--screens { padding: 40px 0 48px; }
}

/* ===== CV OVERLAY CARD ===== */
.cv-card {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 400px;
  transform: translate(-50%, -50%) translateY(16px);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 32px 80px rgba(0,0,0,0.45);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cv-card--open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) translateY(0);
}

.cv-card-img {
  width: 100%;
  height: 240px;
  display: block;
  object-fit: cover;
  object-position: top;
}

.cv-card-download {
  display: block;
  text-align: center;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: opacity 0.2s;
}
.cv-card-download:hover { opacity: 0.82; }

.cv-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(13, 13, 26, 0.7);
  border: 1px solid rgba(245, 243, 238, 0.2);
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.cv-card-close:hover { color: var(--text); }

.hero-img {
  width: 100%;
  max-width: 213px;
  border-radius: 20px;
  display: block;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  transform: perspective(900px) rotateY(0deg) rotateX(0deg) scale(1);
  transition: transform 0.12s ease-out;
  cursor: default;
  will-change: transform;
}

/* ===== PASSWORD GATE ===== */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0d0d1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pw-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Blobs inside gate sit absolute (not fixed) and use homepage default colours */
.pw-blobs .blob {
  position: absolute !important;
}
.pw-blobs .blob-1 { background: #E87060; }
.pw-blobs .blob-2 { background: #7a1f72; }
.pw-blobs .blob-3 { background: #3d1060; }
.pw-blobs .blob-4 { background: #f0a07a; }
.pw-blobs .blob-5 { background: #b03060; }

[data-project="smg"] .pw-blobs .blob-1 { background: #2850e8; }
[data-project="smg"] .pw-blobs .blob-2 { background: #0820a8; }
[data-project="smg"] .pw-blobs .blob-3 { background: #4878ff; }
[data-project="smg"] .pw-blobs .blob-4 { background: #1040d0; }
[data-project="smg"] .pw-blobs .blob-5 { background: #0c28c0; }

.pw-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.pw-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0;
}

.pw-row {
  display: flex;
  gap: 0;
}

.pw-input {
  font-family: var(--mono);
  font-size: 14px;
  background: transparent;
  border: 1px solid rgba(245,243,238,0.15);
  border-right: none;
  border-radius: 3px 0 0 3px;
  color: var(--text);
  padding: 12px 18px;
  outline: none;
  width: 240px;
  transition: border-color 0.2s ease;
}

.pw-input:focus {
  border-color: rgba(245,243,238,0.4);
}

.pw-btn {
  font-family: var(--mono);
  font-size: 16px;
  background: var(--accent);
  color: #0d0d1a;
  border: none;
  border-radius: 0 3px 3px 0;
  padding: 12px 18px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.pw-btn:hover { opacity: 0.85; }

.pw-error {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pw-error--visible { opacity: 1; }

@keyframes pw-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.pw-input--shake { animation: pw-shake 0.45s ease; }

.pw-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-top: 8px;
}
.pw-back:hover {
  color: var(--text-dim);
  border-bottom-color: var(--text-faint);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LINE MASK REVEAL (Untold Heroes style) ===== */
.line-wrap {
  display: block;
  overflow: hidden;
  padding-bottom: 0.15em;
}

.line {
  display: block;
  transform: translateY(110%);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.line.revealed {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .line { transform: none !important; }
}


/* ===== CUSTOM CURSOR ===== */
@media (pointer: fine) {
  body { cursor: none; }

  .cursor-dot {
    position: fixed;
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease;
    will-change: left, top;
  }

  .cursor-dot.hover {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }

  .cursor-dot.click {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0.25;
  }

  .cursor-ring {
    position: fixed;
    width: 34px; height: 34px;
    border: 1.5px solid rgba(245, 243, 238, 0.45);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    backdrop-filter: brightness(1.35) contrast(1.08) saturate(1.2);
    -webkit-backdrop-filter: brightness(1.35) contrast(1.08) saturate(1.2);
    transition: width  0.45s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                background  0.3s ease;
    will-change: left, top;
  }

  .cursor-ring.hover {
    width: 52px; height: 52px;
    border-color: var(--accent);
    background: rgba(232, 112, 96, 0.08);
  }
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}




/* ── Ask about this project ──────────────────────────────── */
.ask-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.ask-toggle:hover,
.ask-toggle--active {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.ask-toggle-icon { font-size: 12px; }

.ask-panel {
  position: fixed;
  bottom: 90px;
  right: 32px;
  width: 360px;
  max-height: 480px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 900;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16,1,0.3,1);
}
.ask-panel--open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.ask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.ask-header-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.ask-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
}
.ask-close:hover { color: var(--text); }

.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.ask-msg {
  font-size: 13px;
  line-height: 1.6;
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 10px;
}
.ask-msg--ai {
  background: var(--surface);
  color: var(--text-dim);
  align-self: flex-start;
  border-radius: 2px 10px 10px 10px;
}
.ask-msg--user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-radius: 10px 10px 2px 10px;
  opacity: 0.92;
}

/* Typing indicator */
.ask-msg--typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px;
}
.ask-msg--typing span {
  width: 5px;
  height: 5px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: ask-bounce 1.2s ease-in-out infinite;
}
.ask-msg--typing span:nth-child(2) { animation-delay: 0.2s; }
.ask-msg--typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ask-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.ask-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.ask-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.ask-input:focus { border-color: var(--accent); }
.ask-input::placeholder { color: var(--text-dim); opacity: 0.5; }
.ask-send {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  width: 38px;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.ask-send:hover { opacity: 0.85; }
.ask-send:disabled, .ask-input:disabled { opacity: 0.5; }

@media (max-width: 480px) {
  .ask-toggle { right: 20px; bottom: 20px; }
  .ask-panel { right: 16px; left: 16px; width: auto; bottom: 80px; }
}

/* ===== THEME SWITCH ===== */
/* Track: inverts so it's always visible — light on dark bg, dark on light bg */
.theme-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(245, 243, 238, 0.20);
  border: 1px solid rgba(245, 243, 238, 0.28);
  border-radius: 11px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .theme-switch-track {
  background: #0d0d1a;
  border-color: #0d0d1a;
}

.theme-switch-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f0eeea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: #2a2838;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              color 0.3s ease;
}

[data-theme="light"] .theme-switch-thumb {
  transform: translateX(18px);
  background: #f5f3ee;
  color: #2a2838;
}

/* ===== SMOOTH THEME TRANSITION ===== */
body,
.nav,
.blob,
.cs-tag,
.row,
.strip,
.footer,
.pw-gate,
.pw-input,
.ask-toggle,
.ask-panel {
  transition-property: background-color, background, color, border-color, opacity;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* Keep animation transitions on blobs intact */
.blob {
  transition-property: background, opacity, transform;
  transition-duration: 0.8s, 0.8s, 26s;
  transition-timing-function: ease, ease, ease-in-out;
}

/* ===== LIGHT THEME ===== */
/* WCAG AA compliant colours:
   --text       #0d0d1a on #f5f3ee  → ~18:1  (AAA)
   --text-dim   #4a4860 on #f5f3ee  → ~7.1:1 (AAA)
   --text-faint #625f78 on #f5f3ee  → ~4.9:1 (AA)
   --accent     #b03020 on #f5f3ee  → ~5.3:1 (AA)
*/
[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-raised: #eceae4;
  --surface: #e4e1d9;
  --line: rgba(13, 13, 26, 0.10);
  --line-strong: rgba(13, 13, 26, 0.20);
  --text: #0d0d1a;
  --text-dim: #4a4860;
  --text-faint: #625f78;
  --accent: #E87060;
  --accent-dim: #8c3040;
}

/* Nav background */
[data-theme="light"] .nav {
  background: linear-gradient(to bottom, rgba(245,243,238,0.97), rgba(245,243,238,0));
}

/* Blobs — strong colour in light mode */
[data-theme="light"] .blob { opacity: 0.32; }
[data-theme="light"] [data-project] .blob { opacity: 0.45; }

/* Scroll cue — flip to dark ink */
[data-theme="light"] .scroll-line {
  background: linear-gradient(to bottom, transparent, rgba(13,13,26,0.45));
}
[data-theme="light"] .scroll-dot {
  background: rgba(13,13,26,0.45);
}

/* Card stack section border */
[data-theme="light"] .my-work-scroll {
  border-bottom-color: rgba(13, 13, 26, 0.08);
}

/* About photo placeholder border */
[data-theme="light"] .strip-photo-placeholder {
  border-color: rgba(13,13,26,0.2);
}

/* Password gate */
[data-theme="light"] .pw-gate {
  background: var(--bg);
}
[data-theme="light"] .pw-input {
  border-color: rgba(13,13,26,0.18);
  color: var(--text);
}
[data-theme="light"] .pw-input:focus {
  border-color: rgba(13,13,26,0.45);
}
[data-theme="light"] .pw-btn {
  color: #fff;
}

/* Custom cursor ring */
[data-theme="light"] .cursor-ring {
  border-color: rgba(13, 13, 26, 0.30);
  backdrop-filter: brightness(0.97) contrast(1.04);
  -webkit-backdrop-filter: brightness(0.97) contrast(1.04);
}

/* CV card close button */
[data-theme="light"] .cv-card-close {
  background: rgba(245, 243, 238, 0.88);
  border-color: rgba(13,13,26,0.20);
}

/* Ask panel shadow in light mode */
[data-theme="light"] .ask-panel {
  box-shadow: 0 8px 48px rgba(0,0,0,0.18);
}
[data-theme="light"] .ask-toggle {
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* ===== MOBILE HAMBURGER MENU ===== */

/* Burger button — injected by mobile-menu.js */
.nav-burger {
  display: none;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
  transform-origin: center;
}
.nav-burger.is-open span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.nav-burger.is-open span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

@media (max-width: 760px) {
  .nav-burger { display: flex; }
}

/* Full-screen overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  /* Never visible on desktop */
}

/* Animated blobs inside the menu */
.mm-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Blobs inherit per-project colours via existing [data-project] and .su-page selectors.
   Bump opacity slightly so they read on the full-screen overlay. */
.mm-blobs .blob { opacity: 0.35; }
[data-project] .mm-blobs .blob { opacity: 0.45; }
[data-theme="light"] .mm-blobs .blob { opacity: 0.38; }

@media (min-width: 761px) {
  .mobile-menu { display: none !important; }
}

.mobile-menu.is-open {
  transform: translateX(0);
}

.mm-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 28px 40px;
}

/* Close button */
.mm-close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  flex-shrink: 0;
}
.mm-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: background 0.2s;
}
.mm-close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.mm-close span:last-child  { transform: translate(-50%, -50%) rotate(-45deg); }
.mm-close:hover span { background: var(--accent); }

/* Navigation links */
.mm-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 12px 0;
}

.mm-link {
  display: block;
  font-family: var(--mono);
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  opacity: 1;
  transition: color 0.2s ease;
}
.mm-link:hover { color: var(--text); }

/* Studio Up logo link */
.mm-link--su {
  font-size: inherit;
  padding: 12px 0 8px;
  opacity: 0.65;
}
.mm-link--su:hover { opacity: 1; color: inherit; }

.mm-su-logo {
  height: clamp(20px, 5.6vw, 31px);
  display: block;
  filter: brightness(0) invert(1);
  opacity: 1;
  transition: filter 0.2s ease;
}
[data-theme="light"] .mm-su-logo {
  filter: brightness(0);
}
.mm-link--su:hover .mm-su-logo {
  filter: brightness(0) invert(1) sepia(1) saturate(6) hue-rotate(8deg) brightness(1);
}
[data-theme="light"] .mm-link--su:hover .mm-su-logo {
  filter: brightness(0) sepia(1) saturate(3) hue-rotate(10deg) brightness(1.2);
}

/* Footer row — theme toggle */
.mm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.mm-theme-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Studio Up page overrides ── */
body.su-page .mobile-menu {
  background: var(--su-bg);
}

body.su-page .mm-link {
  color: rgba(255,255,255,0.65);
}
body.su-page .mm-link:hover {
  color: var(--su-tertiary);
}
body.su-page .mm-link--su {
  color: inherit;
}
body.su-page .mm-link--su:hover { color: inherit; }

body.su-page .mm-su-logo {
  filter: none;
}
body.su-page .mm-link--su:hover .mm-su-logo {
  filter: none;
}

body.su-page .mm-close span {
  background: var(--su-ink);
}
body.su-page .mm-close:hover span {
  background: var(--su-tertiary);
}
body.su-page .nav-burger span {
  background: rgba(255,255,255,0.8);
}

body.su-page .mm-footer {
  border-color: var(--su-line);
}
body.su-page .mm-theme-label {
  color: rgba(255,255,255,0.5);
}

/* Light mode su-page overrides */
[data-theme="light"] body.su-page .mm-su-logo {
  filter: brightness(0);
}
[data-theme="light"] body.su-page .mm-link--su:hover .mm-su-logo {
  filter: brightness(0) sepia(1) saturate(3) hue-rotate(10deg) brightness(0.8);
}
[data-theme="light"] body.su-page .nav-burger span {
  background: rgba(28,20,16,0.8);
}
[data-theme="light"] body.su-page .mm-close span {
  background: var(--su-ink);
}
