/* ============================================================
   Nimisha Reghunandanan — Portfolio
   Direction A · "Atelier"  —  warm-neutral editorial
   ============================================================ */


:root {
  --paper:  #FBF9F3;
  --cream:  #F3EEE2;
  --cream2: #ECE6D8;
  --ink:    #26251E;   /* tapiser brand-plate olive */
  --olive:  #57563F;
  --muted:  #8C8775;
  --faint:  #B6B0A0;
  --line:   #E4DECF;
  --line2:  #D8D1BF;
  --clay:   #B0654A;   /* muted terracotta accent */
  --clay-d: #97543C;
  --sage:   #7C8569;   /* muted sage accent */
  --creamfg:#F6F1E3;

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans:  "Nunito Sans", system-ui, -apple-system, sans-serif;

  --ease-fluid: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: rgba(176,101,74,0.18); }

h1,h2,h3,h4 { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---- reusable ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow .tick { width: 26px; height: 1px; background: var(--line2); display: inline-block; }

.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.italic { font-style: italic; }
.clay { color: var(--clay); }

.section { padding-block: 64px; position: relative; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(38px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.02em;
  margin-top: 18px;
}
.section-head p { margin-top: 18px; color: var(--olive); font-size: 18px; max-width: 540px; }

/* divider */
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: transform .18s var(--ease-fluid), background .2s, color .2s;
  white-space: nowrap; user-select: none;
}
.btn-dark { background: var(--ink); color: var(--creamfg); }
.btn-dark:hover { background: #312f25; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--creamfg); }
.btn-cream { background: var(--creamfg); color: var(--ink); }
.btn:active { transform: scale(0.97); }

/* status dot */
.dot { position: relative; display: inline-flex; width: 8px; height: 8px; }
.dot::before { content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--sage); opacity: .35; animation: dotPulse 2.6s var(--ease-fluid) infinite; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--sage); transform: scale(.5); }
@keyframes dotPulse { 0%{transform:scale(.5);opacity:.5} 70%,100%{transform:scale(1.7);opacity:0} }
@media (prefers-reduced-motion: reduce) { .dot::before { animation: none; opacity: 0.35; } }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .45s var(--ease-fluid), transform .45s var(--ease-fluid); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* =================== NAV =================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; transition: background .3s var(--ease-fluid), border-color .3s var(--ease-fluid), padding .3s var(--ease-fluid);
  border-bottom: 1px solid transparent;
  opacity: 1; pointer-events: auto;
}
.nav.scrolled { background: rgba(251,249,243,0.82); backdrop-filter: blur(12px); border-color: var(--line); padding: 12px 40px; }
.nav .logo {
  font-size: 20px; font-weight: 500; font-variation-settings: "wght" 500;
  text-transform: uppercase; letter-spacing: 0.02em;
}

/* =================== HERO NAME ANIMATION =================== */
.name-spacer { height: 100vh; }
.hero-name {
  position: fixed;
  z-index: 65;
  font-family: "Nunito Sans", var(--font-sans);
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  opacity: 0;
  will-change: transform;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  .name-spacer { height: 0; }
  .hero-name {
    top: 24px !important; left: 32px !important;
    font-size: 20px !important; letter-spacing: 0.02em !important;
    font-variation-settings: "wght" 500 !important;
    opacity: 1 !important;
  }
  .nav { opacity: 1 !important; pointer-events: auto !important; }
}
.nav .links { display: flex; gap: 30px; font-size: 14.5px; color: var(--olive); }
.nav .links a { position: relative; }
.nav .links a::after { content:""; position:absolute; left:0; bottom:-4px; width:100%; height:1px; background: var(--clay); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-fluid); }
.nav .links a:hover::after { transform: scaleX(1); }
@media (max-width: 760px){ .nav .links { display: none; } }

/* =================== HERO =================== */
.hero { padding-top: 80px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 40px; align-items: center; }
.hero h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(48px, 7vw, 88px); line-height: 0.98; letter-spacing: -0.025em;
}
.hero .sub { margin-top: 26px; font-size: 18px; line-height: 1.6; color: var(--olive); }
.hero .cta-row { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-photo { width: 100%; aspect-ratio: 1; border-radius: 999px; overflow: hidden; box-shadow: 0 30px 60px -34px rgba(38,37,30,0.5); position: relative; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.2) contrast(1.02) sepia(.05); }
.hero-photo .ring { position: absolute; inset: -10px; border-radius: 999px; border: 1px solid var(--line2); }
@media (max-width: 820px){
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { width: 220px; order: -1; margin-bottom: 8px; }
}

