/* ==========================================================================
   ONCE. A gallery wall, interrupted by bold bands in today's colour.
   --today is sampled from the piece and swapped per drop. Every colour,
   font and size is a token; the .tone-* classes re-skin a whole section.
   ========================================================================== */

:root {
  --today: #e0612a;       /* sampled from today's piece: the tarp orange */
  --today-ink: #000000;   /* text on --today */

  --bg: #eeede8;          /* gallery wall */
  --surface: #ffffff;
  --fg: #000000;
  --muted: #5f5d57;
  --line: rgb(0 0 0 / .14);
  --accent: var(--today);
  --accent-ink: var(--today-ink);

  --display: "Archivo", system-ui, sans-serif;
  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --narrow: 62%;          /* font-stretch of the ONCE logo, clock and names */

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --section: clamp(5rem, 12vw, 11rem);
  --max: 92rem;
  --mat: clamp(.9rem, 2.2vw, 2.1rem);   /* the white border around hung art */
  --ease-door: cubic-bezier(.76, 0, .12, 1);
  --ease-out: cubic-bezier(.16, .84, .24, 1);
}

/* Bold bands. Each one swaps the tokens, so everything inside follows. */
.tone-today {
  --bg: var(--today); --fg: var(--today-ink); --surface: color-mix(in srgb, var(--today-ink) 8%, transparent);
  --muted: color-mix(in srgb, var(--today-ink) 68%, transparent); --line: color-mix(in srgb, var(--today-ink) 24%, transparent);
  --accent: var(--today-ink); --accent-ink: var(--today);
}
.tone-ink {
  --bg: #000000; --fg: #f1f0ec; --surface: #151515; --muted: #a3a09a; --line: rgb(255 255 255 / .18);
}
.tone-tomorrow {   /* tomorrow's piece: bronze and bread */
  --bg: #2b2018; --fg: #f3e7d2; --surface: #3a2c21; --muted: #bba88b; --line: rgb(243 231 210 / .18);
  --accent: #d9a35a; --accent-ink: #2b2018;
}
[class*="tone-"] { background: var(--bg); color: var(--fg); }

