/* ============================================================
   WAI ORA GALLERY · WISPC 2026 · design source for Codex
   Layout concept: three staggered columns, wall to wall
   (Pixieset column layout). Photographs keep their true ratios
   at full column width; each is followed by a quote tile of the
   same width. Columns start at different heights so seams never
   line up. The wall rises slowly. Nothing tilts, nothing zooms.
   ============================================================ */
:root{
  --wall:#f5f2ec;      /* ground and seams */
  --ink:#1b1917;
  --ink-2:#6f685e;
  --rule:rgba(27,25,23,.14);
  --plate:#e6e0d6;     /* image placeholder ground */
  --tile:#ebe6dd;      /* quote tile, paper */
  --tile-ink:#1b1917;
  --water:#2f5a66;     /* accent quote tile, Waikato river */
  --water-ink:#f3efe8;
  --scrim:rgba(245,242,236,.92);
  --f-display:"Cormorant Garamond",Georgia,"Times New Roman",serif;
  --f-sans:"Manrope","Helvetica Neue",Arial,sans-serif;
  --f-ui:"Inter","Helvetica Neue",Arial,sans-serif;
  /* motion */
  --seam:6px;              /* gap between tiles */
  --t-reveal:1400ms;       /* photo comes up as its row enters */
  --t-quote:900ms;         /* quote tile follows */
  --d-quote:360ms;
  --t-breathe:26s;         /* feature photos: scale 1 → 1.03 */
  --t-ui:320ms;
  --ease-out:cubic-bezier(.22,.61,.36,1);
  --ease-soft:cubic-bezier(.2,.7,.2,1);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --wall:#121110; --ink:#ece7df; --ink-2:#948c80; --rule:rgba(236,231,223,.14);
    --plate:#2a2724; --tile:#1f1d1a; --tile-ink:#ece7df; --water:#274a55; --water-ink:#eef2f1;
    --scrim:rgba(18,17,16,.92); color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --wall:#121110; --ink:#ece7df; --ink-2:#948c80; --rule:rgba(236,231,223,.14);
  --plate:#2a2724; --tile:#1f1d1a; --tile-ink:#ece7df; --water:#274a55; --water-ink:#eef2f1;
  --scrim:rgba(18,17,16,.92); color-scheme:dark;
}

html,body{height:100%}
body{margin:0;background:var(--wall);color:var(--ink);font-family:var(--f-ui);
  -webkit-font-smoothing:antialiased;overflow:hidden}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
button:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--water);outline-offset:4px}

/* ---------- stage: the wall fills it, chrome floats over ---------- */
.stage{position:relative;height:100%}
.wall{position:absolute;inset:0;overflow:hidden}
.track{position:absolute;left:0;right:0;top:0;display:flex;gap:var(--seam);align-items:flex-start}
.col{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:var(--seam);will-change:transform}

.cell{position:relative;flex:none;overflow:hidden;background:var(--plate);
  width:100%;aspect-ratio:var(--ar);
  opacity:0;transition:opacity var(--t-reveal) var(--ease-out)}
.cell.in{opacity:1}
.cell.photo{cursor:zoom-in}
.cell.photo img,.cell.photo .plate{position:absolute;z-index:0;inset:0;width:100%;height:100%;object-fit:cover;display:block;transform-origin:center}
.cell.photo.feature img,.cell.photo.feature .plate{animation:breathe var(--t-breathe) ease-in-out infinite alternate}
@keyframes breathe{from{transform:scale(1)}to{transform:scale(1.03)}}

/* quote tile: a rectangle hung beside the print */
.cell.quote{background:var(--tile);color:var(--tile-ink);container-type:inline-size;
  transition-duration:var(--t-quote);transition-delay:var(--d-quote)}
.cell.quote.accent{background:var(--water);color:var(--water-ink)}
.cell.quote .inner{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:space-between;
  padding:7.5cqw 7.5cqw 7cqw;gap:1em}
