/* sunnykumar.work — v2
   Warm paper, Bricolage Grotesque + Fraunces, blue ink.
   Change colours here. */

:root {
  --paper: #FBFAF7;
  --ink-text: #1A1A1A;
  --muted: #6B6862;
  --muted-2: #4F4D48;
  --line: #B5B2AB;
  --ph: #EFEDE8;            /* image placeholder */
  --ink: #4A6CEB;           /* accent */
  --band: #2F4BD1;          /* TL;DR band */
  --g1: #4F6FF0;            /* landing gradient */
  --g2: #3BA7BF;
  --g3: #8A72E6;
  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --max: 1360px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink-text);
  font-family: var(--sans); font-size: 18px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ink-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--ink); color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 720px; margin: 0 auto; }

/* Floating pill nav */
.pills { position: fixed; top: 20px; right: 20px; z-index: 10; display: flex; gap: 8px; }
.fl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; background: rgba(251,250,247,0.75);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 2px rgba(20,20,30,0.06), 0 8px 28px rgba(20,20,30,0.08);
  font-size: 16px; line-height: 1; transition: box-shadow .2s ease;
}
.fl:hover { text-decoration: none; box-shadow: 0 1px 2px rgba(20,20,30,0.08), 0 10px 32px rgba(20,20,30,0.14); }
.fl.dark { background: rgba(26,26,26,0.92); color: #fff; }

/* ---------- Landing ---------- */
.landing { min-height: 100vh; }
.landing main {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(120px, 16vw, 240px) clamp(20px, 4vw, 48px) clamp(80px, 10vw, 160px);
  display: flex; flex-direction: column; gap: clamp(28px, 4vw, 56px);
}
.row {
  display: block; width: fit-content; max-width: 100%;
  transform-origin: left center;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .2s ease;
}
.row:hover { text-decoration: none; }
.row:active { transform: scale(.985); opacity: .85; }
.t {
  background-image: linear-gradient(100deg, var(--g1), var(--g2), var(--g3), var(--g2), var(--g1));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-size: 300% 100%;
  animation: flow 10s ease-in-out infinite alternate;
  transition: filter .45s ease;
  line-height: 1.02;
}
.row:nth-child(2) .t { animation-delay: -3s; }
.row:nth-child(3) .t { animation-delay: -6s; }
.t-sans { font-family: var(--sans); font-weight: 800; font-size: max(44px, 6.9444vw); /* 100px at 1440 */ letter-spacing: -0.045em; }
.t-serif { font-family: var(--serif); font-weight: 300; font-size: max(48px, 6.9444vw); /* 100px at 1440 */ letter-spacing: -0.03em; }
.t-serif i { font-style: italic; }
@keyframes flow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@media (hover: hover) {
  .row:hover { transform: translateX(10px); }
  .row:hover .t { filter: saturate(1.35) brightness(1.05); }
}
.tag {
  display: inline-block; margin-left: 0.6em; vertical-align: top; margin-top: clamp(6px, 1.4vw, 20px);
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--muted); font-size: 10px; line-height: 1.2; white-space: nowrap;
  -webkit-text-fill-color: var(--muted);
}
.landing-foot {
  max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  font-size: 15px; color: var(--muted);
}
.landing-foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.landing-foot a { color: var(--muted-2); }