/* Other days' colours, to try the idea (footer buttons or ?palette=). */
[data-palette="ilic"] { --today: #1d4f9c; --today-ink: #ffffff; }
[data-palette="night"] {
  --bg: #14110e; --surface: #1f1b17; --fg: #ebe7dd; --muted: #9b968b; --line: rgb(235 231 221 / .16);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--display);
  font-variant-numeric: tabular-nums;
}
/* Film grain over everything. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
h2, h3 { font-weight: 850; font-stretch: var(--narrow); line-height: .9; letter-spacing: -.015em; text-wrap: balance; }
i { font-family: var(--serif); font-style: italic; font-weight: 400; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
/* Sections are full-bleed; their content is centred by the padding. */
main > section { padding: var(--section) max(var(--gutter), calc((100% - var(--max)) / 2)); }
.muted { color: var(--muted); }
.small { font-size: .875rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; text-align: center;
  padding: .9em 1.4em;
  border: 1px solid var(--accent); border-radius: 0;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1rem/1 var(--display); font-stretch: 90%;
  text-decoration: none; cursor: pointer;
  transition: background .25s, color .25s, border-color .25s;
}
.btn:hover { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn:disabled { background: transparent; border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-big { width: 100%; padding: 1.1em 1.4em; font-size: 1.125rem; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }

/* ---------- Bar ---------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.5rem);
  height: 3.75rem; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  animation: fade .9s ease 1.8s backwards;
}
.logo { font: 900 1.9rem/1 var(--display); font-stretch: var(--narrow); letter-spacing: -.02em; text-decoration: none; }
.bar nav { display: flex; gap: 1.5rem; font-size: .875rem; }
.bar nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.bar nav a:hover { color: var(--fg); }
.bar-status { margin-left: auto; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.bar-status strong { margin-left: .35em; color: var(--fg); font-weight: 750; }
.bar .btn { padding: .65em 1em; font-size: .875rem; }
.bar .btn:disabled { display: none; }

/* ---------- Hero: the piece, hung over a blur of itself ---------- */

.hero {
  --fg: #ffffff; --muted: rgb(255 255 255 / .78); --line: rgb(255 255 255 / .3);
  --accent: #ffffff; --accent-ink: #000000;
  position: relative; isolation: isolate; overflow: clip;
  min-height: calc(100svh - 3.75rem);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  background: #000; color: var(--fg);
}
main > .hero { padding-block: clamp(5rem, 13svh, 8rem) clamp(2.5rem, 7svh, 5rem); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; max-width: none; object-fit: cover;
  filter: blur(50px) saturate(1.8) brightness(.78); scale: 1.3;
  animation: fade 2.2s ease .1s backwards;
}

.hero-art { position: relative; justify-self: center; width: min(100%, calc(60svh * 1.25 + 2 * var(--mat))); }
.hero-art img {
  width: 100%;
  border: var(--mat) solid #fff;
  box-shadow: 0 2px 3px rgb(0 0 0 / .3), 0 45px 80px -30px rgb(0 0 0 / .75);
  animation: open 1.9s var(--ease-door) .25s backwards;
  transition: filter 1.2s;
}
/* The wire and nail it hangs from. */
.wire {
  position: absolute; left: 22%; bottom: 100%; width: 56%; height: clamp(2.5rem, 9svh, 5.5rem);
  overflow: visible; animation: fade 1s ease 2s backwards;
}
.wire path { fill: none; stroke: rgb(255 255 255 / .8); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.hero-art::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + clamp(2.5rem, 9svh, 5.5rem));
  width: .6rem; aspect-ratio: 1; border-radius: 50%; translate: -50% 50%;
  background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .4);
  animation: fade 1s ease 2s backwards;
}

@keyframes open {
  0% { clip-path: inset(49.7% 50% 49.7% 50%); }
  32% { clip-path: inset(49.7% 0 49.7% 0); }
  100% { clip-path: inset(0); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { translate: 0 100%; clip-path: inset(0 0 100% 0); } to { translate: 0 0; clip-path: inset(0); } }
.rise { animation: rise .95s var(--ease-out) var(--d, 1.3s) backwards; }

.hero-info { display: grid; gap: clamp(1.5rem, 4svh, 2.5rem); }
.hero-clock {
  display: flex; align-items: flex-start; gap: .06em;
  font: 900 clamp(4.5rem, min(9.4vw, 17svh), 12rem)/.8 var(--display); font-stretch: var(--narrow);
  letter-spacing: -.02em; white-space: nowrap;
}
.hero-clock-label { padding-top: .1em; font-size: max(.8rem, .085em); line-height: 1.05; font-weight: 700; letter-spacing: 0; }
.hero-artist { margin-bottom: .35rem; font: 850 clamp(1.75rem, 2.6vw, 2.5rem)/1 var(--display); font-stretch: var(--narrow); }
.hero-work i { font-size: 1.25em; }
.hero-price { font: 900 clamp(2.5rem, 4vw, 3.5rem)/.9 var(--display); font-stretch: var(--narrow); }
.hero-deal { max-width: 26rem; }
.hero-deal .muted { margin: .45rem 0 1.1rem; font-size: .9375rem; }

/* Sold state, set on <body> by app.js */
.is-sold .hero-art img { filter: grayscale(1); }
.is-sold .hero-clock-label { display: none; }

/* ---------- Manifesto ---------- */

.manifesto h2 { font-size: clamp(4.5rem, 15vw, 14rem); line-height: .82; letter-spacing: -.03em; }
.manifesto > p {
  max-width: 17ch; margin-top: .4em;
  font: 850 clamp(2.4rem, 6.6vw, 6.5rem)/.95 var(--display); font-stretch: var(--narrow); letter-spacing: -.015em;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .light { animation: light linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
  }
}
@keyframes light { from { opacity: .12; } }

.rules {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem;
  margin: clamp(5rem, 11vw, 10rem) 0 0; padding: 0; list-style: none;
}
.rules li { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.rules h3 { margin-bottom: .75rem; font-size: 1.6rem; line-height: 1; }
.rules p { max-width: 36ch; color: var(--muted); }

.curve { position: relative; height: 4.5rem; margin-top: 1.75rem; }
.curve svg { display: block; width: 100%; height: 100%; overflow: visible; }
.curve path { fill: none; vector-effect: non-scaling-stroke; stroke: currentColor; }
.curve .past { stroke-width: 2; }
.curve .future { stroke-width: 1; stroke-dasharray: 3 5; opacity: .5; }
.curve-dot {
  position: absolute; left: calc(var(--x, 0) * 100%); top: calc(var(--y, 0) * 100%);
  translate: 0 -50%; padding-left: 1rem;
  font-size: .8125rem; font-weight: 700; white-space: nowrap;
}
.curve-dot::before {
  content: ""; position: absolute; left: 0; top: 50%; translate: -50% -50%;
  width: .65rem; aspect-ratio: 1; border-radius: 50%; background: currentColor;
}
.curve-dot.flip { padding: 0 1rem 0 0; translate: -100% -50%; }
.curve-dot.flip::before { left: 100%; }

/* ---------- The piece ---------- */

.piece-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 3rem clamp(2rem, 6vw, 6rem); }
.piece-head h2 { font: italic 400 clamp(3.5rem, 9vw, 9rem)/.92 var(--serif); letter-spacing: -.02em; }
.piece-why > p { max-width: 54ch; font-size: 1.125rem; }
.specs { margin: 2rem 0 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }

.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2.25rem); margin-top: clamp(4rem, 8vw, 7rem); }
.crop { aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); }
.crop img { width: 100%; height: 100%; max-width: none; object-fit: none; object-position: var(--pos); transition: scale 1.4s var(--ease-out); }
.details figure:hover .crop img { scale: 1.06; }
.details figcaption { margin-top: 1rem; max-width: 28ch; font: italic 400 1.3rem/1.25 var(--serif); }