.cell.quote q{quotes:"\201C" "\201D";font-family:var(--f-display);font-style:italic;font-weight:400;
  font-size:clamp(17px,8.6cqw,46px);line-height:1.18;text-wrap:pretty;display:block}
.cell.quote .who{font-family:var(--f-sans);font-size:clamp(9px,3cqw,12px);letter-spacing:.14em;
  text-transform:uppercase;line-height:1.7;opacity:.78}
.cell.quote .who b{font-weight:600;display:block;opacity:1}
.cell.quote.accent .who{opacity:.85}

/* floating chrome */
.mast,.bar{position:absolute;left:0;right:0;z-index:5;display:flex;align-items:baseline;gap:1.5rem;
  justify-content:space-between;
  padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px));
  font-family:var(--f-sans);font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--ink);transition:opacity 600ms var(--ease-soft);pointer-events:none}
.mast{top:0;padding-block:20px 48px;background:linear-gradient(var(--wall) 0%,color-mix(in srgb,var(--wall) 70%,transparent) 55%,transparent)}
.bar{bottom:0;padding-block:48px 20px;background:linear-gradient(transparent,color-mix(in srgb,var(--wall) 70%,transparent) 45%,var(--wall))}
.mast > *,.bar > *{pointer-events:auto}
.mast .mark{font-weight:600}
.mast .theme{font-family:var(--f-display);font-style:italic;text-transform:none;letter-spacing:0;
  font-size:clamp(16px,1.4vw,20px)}
.mast .venue{display:none;color:var(--ink-2)}
@media (min-width:900px){.mast .venue{display:block}}
.bar nav{display:flex;gap:1.75rem}
.bar button{letter-spacing:.14em;text-transform:uppercase;padding:10px 0;color:var(--ink-2);
  border-bottom:1px solid transparent;transition:color var(--t-ui),border-color var(--t-ui)}
.bar button:hover{color:var(--ink);border-bottom-color:var(--rule)}
.bar .count{font-variant-numeric:tabular-nums}
.stage.idle .mast,.stage.idle .bar{opacity:0}

/* sample plates: replace with real <img> from the upload system */
.plate{display:grid;place-items:center;color:rgba(255,255,255,.72);font-family:var(--f-sans);
  font-size:10px;letter-spacing:.18em;text-transform:uppercase;text-align:center;padding:12px;
  background-image:radial-gradient(120% 90% at 20% 15%,rgba(255,255,255,.18),transparent 60%),
    linear-gradient(160deg,var(--c1),var(--c2))}
.plate::after{content:"";position:absolute;inset:0;opacity:.35;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
.plate span{position:relative;z-index:1}
.h0{--c1:#4b6b74;--c2:#1f3038}.h1{--c1:#8d7a5c;--c2:#3e3426}.h2{--c1:#5f7760;--c2:#22302a}
.h3{--c1:#7a5f63;--c2:#2d2326}.h4{--c1:#3f5f7a;--c2:#1a2733}.h5{--c1:#9a8a6a;--c2:#4a4030}

/* ---------- overlays ---------- */
.overlay{position:fixed;inset:0;z-index:20;background:var(--scrim);backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);display:flex;flex-direction:column;animation:fade var(--t-ui) var(--ease-soft)}
@keyframes fade{from{opacity:0}}
.overlay .head{display:flex;justify-content:space-between;align-items:baseline;flex:none;padding-block:20px 0;
  padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px));
  font-family:var(--f-sans);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-2)}
.overlay .head button{padding:10px 0;border-bottom:1px solid transparent}
.overlay .head button:hover{color:var(--ink);border-bottom-color:var(--rule)}

/* browse: the same staggered columns, scrolled by hand */
.grid{flex:1;overflow:auto;padding-block:24px 40px;
  padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px))}
.grid .track{position:static;display:flex;gap:var(--seam);align-items:flex-start}
.grid .cell{opacity:1;animation:rise 520ms var(--ease-out) both;animation-delay:var(--i)}
@keyframes rise{from{opacity:0;transform:translateY(8px)}}

