/* atelier chroma. everything here is drawn in css, no images.
   the 3 hues are registered @property angles so switching palette fades
   every gradient instead of snapping */

/* registered props, needed so the angles/percentages can animate */
@property --hue-a { syntax: '<angle>'; inherits: true; initial-value: 30deg; }
@property --hue-b { syntax: '<angle>'; inherits: true; initial-value: 340deg; }
@property --hue-c { syntax: '<angle>'; inherits: true; initial-value: 78deg; }
@property --chroma { syntax: '<number>'; inherits: true; initial-value: 0.19; }

@property --spin  { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --spin2 { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --sheen { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --wave  { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --glow  { syntax: '<length>'; inherits: false; initial-value: 0px; }

/* tokens. accents are all oklch() off the 3 hues, nothing hardcoded */
:root {
  color-scheme: dark;

  /* accents */
  --a:        oklch(74% var(--chroma) var(--hue-a));
  --b:        oklch(68% var(--chroma) var(--hue-b));
  --c:        oklch(80% calc(var(--chroma) * 0.85) var(--hue-c));
  --a-deep:   oklch(46% calc(var(--chroma) * 0.9) var(--hue-a));
  --b-deep:   oklch(40% calc(var(--chroma) * 0.9) var(--hue-b));
  --a-soft:   oklch(74% var(--chroma) var(--hue-a) / .16);
  --b-soft:   oklch(68% var(--chroma) var(--hue-b) / .16);

  /* surfaces, tinted with hue-b so the greys follow the palette too */
  --ink:      oklch(13% 0.024 var(--hue-b));
  --ink-2:    oklch(17% 0.030 var(--hue-b));
  --ink-3:    oklch(22% 0.036 var(--hue-b));
  --paper:    oklch(96% 0.012 var(--hue-c));
  --text:     oklch(94% 0.014 var(--hue-c));
  --muted:    oklch(72% 0.022 var(--hue-c) / .72);
  --line:     oklch(70% 0.04 var(--hue-b) / .18);

  /* type */
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Inter, Roboto, sans-serif;
  --mono:  ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* motion */
  --spring: linear(0, .009 1.2%, .036 2.5%, .143 5.3%, .31 8.5%, .84 16.5%,
                   1.02 20%, 1.07 23.5%, 1.03 30%, .995 40%, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io:  cubic-bezier(.65, 0, .35, 1);

  /* mouse position, atelier.js updates these */
  --mx: 50%;
  --my: 40%;

  /* animates the hues when the palette changes */
  transition: --hue-a 1.1s var(--ease-io),
              --hue-b 1.1s var(--ease-io),
              --hue-c 1.1s var(--ease-io),
              --chroma 1.1s var(--ease-io);
}

/* palettes, the radios restyle :root through :has() */
html:has(#pal-abyss:checked)   { --hue-a: 238deg; --hue-b: 296deg; --hue-c: 196deg; --chroma: .17; }
html:has(#pal-verdant:checked) { --hue-a: 148deg; --hue-b:  96deg; --hue-c: 196deg; --chroma: .16; }
html:has(#pal-orchid:checked)  { --hue-a: 322deg; --hue-b: 282deg; --hue-c: 160deg; --chroma: .19; }

/* base */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(15px, 0.4vw + 14px, 17px);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .9s var(--ease-io), color .9s var(--ease-io);
  /* faint background glow so nothing looks flat */
  background-image:
    radial-gradient(120vw 80vh at 12% -10%, var(--a-soft), transparent 60%),
    radial-gradient(90vw 70vh at 92% 8%, var(--b-soft), transparent 62%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; }
code, pre { font-family: var(--mono); font-size: .84em; }
a { color: inherit; }

::selection { background: var(--b); color: oklch(14% .03 var(--hue-b)); }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.svg-defs { position: absolute; width: 0; height: 0; pointer-events: none; }

/* grain + vignette. the noise is an svg data uri, tiled */
.grain {
  position: fixed; inset: -50%;
  z-index: 9000; pointer-events: none;
  opacity: .32;
  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='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grain-shift 1.1s steps(6) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate3d(0,0,0); }
  20%  { transform: translate3d(-3%, 2%, 0); }
  40%  { transform: translate3d(2%, -3%, 0); }
  60%  { transform: translate3d(-2%, -2%, 0); }
  80%  { transform: translate3d(3%, 1%, 0); }
  100% { transform: translate3d(0,0,0); }
}

.vignette {
  position: fixed; inset: 0; z-index: 8999; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 40%, transparent 42%, oklch(8% .03 var(--hue-b) / .55) 100%);
  transition: background .9s var(--ease-io);
}

/* scroll progress bar, pure css scroll timeline */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 9100;
  background: var(--line);
}
.progress > i {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--a), var(--b) 55%, var(--c));
  box-shadow: 0 0 16px var(--b);
}
@supports (animation-timeline: scroll()) {
  .progress > i {
    animation: fill-bar linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes fill-bar { to { transform: scaleX(1); } }

/* header */
.bar {
  position: sticky; top: 3px; z-index: 8000;
  display: flex; align-items: center; gap: clamp(12px, 3vw, 40px);
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  background: color-mix(in oklab, var(--ink) 62%, transparent);
  border-bottom: 1px solid var(--line);
}

.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark-glyph {
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(from var(--spin), var(--a), var(--b), var(--c), var(--a));
  box-shadow: 0 0 0 1px var(--line), 0 0 18px -2px var(--b);
  animation: sweep 9s linear infinite;
}
.mark-text { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .02em; }
.mark-text em {
  font-style: normal;
  background: linear-gradient(92deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.bar-nav { margin-left: auto; display: flex; gap: clamp(10px, 2vw, 26px); }
.bar-nav a {
  position: relative; text-decoration: none; font-size: .84rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 4px 0; transition: color .35s;
}
/* underline grows from the middle */
.bar-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--a), var(--b));
  transform: scaleX(0); transition: transform .45s var(--ease-out);
}
.bar-nav a:hover { color: var(--text); }
.bar-nav a:hover::after { transform: scaleX(1); }

@keyframes sweep { to { --spin: 360deg; } }

/* hero */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 92svh;
  display: grid; place-items: center;
  padding: clamp(60px, 12vh, 140px) clamp(16px, 5vw, 40px);
}

/* aurora: 4 big blurred blobs moving around in screen blend */
.aurora { position: absolute; inset: -15%; z-index: -2; filter: blur(70px) saturate(1.4); }
.blob {
  position: absolute; width: 46vmax; aspect-ratio: 1; border-radius: 50%;
  mix-blend-mode: screen; opacity: .55;
  offset-rotate: 0deg;
}
.b1 { background: radial-gradient(circle, var(--a) 0 38%, transparent 70%);
      offset-path: path('M 0 0 C 240 -120, 520 140, 300 360 S -120 300, 0 0'); animation: travel 26s var(--ease-io) infinite; }
.b2 { background: radial-gradient(circle, var(--b) 0 36%, transparent 70%);
      offset-path: path('M 400 80 C 120 40, -40 300, 220 420 S 640 260, 400 80'); animation: travel 33s var(--ease-io) infinite reverse; }
.b3 { background: radial-gradient(circle, var(--c) 0 30%, transparent 68%);
      offset-path: path('M 160 300 C 400 420, 700 120, 420 -40 S 0 120, 160 300'); animation: travel 41s var(--ease-io) infinite; }
.b4 { background: radial-gradient(circle, var(--a-deep) 0 42%, transparent 72%);
      offset-path: path('M 520 240 C 300 460, -60 200, 180 40 S 700 60, 520 240'); animation: travel 47s var(--ease-io) infinite reverse; }
@keyframes travel { to { offset-distance: 100%; } }

/* spotlight that follows the mouse */
.spotlight {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(28vmax 28vmax at var(--mx) var(--my),
              oklch(92% .12 var(--hue-c) / .16), transparent 64%);
  transition: background .18s linear;
}

/* rings growing outward forever */
.rings { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; }
.rings i {
  position: absolute; width: 34vmax; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line);
  animation: pulse-ring 7s var(--ease-out) infinite;
}
.rings i:nth-child(2) { animation-delay: -2.33s; }
.rings i:nth-child(3) { animation-delay: -4.66s; }
@keyframes pulse-ring {
  from { scale: .35; opacity: 0; }
  25%  { opacity: .9; }
  to   { scale: 1.6; opacity: 0; }
}

.hero-inner { position: relative; max-width: 60rem; text-align: center; }

.eyebrow {
  margin: 0 0 22px; font-size: .78rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow span {
  color: var(--text); padding: 4px 10px; margin-right: 8px; border-radius: 99px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--a) 12%, transparent);
}

/* headline. atelier.js splits it into letters so each gets an --i,
   the entrance and the float both use transform so animation-composition: add
   lets them stack */
.kinetic {
  margin: 0;
  font-size: clamp(3rem, 13vw, 9.5rem);
  line-height: .92;
  letter-spacing: -0.04em;
  filter: drop-shadow(0 14px 40px oklch(60% .2 var(--hue-b) / .35));
}
/* each letter picks its colour from its index, so the rainbow moves
   across the word. colour is on the letters because background-clip: text
   doesn't follow transformed children */
.kinetic .ch {
  display: inline-block;
  white-space: pre;
  transform-origin: 50% 100%;
  /* mix the palette's own colours so a letter never goes off-palette */
  --blend: calc(var(--i) * 7%);
  color: color-mix(in oklch,
           color-mix(in oklch, var(--a), var(--c) var(--blend)),
           var(--b) var(--wave));
  animation:
    letter-in 1.15s var(--spring) backwards,
    letter-float 6s ease-in-out infinite,
    hue-wave 7s ease-in-out infinite alternate;
  animation-composition: replace, add, replace;
  animation-delay: calc(var(--i) * 42ms), calc(var(--i) * -180ms), calc(var(--i) * -430ms);
}
/* registered as a percentage so the mix can animate */
@keyframes hue-wave {
  from { --wave: 0%; }
  to   { --wave: 38%; }
}
@keyframes letter-in {
  from { transform: translateY(.7em) rotate(8deg) scale(.86); opacity: 0; filter: blur(10px); }
  to   { transform: none; opacity: 1; filter: blur(0); }
}
@keyframes letter-float {
  50% { transform: translateY(-.045em); }
}

.lede {
  max-width: 46rem; margin: 28px auto 0;
  font-size: clamp(1rem, .4vw + .95rem, 1.16rem);
  color: var(--muted);
  text-wrap: pretty;
}
.lede strong { color: var(--text); font-weight: 500; }

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 38px; }

/* buttons: gradient border + a shine on hover */
.cta {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-block; padding: 14px 30px; border-radius: 99px;
  text-decoration: none; font-size: .92rem; letter-spacing: .04em;
  color: oklch(15% .03 var(--hue-b));
  background: linear-gradient(100deg, var(--a), var(--b));
  box-shadow: 0 10px 30px -10px var(--b), inset 0 1px 0 oklch(100% 0 0 / .35);
  transition: transform .5s var(--spring), box-shadow .5s var(--ease-out);
}
.cta::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 20%, oklch(100% 0 0 / .55) 50%, transparent 80%);
  translate: -120% 0; transition: translate .7s var(--ease-out);
}
.cta:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 18px 44px -12px var(--b); }
.cta:hover::before { translate: 120% 0; }
.cta:active { transform: translateY(0) scale(.99); }

