/* Colour page intro and "where next" (ported from the prototype, 20 Nov 2026). Loaded only by colour.html, after calm.css and landscape.css.
   Nothing here changes the finished page except the bars and the spotlight. The stage only exists while colour-intro.js runs it.
   Layers: header 50 < stage 800 < Skip intro 850 < accessibility button 900 < grain 998 < lightbox 1000 < skip link 1001 < panel 1100. */

/* ---- stage: copies of the tiles over a dark screen, aria-hidden ---- */
.ci-stage{position:fixed;inset:0;z-index:800;background:var(--bg);overflow:hidden;contain:strict;
  padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
/* if the script stops while waiting for the first photos, the stage fades away by itself */
.ci-pend{animation:ci-safe .6s ease 4.5s forwards}
@keyframes ci-safe{to{opacity:0;visibility:hidden}}
.ci-t{position:absolute;left:0;top:0;transform-origin:0 0}
/* intro-no-placeholders-2026-11-20: no faint frames, no grey mat. The copy stays transparent until its image has the ok class. */
.ci-f{position:absolute;inset:0;box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);opacity:0;pointer-events:none}
.ci-frames .ci-f{opacity:0}
.ci-m{position:absolute;inset:0;background:transparent;opacity:0;will-change:opacity,transform}
.ci-m img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;opacity:0;transition:opacity .35s ease}
.ci-m img.ok{opacity:1}

/* ---- Skip intro: first in the tab order, quiet, top corner ---- */
.ci-skip{position:fixed;z-index:850;top:max(16px,env(safe-area-inset-top,0px));inset-inline-end:max(var(--gut),env(safe-area-inset-right,0px));
  background:none;border:1px solid var(--line2);border-radius:99px;padding:9px 16px;min-height:36px;color:var(--ink2);
  font:400 11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;cursor:pointer;transition:color .3s,border-color .3s}
.ci-skip:hover{color:var(--ink);border-color:var(--mute)}
.ci-skip:focus-visible{outline:2px solid var(--warm);outline-offset:3px}

/* ---- Replay, next to the title ---- */
.ci-titlerow{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px clamp(16px,2.4vw,36px)}
.ci-replay{background:none;border:0;padding:6px 0;color:var(--mute);font:400 11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;cursor:pointer;
  text-decoration:underline;text-decoration-color:var(--line2);text-underline-offset:5px;transition:color .3s}
.ci-replay:hover{color:var(--warm)}
.ci-replay[hidden]{display:none}

/* ---- where next: three tabs, then one row of cards ---- */
.ci-next{margin-top:clamp(22px,3vw,34px);transition:opacity .8s var(--ease)}
.colour-head .ci-next{margin-bottom:clamp(10px,1.4vw,20px)}
.ci-hold .ci-next{opacity:0;visibility:hidden;transition:none}
.ci-tabs{display:flex;gap:clamp(22px,3vw,44px);border-top:1px solid var(--line);padding-top:10px}
.ci-tab{position:relative;background:none;border:0;padding:6px 0;cursor:pointer;color:var(--ink2);font:400 15px/1.4 var(--sans);white-space:nowrap;transition:color .3s}
.ci-tab .mono{margin-inline-start:4px;font-size:11px}
.ci-tab:hover,.ci-tab[aria-expanded=true]{color:var(--ink)}
.ci-tab[aria-expanded=true]:after{content:"";position:absolute;inset-inline:0;bottom:0;height:1px;background:var(--warm)}
.ci-panel{padding-top:18px}
.ci-panel:not([hidden]){animation:ci-in .5s var(--ease) both}
@keyframes ci-in{from{opacity:0;transform:translateY(6px)}}
.ci-cards{list-style:none;margin:0;padding:0 0 10px;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(128px,164px);gap:16px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:var(--line2) transparent}
.ci-card{display:flex;flex-direction:column;gap:4px;color:var(--ink2)}
.ci-im{display:block;aspect-ratio:5/4;position:relative;background:transparent;margin-bottom:6px}
.ci-im img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .35s ease}
.ci-im img.ok{opacity:1}
.ci-ct{font-family:var(--disp);font-size:18px;line-height:1.15;color:var(--ink);transition:color .3s}
.ci-card .mono{font-size:11px}
.ci-card:hover .ci-ct,.ci-card:focus-visible .ci-ct{color:var(--warm)}
.ci-card:focus-visible{outline:none}
.ci-card:focus-visible .ci-im{outline:2px solid var(--warm);outline-offset:2px}
.ci-all .ci-im{display:grid;place-items:center;background:none;box-shadow:inset 0 0 0 1px var(--line);font-family:var(--disp);font-size:28px;color:var(--mute)}
.ci-keep{padding-bottom:clamp(64px,10vh,120px)}
.ci-keep>h2{margin:0}
.ci-keep .ci-next{margin-top:12px}

/* ---- spotlight: the field dims to a quarter, except the group in focus ---- */
.colour-field .mat{transition:opacity .45s var(--ease)}
.colour-field.ci-spot .cf-cell:not(.ci-lit) .mat{opacity:.25}

@media (max-width:600px){
  .ci-tabs{overflow-x:auto;scrollbar-width:none;gap:24px;margin-inline:calc(var(--gut) * -1);padding-inline:var(--gut)}
  .ci-tabs::-webkit-scrollbar{display:none}
  .ci-cards{grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-columns:auto;overflow:visible;gap:18px 12px}
}

