/* =====================================================================
   DCC Plastic — Colour Studio styles (v3)
   Smooth hue spectrum band + tone row + ordered family quick-pick +
   a Colour Index (C.I.) list in the product panel, now over a slow
   "dye-in-water" WebGL background that takes on the picked colour.
   Reuses styles.css :root variables (red/maroon family). Dark,
   restrained, chemical-major gravitas — no neon, no rainbow.
   ===================================================================== */
.studio-body{
  min-height:100vh;display:flex;flex-direction:column;position:relative;
  /* static fallback wash (used when WebGL is unavailable / before boot) */
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(226,86,79,.16), transparent 55%),
    radial-gradient(120% 100% at 82% 78%, rgba(94,31,31,.5), transparent 60%),
    var(--ink);
}
/* once the GPU field is live we hand the backdrop to the canvas */
.studio-body.dye-on{background:var(--ink)}

/* ---------- dye-in-water canvas layer ---------- */
.dye-canvas{
  position:fixed;inset:0;width:100vw;height:100vh;z-index:0;
  display:block;pointer-events:none;opacity:0;
  transition:opacity 1.1s var(--ease-out);
}
.dye-on .dye-canvas{opacity:1}
/* keep all chrome above the field */
.studio-body > .nav,
.studio-body > .studio,
.studio-body > .footer{position:relative;z-index:1}
@media (prefers-reduced-motion:reduce){
  .dye-canvas{transition:none}
}
.studio{
  flex:1;width:100%;max-width:var(--maxw);margin:0 auto;
  padding:clamp(6.5rem,11vh,8rem) clamp(1.2rem,4vw,3rem) clamp(3rem,6vh,5rem);
}
.studio-head{max-width:760px;margin-bottom:clamp(1.8rem,4vh,2.8rem)}
.studio-title{
  font-family:"Clash Display",sans-serif;font-weight:700;
  font-size:clamp(2rem,4.6vw,3.2rem);line-height:1.04;letter-spacing:-.01em;
  margin:.5rem 0 .7rem;color:var(--text);
}
.studio-sub{color:var(--muted);font-size:clamp(1rem,1.4vw,1.12rem);max-width:640px;line-height:1.6}

/* ---------- layout ---------- */
.studio-layout{
  display:grid;grid-template-columns:1fr 380px;gap:clamp(1.6rem,3vw,2.8rem);
  align-items:start;
}
.studio-pick-col{min-width:0;display:flex;flex-direction:column;gap:clamp(1.6rem,3.2vh,2.4rem)}

/* ---------- spectrum band ---------- */
.band-block{display:flex;flex-direction:column;gap:.7rem}
/* wrapper holds the band + an overlay layer for family divider lines/labels.
   extra bottom room so the labels sit just under the band without overlap */
.band-wrap{position:relative;padding-bottom:1.7rem}
.hue-band{
  position:relative;width:100%;height:64px;border-radius:14px;cursor:crosshair;
  border:1px solid var(--line-strong);
  background:linear-gradient(90deg,
    hsl(0 62% 50%)   0%,
    hsl(36 62% 50%)  10%,
    hsl(60 62% 50%)  17%,
    hsl(120 55% 45%) 33%,
    hsl(180 55% 45%) 50%,
    hsl(212 62% 50%) 59%,
    hsl(278 55% 52%) 77%,
    hsl(320 60% 52%) 89%,
    hsl(360 62% 50%) 100%);
  box-shadow:0 18px 48px -28px rgba(0,0,0,.8),inset 0 0 0 1px rgba(255,255,255,.04);
  touch-action:none;outline:none;overflow:hidden;
}
/* slow flowing sheen across the band — a soft moving highlight that reads
   as gentle liquid motion. GPU-composited (transform only), very cheap. */