.cta.ghost {
  color: var(--text); background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  /* gradient border trick with 2 backgrounds */
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(100deg, var(--a), var(--b), var(--c));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-width: 1px; border-style: solid;
}
.cta.ghost:hover { box-shadow: 0 14px 34px -16px var(--a); }

.scroll-hint {
  margin: 54px auto 0; width: 22px; height: 36px; border-radius: 99px;
  border: 1px solid var(--line); display: grid; justify-items: center;
}
.scroll-hint span {
  width: 3px; height: 8px; border-radius: 2px; margin-top: 6px;
  background: var(--c);
  animation: hint 1.9s var(--ease-io) infinite;
}
@keyframes hint {
  0%   { translate: 0 0; opacity: 0; }
  30%  { opacity: 1; }
  100% { translate: 0 14px; opacity: 0; }
}

/* section headers */
main > section { padding: clamp(70px, 12vh, 130px) clamp(16px, 5vw, 48px); }

.console-head { max-width: 62rem; margin: 0 auto clamp(34px, 6vh, 64px); }

.section-title {
  display: flex; align-items: baseline; gap: 16px;
  margin: 0 0 12px; font-size: clamp(1.9rem, 4.5vw, 3.2rem); line-height: 1.05;
}
.section-title .idx {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .2em;
  color: transparent;
  background: linear-gradient(90deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text;
  /* little line after the number */
  position: relative; padding-right: 34px;
}
.section-title .idx::after {
  content: ''; position: absolute; right: 0; bottom: .42em; width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--b), transparent);
}
.section-sub { margin: 0; max-width: 46rem; color: var(--muted); text-wrap: pretty; }
.section-sub code, .tech code {
  padding: 1px 6px; border-radius: 5px;
  background: color-mix(in oklab, var(--b) 14%, transparent);
  border: 1px solid var(--line); color: var(--text);
}