/* ======================================================================
   colour-first-2026-11-21: Colour is the home page. The "Look by" bar is sticky and keeps a lens on in the field.
   Layers: header 50 > lens bar 40. Everything else as above.
   ====================================================================== */
.lens-wrap{position:sticky;top:var(--hdh,0px);z-index:40;margin-top:clamp(8px,1.6vw,22px);padding:2px 0 12px;background:linear-gradient(var(--bg) calc(100% - 12px),transparent)}
.lens-zone{display:block}
/* the open card row can be taller than the screen on a phone (7 cards in two columns): it scrolls inside the sticky bar instead of running off the bottom */
.lens-wrap .ci-panel{max-height:min(62vh,calc(100vh - var(--hdh,0px) - 150px));max-height:min(62dvh,calc(100dvh - var(--hdh,0px) - 150px));overflow-y:auto;overscroll-behavior:contain}
.lens-wrap .ci-next{margin:0}
.lens-wrap .ci-tabs{border-top:1px solid var(--line);padding-top:0;align-items:center}
.lens-lab{font:400 11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--mute);margin-inline-end:clamp(4px,1.4vw,18px)}
/* 44 px targets */
.ci-tab{min-height:44px;display:inline-flex;align-items:center;gap:4px;padding:0 2px}
.ci-tab.has-lens{color:var(--warm)}
.ci-skip{min-height:44px;padding-block:0}
.ci-replay{min-height:44px;display:inline-flex;align-items:center}
/* the card is a button (it lights a group) or, when nothing of it is in the field, a link to its own page */
button.ci-card{background:none;border:0;padding:0;margin:0;font:inherit;text-align:start;cursor:pointer;width:100%}
.ci-card[aria-pressed=true] .ci-im{outline:2px solid var(--warm);outline-offset:2px}
.ci-card[aria-pressed=true] .ci-ct{color:var(--warm)}
.ci-own .ci-im{opacity:.72}
/* caption of the lit group */
.lens-cap{display:flex;flex-wrap:wrap;align-items:center;gap:0 clamp(14px,2vw,28px);min-height:44px;border-top:1px solid var(--line)}
.lens-cap[hidden]{display:none}
.lens-cap .lc-t{font:400 clamp(20px,2.2vw,26px)/1.15 var(--disp);color:var(--ink)}
.lens-cap .lc-n{color:var(--mute);font-size:11px}
.lens-cap .lc-a,.lens-cap .lc-x{display:inline-flex;align-items:center;min-height:44px;background:none;border:0;padding:0 2px;font:400 14px/1.3 var(--sans);cursor:pointer;text-decoration:underline;text-decoration-color:var(--line2);text-underline-offset:5px;transition:color .3s}
.lens-cap .lc-a{color:var(--warm);gap:6px}
.lens-cap .lc-x{color:var(--ink2);margin-inline-start:auto;min-width:44px;justify-content:center}
.lens-cap .lc-a:hover,.lens-cap .lc-x:hover{color:var(--ink)}
.lens-cap .lc-a:focus-visible,.lens-cap .lc-x:focus-visible,.ci-tab:focus-visible,.ci-skip:focus-visible,.ci-replay:focus-visible{outline:2px solid var(--warm);outline-offset:3px}
/* a group that stays lit: the rest rests at about 16%. Hovering a card previews at 25% instead (ci-spot), then goes back. */
.colour-field.lens-on:not(.ci-spot) .cf-cell:not(.lens-lit) .mat{opacity:.16}
/* below the field: the routine paragraph, the quote and the prints call, as on the old home */
.colour-close{padding-top:clamp(36px,7vh,80px);padding-bottom:clamp(36px,7vh,80px)}
.cc-q{margin:clamp(32px,5vw,60px) auto 0;max-width:34ch}
.cc-q p{font-family:var(--disp);font-size:clamp(19px,1.6vw,24px);line-height:1.3;color:var(--ink2);margin:0}
.cc-q .qcite{display:block;margin-top:10px}
@media (max-width:600px){
  .lens-lab{display:none}
  .lens-wrap .ci-tabs{gap:14px}
  .ci-tab{font-size:14px}
}
/* short and wide (phone on its side): the tabs and the caption share one line, the card row spans the width */
@media (orientation:landscape) and (max-height:500px){
  .lens-wrap{padding-bottom:8px}
  .lens-wrap .ci-next{display:flex;flex-wrap:wrap;align-items:center;column-gap:clamp(14px,2vw,28px)}
  .lens-wrap .ci-tabs{border-top:0;flex:0 0 auto}
  .lens-wrap .lens-cap{border-top:0;flex:1 1 0;min-width:0;flex-wrap:nowrap}
  .lens-wrap .lens-cap .lc-t{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .lens-wrap .lens-cap .lc-n{display:none} /* the count is in the screen reader text; there is no room for it on one line */
  .lens-wrap .lens-cap .lc-a{white-space:nowrap}
  .lens-wrap .ci-panel{flex:1 0 100%}
  .lens-lab{display:none}
}
@media (prefers-reduced-motion:reduce){.colour-field .mat,.colour-field .mat img,.ci-im img,.ci-m img{transition:none}.ci-panel:not([hidden]){animation:none}}