.hue-band::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(105deg,
    transparent 0%, rgba(255,255,255,.0) 30%,
    rgba(255,255,255,.16) 47%, rgba(255,255,255,.22) 50%,
    rgba(255,255,255,.16) 53%, transparent 70%, transparent 100%);
  background-size:240% 100%;
  mix-blend-mode:soft-light;
  animation:bandflow 9s linear infinite;
  will-change:background-position;
}
@keyframes bandflow{0%{background-position:130% 0}100%{background-position:-130% 0}}
@media (prefers-reduced-motion:reduce){.hue-band::after{animation:none;opacity:.5}}
.hue-band:focus-visible{box-shadow:0 0 0 3px rgba(226,86,79,.45),0 18px 48px -28px rgba(0,0,0,.8)}
.band-marker{
  position:absolute;top:-6px;bottom:-6px;left:0;width:6px;
  transform:translateX(-50%);border-radius:6px;pointer-events:none;
  background:#c0312e;border:2px solid #fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.45),0 4px 14px rgba(0,0,0,.55);
  transition:left .12s var(--ease-out),background .12s var(--ease-out);
}

/* ---------- family-boundary segment markers over the band ----------
   thin divider lines mark where one colour family hands over to the next;
   tiny labels name each region so the spectrum reads as the real range. */
.band-segs{position:absolute;left:0;right:0;top:0;bottom:0;pointer-events:none}
.band-seg-line{
  position:absolute;top:0;height:64px;width:2px;transform:translateX(-50%);
  background:linear-gradient(180deg,rgba(255,255,255,.85),rgba(255,255,255,.35));
  box-shadow:0 0 0 1px rgba(0,0,0,.35);border-radius:2px;
}
.band-seg-label{
  position:absolute;bottom:0;transform:translateX(-50%);
  pointer-events:auto;cursor:pointer;white-space:nowrap;
  font-size:.66rem;letter-spacing:.02em;line-height:1;
  color:var(--muted);padding:.18rem .3rem;border-radius:5px;
  transition:color .18s var(--ease-out),background .18s,transform .18s;
}
/* edge labels anchor to the band side instead of centring, so long family
   names never clip off the left/right edge */
.band-seg-label.seg-start{transform:none;left:0}
.band-seg-label.seg-end{transform:translateX(-100%);left:100%}
.band-seg-label:hover{color:var(--text);background:rgba(255,255,255,.06)}
.band-seg-label.active{
  color:#fff;font-weight:600;background:rgba(226,86,79,.28);
  box-shadow:0 0 0 1px rgba(226,86,79,.5);
}
/* "Showing: <family>" caption under the band */
.band-fam-label{
  font-size:.82rem;color:var(--muted);letter-spacing:.01em;min-height:1.1em;
}
.band-fam-label::first-letter{text-transform:uppercase}

/* ---------- ordered family quick-pick ---------- */
.fam-block{display:flex;flex-direction:column;gap:.9rem}
.fam-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:.7rem;
}
.fam-chip{
  display:flex;align-items:center;gap:.7rem;width:100%;cursor:pointer;
  background:linear-gradient(180deg,rgba(36,19,18,.7),rgba(42,23,22,.74));
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  border:1px solid var(--line);border-radius:12px;padding:.78rem .9rem;
  color:var(--text);font:inherit;font-size:.96rem;text-align:left;
  transition:transform .18s var(--ease-out),border-color .18s,background .18s,box-shadow .18s;
}
.fam-chip:hover{transform:translateY(-2px);border-color:var(--line-strong);box-shadow:0 8px 22px -14px rgba(0,0,0,.7)}
.fam-chip.active{
  border-color:var(--teal-bright);
  box-shadow:0 0 0 1px rgba(226,86,79,.5),0 8px 22px -14px rgba(0,0,0,.7);
}
.fam-dot{
  width:26px;height:26px;border-radius:7px;flex:none;
  border:1px solid rgba(255,255,255,.22);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);
}
.fam-name{min-width:0;line-height:1.25}

.stage-tip{color:var(--muted-2);font-size:.85rem;max-width:580px;line-height:1.6;margin:0}