/* titles wipe in as you scroll (view timeline) */
@supports (animation-timeline: view()) {
  .console-head, .manifesto, .tiers, .stage {
    animation: rise-in linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 34%;
  }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(46px) scale(.985); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
/* fallback when view() isn't supported, atelier.js adds .in-view */
@supports not (animation-timeline: view()) {
  .js .console-head, .js .manifesto, .js .tiers, .js .stage, .js .piece {
    opacity: 0; transform: translateY(46px);
    transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  }
  .js .in-view { opacity: 1; transform: none; }
}

/* palette picker */
.console { position: relative; }

.palettes {
  border: 0; margin: 0 auto; padding: 0; max-width: 62rem;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.palettes input { position: absolute; opacity: 0; pointer-events: none; }

.chip {
  cursor: pointer; display: grid; gap: 4px;
  padding: 18px 18px 16px; border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--ink-2) 70%, transparent);
  transition: transform .5s var(--spring), border-color .4s, background .6s, box-shadow .5s;
}
.chip:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--a) 45%, transparent); }

/* each chip shows its own palette, not the current one */
.chip-swatch {
  height: 46px; border-radius: 12px; margin-bottom: 8px;
  background: conic-gradient(from var(--spin),
              oklch(74% .19 var(--sa)), oklch(68% .19 var(--sb)),
              oklch(80% .16 var(--sc)), oklch(74% .19 var(--sa)));
  animation: sweep 12s linear infinite;
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .12);
}
#pal-solaris + .chip { --sa: 30deg;  --sb: 340deg; --sc: 78deg;  }
#pal-abyss   + .chip { --sa: 238deg; --sb: 296deg; --sc: 196deg; }
#pal-verdant + .chip { --sa: 148deg; --sb: 96deg;  --sc: 196deg; }
#pal-orchid  + .chip { --sa: 322deg; --sb: 282deg; --sc: 160deg; }

.chip-name { font-family: var(--serif); font-size: 1.1rem; }
.chip-meta { font-family: var(--mono); font-size: .72rem; color: var(--muted); letter-spacing: .06em; }

