/* =====================================================================
   Bhaskar Jyoti Goswami - Portfolio
   Custom editorial design system. Hand-built, no framework.
   ===================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Palette - warm editorial */
  --bone:      #F2F4F7;
  --bone-2:    #E7EBF1;
  --paper:     #FBFCFE;
  --ink:       #171510;
  --ink-2:     #2B281F;
  --ink-soft:  #6A665A;
  --ink-faint: #9C978A;
  --line:      rgba(23, 21, 16, 0.12);
  --line-soft: rgba(23, 21, 16, 0.07);
  --accent:    #C8553D;   /* clay */
  --accent-2:  #9C3F2C;
  --gold:      #B08A3E;
  --ok:        #2F6B4F;

  /* Type */
  --display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Metrics */
  --wrap: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 18px;
  --radius-lg: 26px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  font-family: var(--sans);
  background: var(--bone);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }

/* Custom hand cursor on interactive elements */
a, button, summary, label,
[role="button"], [onclick],
.split__hz, .split__side, .tile, .life-item, .stack__key, .write-row,
.nav__cta, .text-btn, .split__cta {
  cursor: url("../assets/cursor-tap.png") 31 6, pointer;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 12vw, 160px); }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); display: inline-block; }
.grid { display: grid; gap: var(--gutter); }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.02; letter-spacing: -0.02em; }
.display {
  font-size: clamp(3rem, 11.5vw, 10.5rem);
  line-height: 0.92; letter-spacing: -0.035em; font-weight: 340;
}
.h-xl { font-size: clamp(2.4rem, 6.5vw, 5rem); }
.h-lg { font-size: clamp(2rem, 4.6vw, 3.6rem); }
.h-md { font-size: clamp(1.5rem, 3vw, 2.3rem); }
.italic-em { font-style: italic; font-variation-settings: "opsz" 80; }
.lead { font-size: clamp(1.15rem, 2.1vw, 1.55rem); line-height: 1.45; color: var(--ink-2); font-weight: 400; }
.muted { color: var(--ink-soft); }

/* =====================================================================
   Custom cursor
   ===================================================================== */

/* =====================================================================
   Navigation
   ===================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: padding .4s var(--ease), background .4s var(--ease), box-shadow .4s;
}
/* Frosted background lives on a pseudo-element: backdrop-filter on .nav itself
   would make it the containing block for the fixed mobile menu overlay,
   collapsing the overlay to the nav bar's height */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(242,244,247,0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  opacity: 0; transition: opacity .4s var(--ease);
}
.nav.scrolled { padding-block: 14px; box-shadow: 0 1px 0 var(--line); }
.nav.scrolled::before { opacity: 1; }
.nav__brand { font-family: var(--display); font-size: 1.15rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.nav__brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a { font-size: 14.5px; font-weight: 500; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1.5px;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }
.nav__cta {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--ink); border-radius: 100px; padding: 9px 20px; font-weight: 500; font-size: 14px;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.nav__cta:hover { background: var(--ink); color: var(--bone); transform: translateY(-1px); }
/* arrow appears only on hover */
.nav__cta-arrow {
  width: 0; height: 14px; opacity: 0; margin-left: 0; transform: translateX(-4px);
  transition: width .3s var(--ease), opacity .3s var(--ease), margin-left .3s var(--ease), transform .3s var(--ease);
}
.nav__cta:hover .nav__cta-arrow { width: 14px; opacity: 1; margin-left: 8px; transform: translateX(0); }
.nav__toggle { display: none; width: 30px; height: 18px; position: relative; }
.nav__toggle span { position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink); transition: .3s var(--ease); }
.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 8px; }
.nav__toggle span:nth-child(3) { top: 16px; }
body.menu-open .nav__toggle span:nth-child(1) { top: 8px; transform: rotate(45deg); }
body.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav__toggle span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav__cta { display: none; }
  .nav__toggle { display: block; z-index: 210; }
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 8px;
    background: var(--bone); transform: translateY(-100%); transition: transform .5s var(--ease);
    z-index: 205;
  }
  .nav__links a { font-family: var(--display); font-size: 2.4rem; }
  .nav__links a::after { display: none; }
  body.menu-open .nav__links { transform: translateY(0); }
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding-top: clamp(64px, 7vh, 84px); padding-bottom: clamp(16px, 2.5vh, 28px); overflow: hidden;
  background: linear-gradient(180deg, #F4EEE3 0%, #F4EEE3 88%, var(--paper) 100%); }
.hero .hero__stage { width: 100%; position: relative; z-index: 1; }

.hero__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; margin-bottom: clamp(20px, 4vw, 48px); }
.hero__meta { max-width: 340px; font-size: 15px; color: var(--ink-soft); line-height: 1.5; }
.hero__title { position: relative; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; will-change: transform; }
.hero__title .thin { color: var(--ink-faint); }
.hero__available {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 100px; padding: 7px 14px; background: var(--paper);
}
.hero__available .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: relative; }
.hero__available .pulse::after { content:""; position:absolute; inset:-4px; border-radius:50%; background: var(--ok); opacity:.35; animation: ping 1.8s infinite; }
@keyframes ping { 0%{ transform: scale(.6); opacity:.5;} 100%{ transform: scale(2.2); opacity:0;} }
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; margin-top: clamp(28px, 5vw, 60px); }
.hero__scroll { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.hero__scroll .arrow { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; animation: bob 2s var(--ease) infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(5px);} }

