/* future.css — the optional sections an author adds from the backoffice (see js/components/, all ported from
   /dosti-animation-playground). Every selector is scoped under .d-sec--<name> or a d-<name>__ child so nothing
   here can reach the home-page sections in sections.css.
   Three conventions run through the file:
     · the DEFAULT state of every section is the readable one — plain stacks, visible copy, solid colours. The
       animated layout is opted into by .is-live, which the component adds only once it is actually driving the
       section. With JS off, with GSAP unavailable, or under reduced motion, the server-rendered markup stands.
     · data-nav="light" already means "this section is light, so darken the nav"; it is reused here to pick the
       section's own palette, so a single authored field covers both.
     · colours and type come from tokens.css. The only literals are neutral black/white alphas and #33473a,
       the light-section body colour sections.css already uses, so a light block here matches .story__copy. */

/* =====================================================================
   SHARED SHELL
   ===================================================================== */
.d-sec { position: relative; padding: clamp(80px, 10vw, 160px) var(--gutter); background: var(--forest-950); color: var(--cream); }
.d-sec[data-nav="light"] { background: var(--cream); color: var(--ink); }
.d-wrap { max-width: 1480px; margin: 0 auto; }
.d-sec h2 { font-size: clamp(44px, 7.2vw, 128px); color: var(--cream); }
.d-sec[data-nav="light"] h2 { color: var(--forest-800); }
.d-sec h3 { font-size: clamp(26px, 2.8vw, 44px); }
.d-sec p { font-size: clamp(16px, 1.25vw, 19px); }
.d-sec p + p { margin-top: 14px; }
.d-sec[data-nav="light"] .eyebrow { color: var(--forest-800); }

/* =====================================================================
   01 LIQUID SPLASH — two panels wiped between by an SVG liquid front
   ===================================================================== */