.palettes input:checked + .chip {
  border-color: transparent;
  background:
    linear-gradient(var(--ink-2), var(--ink-2)) padding-box,
    linear-gradient(120deg, var(--a), var(--b), var(--c)) border-box;
  box-shadow: 0 18px 46px -22px var(--b), 0 0 0 1px transparent;
  transform: translateY(-4px);
}
.palettes input:checked + .chip .chip-swatch { box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .3), 0 0 24px -6px currentColor; }

.readout {
  max-width: 62rem; margin: 20px auto 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
}
.readout code { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; }
.readout-bar {
  flex: 1 1 160px; height: 6px; border-radius: 99px; min-width: 120px;
  background: linear-gradient(90deg, var(--a), var(--b), var(--c), var(--a));
  box-shadow: 0 0 20px -6px var(--b);
}

/* gallery */
.gallery-wrap { position: relative; }

.gallery {
  max-width: 78rem; margin: 0 auto;
  display: grid; gap: clamp(18px, 2.4vw, 32px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  perspective: 1400px;
}

/* hovering one piece dims the others */
.gallery:has(.piece:hover) .piece:not(:hover) {
  filter: saturate(.25) brightness(.72);
}
/* shrink on .frame, on .piece it fights the entrance animation */
.gallery:has(.piece:hover) .piece:not(:hover) .frame { transform: scale(.97); }

.piece {
  container-type: inline-size;
  container-name: piece;
  transform-style: preserve-3d;
  transition: filter .6s var(--ease-out), transform .6s var(--ease-out);
}

/* pieces deal in one after another as you scroll */
@supports (animation-timeline: view()) {
  .piece {
    animation: deal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 26%;
  }
}
@keyframes deal-in {
  from { opacity: 0; translate: 0 60px; rotate: x 14deg; scale: .94; }
  to   { opacity: 1; translate: 0 0;    rotate: x 0deg;  scale: 1;   }
}

.frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
  box-shadow: 0 24px 60px -34px oklch(5% .02 var(--hue-b) / .9),
              inset 0 0 0 1px oklch(100% 0 0 / .04);
  transition: box-shadow .6s var(--ease-out), transform .7s var(--spring);
  transform-style: preserve-3d;
}
/* glass reflection over the canvas */
.frame::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(150deg, oklch(100% 0 0 / .16) 0 22%, transparent 42% 70%, oklch(100% 0 0 / .06));
  opacity: .7; transition: opacity .6s, translate .8s var(--ease-out);
}
.piece:hover .frame {
  transform: perspective(900px) rotateX(7deg) rotateY(-7deg) translateZ(26px);
  box-shadow: 0 40px 80px -34px oklch(5% .02 var(--hue-b)),
              0 0 60px -24px var(--b);
}
.piece:hover .frame::after { translate: 12% 0; opacity: .45; }

.art { position: absolute; inset: 0; }

.plate {
  padding: 16px 4px 0;
  display: grid; gap: 2px;
}
.plate h3 { margin: 0; font-size: 1.22rem; }
.tech { margin: 0; font-size: .78rem; color: var(--muted); }

.open {
  justify-self: start; margin-top: 10px;
  font: inherit; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 99px; cursor: pointer;
  color: var(--text); background: transparent;
  border: 1px solid var(--line);
  transition: border-color .4s, background .4s, letter-spacing .4s var(--ease-out);
}
.open:hover {
  border-color: color-mix(in oklab, var(--a) 60%, transparent);
  background: color-mix(in oklab, var(--a) 12%, transparent);
  letter-spacing: .18em;
}

/* container query: smaller plate when the card is narrow */
@container piece (max-width: 240px) {
  .plate h3 { font-size: 1.05rem; }
  .tech { display: none; }
  .frame { aspect-ratio: 1; }
}

/* the artworks, one element each */

/* solaris: the conic start angle spins, not the disc */
.art-solaris {
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%,
    oklch(26% calc(var(--chroma) * .5) var(--hue-a)) 0, var(--ink) 64%);
}
.art-solaris::before {
  content: ''; width: 72%; aspect-ratio: 1; border-radius: 50%;
  background:
    /* hot core, then the sweep under it */
    radial-gradient(circle, oklch(99% .06 var(--hue-c)) 0 13%, transparent 14%),
    conic-gradient(from var(--spin),
      var(--a) 0deg, var(--c) 62deg, var(--b) 148deg,
      var(--a-deep) 232deg, var(--b) 300deg, var(--a) 360deg);
  animation: sweep 14s linear infinite;
  box-shadow: 0 0 70px -8px var(--a), 0 0 140px -24px var(--b);
}
/* corona glow on top */
.art-solaris::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, oklch(92% .14 var(--hue-c) / .45) 0 14%, transparent 46%);
  mix-blend-mode: screen; filter: blur(12px);
  animation: corona 5s ease-in-out infinite;
}
@keyframes corona { 50% { transform: scale(1.22); opacity: .6; } }