/* marquee */
.marquee { margin-top: 64px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { display: flex; gap: 54px; white-space: nowrap; width: max-content; animation: marquee 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-size: 14px; letter-spacing: 0.14em; color: var(--muted); display: inline-flex; align-items: center; gap: 54px; }
.marquee span::after { content: "·"; color: var(--faint); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* =================== ABOUT =================== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(48px, 6vw, 96px); align-items: start; }
.about-left h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.06; letter-spacing: -0.022em; text-wrap: balance; }
.about-lead { color: var(--olive); font-size: 17px; line-height: 1.75; margin-top: 28px; }
.about-body { color: var(--olive); font-size: 17px; line-height: 1.75; }
.about-body p + p { margin-top: 20px; }
.platforms { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 26px; }
.chip { font-size: 13px; font-weight: 600; color: var(--olive); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--paper); }
@media (max-width: 820px){ .about-grid { grid-template-columns: 1fr; gap: 28px; } }

/* =================== FACTS =================== */
.facts { background: var(--ink); color: var(--creamfg); border-radius: 28px; padding: 64px 56px; }
.facts .eyebrow { color: rgba(246,241,227,0.55); }
.facts .eyebrow .tick { background: rgba(246,241,227,0.3); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 32px; }
.fact .num { font-family: var(--font-serif); font-weight: 400; font-size: clamp(44px, 5vw, 62px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact .num .suf { color: var(--clay); }
.fact .lbl { margin-top: 12px; font-size: 14.5px; color: rgba(246,241,227,0.68); line-height: 1.45; }
.fact { border-top: 1px solid rgba(246,241,227,0.16); padding-top: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; }
@media (max-width: 820px){ .facts-grid { grid-template-columns: repeat(2,1fr); } .facts { padding: 44px 28px; } }

/* =================== SERVICES (stacking folders) =================== */
.folder-stack { position: relative; }
.folder {
  position: sticky;
  top: calc(96px + var(--i, 0) * 70px);
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 22px;
  padding: 22px 32px 30px;
  margin-bottom: 70px;
  transform-origin: center top;
  transform: scale(calc(1 - var(--p, 0) * 0.05));
  opacity: calc(1 - var(--p, 0) * 0.34);
  box-shadow: 0 22px 50px -38px rgba(38,37,30,0.42);
  transition: box-shadow .4s var(--ease-fluid);
  will-change: transform, opacity;
}
.folder:last-child { margin-bottom: 24px; }
.folder { cursor: pointer; }
.folder:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.folder.stacked { box-shadow: 0 -12px 28px -22px rgba(38,37,30,0.55), 0 22px 50px -38px rgba(38,37,30,0.42); }
@media (prefers-reduced-motion: reduce) { .folder { transform: none; opacity: 1; } }

.folder-head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; min-height: 46px; }
.folder-tab { width: 44px; height: 36px; border-radius: 7px 7px 9px 9px; position: relative; flex: none; background: var(--cream); border: 1px solid var(--line2); transition: background .35s var(--ease-fluid), border-color .35s var(--ease-fluid); }
.folder-tab::before { content:""; position:absolute; top:-7px; left:6px; width: 19px; height: 9px; background: var(--cream); border: 1px solid var(--line2); border-bottom: none; border-radius: 5px 5px 0 0; transition: background .35s var(--ease-fluid), border-color .35s var(--ease-fluid); }
.folder.active .folder-tab { background: var(--clay); border-color: var(--clay-d); }
.folder.active .folder-tab::before { background: var(--clay); border-color: var(--clay-d); }
.folder-role { font-family: var(--font-serif); font-size: 32px; line-height: 1.05; }
.folder-brand { font-size: 17px; font-weight: 600; color: var(--muted); margin-top: 2px; letter-spacing: .01em; opacity: clamp(0, calc((1 - var(--p, 0)) / 0.3), 1); }
.svc-no { font-family: var(--font-serif); font-size: 22px; color: var(--faint); font-variant-numeric: tabular-nums; }
.svc-stat { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.svc-stat-val { font-family: var(--font-serif); font-size: 40px; line-height: 1; letter-spacing: -0.02em; color: var(--clay); }
.svc-stat-lbl { font-size: 14px; color: var(--olive); margin-top: 10px; line-height: 1.45; }

.folder-content { padding-top: 22px; margin-top: 18px; border-top: 1px solid var(--line); opacity: clamp(0, calc((1 - var(--p, 0)) / 0.3), 1); }
.folder-context { color: var(--olive); font-size: 15.5px; line-height: 1.65; max-width: 720px; margin-bottom: 24px; }
.work-cols { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; }
@media (max-width: 760px){
  .folder { top: calc(74px + var(--i, 0) * 54px); padding: 18px 22px 24px; margin-bottom: 48px; }
  .folder:last-child { margin-bottom: 160px; }
  .work-cols { grid-template-columns: 1fr; gap: 26px; }
  .folder-role { font-size: 22px; }
}

.wins { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.wins li { display: grid; grid-template-columns: auto 1fr; gap: 12px; font-size: 15px; color: var(--olive); line-height: 1.5; }
.wins .mk { color: var(--clay); font-weight: 700; margin-top: 1px; }

/* bar chart */
.chart { display: flex; flex-direction: column; gap: 16px; }
.chart-cap { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bar-row { }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.bar-label { font-size: 14px; color: var(--ink); font-weight: 600; }
.bar-val { font-size: 14px; color: var(--clay); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { height: 9px; border-radius: 999px; background: var(--cream2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sage), var(--clay)); width: 100%; transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease-fluid); }

/* channel tabs */
.chan-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--cream); border-radius: 999px; margin-bottom: 16px; }
.chan-tab { font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--olive); transition: background .2s, color .2s; border: none; background: none; font-family: inherit; }
.chan-tab.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(38,37,30,0.08); }
.chan-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chan { font-size: 13px; font-weight: 600; color: var(--olive); padding: 7px 13px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); }