.d-sec--splash { padding: 0; overflow: clip; }
.d-sec--splash > .d-wrap { max-width: none; }
.d-splash__panel {
  position: relative; min-height: 72vh; padding: clamp(56px, 7vw, 110px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(26px, 5vw, 80px);
  align-items: center; align-content: center;
  background: var(--panel-bg, var(--forest-900)); color: var(--cream);
}
.d-splash__media img { width: 100%; height: auto; border-radius: var(--radius); }
.d-splash__copy h2 { font-size: clamp(38px, 5.4vw, 92px); }
.d-splash__copy p { margin-top: 18px; max-width: 46ch; color: rgba(245, 242, 230, .86); }
.d-splash__btn {
  display: inline-flex; align-items: center; gap: 14px; margin: 0 var(--gutter) clamp(40px, 6vw, 70px);
  padding: 16px 24px; border: 0; border-radius: var(--radius); background: var(--lime); color: var(--forest-800);
  font: 800 12px var(--font-body); letter-spacing: .12em; text-transform: uppercase; transition: background .25s;
}
.d-splash__btn:hover { background: #fff; }
.d-splash__fx { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.d-splash__trail { fill: var(--lime); }
.d-splash__trail.is-2 { fill: var(--trail-bg, var(--forest-700)); }
/* the dead button is hidden rather than left to do nothing when the wipe is not running */
.d-sec--splash:not(.is-live) .d-splash__btn { display: none; }

.d-sec--splash.is-live { min-height: 260vh; }
.d-sec--splash.is-live[data-trigger="click"] { min-height: 0; }
.d-sec--splash.is-live > .d-wrap { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.d-sec--splash.is-live[data-trigger="click"] > .d-wrap { position: relative; }
.d-sec--splash.is-live .d-splash__panel { position: absolute; inset: 0; min-height: 0; }
.d-sec--splash.is-live .d-splash__panel.is-b { z-index: 2; }
.d-sec--splash.is-live .d-splash__btn { position: absolute; z-index: 3; left: 50%; bottom: clamp(18px, 4vw, 42px); transform: translateX(-50%); margin: 0; }
@media (max-width: 900px) {
  .d-splash__panel { grid-template-columns: 1fr; gap: 24px; }
  .d-sec--splash.is-live .d-splash__media { display: none; }
}

/* =====================================================================
   02 FLOATING FRUIT — ingredient art drifting at depth around a bottle
   ===================================================================== */
.d-sec--fruit { overflow: clip; }
.d-sec--fruit > .d-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(26px, 5vw, 80px); align-items: center; }
.d-fruit__stage { position: relative; aspect-ratio: 1; min-height: 420px; }
.d-fruit__stage::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 76%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(215, 230, 78, .26), transparent 72%);
}
.d-fruit__bottle { position: absolute; left: 50%; top: 50%; height: 74%; width: auto; margin-left: -1px; translate: -50% -50%; z-index: 3; filter: drop-shadow(0 30px 34px rgba(0, 0, 0, .45)); }
.d-fruit__item { position: absolute; display: block; pointer-events: none; z-index: 2; will-change: transform; }
.d-fruit__item svg { width: 100%; height: 100%; }
.d-fruit__copy p { margin-top: 18px; max-width: 46ch; }
@media (max-width: 900px) {
  .d-sec--fruit > .d-wrap { grid-template-columns: 1fr; }
  .d-fruit__stage { min-height: 320px; }
}

/* =====================================================================
   03 KINETIC TYPE — split-and-reveal headline (word-rise / letter-flip / mask-wipe / scale-in)
   ===================================================================== */
.d-kinetic__title { font-size: clamp(50px, 11.5vw, 184px); line-height: .9; }
.d-kinetic__line { display: block; }
.d-kinetic__w, .d-kinetic__c { display: inline-block; vertical-align: top; }
/* only the clipping styles need the extra wrapper: a flip or a scale must NOT be clipped */
.d-kinetic__line.is-clip .d-kinetic__w { overflow: hidden; padding-bottom: .07em; margin-bottom: -.07em; }
.d-kinetic__wi, .d-kinetic__ci { display: inline-block; will-change: transform; }
.d-kinetic__sub { margin-top: clamp(18px, 2.4vw, 34px); max-width: 52ch; color: rgba(245, 242, 230, .82); }
/* #33473a is the light-section body colour sections.css already uses for .story__copy and .distribution__intro */
.d-sec--kinetic[data-nav="light"] .d-kinetic__sub { color: #33473a; }

/* =====================================================================
   04 EXPLODING FRUIT — one burst that settles into the authored composition
   ===================================================================== */
.d-sec--burst { overflow: clip; }
.d-sec--burst > .d-wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(26px, 5vw, 80px); align-items: center; }
.d-burst__stage { position: relative; aspect-ratio: 1; min-height: 420px; }
.d-burst__bottle { position: absolute; left: 50%; bottom: 8%; height: 72%; width: auto; translate: -50% 0; z-index: 3; filter: drop-shadow(0 30px 34px rgba(0, 0, 0, .45)); }
.d-burst__item { position: absolute; display: block; pointer-events: none; z-index: 2; will-change: transform; }
.d-burst__item svg { width: 100%; height: 100%; }
.d-burst__copy p { margin-top: 18px; max-width: 46ch; }
@media (max-width: 900px) {
  .d-sec--burst > .d-wrap { grid-template-columns: 1fr; }
  .d-burst__stage { min-height: 320px; }
}

/* =====================================================================
   05 LAYERED PARALLAX — image layers at their own rates (no GSAP needed)
   ===================================================================== */
.d-sec--parallax { overflow: clip; }
/* default: a plain stack, so the images still read with JS off */
.d-parallax__layer { position: relative; max-width: 900px; margin: 0 auto clamp(12px, 2vw, 24px); }
.d-parallax__layer img { width: 100%; height: auto; }
.d-parallax__copy { position: relative; z-index: 9; max-width: 46ch; }
.d-parallax__copy p { margin-top: 18px; }
.d-sec--parallax.is-live > .d-wrap { position: relative; min-height: min(90vh, 760px); display: grid; align-content: center; }
.d-sec--parallax.is-live .d-parallax__layer { position: absolute; inset: 0; max-width: none; margin: 0; display: grid; place-items: center; will-change: transform; }
.d-sec--parallax.is-live .d-parallax__layer img { width: 100%; height: 100%; object-fit: contain; }

/* =====================================================================
   06 MORPHING SHAPES — one silhouette lerped through a shape list on scroll
   ===================================================================== */
.d-sec--morph > .d-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(26px, 5vw, 80px); align-items: center; }
.d-morph__stage { position: relative; aspect-ratio: 200 / 216; width: 100%; max-width: 560px; margin: 0 auto; }
.d-morph__svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 34px 44px rgba(0, 0, 0, .42)); }
.d-morph__path { fill: var(--d-morph-color, var(--lime)); }
.d-morph__gloss { pointer-events: none; }
.d-morph__copy p { margin-top: 18px; max-width: 46ch; }
@media (max-width: 900px) { .d-sec--morph > .d-wrap { grid-template-columns: 1fr; } }