/* ---------- Hero variant: centered portrait (Radicalface-inspired) ---------- */
.hero__stage { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero__stage .hero__available { margin-bottom: clamp(28px, 5vw, 48px); }

/* ---------- Split-personality hero (Adham Dannaway-inspired) ---------- */
.split {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: clamp(16px, 2.5vw, 44px);
  width: 100vw; max-width: 100vw;
  padding-inline: clamp(28px, 6vw, 120px);
  margin: 0;
}
.split__side { display: block; transition: opacity .4s var(--ease); text-align: left; max-width: 330px; }
.split__side--l { justify-self: end; text-align: right; }
.split__side--l .split__rule { margin-left: auto; margin-right: 0; }
.split__side--r { justify-self: start; align-self: end; position: relative; padding-left: 24px; padding-bottom: clamp(20px, 5vh, 60px); }

/* Left headline */
.split__title {
  font-family: var(--display); font-weight: 340; letter-spacing: -.02em;
  font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.03; margin: 0;
}
.split__title--accent { display: block; color: var(--accent); }
.split__title--ink { display: block; color: var(--ink); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.split__title--ink.swap { opacity: 0; transform: translateY(10px); }
.split__rule { display: block; width: 46px; height: 3px; background: var(--accent); border-radius: 3px; margin: clamp(16px,2.2vw,24px) 0 clamp(14px,1.8vw,20px); }

.split__desc { font-size: 15px; line-height: 1.55; color: var(--ink-soft); max-width: 300px; }
.split__side--l .split__desc { margin: 0 0 clamp(20px,2.8vw,28px) auto; }

.split__cta {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--ink); border-radius: 100px; padding: 12px 22px;
  font-weight: 500; font-size: 15px; color: var(--ink);
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.split__cta:hover { background: var(--ink); color: var(--bone); transform: translateY(-2px); }
.split__cta svg { transition: transform .3s var(--ease); }
.split__cta:hover svg { transform: translateX(4px); }

/* Right code card */
.split__side--r::before { content: ""; position: absolute; left: 0; top: 3px; width: 3px; height: 32px; background: var(--accent); border-radius: 3px; }
.split__code { display: block; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: clamp(1.5rem, 2.4vw, 1.95rem); font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 16px; }
.split__heading { font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.15; color: var(--ink); margin: 0; }
.split__stack { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink-2); margin: 10px 0 12px; }
.split__side--r .split__desc { max-width: 250px; }
/* Binary decode reveal — glyphs read as monospace 0/1 while scrambling, then lock in */
.split__side--r .is-decoding {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--ink-faint); letter-spacing: .01em;
}

/* Portrait - two duotone halves on a transparent background (no card) */
.split__portrait { position: relative; width: min(clamp(360px, 52vw, 820px), 96vh); aspect-ratio: 1398 / 1125; perspective: 1100px; }
.split__figure {
  position: absolute; inset: 0; z-index: 2;
  filter: drop-shadow(0 24px 26px rgba(23,21,16,.20));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease), filter .55s var(--ease);
}
/* 3D tilt on hover */
.split__portrait:hover .split__figure {
  transform: rotateX(7deg) rotateY(-11deg) scale(1.04);
  filter: drop-shadow(28px 36px 32px rgba(23,21,16,.28));
}
.split__img { position: absolute; bottom: 0; left: 0; width: 100%; height: auto; transition: clip-path .6s var(--ease); backface-visibility: hidden; }
/* Designer half — black & white photo, left */
.split__img--a {
  z-index: 1; filter: url(#sharpen) grayscale(1) sepia(0.06) brightness(1.04);
  /* photo fills the left half, then dissolves right at the seam into the binary */
  -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 55%);
          mask-image: linear-gradient(90deg, #000 50%, transparent 55%);
}
/* Vibe-coder half — portrait rendered in binary (0/1) on transparent, right */
.split__img--b { z-index: 2; clip-path: inset(0 0 0 50%); }
.split__hz { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; cursor: pointer; }
.split__hz--l { left: 0; } .split__hz--r { right: 0; }

/* Hover a side → that treatment wipes across the whole portrait */
.split:has(.split__side--l:hover) .split__img--a,
.split__portrait:has(.split__hz--l:hover) .split__img--a { clip-path: inset(0 0 0 0); -webkit-mask-image: none; mask-image: none; }
.split:has(.split__side--l:hover) .split__img--b,
.split__portrait:has(.split__hz--l:hover) .split__img--b { clip-path: inset(0 0 0 100%); }
.split:has(.split__side--r:hover) .split__img--a,
.split__portrait:has(.split__hz--r:hover) .split__img--a { clip-path: inset(0 100% 0 0); }
.split:has(.split__side--r:hover) .split__img--b,
.split__portrait:has(.split__hz--r:hover) .split__img--b { clip-path: inset(0 0 0 0); }
.split:has(.split__side--l:hover) .split__side--r,
.split:has(.split__side--r:hover) .split__side--l { opacity: .38; }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; justify-items: center; gap: 24px; }
  .split__side { text-align: center; max-width: 440px; justify-self: center; padding-left: 0; }
  .split__side--r { padding-left: 0; }
  .split__side--r::before { display: none; }
  .split__title, .split__desc, .split__side--r .split__desc { margin-inline: auto; }
  .split__rule { margin-inline: auto; }
  .split__portrait { width: clamp(220px, 62vw, 300px); }
}