/* ---------- The artist ---------- */

.artist-name { font-size: clamp(4rem, 15.5vw, 15rem); font-weight: 900; line-height: .8; letter-spacing: -.035em; }
.artist-line { margin-top: 2rem; max-width: 36ch; font: italic 400 clamp(1.4rem, 2.4vw, 2.1rem)/1.25 var(--serif); }
.artist-body {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 3rem clamp(2rem, 6vw, 6rem);
  margin-top: clamp(3.5rem, 8vw, 7rem);
}
.facts { margin: 0; border-top: 1px solid var(--line); align-self: start; }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.bio { max-width: 62ch; font-size: 1.125rem; }
.bio p + p { margin-top: 1.2em; }

.pull p { max-width: 19ch; font: italic 400 clamp(2.4rem, 6.4vw, 6.5rem)/1.03 var(--serif); letter-spacing: -.01em; text-wrap: balance; }

main > .qa { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 2rem clamp(2rem, 6vw, 6rem); }
.qa h2 { font-size: clamp(2.4rem, 4.5vw, 4rem); }
.qa dl { margin: 0; }
.qa dl div { padding: 0 0 2rem; }
.qa dl div + div { padding-top: 2rem; border-top: 1px solid var(--line); }
.qa dt { color: var(--muted); }
.qa dd { margin: .5rem 0 0; font: italic 400 clamp(1.6rem, 3vw, 2.6rem)/1.15 var(--serif); }

/* ---------- Tomorrow ---------- */