/* =====================================================================
   07 TEXT MASK — headline filled with an image through background-clip: text
   ===================================================================== */
.d-sec--mask { text-align: center; overflow: clip; }
.d-mask__title { font-size: clamp(66px, 19vw, 300px); line-height: .84; }
/* opt-in: .is-mask is only present once JS has a usable image AND the browser supports the clip */
.d-sec--mask.is-mask .d-mask__title {
  background-image: var(--d-mask-img); background-size: cover; background-repeat: no-repeat;
  background-position: var(--d-mask-x, 50%) var(--d-mask-y, 30%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.d-sec--mask.is-nomask .d-mask__title { color: var(--lime); }
.d-sec--mask[data-nav="light"].is-nomask .d-mask__title { color: var(--forest-800); }
.d-mask__sub { margin: clamp(16px, 2.2vw, 30px) auto 0; max-width: 46ch; color: rgba(245, 242, 230, .82); }
.d-sec--mask[data-nav="light"] .d-mask__sub { color: #33473a; }

/* =====================================================================
   08 DYNAMIC COLLAGE — tiles flying between two authored grid layouts (manual FLIP)
   ===================================================================== */
.d-collage__grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(110px, 1fr));
  grid-auto-rows: minmax(110px, 1fr); gap: clamp(8px, 1.2vw, 18px);
}
.d-collage__tile { position: relative; margin: 0; min-width: 0; min-height: 0; overflow: hidden; border-radius: var(--radius); background: var(--forest-800); will-change: transform; }
.d-collage__in { position: absolute; inset: 0; transform-origin: 0 0; }
.d-collage__tile img { width: 100%; height: 100%; object-fit: cover; }
.d-collage__tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 12px; color: var(--cream);
  font: 800 10.5px var(--font-body); letter-spacing: .18em; text-transform: uppercase;
  background: linear-gradient(to top, rgba(7, 22, 15, .86), transparent);
}
.d-collage__btn {
  display: inline-flex; align-items: center; gap: 14px; margin-top: clamp(18px, 2.4vw, 30px);
  padding: 15px 22px; border: 0; border-radius: var(--radius); background: var(--lime); color: var(--forest-800);
  font: 800 12px var(--font-body); letter-spacing: .12em; text-transform: uppercase; transition: background .25s;
}
.d-collage__btn:hover { background: #fff; }
/* the doctype carries a section-level eyebrow / heading, so leave room for one only when it is actually there */
.d-collage__grid:not(:first-child) { margin-top: clamp(26px, 4vw, 54px); }
/* below 700px the grid is a single column; the JS skips the FLIP here, and !important beats its inline grid-area */
@media (max-width: 699px) {
  .d-collage__grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; }
  .d-collage__tile { grid-area: auto !important; aspect-ratio: 16 / 10; transform: none !important; }
  .d-collage__in { position: absolute; }
}

/* =====================================================================
   09 PRODUCT CARDS — pointer tilt, reveal on hover / focus-within, stretched link
   ===================================================================== */
.d-cards__list:not(:first-child) { margin-top: clamp(26px, 4vw, 54px); }
.d-cards__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: clamp(14px, 2vw, 26px); }
.d-cards__card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 10px;
  background: var(--forest-900); color: var(--cream); border: 1px solid rgba(245, 242, 230, .12);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: box-shadow .35s var(--ease-out), border-color .35s;
}
.d-cards__card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; z-index: 3; background: var(--acc, var(--lime)); }
.d-cards__card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 28%), rgba(255, 255, 255, .2), transparent 70%);
}
.d-cards__card:hover, .d-cards__card:focus-within { box-shadow: 0 26px 50px rgba(0, 0, 0, .45); border-color: rgba(245, 242, 230, .3); }
.d-cards__card:hover::after, .d-cards__card:focus-within::after { opacity: 1; }
.d-cards__card > img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 22px 0 0;
  background: radial-gradient(closest-side at 50% 78%, color-mix(in srgb, var(--acc, var(--lime)) 40%, transparent), transparent 74%);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .d-cards__card > img { background: none; }
}
.d-cards__body { position: relative; z-index: 3; padding: 18px 20px 20px; }
.d-cards__body h3 { font-size: clamp(22px, 2vw, 30px); }
.d-cards__body p { margin-top: 8px; font-size: 15px; color: rgba(245, 242, 230, .82); }
.d-cards__more { max-height: 0; margin-top: 0; opacity: 0; overflow: hidden; transition: max-height .45s var(--ease-out), opacity .3s, margin-top .45s var(--ease-out); }
.d-cards__card:hover .d-cards__more, .d-cards__card:focus-within .d-cards__more { max-height: 12em; margin-top: 10px; opacity: 1; }
/* the link is left static so its ::after resolves against the card: one hit area, one focus ring, whole card */
.d-cards__link { position: static; display: inline-block; margin: 0 20px 20px; font-weight: 800; font-size: 13px; letter-spacing: .06em; border-bottom: 1px solid currentColor; padding-bottom: 2px; color: var(--lime); }
.d-cards__link::after { content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; }
.d-cards__card:has(.d-cards__link:focus-visible) { outline: 3px solid var(--lime); outline-offset: 3px; }
.d-cards__link:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