/* =================== SKILLS =================== */
.skill-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.fbtn { font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--paper); color: var(--olive); cursor: pointer; transition: background .2s var(--ease-fluid), color .2s var(--ease-fluid), border-color .2s var(--ease-fluid); font-family: inherit; }
.fbtn:hover { border-color: var(--muted); }
.fbtn.active { background: var(--ink); color: var(--creamfg); border-color: var(--ink); }
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.skill { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px; transition: opacity .4s var(--ease-fluid), transform .4s var(--ease-fluid), border-color .2s; }
.skill .sk-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.skill.hide { display: none; }
.skill small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 900px){ .skill-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px){ .skill-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 400px){ .skill-grid { grid-template-columns: 1fr; } }

/* =================== ACHIEVEMENTS (drag gallery) =================== */
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.gallery-hint { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.gallery { display: flex; gap: 20px; overflow-x: auto; padding: 6px 40px 22px; margin: 0 -40px; cursor: grab; scrollbar-width: none; scroll-snap-type: x proximity; }
.gallery::-webkit-scrollbar { display: none; }
.gallery.drag { cursor: grabbing; scroll-snap-type: none; }
.gcard { flex: 0 0 380px; scroll-snap-align: start; border-radius: 22px; padding: 32px; min-height: 300px; display: flex; flex-direction: column; user-select: none; position: relative; overflow: hidden; }
.gcard.dark { background: var(--ink); color: var(--creamfg); }
.gcard.cream { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.gcard.clay { background: var(--clay); color: #fff; }
.gcard .g-num { font-family: var(--font-serif); font-size: 52px; line-height: 1; letter-spacing: -0.02em; }
.gcard .g-title { font-family: var(--font-serif); font-size: 26px; line-height: 1.1; margin-top: auto; }
.gcard .g-desc { font-size: 14.5px; line-height: 1.55; margin-top: 12px; opacity: .82; }
.gcard .g-tag { font-size: 13px; font-weight: 500; opacity: .72; }
@media (max-width: 560px){ .gcard { flex-basis: 280px; } }

/* =================== CONTACT =================== */
.contact { background: var(--ink); color: var(--creamfg); border-radius: 28px 28px 0 0; padding: 96px 0 64px; position: relative; overflow: hidden; }
.contact .glow { position: absolute; inset: 0; pointer-events: none; transition: background .2s; }
.contact-inner { position: relative; text-align: center; }
.contact h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(40px, 6.5vw, 84px); line-height: 0.98; letter-spacing: -0.025em; }
.contact .em { display: inline-block; }
.contact-sub { max-width: 460px; margin: 22px auto 0; font-size: 18px; color: rgba(246,241,227,0.7); }
.magnet-wrap { display: flex; justify-content: center; margin-top: 42px; }
.magnet { display: inline-flex; align-items: center; gap: 12px; padding: 18px 40px; border-radius: 999px; background: var(--creamfg); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; transition: transform .25s var(--ease-fluid); will-change: transform; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 46px; }
.clink { display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: 999px; border: 1px solid rgba(246,241,227,0.22); color: var(--creamfg); font-size: 14.5px; font-weight: 600; transition: background .2s, border-color .2s; }
.clink:hover { background: rgba(246,241,227,0.08); border-color: rgba(246,241,227,0.4); }
.contact-foot { position: relative; margin-top: 72px; padding-top: 26px; border-top: 1px solid rgba(246,241,227,0.16); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13.5px; color: rgba(246,241,227,0.55); }

/* =================== STICKY CONTACT FAB =================== */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 70;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 22px; border-radius: 999px; background: var(--clay); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer; border: none; font-family: inherit;
  box-shadow: 0 14px 30px -12px rgba(151,84,60,0.7);
  transform: translateY(120px); opacity: 0; transition: transform .5s var(--ease-fluid), opacity .4s var(--ease-fluid), background .2s;
}
.fab.show { transform: none; opacity: 1; }
.fab:hover { background: var(--clay-d); }
.fab.hide-near { transform: translateY(120px); opacity: 0; pointer-events: none; }
@media (max-width: 560px){ .fab { right: 16px; bottom: 16px; padding: 12px 18px; } }

/* footer credit */
.foot-note { text-align: center; padding: 30px; font-size: 13px; color: var(--faint); }

/* =================== MOBILE NAV =================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--ink);
  border-radius: 999px;
  padding: 5px;
  gap: 2px;
  box-shadow: 0 8px 32px -8px rgba(38,37,30,0.55), 0 2px 8px -2px rgba(38,37,30,0.3);
  white-space: nowrap;
}
.mnav-btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: rgba(246,241,227,0.58);
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background .2s, color .2s;
  min-height: 44px;
}
.mnav-btn.active { background: rgba(246,241,227,0.13); color: var(--creamfg); }
.mnav-btn:hover { color: var(--creamfg); }
@media (max-width: 760px) {
  .mobile-nav { display: flex; }
  .fab { display: none; }
  .contact { padding-bottom: 100px; }
}

/* =================== FOLDER TEASER (in stack) =================== */
.folder-teaser { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: start; }
.ft-overview { font-size: 16px; color: var(--olive); line-height: 1.6; max-width: 520px; }
.ft-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ft-tag { font-size: 12.5px; font-weight: 600; color: var(--olive); padding: 6px 12px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); }
.ft-open { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; font-size: 14.5px; font-weight: 700; color: var(--clay); }
.ft-open svg { transition: transform .25s var(--ease-fluid); }
.folder:hover .ft-open svg { transform: translateX(4px); }
.ft-side { display: flex; flex-direction: column; gap: 16px; }
.ft-brands { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px){ .folder-teaser { grid-template-columns: 1fr; gap: 22px; } }

