/* ==========================================================================
   Cell Intelligence – Ingredients scroll section (v3 · "Inside the tube")
   Everything is scoped under .ci-ing so it can live inside any WordPress /
   Bricks page without touching global styles.
   Loaded by the child theme on the home page. Texts and images are edited in Bricks.
   ========================================================================== */


.ci-ing{
  /* brand tokens */
  --ci-green:#E9F1D0;
  --ci-orange:#FF772C;
  --ci-orange-deep:#F2621A;
  --ci-cream:#EEF3D8;
  --ci-copy:var(--ci-cream);   /* copy + line colour on the glow (dev panel: cream / white / ink) */
  --ci-ink:#7A2E0C;
  --ci-font:"CI Area Extended","Helvetica Neue",Arial,sans-serif;
  /* layout tokens */
  --ci-offset:0px;             /* height of a sticky site header, set by the page */
  --ci-margin:clamp(20px,4.2vw,64px);
  --ci-lens:clamp(128px,15vw,224px);

  position:relative;
  background:var(--ci-green);
  color:var(--ci-orange);
  font-family:var(--ci-font);
  font-weight:500;
  isolation:isolate;
}
.ci-ing *,.ci-ing *::before,.ci-ing *::after{box-sizing:border-box}

/* ---------- head ---------- */
.ci-ing__head{position:relative;z-index:3;padding:clamp(48px,7vw,96px) var(--ci-margin) 0}
.ci-ing__eyebrow{margin:0 0 14px;font-weight:800;font-size:13px;letter-spacing:.06em;text-transform:uppercase}
.ci-ing__title{margin:0;font-weight:800;font-size:clamp(30px,3.4vw,46px);line-height:1.12;letter-spacing:-.005em;color:var(--ci-orange)}

/* ---------- list (readable without JS = static fallback / SEO) ---------- */
.ci-ing__list{list-style:none;margin:0;padding:0}
.ci-ing__name{margin:0;font-weight:800;font-size:14px;letter-spacing:.05em;text-transform:uppercase;line-height:1.2}
.ci-ing__desc{margin:0;font-size:15px;line-height:1.3;max-width:24ch}
.ci-ing__lens{
  display:block;width:var(--ci-lens);aspect-ratio:1;border-radius:50%;
  position:relative;overflow:hidden;
  /* glass */
  background:rgba(255,255,255,.1);
  -webkit-backdrop-filter:blur(4px) saturate(120%);
  backdrop-filter:blur(4px) saturate(140%);
  border:1px solid rgb(255 255 255 / .3);
  box-shadow:inset 0 1px 0 rgb(255 255 255 / .4),0 8px 24px rgb(0 0 0 / .12);
}
.ci-ing__lens img{position:absolute;inset:9%;width:82%;height:82%;object-fit:contain;filter:drop-shadow(0 6px 10px rgba(60,40,10,.18))}
.ci-ing__line{display:block;height:1.5px;background:currentColor;opacity:.9}

/* ==========================================================================
   STATIC MODE  (no JS · no WebGL · prefers-reduced-motion · .ci-ing--static)
   The approved layout as a normal, readable section.
   ========================================================================== */
.ci-ing:not(.ci-ing--enhanced) .ci-ing__stage{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:0 clamp(16px,4vw,64px);
  padding:clamp(32px,5vw,72px) var(--ci-margin) clamp(56px,7vw,110px);overflow:hidden;
}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__head{grid-column:1/-1;padding:0 0 clamp(24px,3vw,40px);position:relative;z-index:1}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__list{grid-column:2;grid-row:2}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__fallback{grid-column:1;grid-row:2}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__canvas,
.ci-ing:not(.ci-ing--enhanced) .ci-ing__rail{display:none}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__glow{position:absolute;inset:0;background:radial-gradient(58% 72% at 72% 60%,var(--ci-orange) 0%,rgba(255,119,44,.8) 40%,rgba(255,119,44,.3) 62%,rgba(233,241,208,0) 82%);z-index:0}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__fallback{position:relative;z-index:1;width:min(100%,360px);height:auto;justify-self:center;align-self:center;transform:rotate(-14deg)}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__list{position:relative;z-index:1;display:grid;gap:clamp(14px,2vw,26px);align-content:center;color:var(--ci-copy)}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__item{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 22px;align-items:center}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__lens{--ci-lens:clamp(76px,9vw,124px);grid-row:span 3}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__line{grid-column:2;opacity:.7}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__copy{display:contents}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__name{grid-column:2;grid-row:1;align-self:end}
.ci-ing:not(.ci-ing--enhanced) .ci-ing__desc{grid-column:2;max-width:34ch}
@media (max-width:760px){
  .ci-ing:not(.ci-ing--enhanced) .ci-ing__stage{grid-template-columns:1fr}
  .ci-ing:not(.ci-ing--enhanced) .ci-ing__fallback{grid-column:1;grid-row:2;justify-self:center;width:min(58%,240px);margin-bottom:24px}
  .ci-ing:not(.ci-ing--enhanced) .ci-ing__list{grid-row:3}
  .ci-ing:not(.ci-ing--enhanced) .ci-ing__glow{background:radial-gradient(90% 60% at 50% 70%,var(--ci-orange) 0%,rgba(255,119,44,.5) 45%,rgba(233,241,208,0) 80%)}
}