/* =====================================================================
   10 PINNED STORY — sticky stage, chapters advancing with scroll
   ===================================================================== */
.d-sec--story2 { padding: 0; }
/* the stage carries its own padding; a section-level eyebrow / heading above it still needs the gutter */
.d-sec--story2 > .d-wrap { padding: clamp(70px, 9vw, 130px) var(--gutter) 0; }
/* default: a plain, fully readable list — media in order, then the chapters */
.d-story2__stage { max-width: 1100px; margin: 0 auto; padding: clamp(70px, 9vw, 130px) var(--gutter); }
.d-story2__media { display: grid; gap: 16px; }
.d-story2__img { width: 100%; height: auto; border-radius: var(--radius); }
.d-story2__chapters { display: grid; gap: clamp(26px, 4vw, 56px); margin-top: clamp(26px, 4vw, 48px); }
.d-story2__kicker { display: block; font: 800 11px var(--font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--lime); margin-bottom: 10px; }
.d-story2__chapter h3 { font-size: clamp(30px, 4vw, 62px); }
.d-story2__chapter p { margin-top: 12px; max-width: 46ch; color: rgba(245, 242, 230, .86); }
.d-story2__progress { display: none; }

.d-sec--story2.is-live { min-height: calc(var(--d-story2-n, 3) * 100vh); }
.d-sec--story2.is-live .d-story2__stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; max-width: none; margin: 0; overflow: hidden;
  padding: calc(var(--nav-h) + 26px) var(--gutter) 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center;
}
.d-sec--story2.is-live .d-story2__media { position: relative; display: block; height: 100%; }
.d-sec--story2.is-live .d-story2__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform, opacity; }
.d-sec--story2.is-live .d-story2__chapters { position: relative; display: block; height: 100%; margin: 0; }
.d-sec--story2.is-live .d-story2__chapter { position: absolute; left: 0; right: 0; top: 50%; will-change: transform, opacity; }
.d-sec--story2.is-live .d-story2__progress { display: block; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 26px; height: 3px; background: rgba(245, 242, 230, .2); }
.d-story2__progress > i { display: block; height: 100%; background: var(--lime); transform: scaleX(0); transform-origin: left; }
@media (max-width: 900px) {
  .d-sec--story2.is-live .d-story2__stage { grid-template-columns: 1fr; grid-template-rows: 38% 1fr; align-items: stretch; }
}

/* =====================================================================
   SITE-WIDE CUSTOM CURSOR (js/lib/cursor.js) — fine pointers only, off by default
   ===================================================================== */
html.d-cursor-on, html.d-cursor-on * { cursor: none; }
html.d-cursor-on input, html.d-cursor-on textarea, html.d-cursor-on select { cursor: text; }
.d-cursor { position: fixed; left: 0; top: 0; z-index: 999; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .18s; --d-cur: 1; }
.d-cursor[data-on="1"] { opacity: 1; }
.d-cursor[data-state="hit"] { --d-cur: 2.1; }
.d-cursor[data-state="text"] { opacity: 0; }
.d-cursor[data-down="1"] { --d-cur: .8; }
.d-cursor__ring, .d-cursor__drop { position: absolute; left: 0; top: 0; will-change: transform; }
.d-cursor__ring::before {
  content: ""; position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 1.5px solid var(--lime); background: rgba(215, 230, 78, .14);
  transform: scale(var(--d-cur)); transition: transform .28s cubic-bezier(.3, 1.5, .5, 1), background .2s;
}
.d-cursor[data-state="hit"] .d-cursor__ring::before { background: rgba(215, 230, 78, .3); }
.d-cursor__drop { width: 0; height: 0; }
.d-cursor__drop svg { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; opacity: .85; }

