/* ============================================================
   WORK SECTION (v2) — Nouver arc drift gallery + project cards
   Palette: deep indigo / violet world (#141126 → #0E0B1E),
   champagne gold #C9A96A used sparingly. NOT orange-led.
   Motion: transform / opacity only. Reveals, settle, parallax
   and float are driven by motion.js; the arc loop is a small
   in-page script that owns .arc-tilt. This file owns the arc
   slot geometry, the hover/tap screenshot travel and the tilt
   surface. No WebGL, no particles.
   ============================================================ */

:root{
  --indigo:#141126;
  --deep:#0E0B1E;
  --deep-2:#0A0817;
  --ink:#F1EDFB;
  --ink-dim:#BDB5D6;
  --ink-faint:#A79FC4;
  --violet:#8B7CF6;
  --gold:#C9A96A;
  --line:rgba(255,255,255,.10);
  --font-d:"Fraunces",Georgia,serif;
  --font-b:"Manrope",system-ui,sans-serif;
  --shot-h:320px;
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:var(--font-b);
  background:var(--deep);
  color:var(--ink);
  line-height:1.6;
  overflow-x:hidden;
}
img{display:block;max-width:100%}

/* ---------- reveal (motion.js toggles .in; .js gate + noscript
   fallback in the page keep content visible without the engine) */
.js [data-reveal]{opacity:0;transform:translateY(28px);transition:opacity .9s ease,transform .9s cubic-bezier(.22,.61,.36,1)}
.js [data-reveal].in{opacity:1;transform:none}

/* ---------- section shell ---------- */
.work{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  padding:clamp(96px,13vh,140px) 0 clamp(110px,14vh,150px);
  background:linear-gradient(180deg,var(--indigo) 0%,var(--deep) 78%,var(--deep) 100%);
}
.wrap{max-width:1180px;margin:0 auto;padding:0 24px;position:relative;z-index:2}