/* Cursor-following spotlight (added via JS) */
.hero__spotlight {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  transition: opacity .5s var(--ease);
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 40%), rgba(200,85,61,.14), transparent 70%);
}
.hero:hover .hero__spotlight { opacity: 1; }

.hero__name {
  font-family: var(--display); font-weight: 340;
  font-size: clamp(2.8rem, 9vw, 7rem); line-height: .95; letter-spacing: -.03em;
}
.hero__name .italic-em { color: var(--accent); }
.hero__tag { max-width: 640px; margin: clamp(6px,1.2vw,14px) auto 0; }
.hero__tag strong { color: var(--ink); font-weight: 600; }
.hero__tag em { color: var(--ink); font-style: normal; font-weight: 500; border-bottom: 1.5px solid var(--accent); }
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: clamp(18px,2.6vw,28px); }
.hero__stage .hero__scroll { margin-top: clamp(14px,2.4vw,26px); }

/* Entrance animation */
.hero__anim { opacity: 0; transform: translateY(20px); animation: heroIn 1s var(--ease-out) forwards; }
.hero__anim-d1 { animation-delay: .12s; }
.hero__anim-d2 { animation-delay: .24s; }
.hero__anim-d3 { animation-delay: .34s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }

@media (max-width: 1000px) { .hero__word { display: none; } }
@media (max-width: 640px) {
  .hero__chip--1 { left: -6%; top: 8%; }
  .hero__chip--2 { right: -6%; bottom: 10%; }
}
@media (max-width: 420px) { .hero__chip { display: none; } }

/* =====================================================================
   Clients — "Places I've Designed For"
   ===================================================================== */
