/* ==========================================================
   Case study pages — set in the client's own palette
   ========================================================== */
.cs {
  --forest: #123B22;
  --forest-2: #1E4D2B;
  --leaf: #5C7F2A;
  --turmeric: #F2C21B;
  --chilli: #C8371D;
  --earth: #5B3A21;
  --cream: #F6EFDF;
  --cream-2: #EFE5CC;
  --ink: #17261B;
  --muted: #5E6B5F;
  --rule: rgba(23, 38, 27, .12);
  background: var(--cream);
  color: var(--ink);
}
body:has(.cs) { background: var(--cream); }

/* nav sits on the dark hero until scrolled */
.nav--case:not(.is-scrolled) .nav__brand { color: #fff; }
.nav--case:not(.is-scrolled) .nav__links a { color: rgba(246, 239, 223, .8); }
.nav--case:not(.is-scrolled) .nav__links a:hover { color: #fff; }
.nav--case:not(.is-scrolled) .nav__toggle { background: rgba(255, 255, 255, .12); }
.nav--case:not(.is-scrolled) .nav__toggle span { background: #fff; }

.cs-sec { padding: clamp(80px, 11vw, 150px) 0; position: relative; }
.cs-h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 800; color: var(--forest); max-width: 16ch; }
.cs-note { color: var(--muted); font-size: 1.125rem; max-width: 46ch; }
.cs-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: end; margin-bottom: clamp(40px, 5vw, 72px); }
.cs-head--center { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.cs-head--center .cs-h2 { max-width: 18ch; }
.cs-head--center .cs-note { margin-top: 4px; }
.cs-chapter { font-weight: 600; font-size: .9375rem; color: var(--leaf); margin-bottom: 14px; display: inline-flex; align-items: center; gap: 10px; }
.cs-chapter::before { content: ""; width: 22px; height: 2px; background: var(--turmeric); border-radius: 2px; }
.cs-split { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.cs-split--wide { grid-template-columns: 1fr 1fr; align-items: center; }
.cs-split--media { grid-template-columns: 1fr 1.1fr; align-items: center; }
.cs-split--rev { grid-template-columns: 1.1fr 1fr; }
.cs-prose p { font-size: 1.125rem; line-height: 1.75; color: #33433A; max-width: 56ch; }
.cs-prose p + p { margin-top: 18px; }
.cs-prose b { color: var(--forest); }
.cs-lead { font: 600 clamp(1.3rem, 2.2vw, 1.75rem)/1.4 var(--display) !important; color: var(--forest) !important; letter-spacing: -.015em; }

/* ---------- Hero ---------- */
.cs-hero { background: var(--forest); color: var(--cream); padding: 150px 0 0; position: relative; overflow: hidden; isolation: isolate; }
.cs-hero__texture {
  position: absolute; inset: 0; opacity: .5; pointer-events: none; mix-blend-mode: multiply;
  background: url("assets/work/nirai/spice-lineart.png") 0 0 / 260px repeat;
}
.cs-hero__head { position: relative; }
.cs-back {
  display: inline-flex; align-items: center; gap: 8px; color: rgba(246, 239, 223, .75); text-decoration: none;
  font-weight: 500; font-size: .9375rem; margin-bottom: 36px; transition: color .3s, gap .4s var(--apple);
}
.cs-back::before { content: "←"; }
.cs-back:hover { color: #fff; gap: 12px; }
.cs-hero__kicker { color: var(--turmeric); font-weight: 600; margin-bottom: 18px; }
.cs-hero__title { font-size: clamp(2.8rem, 7.4vw, 7rem); line-height: .95; letter-spacing: -.045em; font-weight: 800; color: #fff; max-width: 13ch; }
.cs-hero__ta { margin-top: 22px; font: 600 clamp(1.1rem, 1.6vw, 1.35rem)/1.4 var(--display); color: var(--turmeric); opacity: .9; }
.cs-meta {
  margin: clamp(40px, 5vw, 64px) 0 0; padding: 28px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  border-top: 1px solid rgba(246, 239, 223, .16); border-bottom: 1px solid rgba(246, 239, 223, .16);
}
.cs-meta dt { font-size: .8125rem; color: rgba(246, 239, 223, .6); margin-bottom: 6px; }
.cs-meta dd { margin: 0; font-weight: 600; color: #fff; }
.cs-hero__media {
  margin: clamp(48px, 6vw, 80px) auto 0; width: min(100% - 2 * var(--gutter), 1400px);
  aspect-ratio: 16 / 8; border-radius: 32px 32px 0 0; overflow: hidden; will-change: clip-path, transform;
}
.cs-hero__media img { width: 100%; height: 115%; object-fit: cover; object-position: center 62%; will-change: transform; }

/* ---------- Strategy pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar {
  background: #fff; border-radius: 28px; padding: 36px 32px 40px; border: 1px solid var(--rule);
  transition: transform .8s var(--apple), box-shadow .8s var(--apple);
}
.pillar:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(18, 59, 34, .35); }
.pillar h3 { font-size: 1.75rem; letter-spacing: -.02em; color: var(--forest); margin: 26px 0 10px; font-weight: 800; }
.pillar p { color: var(--muted); }
.pillar__ic { display: block; width: 56px; height: 56px; border-radius: 18px; position: relative; }
.pillar__ic--leaf { background: #E3EDD3; }
.pillar__ic--leaf::after { content: ""; position: absolute; inset: 14px; background: var(--leaf); border-radius: 0 60% 0 60%; }
.pillar__ic--bowl { background: #FBEFC6; }
.pillar__ic--bowl::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 14px; height: 16px; background: var(--earth); border-radius: 0 0 16px 16px; }
.pillar__ic--bowl::before { content: ""; position: absolute; left: 19px; right: 19px; top: 14px; height: 14px; background: var(--turmeric); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pillar__ic--seal { background: #F6DCD5; }
.pillar__ic--seal::after { content: ""; position: absolute; inset: 15px 11px; border-radius: 50%; background: var(--forest-2); box-shadow: 0 0 0 3px var(--turmeric); }

/* ---------- Competitors ---------- */
.cs-compete { background: var(--cream-2); }
.findings { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.findings li { padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, .6); color: #33433A; }
.findings li:last-child { background: var(--forest); color: var(--cream); }
.findings b { color: var(--forest); }
.findings li:last-child b { color: var(--turmeric); }
.map { margin: 0; background: #fff; border-radius: 32px; padding: 24px; box-shadow: 0 40px 80px -40px rgba(18, 59, 34, .35); }
.map svg { width: 100%; height: auto; overflow: visible; }
.map__axis { stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 4 6; }
.map__lbl { font: 600 12px var(--body); fill: var(--muted); }
.map__grp circle { fill: #E8DFC9; }
.map__grp:nth-child(1) circle, .map__grp:nth-child(2) circle { fill: rgba(200, 55, 29, .18); }
.map__grp text { font: 500 11px var(--body); fill: var(--muted); }
.map__grp { opacity: 0; transform: scale(.4); transform-box: fill-box; transform-origin: center; transition: opacity .7s var(--apple), transform .9s var(--apple); transition-delay: calc(var(--d) * 140ms); }
.map.is-in .map__grp { opacity: 1; transform: none; }
.map__nirai { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; transition: opacity .8s var(--apple) .8s, transform 1.1s cubic-bezier(.34, 1.56, .64, 1) .8s; }
.map.is-in .map__nirai { opacity: 1; transform: none; }
.map__halo { fill: rgba(30, 77, 43, .12); transform-box: fill-box; transform-origin: center; animation: halo 2.6s ease-in-out infinite; }
.map__core { fill: var(--forest-2); stroke: var(--turmeric); stroke-width: 3; r: 30; }
.map__nlbl { font: 800 13px var(--display); fill: #fff; }
@keyframes halo { 50% { transform: scale(1.18); opacity: .5; } }

/* ---------- Timeline (a real sequence) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; position: relative; counter-reset: s; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 26px; height: 2px; background: var(--rule); }
.timeline::after { content: ""; position: absolute; left: 0; top: 26px; height: 2px; width: 100%; background: var(--leaf); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.timeline li { position: relative; padding-right: 20px; }
.timeline span {
  position: relative; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px;
  background: var(--cream); border: 2px solid var(--rule); color: var(--forest); font: 800 1.25rem var(--display);
  transition: background .5s, color .5s, border-color .5s, transform .6s var(--apple);
}
.timeline li.is-on span { background: var(--forest); color: var(--turmeric); border-color: var(--forest); transform: rotate(-6deg); }
.timeline h3 { margin: 22px 0 8px; font-size: 1.25rem; font-weight: 800; color: var(--forest); }
.timeline p { color: var(--muted); font-size: .9688rem; }

/* ---------- Sketchbook ---------- */
.cs-sketch { background: #fff; }
.sketchbook { position: relative; margin: 0; }
.sketchbook__img { border-radius: 28px; overflow: hidden; box-shadow: 0 50px 100px -40px rgba(91, 58, 33, .45); }
.sketchbook__img img { width: 100%; height: auto; filter: grayscale(1) contrast(1.05); transition: filter 1.4s var(--apple); }
.sketchbook.is-inked .sketchbook__img img { filter: none; }
.sketchbook__img { clip-path: inset(0 100% 0 0 round 28px); }
.sketchbook__scan {
  position: absolute; top: 0; bottom: 0; left: 0; width: 3px; border-radius: 3px; pointer-events: none;
  background: var(--turmeric); box-shadow: 0 0 24px 6px rgba(242, 194, 27, .55); opacity: 0;
}
.note {
  position: absolute; padding: 8px 14px; border-radius: 12px; background: var(--forest); color: var(--cream);
  font: 600 .875rem/1.2 var(--body); white-space: nowrap; box-shadow: 0 16px 30px -12px rgba(18, 59, 34, .5);
  opacity: 0; transform: translateY(10px) scale(.92); transition: opacity .6s var(--apple), transform .8s var(--apple);
}
.note::after { content: ""; position: absolute; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.note--a { left: -4%; top: 30%; } .note--a::after { right: -4px; top: 50%; margin-top: -5px; }
.note--b { left: 6%; bottom: 14%; } .note--b::after { right: 22px; top: -4px; }
.note--c { right: -3%; bottom: 26%; } .note--c::after { left: -4px; top: 50%; margin-top: -5px; }
.sketchbook.is-inked .note { opacity: 1; transform: none; }
.sketchbook.is-inked .note--b { transition-delay: .15s; }
.sketchbook.is-inked .note--c { transition-delay: .3s; }

/* ---------- Explorations ---------- */
.explore { margin: 0; display: grid; grid-template-columns: 1.4fr .8fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.explore__img { border-radius: 32px; overflow: hidden; box-shadow: 0 50px 100px -40px rgba(18, 59, 34, .4); }
.explore__img img { width: 100%; height: auto; will-change: transform; transform-origin: 18% 26%; }
.explore__why h3 { font-size: 1.5rem; font-weight: 800; color: var(--forest); margin-bottom: 18px; }
.explore__why p { padding: 16px 0; border-top: 1px solid var(--rule); color: var(--muted); }
.explore__why b { color: var(--forest); display: block; margin-bottom: 2px; }

/* ---------- Palette ---------- */
.cs-palette { background: var(--forest); color: var(--cream); }
.cs-palette .cs-h2 { color: #fff; }
.cs-palette .cs-note { color: rgba(246, 239, 223, .75); }
.swatches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; height: clamp(260px, 32vw, 380px); }
.swatches li {
  background: var(--c); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  color: #fff; transform-origin: bottom; transform: scaleY(.15); opacity: 0;
  transition: transform 1.1s var(--apple), opacity .6s, flex-grow .8s var(--apple);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.swatches li.is-light { color: var(--forest); }
.swatches.is-in li { transform: none; opacity: 1; }
.swatches.is-in li:nth-child(2) { transition-delay: .08s; } .swatches.is-in li:nth-child(3) { transition-delay: .16s; }
.swatches.is-in li:nth-child(4) { transition-delay: .24s; } .swatches.is-in li:nth-child(5) { transition-delay: .32s; }
.swatches.is-in li:nth-child(6) { transition-delay: .4s; }
.swatches span { font: 700 1.0625rem var(--display); }
.swatches code { font: 500 .8125rem var(--body); opacity: .8; }
@media (hover: hover) and (min-width: 981px) {
  .swatches { display: flex; }
  .swatches li { flex: 1; }
  .swatches li:hover { flex-grow: 2.2; }
}

/* ---------- Illustration feature ---------- */
.cs-illus { overflow: hidden; }
.cs-illus__texture {
  position: absolute; inset: 0; pointer-events: none; opacity: .55; mix-blend-mode: multiply;
  background: url("assets/work/nirai/spice-lineart.png") center / 320px repeat;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, #000 80%);
  mask-image: radial-gradient(ellipse at center, transparent 30%, #000 80%);
}
.feature {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  background: #fff; border-radius: 40px; padding: clamp(28px, 5vw, 72px);
  box-shadow: 0 60px 120px -60px rgba(91, 58, 33, .45);
}
.feature__art { margin: 0; text-align: center; }
.feature__plate {
  position: relative; width: min(100%, 380px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #FFF6DE 0%, #F8EBCB 60%, #F2DFB4 100%);
  display: grid; place-items: center; clip-path: circle(0% at 50% 50%);
}
.feature__plate::before { /* hand-drawn ring */
  content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 1.5px dashed rgba(91, 58, 33, .3);
  animation: spin 60s linear infinite;
}
.feature__plate img { width: 86%; height: auto; position: relative; mix-blend-mode: multiply; animation: ride 5s ease-in-out infinite; }
@keyframes ride { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(4px, -5px) rotate(-.8deg); } }
.feature__art figcaption { margin-top: 18px; font-size: .875rem; color: var(--muted); font-style: italic; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: #FBEFC6; color: var(--earth); font-weight: 700; font-size: .8125rem;
}
.badge::before { content: "★"; color: #D59E00; }
.feature__copy h3 { margin: 18px 0 16px; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1; letter-spacing: -.035em; font-weight: 800; color: var(--forest); }
.feature__copy p { color: #33433A; font-size: 1.0625rem; line-height: 1.75; }
.feature__copy p + p { margin-top: 14px; }
.feature__facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.feature__facts li { background: var(--cream); border-radius: 16px; padding: 14px; font-size: .875rem; color: var(--muted); }
.feature__facts b { display: block; color: var(--forest); font-size: .8125rem; margin-bottom: 4px; }
.lineart { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: center; margin-top: 28px; padding: 28px clamp(24px, 4vw, 48px); border-radius: 32px; background: rgba(255, 255, 255, .65); }
.lineart__img { margin: 0; width: 220px; aspect-ratio: 1; border-radius: 24px; background: #FBF6EA; display: grid; place-items: center; overflow: hidden; }
.lineart__img img { width: 92%; mix-blend-mode: multiply; transition: transform 1.2s var(--apple); }
.lineart:hover .lineart__img img { transform: scale(1.08) rotate(-2deg); }
.lineart h3 { font-size: 1.5rem; font-weight: 800; color: var(--forest); margin-bottom: 10px; }
.lineart p { color: var(--muted); max-width: 56ch; }

/* ---------- Packaging hotspots ---------- */
.cs-pack { background: var(--cream-2); }
.hotspots { position: relative; margin: 0; border-radius: 36px; overflow: hidden; box-shadow: 0 60px 120px -60px rgba(18, 59, 34, .5); }
.hotspots img { width: 100%; height: auto; display: block; }
.spot {
  position: absolute; left: var(--x); top: var(--y); translate: -50% -50%;
  width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 8px 20px rgba(0, 0, 0, .3);
  opacity: 0; scale: .3; transition: opacity .6s var(--apple), scale .8s cubic-bezier(.34, 1.56, .64, 1);
}
.hotspots.is-in .spot { opacity: 1; scale: 1; }
.hotspots.is-in .spot:nth-of-type(2) { transition-delay: .12s; } .hotspots.is-in .spot:nth-of-type(3) { transition-delay: .24s; }
.hotspots.is-in .spot:nth-of-type(4) { transition-delay: .36s; }
.spot::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--forest-2); }
.spot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid #fff; animation: ping-ring 2.2s ease-out infinite; }
@keyframes ping-ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.spot span, .spot em {
  position: absolute; left: 50%; translate: -50% 0; pointer-events: none; text-align: left;
  opacity: 0; transition: opacity .4s var(--apple), transform .5s var(--apple);
}
.spot span {
  bottom: calc(100% + 14px); transform: translateY(6px);
  padding: 6px 12px; border-radius: 999px; background: var(--forest); color: #fff; font: 700 .8125rem var(--body); white-space: nowrap;
}
.spot em {
  top: calc(100% + 14px); transform: translateY(-6px); width: 230px;
  padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: var(--ink);
  font: 500 .8438rem/1.45 var(--body); font-style: normal; box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .35);
}
.spot:hover span, .spot:focus-visible span, .spot:hover em, .spot:focus-visible em { opacity: 1; transform: none; }
.spot:hover, .spot:focus-visible { z-index: 2; }

/* ---------- Source ---------- */
.source__img { margin: 0; border-radius: 32px; overflow: hidden; aspect-ratio: 1; box-shadow: 0 50px 100px -40px rgba(91, 58, 33, .45); }
.source__img img { width: 100%; height: 118%; object-fit: cover; will-change: transform; }

/* ---------- Deliverables ---------- */
.deliver { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--rule); border-radius: 28px; overflow: hidden; border: 1px solid var(--rule); }
.deliver li { background: var(--cream); padding: 28px 22px 32px; min-height: 170px; position: relative; transition: background .5s var(--apple); }
.deliver li::before { content: ""; display: block; width: 26px; height: 26px; border-radius: 8px; margin-bottom: 22px; background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%23F2C21B' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat; transition: transform .6s var(--apple); }
.deliver li:hover { background: #fff; }
.deliver li:hover::before { transform: rotate(-10deg) scale(1.1); }
.deliver h3 { font-size: 1.125rem; font-weight: 800; color: var(--forest); margin-bottom: 6px; }
.deliver p { font-size: .9063rem; color: var(--muted); }

/* ---------- Next ---------- */
.cs-next { background: var(--forest); color: var(--cream); padding: clamp(90px, 12vw, 160px) 0; text-align: center; position: relative; overflow: hidden; }
.cs-next::before { content: ""; position: absolute; inset: 0; opacity: .45; mix-blend-mode: multiply; background: url("assets/work/nirai/spice-lineart.png") 0 0 / 260px repeat; }
.cs-next__wrap { position: relative; display: grid; justify-items: center; }
.cs-next__ta { font: 700 1.25rem var(--display); color: var(--turmeric); margin-bottom: 14px; }
.cs-next__title { font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1; letter-spacing: -.04em; font-weight: 800; color: #fff; max-width: 18ch; }
.cs-next__actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: center; }
.btn--cream { background: var(--turmeric); color: var(--forest); box-shadow: 0 16px 40px -14px rgba(242, 194, 27, .6); }
.btn--cream:hover { background: #fff; color: var(--forest); }
.cs-next__back { color: rgba(246, 239, 223, .8); font-weight: 600; }
.cs-next__back:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cs-head, .cs-split, .cs-split--wide, .cs-split--media, .cs-split--rev, .explore, .feature { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .timeline::before, .timeline::after { display: none; }
  .swatches { grid-template-columns: repeat(3, 1fr); height: auto; }
  .swatches li { min-height: 130px; }
  .deliver { grid-template-columns: repeat(2, 1fr); }
  .lineart { grid-template-columns: 1fr; }
  .note--a { left: 2%; } .note--c { right: 2%; }
  .cs-hero__media { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
  .feature__facts { grid-template-columns: 1fr; }
  .spot em { width: 180px; }
  .timeline { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sketchbook__img { clip-path: none; }
  .feature__plate { clip-path: none; }
}