/* ---------- About ---------- */
.about-lede {
  padding: clamp(120px, 13vw, 180px) 0 clamp(80px, 10vw, 144px);
}
.about-lede p {
  margin: 0; max-width: 1080px; font-family: var(--serif); font-weight: 300;
  font-size: clamp(30px, 3.6vw, 54px); line-height: 1.22; letter-spacing: -0.02em;
}
.about-lede p + p { margin-top: 0.8em; }
.about-lede em { font-style: italic; color: var(--ink); }
.cv { display: flex; flex-wrap: wrap; gap: 12px 48px; padding: 0 0 72px; }
.cv:last-of-type { padding-bottom: clamp(96px, 12vw, 160px); }
.cv h2 { margin: 0; flex: 1 1 220px; font-weight: 800; font-size: 20px; line-height: 1.3; letter-spacing: -0.02em; color: #111; }
.cv ul { margin: 0; padding: 0; list-style: none; flex: 3 1 560px; display: flex; flex-direction: column; gap: 14px; }
.cv .when { color: var(--muted); }

/* ---------- Case study ---------- */
.band { position: relative; background: var(--band); color: #fff; }
.band a { color: #fff; }
.back {
  position: absolute; top: 20px; left: 20px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; font-size: 16px; line-height: 1;
}
.band-inner {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(104px, 11vw, 160px) 1.5rem clamp(56px, 7vw, 96px);
  display: flex; flex-direction: column; gap: clamp(28px, 3.4vw, 44px);
}
.eyebrow { font-size: 15px; color: rgba(255,255,255,0.78); }
.band h1 {
  margin: 16px 0 0; max-width: 1150px; font-weight: 800;
  font-size: clamp(40px, 7vw, 108px); line-height: 0.98; letter-spacing: -0.045em;
}
.tldr { display: flex; flex-wrap: wrap; gap: 24px 64px; }
.tldr h2 {
  margin: 0; flex: 1 1 140px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.72); font-weight: 500;
}
.tldr-body { flex: 6 1 560px; display: flex; flex-direction: column; gap: clamp(24px, 3vw, 36px); }
.tldr-lede { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(22px, 2.5vw, 34px); line-height: 1.28; letter-spacing: -0.01em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px 32px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-weight: 800; font-size: clamp(36px, 4vw, 56px); line-height: 1; letter-spacing: -0.04em; }
.stat span { font-size: 15px; line-height: 1.4; color: rgba(255,255,255,0.82); }
.tldr ul { margin: 0; padding: 0 0 0 1.1em; display: flex; flex-direction: column; gap: 8px; font-size: 17px; line-height: 1.5; }
.tldr strong { font-weight: 500; }
.impact-note { margin: 0; font-size: 15px; color: rgba(255,255,255,0.82); }

.body { padding-top: clamp(56px, 7vw, 96px); }

/* Figures — real image if the file exists, otherwise a labelled grey box */
figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); }
.ph {
  position: relative; background: var(--ph); overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 15px; padding: 16px;
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph.contain img { object-fit: contain; }
.r-hero { aspect-ratio: 16 / 8; }
.r-wide { aspect-ratio: 16 / 7; }
.r-43 { aspect-ratio: 4 / 3; }
.r-34 { aspect-ratio: 3 / 4; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.gap-fig { margin-bottom: clamp(64px, 8vw, 112px); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px 56px; padding: clamp(72px, 9vw, 128px) 0; }
.facts div { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 15px; color: var(--muted); }
.facts p { margin: 0; }

.sec { padding: 0 0 clamp(64px, 8vw, 112px); display: flex; flex-direction: column; gap: 20px; }
.sec.tight { padding-bottom: 48px; }
.sec h2 { margin: 0 0 8px; font-weight: 800; font-size: clamp(30px, 3vw, 44px); line-height: 1.05; letter-spacing: -0.03em; }
.sec h3 { margin: 24px 0 0; font-size: 18px; font-weight: 500; }
.sec p { margin: 0; }
.sec ul { margin: 0; padding: 0 0 0 1.1em; display: flex; flex-direction: column; gap: 10px; }
.sec strong { font-weight: 500; }
blockquote {
  margin: 24px 0 0; font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(26px, 2.6vw, 38px); line-height: 1.25; color: var(--ink);
}

.principle { max-width: 900px; margin: 0 auto; padding: clamp(72px, 9vw, 128px) 0; text-align: center; }
.principle p { margin: 0; }
.principle .big { font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 3.4vw, 48px); line-height: 1.2; letter-spacing: -0.02em; }
.principle em { font-style: italic; color: var(--ink); }

.chapters { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(56px, 7vw, 96px); padding: 0 0 clamp(72px, 9vw, 128px); }
.chapter { display: flex; flex-wrap: wrap; gap: 16px 56px; }
.chapter .n { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.chapter .n b { font-weight: 800; font-size: 64px; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.chapter .n b.dim { color: var(--line); }
.chapter .c { flex: 3 1 520px; display: flex; flex-direction: column; gap: 14px; }
.chapter h3 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.2; letter-spacing: -0.015em; }
.chapter p { margin: 0; }
.chapter strong { font-weight: 500; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0; }
.steps div { border-top: 2px solid var(--ink); padding-top: 12px; }
.steps b { display: block; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.steps span { display: block; font-size: 15px; line-height: 1.45; color: var(--muted-2); }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; padding: 16px 0; }
.metrics div { display: flex; flex-direction: column; gap: 4px; }
.metrics b { font-weight: 800; font-size: clamp(40px, 4vw, 56px); white-space: nowrap; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.metrics span { font-size: 15px; color: var(--muted-2); }

.next { display: flex; flex-direction: column; gap: 10px; padding: clamp(48px, 6vw, 96px) 0 clamp(64px, 8vw, 120px); }
.next:hover { text-decoration: none; }
.next .label { color: var(--muted-2); font-size: 16px; }
.next .big { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 6vw, 92px); line-height: 1.02; letter-spacing: -0.03em; color: var(--ink); transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.next .big i { font-style: italic; }
@media (hover: hover) { .next:hover .big { transform: translateX(10px); } }

@media (prefers-reduced-motion: reduce) {
  .t { animation: none; }
  .row, .next .big { transition: none; }
}

/* ---------- Per-case-study colour, from the landing gradient ---------- */
.theme-violet { --band: #5B45C2; --ink: #6A52D6; }   /* from g3 #8A72E6 */
.theme-teal   { --band: #1F6E80; --ink: #1E7A8C; }   /* from g2 #3BA7BF */
.theme-blue   { --band: #2F4BD1; --ink: #4A6CEB; }   /* from g1 #4F6FF0 */
.band { background: linear-gradient(135deg, var(--band) 0%, color-mix(in srgb, var(--band) 82%, #000) 100%); }

/* ---------- Hero-story components ---------- */
.kicker { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); font-weight: 500; }
ol.process { list-style: none; margin: 8px 0 clamp(64px, 8vw, 112px); padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); counter-reset: step; }
ol.process li { position: relative; counter-increment: step; display: flex; flex-direction: column; gap: 6px; padding: 28px 20px 0 0; border-top: 2px solid #E2DED6; }
ol.process li::before { content: counter(step, decimal-leading-zero); position: absolute; top: -12px; left: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; line-height: 22px; text-align: center; box-shadow: 0 0 0 4px var(--paper); }
ol.process b { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; }
ol.process span { font-size: 15px; line-height: 1.45; color: var(--muted-2); }
@media (max-width: 1000px) { ol.process { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; } }
@media (max-width: 600px) {
  ol.process { grid-template-columns: 1fr; row-gap: 0; }
  ol.process li { border-top: 0; border-left: 2px solid #E2DED6; padding: 0 0 28px 32px; }
  ol.process li:last-child { padding-bottom: 0; border-left-color: transparent; }
  ol.process li::before { top: 0; left: -12px; }
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 8px 0 clamp(64px, 8vw, 112px); }
.card { background: #fff; border: 1px solid #E6E3DC; border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.card .num { font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.card h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; }
.card p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted-2); }
.card .so { font-size: 14px; color: var(--ink); font-weight: 500; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px 56px; align-items: start; }

.table-wrap { overflow-x: auto; border: 1px solid #E6E3DC; border-radius: 14px; background: #fff; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; min-width: 640px; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 16px 20px; border-bottom: 1px solid #EEEBE5; }
.table-wrap th { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; color: var(--muted); background: #F6F4EF; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { font-weight: 600; }

.bottleneck { display: grid; grid-template-columns: 44px 1fr; gap: 4px 16px; padding: 20px 0; border-bottom: 1px solid #E6E3DC; }
.bottleneck:first-of-type { border-top: 1px solid #E6E3DC; }
.bottleneck svg { color: var(--ink); margin-top: 3px; }
.bottleneck b { font-weight: 600; }
.bottleneck p { grid-column: 2; margin: 0; color: var(--muted-2); font-size: 16px; }

.rounds { counter-reset: r; display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; }
.rounds li { list-style: none; counter-increment: r; display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; padding: 18px 0; border-bottom: 1px solid #E6E3DC; }
.rounds li::before { content: counter(r, decimal-leading-zero); grid-row: span 2; font-weight: 800; font-size: 28px; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; }
.rounds b { font-weight: 600; }
.rounds span { color: var(--muted-2); font-size: 16px; }

.lessons { counter-reset: l; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px 48px; padding: 0; margin: 8px 0 0; }
.lessons li { list-style: none; counter-increment: l; display: flex; flex-direction: column; gap: 6px; }
.lessons li::before { content: counter(l); font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1; color: var(--ink); }
.lessons b { font-size: 19px; font-weight: 600; }
.lessons span { color: var(--muted-2); font-size: 16px; }

.wide-sec { padding: 0 0 clamp(64px, 8vw, 112px); }
.wide-sec > h2 { margin: 0 0 12px; font-weight: 800; font-size: clamp(30px, 3vw, 44px); line-height: 1.05; letter-spacing: -0.03em; }
.wide-sec > .intro { margin: 0 0 32px; max-width: 720px; }
.pill-badge { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted-2); background: #fff; margin-left: 6px; vertical-align: middle; }
.ph video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph.top img, .ph.top video { object-position: top center; }
.ph.white { background: #fff; border: 1px solid #E6E3DC; }
.ph.contain img { object-fit: contain; padding: 12px; }
.grid-2x2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 700px) { .grid-2x2 { grid-template-columns: 1fr; } }
img.diagram { width: 100%; height: auto; background: #fff; border: 1px solid #E6E3DC; border-radius: 14px; }

/* ---------- Side margins at 1440px desktop: left 140px (9.72vw), right 280px (19.44vw); proportional on tablet/desktop; phones unchanged ---------- */
@media (min-width: 768px) {
  :root { --gutter-l: 9.7222vw; --gutter-r: 19.4444vw; }
  .wrap { max-width: none; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
  .band-inner { max-width: none; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
  .landing main { max-width: none; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
}