/* lightbox: print and quote tile side by side, same height */
.light .body{flex:1;min-height:0;display:flex;justify-content:center;align-items:center;gap:var(--seam);
  padding-block:16px 24px;
  padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px))}
.light .cell{opacity:1;width:auto;height:var(--lh);aspect-ratio:var(--ar);max-width:100%;flex:none}
.light .cell.photo{animation:print 480ms var(--ease-soft)}
.light .cell.quote{animation:fade 320ms var(--ease-soft) 160ms both}
@keyframes print{from{opacity:0;transform:scale(.985)}}
.light .arrows{display:flex;gap:1.75rem}
.light .arrows button,.light .idx{font-family:var(--f-sans);font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--ink-2);padding:10px 0;border-bottom:1px solid transparent;font-variant-numeric:tabular-nums}
.light .arrows button:hover{color:var(--ink);border-bottom-color:var(--rule)}

@media (max-width:760px){
  .mast,.bar,.overlay .head,.grid{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .mast{padding-block:14px 36px}.bar{padding-block:36px 14px}
  .bar nav{gap:1.1rem}
  .light .body{flex-direction:column;gap:var(--seam)}
  .light .cell{height:auto;width:100%;max-height:48vh}
  .light .cell.quote{aspect-ratio:auto;min-height:150px}
  .light .cell.quote .inner{position:relative;padding:20px}
}

/* ---------- reduced motion: a still wall you step through ---------- */
@media (prefers-reduced-motion:reduce){
  .cell,.cell.quote{transition:none;opacity:1}
  .cell.photo.feature img,.cell.photo.feature .plate,.overlay,.grid .cell,.light .cell{animation:none}
}

/* Integration safeguards; source tokens, column rules and timing are unchanged. */
.stage.is-paused .cell.photo.feature img,.stage.is-paused .cell.photo.feature .plate{animation-play-state:paused}
.light .cell.photo.feature img,.light .cell.photo.feature .plate{animation-play-state:paused}
.cell.quote .inner{overflow:hidden}
.cell.quote q,.cell.quote .who{overflow-wrap:anywhere;flex-shrink:0}
.cell.quote .who{margin-top:auto}
.gallery-status{width:100%;min-height:100vh;margin:0;display:grid;place-items:center;padding:24px;text-align:center;font:14px var(--f-sans);color:var(--ink-2)}
.stage.idle:focus-within .mast,.stage.idle:focus-within .bar{opacity:1}

/* Each person travels as one story. Repeated loop copies have enough space
   between them to keep the same person out of two visible positions. */
.wall .col{gap:0}
.cycle{display:flex;flex-direction:column;gap:var(--seam);flex:none;width:100%}
.cycle-gap{flex:none;width:100%;pointer-events:none}
.story{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--photo-h) var(--quote-h);
  gap:var(--seam);height:var(--story-h);flex:none;min-width:0;width:100%}
.story .cell{width:100%;height:100%;min-height:0;min-width:0;aspect-ratio:auto}
.story .photo img{object-fit:contain;background:var(--plate)}
.story.quote-left,.story.quote-right{grid-template-columns:minmax(0,56fr) minmax(0,44fr);grid-template-rows:minmax(0,1fr)}
.story.quote-left{grid-template-columns:minmax(0,44fr) minmax(0,56fr)}
.story:not(.stacked) .quote q{font-size:clamp(20px,8cqw,44px)}
.story.stacked .quote .inner{padding:clamp(18px,4cqw,34px) clamp(20px,5cqw,44px);gap:.7em}
.story.stacked .quote q{font-size:clamp(20px,5.2cqw,38px);line-height:1.18}
.story.stacked .quote .who{font-size:clamp(10px,2.3cqw,12px)}
.wall .col.is-swapping .cell{opacity:0}
@media (prefers-reduced-motion:reduce){.wall .col.is-swapping .cell{opacity:1}}