/* moiré: 2 conic gradients with slightly different spokes make the rings */
.art-moire {
  background:
    repeating-conic-gradient(from var(--spin) at 50% 50%,
      var(--a) 0 3deg, transparent 3deg 6deg),
    repeating-conic-gradient(from calc(var(--spin) * -1.7) at 50% 50%,
      var(--b) 0 3.4deg, transparent 3.4deg 6.8deg),
    radial-gradient(circle, var(--ink-3), var(--ink));
  background-blend-mode: screen, screen, normal;
  animation: sweep 40s linear infinite;
  filter: contrast(1.25) saturate(1.2);
}
.art-moire::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, transparent 30%, var(--ink) 82%);
}

/* duotone */
.art-duotone { background: linear-gradient(200deg, var(--a-deep), var(--b-deep) 70%); isolation: isolate; }
.art-duotone::before, .art-duotone::after { content: ''; position: absolute; inset: -20%; }
.art-duotone::before {
  background:
    radial-gradient(58% 52% at 30% 28%, var(--a) 0, transparent 64%),
    radial-gradient(52% 48% at 74% 72%, var(--b) 0, transparent 66%),
    linear-gradient(30deg, var(--b-deep), transparent 72%);
  mix-blend-mode: hard-light;
  animation: sway 13s var(--ease-io) infinite;
}
.art-duotone::after {
  background:
    repeating-linear-gradient(115deg, var(--c) 0 1px, transparent 1px 15px),
    radial-gradient(56% 56% at 52% 80%, var(--c) 0, transparent 62%);
  mix-blend-mode: color-dodge; opacity: .3;
  animation: sway 17s var(--ease-io) infinite reverse;
}
@keyframes sway {
  33%  { transform: translate3d(6%, -4%, 0) rotate(4deg) scale(1.08); }
  66%  { transform: translate3d(-5%, 5%, 0) rotate(-3deg) scale(1.04); }
}

/* fracture: polygon morph, every keyframe needs the same point count */
.art-fracture {
  background: linear-gradient(140deg, var(--ink-3), var(--ink));
  display: grid; place-items: center;
}
.art-fracture::before {
  content: ''; width: 78%; aspect-ratio: 1;
  background: conic-gradient(from calc(var(--spin) + 20deg), var(--b), var(--a), var(--c), var(--b));
  clip-path: polygon(50% 2%, 88% 24%, 96% 66%, 62% 97%, 20% 88%, 3% 46%);
  animation: sweep 11s linear infinite, fracture 6.5s infinite;
  animation-timing-function: linear, var(--spring);
  box-shadow: 0 0 60px -12px var(--b);
}
@keyframes fracture {
  0%,100% { clip-path: polygon(50% 2%, 88% 24%, 96% 66%, 62% 97%, 20% 88%, 3% 46%); }
  33%     { clip-path: polygon(28% 8%, 92% 12%, 78% 58%, 90% 92%, 34% 84%, 10% 38%); }
  66%     { clip-path: polygon(50% 14%, 72% 6%, 98% 52%, 54% 92%, 12% 70%, 22% 24%); }
}
.art-fracture::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, oklch(100% 0 0 / .045) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