/* ---------- product panel ---------- */
/* slightly translucent + blurred so the dye field glows behind it without
   hurting legibility */
.product-panel{
  position:sticky;top:96px;
  background:linear-gradient(180deg,rgba(36,19,18,.82),rgba(42,23,22,.86));
  -webkit-backdrop-filter:blur(10px) saturate(120%);backdrop-filter:blur(10px) saturate(120%);
  border:1px solid var(--line-strong);border-radius:18px;
  padding:1.5rem 1.5rem 1.6rem;
  box-shadow:0 24px 70px -44px rgba(0,0,0,.85);
  opacity:0;transform:translateY(10px);transition:opacity .4s var(--ease-out),transform .4s var(--ease-out);
}
.product-panel.show{opacity:1;transform:none}
.pick-row{display:flex;align-items:center;gap:.85rem;padding-bottom:1.1rem;border-bottom:1px solid var(--line)}
.pick-dot{
  width:46px;height:46px;border-radius:12px;flex:none;
  border:1px solid rgba(255,255,255,.25);background:#c0312e;
  box-shadow:0 4px 16px rgba(0,0,0,.4),inset 0 0 0 1px rgba(255,255,255,.06);
}
.pick-meta{display:flex;flex-direction:column;min-width:0}
.pick-label{font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-2)}
.pick-hex{font-family:"Clash Display",sans-serif;font-weight:600;font-size:1.4rem;color:var(--text);letter-spacing:.02em}
.pd-block{padding:1.05rem 0;border-bottom:1px solid var(--line)}
.pd-block:last-of-type{border-bottom:0}
.pd-eyebrow{display:block;font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;color:var(--teal-bright);margin-bottom:.45rem}
.pd-name{font-family:"Clash Display",sans-serif;font-weight:600;font-size:1.32rem;color:var(--text);margin:0 0 .25rem}
.pd-cat{color:var(--muted);font-size:.9rem;margin:0;line-height:1.5}

/* ---------- application-choice guidance (the core "depends on application" note) ---------- */
.pd-guide-block{background:rgba(226,86,79,.06);border:1px solid var(--line);border-radius:12px;padding:.85rem .95rem;margin-top:.2rem}
.pd-guide-block .pd-eyebrow{color:var(--gold-spark,var(--amber))}
.pd-guide{color:var(--text);opacity:.92;font-size:.86rem;margin:0;line-height:1.6}