/* =================== DETAIL OVERLAY (case study) =================== */
.detail {
  position: fixed; inset: 0; z-index: 200; background: var(--paper);
  display: flex; flex-direction: column;
  opacity: 1;
  animation: detailIn .42s var(--ease-drawer);
}
@keyframes detailIn { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail.exiting { animation: detailOut .2s var(--ease-fluid) forwards; }
@keyframes detailOut { to { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce){ .detail { animation: none; } .detail.exiting { animation: none; } }

.detail-bar {
  flex: none; display: flex; align-items: center; gap: 18px; padding: 15px 40px;
  border-bottom: 1px solid var(--line); background: rgba(251,249,243,0.92); backdrop-filter: blur(10px);
}
.d-back {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--ink); background: none; color: var(--ink); font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s;
}
.d-back:hover { background: var(--ink); color: var(--creamfg); }
.d-bar-title { font-family: var(--font-serif); font-size: 20px; margin-right: auto; white-space: nowrap; }

.detail-scroll { flex: 1 1 auto; overflow-y: auto; padding-bottom: 64px; }

/* ---- full-page name takeover ---- */
.d-hero {
  padding-top: 48px;
  padding-bottom: 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.d-hero-eyebrow {
  font-family: var(--font-serif); font-style: italic; color: var(--clay);
  font-size: clamp(18px, 2vw, 24px); line-height: 1.2; margin-bottom: 22px;
  opacity: 0; transform: translateY(14px);
  animation: dHeroMeta .7s var(--ease-fluid) forwards .12s;
}
.d-bigname {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(40px, 6vw, 80px); line-height: 0.95; letter-spacing: -0.03em;
  color: var(--ink); margin: 0;
}
.d-bigname .d-line { display: block; overflow: hidden; padding-bottom: 0.18em; margin-bottom: -0.14em; }
.d-line-i {
  display: block; transform: translateY(112%);
  animation: dNameUp 1s var(--ease-drawer) forwards;
  animation-delay: calc(var(--li) * 0.11s + 0.14s);
}
.d-hero-meta {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: clamp(16px, 2vw, 28px);
  opacity: 0; transform: translateY(16px);
  animation: dHeroMeta .8s var(--ease-fluid) forwards .42s;
}
.d-hero-meta .d-intro { margin-top: 0; max-width: 640px; }
.d-hero-meta .d-tags { margin-top: 0; }
.d-scrollcue {
  flex: none; display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-top: 4px;
  opacity: 0; animation: dHeroMeta .8s var(--ease-fluid) forwards .62s;
}
.d-scrollcue svg { animation: dCueBob 1.8s ease-in-out infinite; }
@keyframes dNameUp { to { transform: none; } }
@keyframes dHeroMeta { to { opacity: 1; transform: none; } }
@keyframes dCueBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .d-line-i, .d-hero-eyebrow, .d-hero-meta, .d-scrollcue { animation: none !important; opacity: 1; transform: none; }
  .d-scrollcue svg { animation: none; }
}
.d-intro { max-width: 560px; font-size: 19px; line-height: 1.6; color: var(--olive); }
.d-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.d-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--olive); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--cream); }