main > .tomorrow { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); }
.tomorrow-art { position: relative; overflow: hidden; cursor: crosshair; }
.tomorrow-art img { width: 100%; }
.peek-blur { filter: blur(30px) saturate(1.2); scale: 1.2; }
.peek-sharp {
  position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0;
  mask: radial-gradient(circle 4.5rem at var(--mx, -10rem) var(--my, -10rem), #000 95%, transparent);
  transition: opacity .35s;
}
.tomorrow-art:hover .peek-sharp { opacity: 1; }
.tomorrow h2 { font-size: clamp(4rem, 12vw, 11rem); font-weight: 900; line-height: .8; letter-spacing: -.03em; }
.redacted { display: flex; flex-wrap: wrap; gap: .25em; margin-top: 1.5rem; font-size: clamp(2.2rem, 5vw, 4.25rem); }
.redacted span { display: block; width: var(--w); height: .75em; background: var(--fg); }
.reveal { margin-top: 1.75rem; color: var(--muted); }
.reveal strong { display: block; color: var(--fg); font: 900 clamp(2.5rem, 5vw, 4.25rem)/1 var(--display); font-stretch: var(--narrow); }
.hints { max-width: 48ch; margin: 2rem 0 2.5rem; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.hints li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.peek-hint { margin-top: 1rem; }
@media (hover: none) { .peek-hint { display: none; } }

/* ---------- The gone ---------- */

.gone h2 { font-size: clamp(4rem, 14vw, 13rem); font-weight: 900; line-height: .8; letter-spacing: -.03em; }
.gone-sum { margin-top: 2rem; max-width: 22ch; font: italic 400 clamp(1.8rem, 4vw, 3.4rem)/1.1 var(--serif); }
.gone-stats { margin-top: 1rem; max-width: 52ch; color: var(--muted); }
.gone-list {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3rem 1.75rem;
  margin: clamp(3.5rem, 7vw, 6rem) 0 0; padding: 0; list-style: none;
}
.past-frame { aspect-ratio: 4 / 5; margin-bottom: 1.25rem; padding: 12%; background: var(--surface); }
.past-frame img {
  width: 100%; height: 100%; object-fit: contain;
  filter: grayscale(1); opacity: .8; transition: filter .7s, opacity .7s;
}
.past:hover .past-frame img, .past:focus-within .past-frame img { filter: none; opacity: 1; }
.past-when { font-size: .8125rem; color: var(--muted); }
.past h3 { margin: .35rem 0 .3rem; font-size: 1.6rem; }
.past-title { font-size: .9375rem; }
.past-title i { font-size: 1.15em; }
.past-bio { margin-top: .6rem; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.past-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.past-stats dt { font-size: .8125rem; color: var(--muted); }
.past-stats dd { margin: 0; font: 850 1.5rem/1.05 var(--display); font-stretch: var(--narrow); }
.past-note { font-size: .8125rem; color: var(--muted); }

/* ---------- Newsletter ---------- */

.email h2 { font-size: clamp(3.5rem, 10vw, 10rem); font-weight: 900; line-height: .82; letter-spacing: -.03em; }
.email-lede { margin-top: 1.75rem; max-width: 44ch; font-size: 1.25rem; line-height: 1.45; }
.email-form { max-width: 60rem; margin-top: 3rem; }
.email-form label { display: block; margin-bottom: .25rem; color: var(--muted); font-size: .875rem; }
.email-row { display: flex; flex-wrap: wrap; align-items: end; gap: 1.25rem 2rem; margin-bottom: .75rem; }
.email-row input {
  flex: 1 1 20rem; min-width: 0; padding: .3em 0;
  border: 0; border-bottom: 1px solid var(--fg); border-radius: 0;
  background: transparent; color: var(--fg);
  font: italic 400 clamp(1.6rem, 3.2vw, 2.75rem)/1.2 var(--serif);
}
.email-row input::placeholder { color: var(--muted); }
.email-row input:focus-visible { outline: none; border-bottom-color: var(--accent); }
.email-row .btn { flex: 0 1 auto; width: auto; }
.email-done { margin-top: 3rem; font: italic 400 clamp(1.8rem, 3.5vw, 3rem)/1.1 var(--serif); }

/* ---------- For artists ---------- */

.artists h2 { max-width: 14ch; font-size: clamp(3rem, 7vw, 6.5rem); }
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem 2.5rem; margin: 3rem 0; padding: 0; list-style: none; }
.terms li { padding-top: 1rem; border-top: 1px solid var(--line); font-size: 1.125rem; }

/* ---------- Questions ---------- */

.faq > * { max-width: 64rem; }
.faq h2 { margin-bottom: 2.5rem; font-size: clamp(3rem, 7vw, 6.5rem); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 0;
  list-style: none; cursor: pointer;
  font: 800 clamp(1.4rem, 2.4vw, 2rem)/1.05 var(--display); font-stretch: var(--narrow);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 300; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { max-width: 60ch; padding-bottom: 1.5rem; color: var(--muted); }

/* ---------- Footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem 2.5rem;
  padding: 2rem var(--gutter) 2.5rem; font-size: .875rem;
}
.foot .logo { width: 100%; font-size: min(47vw, 44rem); line-height: .74; letter-spacing: -.04em; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.palettes { margin-left: auto; }
.palettes button { margin-left: .25rem; padding: .3em .7em; border: 1px solid var(--line); background: none; color: var(--fg); font: inherit; cursor: pointer; }
.palettes button:hover { border-color: var(--fg); }

/* ---------- Buy dialog ---------- */

.buy {
  width: min(32rem, calc(100% - 2rem)); padding: clamp(1.75rem, 4vw, 3rem);
  border: 0; background: var(--surface); color: var(--fg);
}
.buy::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(10px); }
.buy h2 { margin-top: .75rem; font-size: clamp(2.5rem, 6vw, 3.75rem); }
.buy h2 + p { margin-top: 1.25rem; }
.buy-actions { display: grid; gap: .75rem; margin: 2rem 0 1.25rem; }

/* ---------- Smaller screens ---------- */

@media (max-width: 64rem) {
  .bar nav { display: none; }
  .rules { grid-template-columns: minmax(0, 1fr); max-width: 40rem; }
  .piece-head, .artist-body, main > .qa, main > .tomorrow { grid-template-columns: minmax(0, 1fr); }
  .tomorrow-art { max-width: 28rem; }
  .gone-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
  main > .hero { grid-template-columns: minmax(0, 1fr); padding-top: clamp(4.5rem, 12svh, 6rem); }
  .hero-art { width: 100%; }
  .hero-clock { font-size: 22.5vw; }
  .details { grid-template-columns: minmax(0, 1fr); }
  .crop { aspect-ratio: 1; }
}

@media (max-width: 40rem) {
  .bar-status span { display: none; }
  .gone-list {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%;
    overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter);
  }
  .past { scroll-snap-align: start; }
  .past-frame img { filter: none; opacity: 1; }
  .facts div { grid-template-columns: 6rem 1fr; }
  .palettes { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