/* ==========================================================================
   ENHANCED MODE  (JS + WebGL). The section gets a scroll length; the stage is
   sticky (native CSS, no scroll hijacking). Background, glow, tube and the
   liquid-glass refraction are drawn in one WebGL canvas; images, text and the
   menu are HTML on top (crisp, selectable, clickable).
   ========================================================================== */
.ci-ing--enhanced .ci-ing__head{position:absolute;inset:0 0 auto 0;padding-top:clamp(40px,6vh,80px);will-change:transform,opacity;pointer-events:none}
.ci-ing--enhanced .ci-ing__stage{
  position:sticky;top:var(--ci-offset);
  height:calc(100vh - var(--ci-offset));height:calc(100lvh - var(--ci-offset));   /* lvh: still full height when the mobile browser bar hides */
  overflow:hidden;
}
.ci-ing--enhanced .ci-ing__glow,
.ci-ing--enhanced .ci-ing__fallback{display:none}
.ci-ing--enhanced .ci-ing__canvas{position:absolute;inset:0;width:100%;height:100%;z-index:1;display:block}
.ci-ing--enhanced .ci-ing__list{position:absolute;inset:0;z-index:2;pointer-events:none}
.ci-ing--enhanced .ci-ing__item{position:absolute;inset:0;color:var(--ci-copy)}
.ci-ing--enhanced .ci-ing__lens,
.ci-ing--enhanced .ci-ing__line,
.ci-ing--enhanced .ci-ing__name,
.ci-ing--enhanced .ci-ing__desc{position:absolute;left:0;top:0;will-change:transform,opacity;opacity:0}
/* the glass itself (refraction, rim light, chromatic edge) is rendered in WebGL under this element */
.ci-ing--enhanced .ci-ing__lens{
  width:var(--ci-lens);transform-origin:50% 50%;
  background:none;-webkit-backdrop-filter:none;backdrop-filter:none;
  border:1px solid rgb(255 255 255 / .42);
  box-shadow:inset 0 1px 0 rgb(255 255 255 / .35);
  pointer-events:auto;cursor:pointer;
}
.ci-ing--enhanced .ci-ing__lens img{filter:drop-shadow(0 10px 14px rgba(70,30,0,.22))}
.ci-ing--enhanced .ci-ing__lens:focus-visible{outline:2px solid var(--ci-copy);outline-offset:4px}
.ci-ing--enhanced .ci-ing__line{width:100px;transform-origin:0 50%}
.ci-ing--enhanced .ci-ing__name{white-space:nowrap;transform-origin:0 50%;font-size:15px;pointer-events:auto;cursor:pointer}
.ci-ing--enhanced .ci-ing__desc{width:max-content;max-width:min(24ch,26vw);font-size:16px;line-height:1.28}

/* menu: ingredient thumbnails on the left, name on hover, click = go to ingredient */
.ci-ing__rail{position:absolute;z-index:3;left:calc(var(--ci-margin) / 2 - 4px);top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none}
.ci-ing__rail button{
  position:relative;display:block;width:34px;height:34px;padding:0;border-radius:50%;cursor:pointer;
  background:rgb(255 255 255 / .28) center/76% no-repeat;
  border:1px solid rgb(255 255 255 / .7);
  box-shadow:none;
  -webkit-backdrop-filter:blur(4px) saturate(140%);backdrop-filter:blur(4px) saturate(140%);
  opacity:.55;transition:opacity .3s,transform .3s,border-color .3s;
}
.ci-ing__rail button:hover,.ci-ing__rail button:focus-visible{opacity:1}
.ci-ing__rail button.is-active{opacity:1;transform:scale(1.18);border-color:#fff}
.ci-ing__rail button span{
  position:absolute;left:calc(100% + 12px);top:50%;transform:translate(-6px,-50%);white-space:nowrap;
  font:500 11px/1 var(--ci-font);letter-spacing:.05em;text-transform:uppercase;color:var(--ci-orange);
  opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;
}
.ci-ing__rail button:hover span,.ci-ing__rail button:focus-visible span{opacity:1;transform:translate(0,-50%)}
.ci-ing__rail button:focus-visible{outline:2px solid var(--ci-orange);outline-offset:3px}

/* mobile */
@media (max-width:760px){
  .ci-ing--enhanced .ci-ing__desc{font-size:15px;line-height:1.3}
  .ci-ing--enhanced .ci-ing__name{font-size:16px}
  .ci-ing__rail{display:none}
}