.d-body { display: flex; flex-direction: column; gap: 40px; margin-top: 0; }
.d-kicker { font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.d-note { color: var(--olive); font-size: 16px; margin: -8px 0 24px; line-height: 1.55; }

/* wins */
/* ── platform tabs ── */
.d-ptabs { display: flex; gap: 8px; margin-bottom: 14px; }
.d-ptab { padding: 8px 22px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, color .15s; font-family: inherit; }
.d-ptab:hover { border-color: var(--ink); }
.d-ptab.active { background: var(--ink); color: var(--creamfg); border-color: var(--ink); }
.d-pcard { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.d-pcard-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
.d-pcard-name { font-size: 12.5px; font-weight: 700; background: var(--clay); color: var(--creamfg); padding: 5px 14px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.d-pcard-headline { display: flex; align-items: baseline; gap: 7px; }
.d-pcard-val { font-size: 22px; font-weight: 700; color: var(--ink); font-family: var(--font-sans); line-height: 1; }
.d-pcard-lbl { font-size: 14px; color: var(--olive); }
.d-pcard-delta { font-size: 13px; font-weight: 600; color: var(--sage); }
.d-pcard-metrics { display: grid; grid-template-columns: repeat(5, 1fr); }
.d-pmetric { padding: 16px 20px; border-right: 1px solid var(--line); }
.d-pmetric:last-child { border-right: none; }
.d-pmetric-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.d-pmetric-val { font-size: 22px; font-weight: 700; color: var(--ink); font-family: var(--font-sans); line-height: 1; }
.d-pmetric-delta { font-size: 12px; font-weight: 600; color: var(--sage); margin-top: 5px; }
.d-pchina { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 14px 20px; background: var(--cream2); border: 1px solid var(--line); border-radius: 14px; gap: 16px; flex-wrap: wrap; }
.d-pchina-label { font-size: 13px; color: var(--olive); font-weight: 500; }
.d-pchina-stats { display: flex; gap: 28px; }
.d-pchina-stat { display: flex; align-items: baseline; gap: 5px; }
.d-pchina-val { font-size: 20px; font-weight: 700; color: var(--ink); font-family: var(--font-sans); line-height: 1; }
.d-pchina-lbl { font-size: 12px; color: var(--muted); }
.d-pchina-delta { font-size: 12px; font-weight: 600; color: var(--sage); }
@media (max-width: 720px) { .d-pcard-metrics { grid-template-columns: repeat(2, 1fr); } .d-pmetric:nth-child(2n) { border-right: none; } .d-pchina { flex-direction: column; align-items: flex-start; } }

.d-wins { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.d-win { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; min-height: 232px; }
.d-win-cat { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.d-win-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.d-win-brand { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 16px; }
.d-win-stat { font-family: var(--font-sans); font-size: 22px; font-weight: 700; line-height: 1.04; margin-top: 8px; color: var(--ink); white-space: nowrap; }
.d-win-desc { font-size: 13.5px; line-height: 1.5; color: var(--olive); margin-top: 12px; }

/* ---- dark / vivid win card variant ---- */
.d-win--vivid {
  background: var(--cream);
  border-color: var(--line);
  border-top: 3px solid var(--accent, var(--clay));
}
.d-win--vivid .d-win-brand { color: var(--faint); }
.d-win--vivid .d-win-stat  { color: var(--ink); }
.d-win--vivid .d-win-desc  { color: var(--olive); }
@media (max-width: 1000px){ .d-wins { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .d-wins { grid-template-columns: 1fr; } .d-win { min-height: 0; } }

/* role / case study */
.d-role { background: var(--cream); border: 1px solid var(--line); border-radius: 26px; padding: 40px; }
.d-role-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.d-role h3 { font-family: var(--font-serif); font-weight: 400; font-size: 34px; letter-spacing: -0.02em; }
.d-role-title { font-size: 13.5px; font-weight: 700; letter-spacing: .04em; color: var(--clay); }
.d-role-summary { margin-top: 16px; font-size: 17px; line-height: 1.65; color: var(--olive); }

.d-media { display: grid; grid-template-columns: 1.5fr 0.5fr; gap: 22px; margin-top: 30px; align-items: stretch; }
.d-media-cap { margin-top: 10px; font-size: 13px; color: var(--muted); }
.d-media-stats { display: flex; flex-direction: column; justify-content: center; gap: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.d-mstat-val { font-family: var(--font-serif); font-size: 42px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.d-mstat-lbl { font-size: 13px; color: var(--olive); margin-top: 6px; }
@media (max-width: 760px){ .d-media { grid-template-columns: 1fr; } }

.d-groups { margin-top: 16px; display: flex; flex-direction: column; gap: 26px; }
.d-groups .d-kicker { margin-bottom: 4px; }
.d-group-name { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); margin-bottom: 14px; }
.d-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px; }
.d-gstat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.d-gstat-val { font-family: var(--font-serif); font-size: 32px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.d-gstat-lbl { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.d-gstat-delta { font-size: 13px; font-weight: 700; color: #3F7D52; margin-top: 8px; font-variant-numeric: tabular-nums; }

.d-video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; margin-bottom: 28px; }
.d-video-grid.d-video-grid-center { grid-template-columns: repeat(3, 1fr); max-width: 75%; margin-left: auto; margin-right: auto; }
.d-video-item { display: flex; flex-direction: column; }
.d-video-frame { position: relative; aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; background: var(--ink); }
.d-video-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.d-video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.18); transition: background .2s; }
.d-video-frame:hover .d-video-play { background: rgba(0,0,0,0.32); }
.d-play-btn { width: 44px; height: 44px; border-radius: 999px; background: rgba(255,255,255,0.18); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding-left: 2px; transition: background .2s, transform .2s; }
.d-video-frame:hover .d-play-btn { background: rgba(255,255,255,0.28); transform: scale(1.08); }
.d-video-frame iframe { position: absolute; top: -8%; left: -3%; width: 106%; height: 123%; border: none; }
.d-video-local { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-video-lbl { font-size: 12px; color: var(--olive); font-weight: 500; margin-top: 7px; line-height: 1.3; }
@media (max-width: 720px) { .d-video-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── video gallery filter ── */
.d-gallery-filter { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.d-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-filter-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; color: var(--olive); text-transform: uppercase; min-width: 38px; flex-shrink: 0; }
.d-filter-btn { padding: 6px 15px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; font-family: inherit; line-height: 1; }
.d-filter-btn:hover { border-color: var(--ink); }
.d-filter-btn.active { background: var(--clay); color: var(--creamfg); border-color: var(--clay); }

/* ── instagram link cards ── */
.d-ig-card { position: relative; display: flex; flex-direction: column; aspect-ratio: 9/16; background: var(--cream); border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--ink); transition: border-color .2s; }
.d-ig-card:hover { border-color: var(--clay); }
.d-ig-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-ig-body { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; height: 100%; padding: 18px 16px; background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.55) 100%); }
.d-ig-card.has-thumb .d-ig-icon { color: rgba(255,255,255,0.8); }
.d-ig-card.has-thumb .d-ig-title { color: #fff; }
.d-ig-card.has-thumb .d-ig-cta { color: rgba(255,255,255,0.85); }
.d-ig-icon { color: var(--muted); flex-shrink: 0; }
.d-ig-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-top: auto; padding-top: 12px; }
.d-ig-cta { font-size: 12px; font-weight: 500; color: var(--clay); margin-top: 10px; }

.d-block-quote { margin-top: -24px; }
.d-quote { border-left: 3px solid var(--clay); padding: 4px 0 4px 24px; margin: 0; }
.d-quote-text { font-family: var(--font-sans); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.65; color: var(--ink); font-style: italic; margin: 0; }
.d-quote-attr { display: block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--clay); font-style: normal; letter-spacing: 0.04em; }

.d-sub { margin-top: 30px; }
.d-sub-h { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink); margin-bottom: 14px; }
.d-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.d-list li { display: grid; grid-template-columns: auto 1fr; gap: 14px; font-size: 15.5px; line-height: 1.55; color: var(--olive); }
.d-list .mk { color: var(--clay); font-weight: 700; font-variant-numeric: tabular-nums; }
.d-list-num li { align-items: start; }
.d-list-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
@media (max-width: 640px){ .d-list-cols { grid-template-columns: 1fr; } }

/* stat row */
.d-statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.d-stat { background: var(--cream); border: 1px solid var(--line); border-top: 3px solid var(--clay); border-radius: 16px; padding: 20px 22px 22px; }
.d-items-card { background: var(--cream); border: 1px solid var(--line); border-top: 3px solid var(--clay); border-radius: 16px; overflow: hidden; margin-top: 16px; }
.d-items-card-row { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.d-items-card-row:last-child { border-bottom: none; }
.d-items-card-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.d-items-card-text { font-size: 15px; color: var(--ink); line-height: 1.5; font-weight: 700; }
.d-stat-val { font-family: var(--font-serif); font-size: clamp(34px, 4vw, 50px); line-height: 1.02; letter-spacing: -0.02em; color: var(--ink); }
.d-stat-lbl { margin-top: 10px; font-size: 14px; color: var(--olive); line-height: 1.45; }
.d-delta { display: block; color: #3F7D52; font-weight: 700; margin-top: 4px; }

/* gallery */
.d-gallery { display: grid; gap: 16px; }
.d-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.d-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px){ .d-gallery.cols-3, .d-gallery.cols-4 { grid-template-columns: repeat(2, 1fr); } }

/* Gallery: hero layout (first image full-width, rest in a row below) */
.d-gallery-hero { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.d-gallery-hero-img { width: 100%; height: auto; border-radius: 14px; display: block; }
.d-gallery-hero-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.d-gallery-hero-sub { width: 100%; height: auto; border-radius: 14px; display: block; }

/* Gallery: default 2-col grid, natural ratio */
.d-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.d-gallery-grid-img { width: 100%; height: auto; border-radius: 14px; display: block; }
@media (max-width: 560px) { .d-gallery-grid { grid-template-columns: 1fr; } }
.d-caption-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-bottom: 20px; }
.d-caption-item { display: flex; flex-direction: column; gap: 10px; }
.d-caption-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; display: block; }
.d-caption-label { font-size: 13px; font-weight: 600; color: var(--ink); text-align: center; letter-spacing: 0.01em; }

/* Gallery: full-bleed landscape */
.d-gallery-full { display: flex; gap: 10px; margin-bottom: 20px; }
.d-gallery-full-img { flex: 1 1 0; min-width: 0; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 14px; }

/* chips */
.d-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.d-chip { font-size: 14px; font-weight: 600; color: var(--ink); padding: 10px 18px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line2); }

.d-foot { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }

@media (max-width: 560px){
  .detail-bar { padding: 13px 22px; }
  .d-role { padding: 26px 22px; }
}