.clients { background: #0B0B0C; color: #fff; padding: clamp(72px, 10vw, 130px) clamp(28px, 6vw, 120px); text-align: center; overflow: hidden; }
.clients__eyebrow { font-style: italic; font-size: clamp(1rem, 1.6vw, 1.25rem); color: rgba(255,255,255,.92); margin-bottom: clamp(24px, 3.5vw, 44px); position: relative; z-index: 2; }
.clients__row { display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; }
.clients__logos { width: min(900px, 92%); height: auto; object-fit: contain; opacity: .92; }

/* Sparkles band (adapted from Aceternity SparklesCore) */
.clients__sparkles { position: relative; width: min(640px, 92%); height: clamp(110px, 16vw, 160px); margin: clamp(28px, 4vw, 48px) auto 0; }
.clients__line { position: absolute; top: 0; display: block; }
.clients__line--indigo-glow { left: 12.5%; width: 75%; height: 2px; background: linear-gradient(to right, transparent, #6366f1, transparent); filter: blur(3px); }
.clients__line--indigo { left: 12.5%; width: 75%; height: 1px; background: linear-gradient(to right, transparent, #6366f1, transparent); }
.clients__line--sky-glow { left: 37.5%; width: 25%; height: 5px; background: linear-gradient(to right, transparent, #0ea5e9, transparent); filter: blur(3px); }
.clients__line--sky { left: 37.5%; width: 25%; height: 1px; background: linear-gradient(to right, transparent, #0ea5e9, transparent); }
.clients__particles { width: 100%; height: 100%; opacity: 0; transition: opacity 1s ease; }
.clients__particles canvas { display: block; }
/* Radial fade so the particle field has no hard edges */
.clients__fade { position: absolute; inset: 0; background: #0B0B0C; -webkit-mask-image: radial-gradient(350px 200px at top, transparent 20%, white); mask-image: radial-gradient(350px 200px at top, transparent 20%, white); pointer-events: none; }

/* =====================================================================
   Work / Projects
   ===================================================================== */
/* Sits directly under the marquee bar - trim the big top gap. */
#work { padding-top: clamp(36px, 5vw, 64px); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; margin-bottom: clamp(36px, 6vw, 72px); }
.section-head .count { font-family: var(--display); font-size: clamp(1.1rem,2vw,1.4rem); color: var(--ink-faint); }

/* Editorial header (matches the About script treatment) */
.work__head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 30px;
  margin-bottom: clamp(30px, 5vw, 56px); }
.work__lead { max-width: 620px; }
.work__kicker { display: block; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.work__title { margin: 10px 0 clamp(14px, 2vw, 22px); max-width: 14ch; }
.work__intro { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.55; max-width: 46ch; }
.work__meta { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
  font-weight: 500; text-align: right; line-height: 1.7; white-space: nowrap; }

/* Case-study cards — dark immersive panels, text left / floating screenshot right */
.gallery { display: flex; flex-direction: column; gap: clamp(28px, 3.5vw, 48px); }
.tile {
  display: grid; grid-template-columns: 50% 40%; gap: 10%;
  align-items: center; width: 100%;
  position: sticky; top: clamp(84px, 12vh, 120px); overflow: hidden;
  --pad: clamp(30px, 4.5vw, 68px);
  padding: var(--pad);
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  will-change: transform;
}
/* JS drives a scroll-linked 3D tilt on tiles — keep reveal to a pure fade so
   its transform/transition can't fight the per-frame transform */
.gallery .tile.reveal { transform: none; transition: opacity 1s var(--ease-out); }

.tile__body { order: 1; max-width: 480px; }
.tile__media {
  order: 2; position: relative; overflow: hidden;
  /* full-bleed: negative margins cancel the card padding on top/right/bottom,
     the card's own radius + overflow clip the corners */
  align-self: stretch;
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) calc(var(--pad) * -1) 0;
  /* no frame — the image melts into the card via a left-edge fade */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%);
  mask-image: linear-gradient(to right, transparent 0, #000 30%);
}
img.visual { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile__media .visual {
  transition: transform .9s var(--ease), filter .5s var(--ease), opacity .5s var(--ease);
  filter: saturate(.75) contrast(.92) brightness(1.06); opacity: .9;
}
.tile:hover .tile__media .visual { filter: none; opacity: 1; }
.tile:hover .tile__media .visual { transform: scale(1.05); }
.tile__view {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; text-align: center;
  opacity: 0; transition: opacity .4s var(--ease); background: rgba(0,0,0,.32); backdrop-filter: blur(1.5px);
  font-family: "Inter", sans-serif; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; color: #fff;
}
.tile:hover .tile__view { opacity: 1; }

.tile__cat {
  display: block; margin-bottom: 20px; padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft);
}
.tile__title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.9rem); line-height: 1.08; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 20px; transition: color .3s var(--ease);
}
.tile__desc {
  color: var(--ink-soft); font-size: 15.5px; line-height: 1.62; max-width: 46ch; margin-bottom: 34px;
}
.tile__read {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 30px; border-radius: 100px; border: 1.4px solid rgba(0,0,0,.25);
  font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--ink);
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.tile__read .ln { display: none; }
.tile:hover .tile__read { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Non-link tiles: no case study yet, no fake affordances */
.tile--soon { cursor: default; }
.tile--soon .tile__title { transition: none; }
.tile__soon {
  display: inline-flex; align-items: center;
  padding: 14px 30px; border-radius: 100px; border: 1.4px dashed rgba(0,0,0,.25);
  font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft);
}

@media (max-width: 900px) { .work__head { grid-template-columns: 1fr; } .work__meta { text-align: left; } }
@media (max-width: 820px) {
  .tile { grid-template-columns: 1fr; gap: 28px; position: relative; top: auto; }
  .tile__media {
    order: 1; align-self: auto; aspect-ratio: 4 / 3;
    margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
    mask-image: linear-gradient(to bottom, #000 72%, transparent);
  }
  .tile__body { order: 2; max-width: none; }
}

/* Visual poster backgrounds (CSS-drawn, no external images) */
.v-grad { background: radial-gradient(120% 120% at 20% 10%, #E6C7A8 0%, #C8553D 55%, #7A2E1E 100%); }
.v-1 { background: linear-gradient(140deg, #1b1b2f, #2d3561 60%, #4b6cb7); }
.v-2 { background: radial-gradient(circle at 70% 30%, #ffd9a0, #e08a3c 55%, #7a3b12); }
.v-3 { background: linear-gradient(135deg, #123f2e, #2f6b4f 60%, #7fbf9a); }
.v-4 { background: linear-gradient(160deg, #efe7db, #c9b79b 60%, #8a755a); }
.v-5 { background: radial-gradient(circle at 30% 30%, #f4a9b8, #c8553d 60%, #6a1f2b); }
.v-6 { background: linear-gradient(140deg, #202432, #3a3f5c 55%, #6d6f9c); }
.v-7 { background: linear-gradient(150deg, #f7e9d0, #d8a35b 60%, #9c5a1f); }
.v-8 { background: linear-gradient(145deg, #2a2440, #6a4c93 60%, #b79ce0); }
.poster { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: rgba(255,255,255,.92); padding: 30px; }
.poster .pk { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1; letter-spacing: -.03em; }
.poster .ps { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-top: 14px; opacity: .8; }
.poster.dark { color: rgba(20,18,14,.85); }
/* Decorative dot texture overlay */
.dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 14px 14px; }

/* =====================================================================
   About / Bio
   ===================================================================== */
.about { position: relative; background: linear-gradient(180deg, var(--paper) 0%, #F4EEE3 22%, #F4EEE3 100%); }
.about__title { max-width: 16ch; margin-inline: auto; }
/* Bold grotesque statement paired with the script */
.about__bold {
  font-family: "Inter", sans-serif; font-weight: 800;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.02; letter-spacing: -.025em;
  color: var(--ink);
}
.about__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(30px, 6vw, 80px); align-items: start; }
.about__statement { font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 2.9rem); line-height: 1.16; letter-spacing: -.02em; font-weight: 340; }
.about__statement em { color: var(--accent); font-style: italic; }
.about__side p { color: var(--ink-soft); margin-bottom: 18px; }
.about__side p:first-child { color: var(--ink-2); font-size: 1.05rem; }
.portrait {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: linear-gradient(160deg, #d8c4a8, #c8553d); margin-bottom: 28px; border: 1px solid var(--line);
}
.portrait .initials { position: absolute; inset: 0; display: grid; place-content: center; font-family: var(--display); font-size: 5rem; color: rgba(255,255,255,.9); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Transparent B&W cutout sitting on the clay panel, bottom-aligned */
.portrait--cutout { background: radial-gradient(circle at 50% 28%, #e6ad93, #c8553d 62%, #9c3f2c); }
.portrait--cutout::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px); background-size: 16px 16px; }
.portrait--cutout img { top: auto; bottom: 0; height: 92%; object-fit: contain; object-position: bottom center; filter: grayscale(1) contrast(1.03); }
.facts { list-style: none; margin-top: 26px; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.facts .k { color: var(--ink-faint); }
.facts .v { color: var(--ink-2); text-align: right; font-weight: 500; }
.signature { font-family: var(--display); font-style: italic; font-size: 1.3rem; color: var(--ink); margin-top: 10px; }
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: clamp(40px,7vw,80px); border-top: 1px solid var(--line); padding-top: 40px; }
.stat .num { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.03em; }
.stat .num .accent { color: var(--accent); }
.stat .lbl { font-size: 13.5px; color: var(--ink-soft); margin-top: 10px; max-width: 180px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; gap: 30px 20px; } }

/* =====================================================================
   Capabilities / Services
   ===================================================================== */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cap { background: var(--paper); padding: clamp(28px, 4vw, 46px); transition: background .4s var(--ease); }
.cap:hover { background: var(--bone-2); }
.cap__no { font-family: var(--display); color: var(--accent); font-size: 1rem; }
.cap h3 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); margin: 22px 0 14px; }
.cap p { color: var(--ink-soft); font-size: 15.5px; }
.cap ul { list-style: none; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.cap ul li { font-size: 12.5px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 100px; padding: 4px 12px; }
@media (max-width: 820px) { .caps { grid-template-columns: 1fr; } }

/* =====================================================================
   Writing
   ===================================================================== */
.writing__list { border-top: 1px solid var(--line); }
.write-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 24px; align-items: center; padding: clamp(22px,3vw,34px) 0; border-bottom: 1px solid var(--line); transition: padding-left .4s var(--ease); position: relative; }
.write-row:hover { padding-left: 18px; }
.write-row .no { font-family: var(--display); color: var(--ink-faint); }
.write-row h3 { font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 380; }
.write-row .sub { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.write-row .go { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: background .3s, color .3s, transform .3s; }
.write-row:hover .go { background: var(--ink); color: var(--bone); transform: rotate(-45deg); }
.write-row .go--soon {
  width: auto; height: auto; border-radius: 100px; border: 1.4px dashed var(--line);
  padding: 9px 18px; font-size: 11px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-soft);
}
.write-row:hover .go--soon { background: none; color: var(--ink-soft); transform: none; }
@media (max-width: 620px){ .write-row { grid-template-columns: 34px 1fr; } .write-row .go { display:none; } }

/* =====================================================================
   CTA / Footer
   ===================================================================== */
.footer { background: var(--ink); color: var(--bone); padding-top: clamp(80px, 12vw, 150px); position: relative; overflow: hidden; }
.footer .eyebrow { color: rgba(255,255,255,.55); }
.footer .eyebrow::before { background: var(--accent); }
.footer__cta { font-family: var(--display); font-size: clamp(2.6rem, 9vw, 8rem); line-height: .95; letter-spacing: -.035em; font-weight: 340; }
.footer__cta a { transition: color .3s; }
.footer__cta a:hover { color: var(--accent); }
.footer__mail { display: inline-flex; align-items: center; gap: 14px; margin-top: 30px; font-size: clamp(1.1rem,2vw,1.5rem); border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 6px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-top: clamp(60px,10vw,120px); padding-top: 44px; border-top: 1px solid rgba(255,255,255,.14); }
.footer__col h4 { font-family: var(--sans); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 600; margin-bottom: 20px; }
.footer__col a, .footer__col p { color: rgba(255,255,255,.8); display: block; margin-bottom: 12px; font-size: 15px; transition: color .3s; }
.footer__col a:hover { color: var(--accent); }
.footer__bio { max-width: 340px; color: rgba(255,255,255,.7); font-size: 15px; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-block: 34px; margin-top: 40px; border-top: 1px solid rgba(255,255,255,.14); font-size: 13px; color: rgba(255,255,255,.5); }
.footer__big { font-family: var(--display); font-size: clamp(4rem, 22vw, 20rem); line-height: .8; letter-spacing: -.04em; color: rgba(255,255,255,.06); text-align: center; margin-top: 30px; user-select: none; }
@media (max-width: 720px){ .footer__grid { grid-template-columns: 1fr 1fr; } }

/* =====================================================================
   Scroll reveal
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }

/* Progress bar */
.progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 300; width: 0; }

/* =====================================================================
   Case study pages
   ===================================================================== */
.cs-hero { padding-top: clamp(130px, 18vh, 200px); padding-bottom: clamp(30px,5vw,60px); }
.cs-hero .back { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); margin-bottom: 40px; transition: gap .3s; }
.cs-hero .back:hover { gap: 16px; color: var(--ink); }
.cs-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.cs-hero h1 { font-size: clamp(2.6rem, 7.5vw, 6.4rem); line-height: .95; margin: 20px 0 0; }
.cs-hero .lead { max-width: 560px; font-size: clamp(1.02rem, 1.6vw, 1.2rem); line-height: 1.55; color: var(--ink-soft); border-left: 2px solid var(--accent); padding-left: 22px; }
@media (max-width: 820px){ .cs-hero__grid { grid-template-columns: 1fr; align-items: start; gap: 26px; } }
.cs-cover { aspect-ratio: 16/8; border-radius: var(--radius-lg); overflow: hidden; position: relative; border: 1px solid var(--line); margin-top: clamp(30px,5vw,60px); }
.cs-meta { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; border-block: 1px solid var(--line); padding-block: 34px; margin-top: clamp(30px,5vw,60px); }
.cs-meta .k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.cs-meta .v { font-size: 15.5px; color: var(--ink-2); }
@media (max-width: 720px){ .cs-meta { grid-template-columns: 1fr 1fr; gap: 26px; } }

.cs-block { display: grid; grid-template-columns: 300px 1fr; gap: clamp(30px,5vw,70px); align-items: start; padding-block: clamp(40px,6vw,80px); border-bottom: 1px solid var(--line); }
.cs-block:last-of-type { border-bottom: none; }
.cs-block__label { position: sticky; top: 110px; }
.cs-block__label .eyebrow {
  display: block; font-family: var(--display); font-weight: 340;
  font-size: clamp(3.2rem, 6vw, 5.2rem); line-height: 1; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.2px rgba(23,21,16,.3);
  margin-bottom: 16px; text-transform: none;
}
.cs-block__label .eyebrow::before { display: none; }
.cs-block__label h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.cs-block__label::after { content: ""; display: block; width: 44px; height: 2px; background: var(--accent); margin-top: 18px; }
.cs-block__body p { color: var(--ink-2); margin-bottom: 20px; font-size: 1.08rem; line-height: 1.65; }
.cs-block__body p:last-child { margin-bottom: 0; }
.cs-block__body .big-q {
  font-family: var(--display); font-size: clamp(1.5rem,3.2vw,2.2rem); line-height: 1.25;
  color: var(--ink); margin: 34px 0; font-weight: 340; font-style: italic;
  border-left: 3px solid var(--accent); padding: 8px 0 8px 26px;
}
.cs-block:first-of-type .cs-block__body > p:first-child::first-letter {
  float: left; font-family: var(--display); font-weight: 400;
  font-size: 3.1em; line-height: .82; padding: 6px 12px 0 0; color: var(--accent);
}
.cs-block__body ul { list-style: none; margin: 10px 0 20px; }
.cs-block__body ul li { position: relative; padding-left: 26px; margin-bottom: 14px; color: var(--ink-2); }
.cs-block__body ul li::before { content: ""; position: absolute; left: 0; top: 11px; width: 12px; height: 1px; background: var(--accent); }
@media (max-width: 820px){ .cs-block { grid-template-columns: 1fr; gap: 20px; } .cs-block__label { position: static; } .cs-block__label .eyebrow { font-size: 2.6rem; margin-bottom: 8px; } .cs-block__label::after { display: none; } }

.cs-figure { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; position: relative; margin: 10px 0 30px; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.cs-figure:has(img.visual):hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(23,21,16,.13); }
.cs-figure:has(img.visual)::after {
  content: "⤢"; position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; display: grid; place-content: center;
  border-radius: 50%; background: rgba(23,21,16,.72); color: #fff; font-size: 15px;
  opacity: 0; transform: scale(.8); transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
}
.cs-figure:has(img.visual):hover::after { opacity: 1; transform: scale(1); }
.cs-figcap { font-size: 13.5px; color: var(--ink-soft); margin-top: -18px; margin-bottom: 30px; display: flex; gap: 10px; align-items: baseline; }
.cs-figcap::before { content: ""; width: 18px; height: 1px; background: var(--accent); flex: none; transform: translateY(-4px); }
.cs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 620px){ .cs-two { grid-template-columns: 1fr; } }

/* Real screenshot figures - natural aspect ratio, no crop */
.cs-figure.fit { aspect-ratio: auto; border: none; }
.cs-figure.fit img.visual { position: static; width: 100%; height: auto; display: block; }
.cs-cover.fit { aspect-ratio: auto; }
.cs-cover.fit img.visual { position: static; width: 100%; height: auto; display: block; }
.cs-figure.top img.visual { object-position: top center; }
.cs-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 10px 0 30px; }
.cs-gallery .cs-figure { margin: 0; }
@media (max-width: 620px){ .cs-gallery { grid-template-columns: 1fr; } }

.cs-outcomes { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin: 20px 0; }
.cs-outcome { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; position: relative; overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.cs-outcome::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.cs-outcome:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(23,21,16,.09); }
.cs-outcome:hover::before { transform: scaleX(1); }
.cs-outcome .num { font-family: var(--display); font-size: clamp(2rem,4vw,3rem); line-height: 1; color: var(--accent); }
.cs-outcome .lbl { font-size: 14px; color: var(--ink-soft); margin-top: 12px; }
@media (max-width: 720px){ .cs-outcomes { grid-template-columns: 1fr; } }

/* Next project */
.cs-next { background: var(--ink); color: var(--bone); padding-block: clamp(60px,10vw,120px); text-align: center; }
.cs-next .eyebrow { color: rgba(255,255,255,.5); justify-content: center; }
.cs-next a { font-family: var(--display); font-size: clamp(2.4rem,8vw,6rem); line-height: 1; letter-spacing: -.03em; transition: color .3s; display: inline-block; margin-top: 20px; }
.cs-next a::after { content: "→"; display: inline-block; margin-left: .22em; transition: transform .35s var(--ease); }
.cs-next a:hover { color: var(--accent); }
.cs-next a:hover::after { transform: translateX(14px); }

/* Utility */
.center { text-align: center; }
.mt-s { margin-top: 20px; } .mt-m { margin-top: 40px; } .mt-l { margin-top: 70px; }
.text-btn { display: inline-flex; align-items: center; gap: 12px; border: 1px solid var(--ink); border-radius: 100px; padding: 14px 26px; font-weight: 500; font-size: 15px; transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease); }
.text-btn:hover { background: var(--ink); color: var(--bone); transform: translateY(-2px); }
.text-btn.solid { background: var(--ink); color: var(--bone); }
.text-btn.solid:hover { background: var(--accent); border-color: var(--accent); }

/* =====================================================================
   About "Less about pixels" + Life gallery
   ===================================================================== */
.about__intro { text-align: center; max-width: 760px; margin-inline: auto; }
.about__intro h2 { line-height: 1; }
.about__photo { position: relative; display: flex; justify-content: center; align-items: center; }
.about__photo img {
  position: relative; z-index: 2; width: min(100%, 470px);
  border-radius: 12px; border: 9px solid var(--paper);
  box-shadow: 0 34px 70px -34px rgba(23,21,16,.45);
  transform: rotate(-3deg); transition: transform .55s var(--ease);
}
.about__photo:hover img { transform: rotate(0deg) scale(1.01); }
.about__photo .wavy {
  position: absolute; inset: -12% -6%; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='16'%3E%3Cpath d='M0 8 Q10 0 20 8 T40 8' fill='none' stroke='%23aeb4c0' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 40px 16px;
}

/* Life - dual-row auto-scrolling photo marquee (opposite directions) */
.life-marquee {
  display: flex; flex-direction: column; gap: 20px;
  /* full-bleed: break out of the centered .wrap to the full viewport width */
  width: 100vw; max-width: 100vw;
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
}
.life-row {
  overflow: hidden; /* no scrollbar — content is driven by the animation */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.life-track {
  display: flex; gap: 18px; width: max-content;
  animation: life-scroll 55s linear infinite; will-change: transform;
}
.life-row--rev .life-track { animation-name: life-scroll-rev; animation-duration: 68s; }
/* content is duplicated once, so -50% lands on a seamless seam */
@keyframes life-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes life-scroll-rev { from { transform: translateX(-50%); } to { transform: translateX(0); } }

.life-item {
  position: relative; flex: 0 0 auto; height: clamp(200px, 22vw, 320px);
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line); cursor: pointer;
  box-shadow: 0 20px 40px -28px rgba(23,21,16,.4);
}
.life-item img { height: 100%; width: auto; max-width: none; display: block; transition: transform .7s var(--ease); }
.life-item:hover img { transform: scale(1.06); }
.life-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; color: #fff;
  font-size: 13px; font-weight: 500;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
  opacity: 0; transform: translateY(6px); transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.life-item:hover figcaption { opacity: 1; transform: none; }
@media (max-width: 560px) { .life-item { height: clamp(150px, 44vw, 210px); } }
@media (prefers-reduced-motion: reduce) { .life-track { animation: none; } }

/* =====================================================================
   Tech Stack - interactive keycap grid
   ===================================================================== */
.stack { display: grid; grid-template-columns: repeat(9, 1fr); gap: clamp(8px, 1vw, 15px); max-width: 1080px; margin-inline: auto; }
.stack__key { aspect-ratio: 1; border-radius: clamp(12px, 1.4vw, 20px); }
/* empty keycaps - faint field */
span.stack__key { background: rgba(23,21,16,.035); box-shadow: inset 0 0 0 1px var(--line-soft); }
/* filled tool keycaps */
.stack__key.is-tool {
  background: var(--bg, #111); color: var(--fg, #fff);
  display: grid; place-items: center; position: relative; cursor: pointer; border: none;
  box-shadow: 0 12px 24px -14px rgba(23,21,16,.55);
  transform: translate(var(--px, 0px), var(--py, 0px)) scale(.86);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  will-change: transform;
}
.stack__key .lbl { font-family: var(--display); font-weight: 500; font-size: clamp(15px, 1.9vw, 24px); line-height: 1; }
.stack__key .lbl--sm { font-family: var(--sans); font-weight: 700; font-size: clamp(10px, 1.2vw, 14px); letter-spacing: -.01em; }
.stack__key.is-tool:hover {
  transform: translate(var(--px,0px), var(--py,0px)) translateY(-7px) scale(1.1);
  box-shadow: 0 26px 42px -16px rgba(23,21,16,.6); z-index: 6;
}
/* Figma hero keycap */
.stack__key.is-hero {
  transform: translate(var(--px,0px), var(--py,0px)) scale(1.2); z-index: 4;
  border: 5px solid var(--accent);
  box-shadow: 0 30px 55px -20px rgba(0,0,0,.6);
}
.stack__key.is-hero:hover { transform: translate(var(--px,0px), var(--py,0px)) scale(1.28) translateY(-4px); z-index: 6; }
/* tooltip */
.stack__key.is-tool::after {
  content: attr(data-name); position: absolute; top: -34px; left: 50%;
  transform: translateX(-50%) translateY(5px); background: var(--ink); color: var(--bone);
  font-family: var(--sans); font-size: 11px; font-weight: 500; padding: 5px 10px; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.stack__key.is-tool:hover::after { opacity: 1; transform: translateX(-50%); }

@media (max-width: 820px) { .stack { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 520px) { .stack { grid-template-columns: repeat(4, 1fr); gap: 8px; } }

/* ---------- Case-study lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 5vw, 56px);
  background: rgba(23, 21, 16, 0.93);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox__img {
  max-width: 100%; max-height: 100%;
  border-radius: 12px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.97); transition: transform 0.25s ease;
}
.lightbox.open .lightbox__img { transform: scale(1); }
.lightbox__close,
.lightbox__nav {
  position: absolute; z-index: 2;
  display: grid; place-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__close { top: 20px; right: 22px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 12.5px; letter-spacing: 0.12em;
}
.lightbox.single .lightbox__nav,
.lightbox.single .lightbox__count { display: none; }
@media (max-width: 620px) {
  .lightbox { padding: 12px; }
  .lightbox__nav { width: 38px; height: 38px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}

/* =====================================================================
   Case study v2 — centered hero, before/after, label rows, tools band
   ===================================================================== */
.project__tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.tag {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); background: var(--paper); border-radius: 100px;
  padding: 7px 16px; font-size: 12.5px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft);
}

.csx-hero { padding-top: clamp(120px, 16vh, 180px); padding-bottom: clamp(24px, 4vw, 48px); text-align: center; }
.csx-hero .back { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); margin-bottom: 34px; transition: gap .3s; }
.csx-hero .back:hover { gap: 16px; color: var(--ink); }
.csx-hero .project__tags { justify-content: center; }
.csx-hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); line-height: 1.04; max-width: 20ch; margin: 22px auto 0; }
.csx-hero .sub { color: var(--ink-soft); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.6; max-width: 62ch; margin: 18px auto 0; }

/* Before / After slider */
.ba { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: stretch; margin-top: clamp(30px, 5vw, 56px); }
.ba__side {
  writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-faint);
}
.ba__side--l { transform: rotate(180deg); }
.ba__frame {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--paper);
  user-select: none; -webkit-user-select: none; touch-action: none; cursor: ew-resize;
}
.ba__frame img { width: 100%; height: auto; display: block; pointer-events: none; }
.ba__top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--ba, 50%)) 0 0); }
.ba__top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--ba, 50%); width: 2.5px;
  background: var(--ink); transform: translateX(-50%); pointer-events: none;
}
.ba__handle::after {
  content: "◂ ▸"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  display: grid; place-content: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: var(--bone); font-size: 12px; letter-spacing: 1px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
@media (max-width: 620px){ .ba { gap: 8px; } .ba__handle::after { width: 38px; height: 38px; font-size: 10px; } }

/* Framed cover (non-slider heroes) */
.csx-cover { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--paper); margin-top: clamp(30px, 5vw, 56px); }
.csx-cover img { width: 100%; height: auto; display: block; }

/* Client intro card */
.client-card {
  display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: clamp(24px, 5vw, 60px);
  align-items: center; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(26px, 4.5vw, 54px);
  margin-top: clamp(36px, 6vw, 72px);
}
.client-card__logo { font-family: var(--display); font-size: clamp(1.5rem, 2.8vw, 2.2rem); letter-spacing: -.02em; line-height: 1.05; }
.client-card__logo .muted-sub { display: block; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); margin-top: 10px; }
.client-card p { color: var(--ink-2); font-size: 1.05rem; line-height: 1.65; }
@media (max-width: 720px){ .client-card { grid-template-columns: 1fr; gap: 18px; } }

/* Label rows */
.csx-row { display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 70px); align-items: start; padding-block: clamp(44px, 6.5vw, 88px); border-bottom: 1px solid var(--line); }
main .csx-row:last-of-type { border-bottom: none; }
.csx-label { position: sticky; top: 110px; font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); display: flex; align-items: center; gap: 12px; }
.csx-label::before { content: ""; width: 22px; height: 1.5px; background: var(--accent); flex: none; }
.csx-row .cs-block__body > h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; margin-bottom: 20px; max-width: 24ch; }
@media (max-width: 820px){ .csx-row { grid-template-columns: 1fr; gap: 18px; } .csx-label { position: static; } }

/* Visit / pill button */
.btn-pill {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 14px;
  border: 1px solid var(--ink); border-radius: 100px; padding: 12px 24px;
  font-size: 14.5px; font-weight: 500; transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.btn-pill:hover { background: var(--ink); color: var(--bone); transform: translateY(-1px); }

/* Tools band */
.tools { position: relative; text-align: center; padding-block: clamp(64px, 9vw, 120px); border-bottom: 1px solid var(--line); overflow: hidden; }
.tools::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, rgba(0,0,0,.9), transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, rgba(0,0,0,.9), transparent 75%);
}
.tools > * { position: relative; }
.tools h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.02em; margin-bottom: 34px; }
.tools__chips { display: flex; flex-wrap: wrap; gap: 12px 14px; justify-content: center; max-width: 780px; margin-inline: auto; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 100px;
  padding: 11px 20px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.tool-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tool-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,21,16,.08); }

/* Quote / testimonial card */
.quote-card {
  display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: clamp(24px, 5vw, 60px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 58px);
}
.quote-card__brand { font-family: var(--display); font-size: 1.4rem; letter-spacing: -.02em; }
.quote-card__q { font-family: var(--display); font-size: clamp(1.25rem, 2.4vw, 1.8rem); line-height: 1.4; font-weight: 340; margin-bottom: 28px; }
.quote-card__who { display: flex; align-items: center; gap: 14px; }
.quote-card__who img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.quote-card__who .n { font-weight: 500; font-size: 15px; }
.quote-card__who .t { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 720px){ .quote-card { grid-template-columns: 1fr; gap: 18px; } }

/* Full-width case-study section (label on top, content spans the wrap) */
.csx-full { padding-block: clamp(44px, 6.5vw, 88px); border-bottom: 1px solid var(--line); }
.csx-full .csx-label { position: static; margin-bottom: 20px; }
.csx-full > h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; margin-bottom: 8px; max-width: 24ch; }
.csx-full .ba { margin-top: clamp(20px, 3vw, 36px); }
.csx-full .cs-figcap { margin-top: 16px; margin-bottom: 0; }