/* =====================================================================
   STATIC MODE — reduced motion, or GSAP unavailable (html.static, set by js/main.js).
   Every section's default is already the readable one, so these are belt and braces: they neutralise anything a
   component may have written before the preference changed, and they keep the sections safe with CSS alone.
   The parallax block is exempt while .is-live, because it runs without GSAP by design.
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .d-cards__card { transform: none; }
  .d-cards__more { max-height: none; margin-top: 10px; opacity: 1; overflow: visible; }
  .d-splash__btn, .d-collage__btn { display: none; }
  .d-kinetic__w { overflow: visible; }
  .d-kinetic__wi, .d-kinetic__ci { transform: none; opacity: 1; }
  .d-story2__chapter, .d-story2__img { position: relative; opacity: 1; transform: none; visibility: visible; }
  .d-sec--parallax:not(.is-live) .d-parallax__layer { transform: none; }
  .d-fruit__item, .d-burst__item { transition: none; }
}
html.static .d-cards__card { transform: none; }
html.static .d-cards__more { max-height: none; margin-top: 10px; opacity: 1; overflow: visible; }
html.static .d-sec--splash:not(.is-live) .d-splash__btn,
html.static .d-sec--collage .d-collage__btn { display: none; }
html.static .d-kinetic__w { overflow: visible; }
html.static .d-kinetic__wi, html.static .d-kinetic__ci { transform: none; opacity: 1; }
html.static .d-sec--story2:not(.is-live) .d-story2__chapter,
html.static .d-sec--story2:not(.is-live) .d-story2__img { position: relative; opacity: 1; transform: none; visibility: visible; }
html.static .d-sec--parallax:not(.is-live) .d-parallax__layer { transform: none; }
html.static .d-cursor { display: none; }

/* ---- Android app & QR code (optional section) --------------------------------------------
   Readable with no JavaScript: nothing starts hidden. app-promo.js adds .is-live only when it is
   actually animating, so the reveal cannot leave content stuck at opacity 0. */
.d-app { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .d-app { grid-template-columns: 1.1fr .9fr; } }

.d-app__h { font-size: clamp(34px, 5vw, 76px); line-height: 1.02; margin: 0; }
.d-app__p { margin-top: 18px; max-width: 46ch; color: rgba(245, 242, 230, .84); }
.d-sec--app[data-nav="light"] .d-app__p { color: #33473a; }

.d-app__features { list-style: none; margin: clamp(22px, 3vw, 34px) 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 560px) { .d-app__features { grid-template-columns: 1fr 1fr; gap: 12px 26px; } }
.d-app__feature { display: flex; align-items: flex-start; gap: 11px; font: 400 clamp(15px, 1.05vw, 17px)/1.45 var(--font-body); }
.d-app__feature svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; color: var(--lime); }
.d-sec--app[data-nav="light"] .d-app__feature svg { color: var(--forest-700); }

.d-app__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: clamp(26px, 3.4vw, 40px); }
.d-app__note { margin-top: 16px; font: 400 13px/1.5 var(--font-body); opacity: .62; }

.d-app__visual { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 40px); flex-wrap: wrap; }
.d-app__phone { flex: 0 1 300px; max-width: 320px; will-change: transform; transition: transform .5s var(--ease-out); }
.d-app__phone img { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: 0 30px 60px rgba(0, 0, 0, .45); }

/* White plate behind the code whatever the section theme: a QR code on a dark or tinted
   background is the single most common reason one will not scan. */
.d-app__qr { flex: 0 0 auto; margin: 0; text-align: center; }
.d-app__qr img { display: block; width: 160px; height: 160px; padding: 12px; background: #fff; border-radius: var(--radius); box-shadow: 0 16px 34px rgba(0, 0, 0, .3); }
.d-app__qr figcaption { margin-top: 10px; font: 700 11px/1.3 var(--font-body); letter-spacing: .14em; text-transform: uppercase; opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  .d-app__phone { transform: none !important; transition: none; }
}