/* ---------- backdrop: dot grid + glows (static layers) ---------- */
.work-bg{position:absolute;inset:0;z-index:0;pointer-events:none}
.work-dots{
  position:absolute;inset:0;
  background-image:radial-gradient(rgba(199,188,255,.14) 1px,transparent 1.5px);
  background-size:22px 22px;
  -webkit-mask-image:radial-gradient(ellipse 90% 72% at 50% 34%,#000 30%,transparent 78%);
          mask-image:radial-gradient(ellipse 90% 72% at 50% 34%,#000 30%,transparent 78%);
}
.work-glow{position:absolute;border-radius:50%}
.glow-violet{
  width:min(880px,90vw);height:min(880px,90vw);
  left:50%;top:-6%;transform:translateX(-50%);
  background:radial-gradient(closest-side,rgba(109,88,246,.22),rgba(109,88,246,.07) 55%,transparent 72%);
}
.glow-gold{
  width:min(620px,70vw);height:min(620px,70vw);
  right:-12%;bottom:-24%;
  background:radial-gradient(closest-side,rgba(201,169,106,.09),transparent 70%);
}

/* ---------- header (centred, Nouver composition) ---------- */
.work-head{text-align:center}
.kicker{
  font-size:.78rem;font-weight:800;letter-spacing:.32em;text-transform:uppercase;
  color:var(--gold);
  display:flex;align-items:center;justify-content:center;gap:16px;
}
.kicker::before,.kicker::after{
  content:"";height:1px;width:min(64px,14vw);
}
.kicker::before{background:linear-gradient(90deg,transparent,rgba(201,169,106,.65))}
.kicker::after{background:linear-gradient(90deg,rgba(201,169,106,.65),transparent)}
.work-head h2{
  font-family:var(--font-d);font-weight:600;letter-spacing:-.01em;
  font-size:clamp(2.6rem,5.6vw,4.3rem);line-height:1.05;
  color:#F5F2FF;margin-top:20px;
  text-shadow:0 6px 40px rgba(4,2,16,.55);
}
.section-sub{
  color:var(--ink-faint);font-size:1.02rem;
  max-width:560px;margin:18px auto 0;
}

/* ============================================================
   FANNED ARC GALLERY — 7 frames across the full width.
   Resting geometry lives on .arc-tilt via per-frame custom
   properties (rotate / drop / scale, origin bottom centre,
   centre frame highest and largest, edges tilt away ±14deg).
   These custom properties are the SLOT PRESETS: the in-page
   arc-loop script measures them (plus each slot's layout centre
   and width) and interpolates them so the frames rotate through
   the fan, writing transform + opacity on .arc-tilt only. The
   CSS transform below is the resting / no-JS / reduced-motion
   pose. .arc-settle keeps the engine's scroll-y fan settle and
   .arc-media keeps its speed / float; .arc-track no longer
   drifts (the loop replaces the sideways scroll drift).
   ============================================================ */
.arc-viewport{
  position:relative;z-index:2;
  margin-top:clamp(44px,6vh,64px);
}
.arc-row{
  display:flex;justify-content:center;align-items:flex-end;
  width:max-content;max-width:none;margin:0 auto;
  padding:26px 4vw 6px;
}
.arc-frame{flex:0 0 auto;position:relative}
.f1{--w:11.5vw;--rot:-14deg;--ty:46px;--sc:.84;z-index:4}
.f2{--w:12.25vw;--rot:-10deg;--ty:29px;--sc:.91;z-index:5}
.f3{--w:13.5vw;--rot:-5deg;--ty:12px;--sc:.97;z-index:6}
.f4{--w:15vw;--rot:0deg;--ty:-6px;--sc:1.07;z-index:7}
.f5{--w:13.5vw;--rot:5deg;--ty:12px;--sc:.97;z-index:6}
.f6{--w:12.25vw;--rot:10deg;--ty:29px;--sc:.91;z-index:5}
.f7{--w:11.5vw;--rot:14deg;--ty:46px;--sc:.84;z-index:4}
.f1,.f2,.f3{margin-right:-1.15vw}
.f5,.f6,.f7{margin-left:-1.15vw}
.arc-tilt{
  transform:rotate(var(--rot)) translateY(var(--ty)) scale(var(--sc));
  transform-origin:50% 100%;
}
.arc-media{
  width:var(--w);max-width:238px;min-width:104px;
  aspect-ratio:3/4;
  overflow:hidden;border-radius:10px;
  border:1px solid rgba(255,255,255,.17);
  background:var(--deep-2);
  box-shadow:0 30px 60px rgba(2,0,14,.58),0 6px 18px rgba(2,0,14,.45),inset 0 1px 0 rgba(255,255,255,.14);
  will-change:transform;
}
.f4 .arc-media{max-width:252px;border-color:rgba(201,169,106,.38)}
.arc-media img{
  width:100%;height:100%;
  object-fit:cover;
}
.arc-legend{
  display:flex;align-items:center;justify-content:center;gap:16px;
  margin-top:clamp(30px,4.5vh,44px);
  font-size:.72rem;font-weight:800;letter-spacing:.3em;text-transform:uppercase;
  color:rgba(189,181,214,.62);
}
.arc-legend i{width:5px;height:5px;border-radius:50%;background:rgba(201,169,106,.75)}

/* ============================================================
   PROJECT CARDS — 3 equal, stacked on mobile. No links.
   .card carries the reveal; .card-tilt carries the JS tilt
   (perspective on the card); .shot is the travel window.
   ============================================================ */
.cards-wrap{margin-top:clamp(64px,9vh,96px)}
.bgword{
  /* no CSS transform here: motion.js owns this element's transform
     (data-scroll-scale), so centring is done with left/right + text-align */
  position:absolute;left:0;right:0;top:36%;
  text-align:center;
  z-index:0;pointer-events:none;user-select:none;
}
.bgword span{
  display:block;
  font-family:var(--font-d);font-weight:700;
  font-size:clamp(9rem,24vw,21rem);line-height:1;letter-spacing:.02em;
  color:transparent;
  -webkit-text-stroke:1px rgba(167,159,255,.16);
  opacity:.55;
  will-change:transform;
}
.grid-work{
  position:relative;z-index:1;
  display:grid;grid-template-columns:repeat(3,1fr);gap:26px;
}
.card{
  perspective:1000px;
  border-radius:24px;
}
.card-tilt{
  height:100%;
  background:linear-gradient(168deg,rgba(255,255,255,.065),rgba(255,255,255,.032) 55%,rgba(139,124,246,.05));
  border:1px solid var(--line);
  border-radius:24px;
  padding:14px;
  box-shadow:0 24px 54px rgba(2,0,14,.42),inset 0 1px 0 rgba(255,255,255,.09);
  transform-style:preserve-3d;
  transition:transform .15s ease-out,border-color .3s ease;
}
.card:hover .card-tilt,.card:focus-within .card-tilt{border-color:rgba(201,169,106,.45)}

/* screenshot window: hero of the full page, travel on hover/tap.
   The inner wrapper is oversized by 56px so its data-speed
   parallax never exposes an edge inside the well. */
.shot{
  position:relative;
  height:var(--shot-h);
  overflow:hidden;border-radius:14px;
  background:var(--deep-2);
  outline:none;
}
.shot:focus-visible{box-shadow:0 0 0 2px var(--deep),0 0 0 4px var(--gold)}
.shot-bar{
  position:absolute;top:0;left:0;right:0;height:26px;z-index:3;
  display:flex;align-items:center;gap:6px;padding:0 12px;
  background:linear-gradient(180deg,rgba(8,6,20,.55),rgba(8,6,20,0));
  pointer-events:none;
}
.shot-bar i{width:7px;height:7px;border-radius:50%;background:rgba(255,255,255,.38)}
.shot-bar i:first-child{background:rgba(201,169,106,.75)}
.shot-par{
  position:relative;
  height:calc(100% + 56px);
  margin-top:-28px;
  will-change:transform;
}
.shot img{
  width:100%;height:auto;
  /* return trip (this transition governs when hover/focus ends) */
  transition:transform .8s cubic-bezier(.25,.6,.25,1);
  will-change:transform;
}
.card:hover .shot img,
.card:focus-within .shot img,
.shot.tapped img{
  /* +28px repays the parallax wrapper's -28px offset, so the image
     bottom lands exactly on the well bottom at full travel */
  transform:translateY(calc(-100% + var(--shot-h) + 28px));
  transition:transform 5.5s cubic-bezier(.25,.6,.25,1);
}
.shot::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:44px;z-index:2;
  background:linear-gradient(180deg,transparent,rgba(8,6,20,.42));
  pointer-events:none;
}

.card-meta{padding:22px 8px 10px}
.card-meta h3{
  font-family:var(--font-d);font-weight:600;
  font-size:1.55rem;line-height:1.15;color:#F5F1FF;
}
.card-cat{
  font-size:.72rem;font-weight:800;letter-spacing:.2em;text-transform:uppercase;
  color:var(--gold);margin:8px 0 10px;
}
.card-line{color:var(--ink-dim);font-size:.95rem;line-height:1.65}

/* ---------- tablet: cards stay 3-up until they cannot breathe ---------- */
@media (max-width:1020px){
  .grid-work{gap:20px}
  :root{--shot-h:280px}
}

/* ---------- mobile: 5 arc frames, flattened fan, stacked cards ---------- */
@media (max-width:768px){
  :root{--shot-h:300px}
  .f1,.f7{display:none}
  .f2{--w:20vw;--rot:-8deg;--ty:17px;--sc:.94}
  .f3{--w:23vw;--rot:-4deg;--ty:6px;--sc:.98}
  .f4{--w:26vw;--rot:0deg;--ty:-2px;--sc:1.02}
  .f5{--w:23vw;--rot:4deg;--ty:6px;--sc:.98}
  .f6{--w:20vw;--rot:8deg;--ty:17px;--sc:.94}
  .arc-media{min-width:0;border-radius:8px}
  .arc-row{padding:18px 3vw 4px}
  .f2,.f3{margin-right:-2vw}
  .f5,.f6{margin-left:-2vw}
  .arc-legend{gap:12px;font-size:.64rem;letter-spacing:.24em}
  .grid-work{grid-template-columns:1fr;gap:40px}
  .bgword span{font-size:clamp(7rem,38vw,11rem)}
  .work-dots{background-size:18px 18px}
}

@media (max-width:420px){
  :root{--shot-h:260px}
  .work-head h2{font-size:2.35rem}
}

/* ---------- reduced motion: everything composed and readable ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js [data-reveal]{opacity:1;transform:none;transition:none}
  .card-tilt{transition:none}
  .shot img{transition:none}
  .card:hover .shot img,
  .card:focus-within .shot img,
  .shot.tapped img{
    /* travel stays reachable, as an instant jump cut */
    transform:translateY(calc(-100% + var(--shot-h) + 28px));
    transition:none;
  }
}