/* annulus: rings cut out with mask subtract */
.art-annulus {
  background: conic-gradient(from var(--spin), var(--a), var(--b), var(--c), var(--a));
  -webkit-mask-image:
    radial-gradient(circle at 50% 50%, #000 0 46%, transparent 46.6%),
    radial-gradient(circle at 50% 50%, #000 0 34%, transparent 34.6%),
    radial-gradient(circle at 50% 50%, #000 0 24%, transparent 24.6%),
    radial-gradient(circle at 50% 50%, #000 0 14%, transparent 14.6%);
  mask-image:
    radial-gradient(circle at 50% 50%, #000 0 46%, transparent 46.6%),
    radial-gradient(circle at 50% 50%, #000 0 34%, transparent 34.6%),
    radial-gradient(circle at 50% 50%, #000 0 24%, transparent 24.6%),
    radial-gradient(circle at 50% 50%, #000 0 14%, transparent 14.6%);
  /* subtract then add, alternating rings */
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: sweep 20s linear infinite reverse, breathe-mask 8s var(--ease-io) infinite;
}
@keyframes breathe-mask { 50% { scale: 1.07; filter: hue-rotate(22deg); } }
/* dark plate behind the rings */
.piece:nth-child(5) .frame { background: radial-gradient(circle at 50% 45%, var(--ink-3), var(--ink) 72%); }

/* orbit: dots on an offset-path, offset-rotate keeps them aligned */
.art-orbit {
  background:
    radial-gradient(circle at 50% 50%, var(--ink-3), var(--ink) 70%),
    conic-gradient(from 0deg, var(--a-soft), var(--b-soft), var(--a-soft));
  display: grid; place-items: center;
}
.art-orbit::before {
  content: ''; width: 62%; aspect-ratio: 1; border-radius: 50%;
  border: 1px dashed var(--line);
  background: radial-gradient(circle at 40% 36%, var(--c) 0 9%, transparent 10%),
              radial-gradient(circle, var(--a-deep) 0 30%, transparent 62%);
  box-shadow: 0 0 50px -14px var(--a);
  animation: slow-turn 26s linear infinite;
}
.sat {
  position: absolute; width: 11px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(98% .05 var(--hue-c)), var(--b) 72%);
  box-shadow: 0 0 16px 2px var(--b);
  offset-path: path('M 12 118 C 60 -8, 176 -8, 224 118 C 176 244, 60 244, 12 118');
  offset-rotate: auto;
  animation: travel 9s linear infinite;
}
.sat:nth-of-type(2) { animation-duration: 13s; animation-delay: -4s; width: 8px;
  background: radial-gradient(circle at 35% 30%, oklch(98% .05 var(--hue-c)), var(--a) 72%); box-shadow: 0 0 14px 2px var(--a); }
.sat:nth-of-type(3) { animation-duration: 17s; animation-delay: -9s; width: 6px;
  background: var(--c); box-shadow: 0 0 12px 2px var(--c); }
@keyframes slow-turn { to { rotate: 360deg; } }

/* caustics: gradient through an svg displacement filter */
.art-caustics {
  background: var(--ink);
}
/* bigger than the frame so the wobbly edges stay hidden */
.art-caustics::before {
  content: ''; position: absolute; inset: -14%;
  background: repeating-linear-gradient(48deg, var(--a) 0 6px, var(--b) 6px 12px, var(--c) 12px 18px);
  filter: url(#liquid) saturate(1.35) contrast(1.15);
  animation: drift-bg 22s var(--ease-io) infinite alternate;
}
@keyframes drift-bg { to { background-position: 120px 60px; transform: scale(1.12); } }
.art-caustics::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 42%, var(--ink) 92%);
}

/* ink bloom: blurred blobs in screen blend */
.art-bloom { background: var(--ink); overflow: hidden; }
.art-bloom::before, .art-bloom::after {
  content: ''; position: absolute; inset: -30%;
  filter: blur(26px); mix-blend-mode: screen;
}
.art-bloom::before {
  background:
    radial-gradient(34% 30% at 32% 40%, var(--b) 0, transparent 70%),
    radial-gradient(28% 26% at 66% 62%, var(--a) 0, transparent 72%);
  animation: bloom-drift 19s var(--ease-io) infinite, bloom-breathe 4.2s ease-in-out infinite;
  animation-composition: replace, add;
}
.art-bloom::after {
  background:
    radial-gradient(30% 28% at 58% 30%, var(--c) 0, transparent 70%),
    radial-gradient(40% 34% at 40% 76%, var(--a-deep) 0, transparent 74%);
  opacity: .8;
  animation: bloom-drift 27s var(--ease-io) infinite reverse, bloom-breathe 6.1s ease-in-out infinite;
  animation-composition: replace, add;
}
@keyframes bloom-drift {
  33%  { transform: translate3d(9%, -7%, 0) rotate(40deg); }
  66%  { transform: translate3d(-8%, 8%, 0) rotate(-30deg); }
}
@keyframes bloom-breathe { 50% { transform: scale(1.12); } }

/* popover info sheets. @starting-style + allow-discrete for the
   open/close animation */
.sheet {
  width: min(560px, 92vw);
  padding: 30px 32px 26px;
  border: 1px solid var(--line); border-radius: 20px;
  background: color-mix(in oklab, var(--ink-2) 88%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  color: var(--text);
  box-shadow: 0 50px 100px -40px oklch(4% .02 var(--hue-b)), 0 0 70px -40px var(--b);

  opacity: 0; scale: .92; translate: 0 24px; filter: blur(8px);
  transition:
    opacity .5s var(--ease-out), scale .5s var(--spring),
    translate .5s var(--spring), filter .5s var(--ease-out),
    display .5s allow-discrete, overlay .5s allow-discrete;
}
.sheet:popover-open { opacity: 1; scale: 1; translate: 0 0; filter: blur(0); }
@starting-style {
  .sheet:popover-open { opacity: 0; scale: .92; translate: 0 24px; filter: blur(8px); }
}
.sheet::backdrop {
  background: oklch(6% .02 300 / .55);
  backdrop-filter: blur(6px);
  transition: opacity .5s var(--ease-out), display .5s allow-discrete, overlay .5s allow-discrete;
  opacity: 0;
}
.sheet:popover-open::backdrop { opacity: 1; }
@starting-style { .sheet:popover-open::backdrop { opacity: 0; } }

.sheet h3 {
  margin: 0 0 10px; font-size: 1.5rem;
  background: linear-gradient(92deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sheet p { margin: 0 0 16px; color: var(--muted); text-wrap: pretty; }
.sheet code { color: var(--text); }
.sheet pre {
  margin: 0 0 20px; padding: 14px 16px; overflow-x: auto;
  border-radius: 12px; border: 1px solid var(--line);
  background: oklch(10% .02 var(--hue-b) / .6);
  line-height: 1.55; color: var(--c);
}
.close {
  font: inherit; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 18px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: background .35s, border-color .35s;
}
.close:hover { background: color-mix(in oklab, var(--b) 16%, transparent); border-color: var(--b); }

/* rotunda: panels rotated by index and pushed out on Z, real 3d */
.rotunda { overflow: clip; }

.stage {
  position: relative;
  height: clamp(340px, 46vh, 520px);
  perspective: 1200px;
  perspective-origin: 50% 42%;
  display: grid; place-items: center;
}

.cylinder {
  --radius: 340px;
  --count: 9;
  position: relative;
  width: 200px; height: 260px;
  transform-style: preserve-3d;
  animation: rotunda-turn 34s linear infinite;
}
@keyframes rotunda-turn {
  from { transform: rotateX(-6deg) rotateY(0deg); }
  to   { transform: rotateX(-6deg) rotateY(-360deg); }
}
/* stops turning on hover */
.stage:hover .cylinder { animation-play-state: paused; }

.panel {
  position: absolute; inset: 0; margin: 0;
  transform:
    rotateY(calc(var(--n) * (360deg / var(--count))))
    translateZ(var(--radius));
  backface-visibility: hidden;
  display: grid; gap: 10px; justify-items: center;
}

/* each panel gets its own slice of the palette + a sheen */
.panel span {
  display: block; width: 100%; height: 216px; border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px oklch(4% .02 var(--hue-b)), inset 0 0 0 1px oklch(100% 0 0 / .06);
  background:
    linear-gradient(calc(var(--n) * 40deg), oklch(100% 0 0 / .18), transparent 46%),
    conic-gradient(from calc(var(--spin) + var(--n) * 40deg) at 50% 50%,
      var(--a), var(--b) 35%, var(--c) 62%, var(--a-deep) 82%, var(--a)),
    var(--ink-2);
  animation: sweep calc(16s + var(--n) * 1s) linear infinite;
  filter: saturate(1.15);
}
/* alternate masks so it doesn't look repeated */
.panel:nth-child(3n) span {
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0 52%, transparent 53%);
  mask-image: radial-gradient(circle at 50% 45%, #000 0 52%, transparent 53%);
}
.panel:nth-child(3n+2) span {
  clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
}
.panel figcaption {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
}

/* floor reflection */
.floor {
  position: absolute; bottom: 4%; left: 50%; translate: -50% 0;
  width: min(760px, 88vw); height: 120px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%,
    color-mix(in oklab, var(--b) 30%, transparent) 0, transparent 70%);
  filter: blur(26px);
  animation: floor-pulse 9s var(--ease-io) infinite;
}
@keyframes floor-pulse { 50% { opacity: .6; transform: scaleX(1.1); } }

/* manifesto: the text gets revealed by a mask as you scroll */
.manifesto { display: grid; place-items: center; }
.wipe {
  max-width: 42rem; margin: 0; text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.4vw, 2.6rem); line-height: 1.34;
  text-wrap: balance;
  background: linear-gradient(100deg, var(--a), var(--c) 40%, var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@supports (animation-timeline: view()) {
  .wipe {
    -webkit-mask-image: linear-gradient(100deg, #000 0 25%, oklch(0% 0 0 / .18) 42%, oklch(0% 0 0 / .18) 100%);
    mask-image: linear-gradient(100deg, #000 0 25%, oklch(0% 0 0 / .18) 42%, oklch(0% 0 0 / .18) 100%);
    -webkit-mask-size: 420% 100%; mask-size: 420% 100%;
    -webkit-mask-position: 100% 0; mask-position: 100% 0;
    animation: wipe-reveal linear both;
    animation-timeline: view();
    animation-range: entry 20% cover 62%;
  }
}
@keyframes wipe-reveal {
  to { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
}

/* editions (the shop part) */
.tiers {
  max-width: 72rem; margin: 0 auto;
  display: grid; gap: clamp(16px, 2vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: start;
}

.tier {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 28px 26px 26px; border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--ink-2) 76%, transparent);
  transition: transform .6s var(--spring), box-shadow .6s var(--ease-out), border-color .5s;
}
/* conic ring, only shows on hover through the mask */
.tier::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--spin), var(--a), var(--b), var(--c), var(--a));
  opacity: 0; transition: opacity .6s var(--ease-out);
  animation: sweep 6s linear infinite;
  -webkit-mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000);
  -webkit-mask-clip: content-box, border-box;
  mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000);
  mask-clip: content-box, border-box;
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px;
}
.tier:hover { transform: translateY(-8px); box-shadow: 0 40px 80px -40px oklch(4% .02 var(--hue-b)); }
.tier:hover::before { opacity: 1; }

.tier.featured {
  background:
    linear-gradient(var(--ink-2), var(--ink-2)) padding-box,
    linear-gradient(140deg, var(--a), var(--b), var(--c)) border-box;
  border-color: transparent;
  box-shadow: 0 30px 70px -40px var(--b);
}

.ribbon {
  position: absolute; top: 16px; right: -34px;
  transform: rotate(38deg); transform-origin: 50% 50%;
  padding: 5px 40px; font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: oklch(15% .03 var(--hue-b));
  background: linear-gradient(90deg, var(--a), var(--c));
}

.tier h3 { margin: 0 0 4px; font-size: 1.5rem; }
.price { margin: 0 0 18px; display: flex; align-items: baseline; gap: 7px; }
.price .cur { font-size: 1.45rem; color: var(--c); }
.price .num {
  font-size: 2.6rem; font-variant-numeric: tabular-nums; line-height: 1;
  background: linear-gradient(92deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.tier ul { margin: 0 0 24px; padding: 0 0 0 1.1em; display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }
.tier li::marker { content: '◈  '; color: var(--c); }

.buy {
  width: 100%; font: inherit; font-size: .86rem; letter-spacing: .06em;
  padding: 13px 20px; border-radius: 99px; cursor: pointer; border: 0;
  color: oklch(15% .03 var(--hue-b));
  background: linear-gradient(100deg, var(--a), var(--b));
  transition: transform .45s var(--spring), filter .4s, box-shadow .5s;
}
.buy:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 16px 34px -16px var(--b); }
.buy:active { transform: translateY(0) scale(.985); }

/* sold out cards grey themselves out with :has() */
.tier:has([disabled]) { opacity: .62; }
.tier:has([disabled]) .buy {
  background: var(--ink-3); color: var(--muted); cursor: not-allowed;
  text-decoration: line-through; text-decoration-thickness: 1px;
}
.tier:has([disabled]):hover { transform: none; }
.tier[data-soldout] { padding-bottom: 46px; }
.tier[data-soldout]::after {
  content: 'Edition closed'; position: absolute; inset: auto 0 0 0;
  padding: 6px; text-align: center; font-size: .64rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--ink-3) 0 8px, var(--ink-2) 8px 16px);
  border-top: 1px solid var(--line);
}

/* marquee: list is doubled and moves -50% so it loops clean.
   pause with play-state, changing the duration makes it jump */
.marquee {
  overflow: hidden; padding: 22px 0;
  border-block: 1px solid var(--line);
  background: color-mix(in oklab, var(--ink-2) 50%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent);
}
.track {
  display: flex; align-items: center; gap: 26px; width: max-content;
  font-family: var(--mono); font-size: .92rem; letter-spacing: .04em;
  color: var(--muted);
  animation: slide 38s linear infinite;
}
.marquee:hover .track { animation-play-state: paused; }
.track i { color: var(--a); font-style: normal; }
.track span { white-space: nowrap; }
@keyframes slide { to { transform: translateX(-50%); } }

/* footer */
.foot {
  padding: clamp(50px, 9vh, 90px) clamp(16px, 5vw, 48px) 60px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(70vw 40vh at 50% 120%, var(--b-soft), transparent 70%),
    var(--ink);
}
.foot-inner { max-width: 62rem; margin: 0 auto; display: grid; gap: 14px; justify-items: center; text-align: center; }
.foot-mark { margin: 0; font-family: var(--serif); font-size: 1.4rem; }
.foot-mark em {
  font-style: normal;
  background: linear-gradient(92deg, var(--a), var(--b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.foot-note { margin: 0; max-width: 40rem; color: var(--muted); font-size: .9rem; }
.foot-note a, .foot-links a { color: var(--c); text-decoration-color: color-mix(in oklab, var(--c) 40%, transparent); text-underline-offset: 3px; }
.foot-links { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 0; margin: 10px 0 0; font-size: .86rem; }

/* reduced motion: keep the colours, drop the movement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
  .cylinder { animation: none; transform: rotateX(-6deg) rotateY(-20deg); }
  .js .console-head, .js .manifesto, .js .tiers, .js .stage { opacity: 1; transform: none; }
  .wipe {
    -webkit-mask-image: none; mask-image: none;
  }
}

/* phones */
@media (max-width: 640px) {
  /* menu drops to its own row instead of disappearing */
  .bar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 16px 8px; }
  .bar-nav { margin-left: 0; width: 100%; justify-content: space-between; }
  .bar-nav a { font-size: .72rem; letter-spacing: .1em; }

  .eyebrow { font-size: .7rem; letter-spacing: .2em; }
  .eyebrow span { display: table; margin: 0 auto 10px; }
  .scroll-hint { margin-top: 36px; }

  main > section { padding: 56px 16px; scroll-margin-top: 30px; }
  .console-head { margin-bottom: 28px; }
  .section-title { gap: 12px; }

  /* 4 palettes as a 2x2 grid, not 4 big stacked cards */
  .palettes { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .chip { padding: 12px 12px 10px; border-radius: 14px; }
  .chip-swatch { height: 32px; margin-bottom: 6px; border-radius: 9px; }
  .chip-name { font-size: 1rem; }
  .chip-meta { font-size: .64rem; }

  /* 2 columns, the piece container query squares the frames */
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .open { padding: 6px 10px; font-size: .68rem; letter-spacing: .08em; }
  .open:hover { letter-spacing: .08em; }
  /* no hover on touch, a tap shouldn't leave the others greyed out */
  .gallery:has(.piece:hover) .piece:not(:hover) { filter: none; }
  .gallery:has(.piece:hover) .piece:not(:hover) .frame,
  .piece:hover .frame { transform: none; }

  /* smaller cylinder or the side panels go off screen */
  .stage { height: 300px; perspective: 900px; }
  .cylinder { --radius: 165px; width: 112px; height: 160px; }
  .panel span { height: 126px; border-radius: 10px; }
  .panel figcaption { font-size: .56rem; letter-spacing: .14em; }

  .tier { padding: 24px 20px 22px; }
  .tier:hover { transform: none; }

  .sheet { padding: 24px 20px 20px; max-height: 86svh; overflow-y: auto; }
  .sheet h3 { font-size: 1.3rem; }
}