/* ---------- Colour Index list ---------- */
.pd-ci{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.7rem}
.ci-item{padding-bottom:.7rem;border-bottom:1px dashed var(--line)}
.ci-item:last-child{border-bottom:0;padding-bottom:0}
.ci-head{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:.6rem;row-gap:.1rem}
.ci-name{color:var(--text);font-size:.92rem;line-height:1.4;min-width:0}
.ci-code{
  justify-self:end;font-family:"Clash Display",sans-serif;font-weight:600;
  font-size:.86rem;letter-spacing:.02em;color:var(--teal-bright);white-space:nowrap;
}
.ci-no{
  grid-column:1 / -1;color:var(--muted-2);font-size:.76rem;letter-spacing:.02em;
}
/* meta row: heat badge + polymer tags + light fastness */
.ci-meta{display:flex;flex-direction:column;gap:.4rem;margin-top:.45rem}
.ci-row{display:flex;align-items:baseline;flex-wrap:wrap;gap:.32rem}
.ci-row-heat{align-items:center}
.ci-row-label{
  flex:0 0 auto;font-size:.62rem;line-height:1;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted-2);font-weight:600;min-width:5.8rem;
}
.ci-row-sec .ci-row-label{opacity:.85}
.ci-row-tags{display:flex;flex-wrap:wrap;gap:.32rem}
.ci-heat,.ci-poly,.ci-light{
  font-size:.7rem;line-height:1;letter-spacing:.02em;
  padding:.28rem .42rem;border-radius:6px;white-space:nowrap;
}
.ci-heat{background:rgba(226,86,79,.16);color:#f3b6b1;font-weight:600}
.ci-poly{background:rgba(226,86,79,.12);color:#f3cac6;border:1px solid rgba(226,86,79,.28)}
.ci-poly-sec{background:rgba(255,255,255,.05);color:var(--muted-2);border:1px solid var(--line);opacity:1}
.ci-light{background:transparent;color:var(--muted-2);border:1px solid var(--line)}
/* group heading inside the colourant list (Pigments / Solvent dyes) */
.ci-group-head{
  list-style:none;border-bottom:0;padding:0;margin:.2rem 0 -.1rem;
  font-size:.66rem;line-height:1;letter-spacing:.11em;text-transform:uppercase;
  font-weight:600;color:var(--gold-spark);opacity:.92;
}
.ci-group-head:first-child{margin-top:0}
/* explore-more / show-fewer toggle + reassurance hint */
.pd-more{margin:.85rem 0 0;display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}
.pd-more-btn{
  appearance:none;cursor:pointer;font-family:inherit;
  font-size:.78rem;letter-spacing:.02em;font-weight:600;
  color:#f3cac6;background:rgba(226,86,79,.12);
  border:1px solid rgba(226,86,79,.34);border-radius:8px;
  padding:.5rem .85rem;transition:background .2s ease,border-color .2s ease,color .2s ease;
}
.pd-more-btn:hover,.pd-more-btn:focus-visible{
  background:rgba(226,86,79,.2);border-color:rgba(226,86,79,.55);color:#fff;outline:none;
}
.pd-more-hint{color:var(--muted-2);font-size:.76rem;font-style:italic;line-height:1.5}

.pd-apps{color:var(--muted);font-size:.92rem;margin:0;line-height:1.55}
.pd-inquiry{width:100%;justify-content:center;margin-top:1.2rem}
.pd-disclaimer{margin:.85rem 0 0;color:var(--muted-2);font-size:.76rem;line-height:1.5;opacity:.85}

/* ---------- responsive ---------- */
@media (max-width:900px){
  .studio-layout{grid-template-columns:1fr;gap:1.8rem}
  .product-panel{position:static;top:auto}
}
@media (max-width:560px){
  .hue-band{height:56px}
  .band-seg-line{height:56px}
  .band-seg-label{font-size:.6rem;padding:.16rem .24rem}
  .fam-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
}

/* ---------- RTL ---------- */
html[dir="rtl"] .fam-chip{text-align:right}
html[dir="rtl"] .ci-head{grid-template-columns:auto 1fr}
html[dir="rtl"] .ci-code{justify-self:start}
html[dir="rtl"] .ci-row{flex-direction:row-reverse;justify-content:flex-end}
html[dir="rtl"] .ci-row-tags{flex-direction:row-reverse}
html[dir="rtl"] .ci-row-label{text-align:right}
html[dir="rtl"] .pd-guide,html[dir="rtl"] .pd-more{text-align:right}
html[dir="rtl"] .pd-more{align-items:flex-end}
html[dir="rtl"] .ci-group-head,html[dir="rtl"] .pd-more-hint{text-align:right}
/* polymer tags + C.I. codes stay LTR (technical identifiers) */
html[dir="rtl"] .ci-poly,html[dir="rtl"] .ci-code,html[dir="rtl"] .ci-no,html[dir="rtl"] .ci-heat,html[dir="rtl"] .ci-light{direction:ltr;unicode-bidi:embed}
html[dir="rtl"] .studio-head,html[dir="rtl"] .studio-sub,html[dir="rtl"] .stage-tip{text-align:right}
/* the hue band gradient + its segment markers stay left→right (it's a physical
   spectrum, not text) — positions are set in % from the left edge in JS, so the
   overlay must keep an LTR coordinate frame even under RTL */
html[dir="rtl"] .band-segs{direction:ltr}
html[dir="rtl"] .band-fam-label{text-align:right}
