/* Paint the Facts — product page. The page is the artworks' own dark canvas (the app's Theme.swift):
   paintings float on it without frames, and every colour beyond pearl text comes from a pigment. */

@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }

:root {
  --page: #02080e;
  --sheet: #030d17;
  --ink: #eee1cb;
  --body: rgb(238 225 203 / .8);
  --muted: #94a6b3;
  --rule: rgb(148 166 179 / .18);
  --accent: #fcca1f;
  --on-accent: #0c1c2c;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 84px);
  --max: 1320px;
  --section: clamp(112px, 18vh, 220px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, .55vw + 14px, 20px);
  line-height: 1.55;
  font-weight: 400;
  font-optical-sizing: auto;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 15px/1 var(--round); text-decoration: none; }
.skip-link:focus { top: 12px; }

/* The one WebGL canvas, behind all the text. paint.js adds it. */
.stage { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; }
main, .footer { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section) 0; }

h1, h2 { font-weight: 330; font-variation-settings: "opsz" 72; letter-spacing: -.028em; text-wrap: balance; }
h2 { font-size: clamp(38px, 4.6vw + 12px, 80px); line-height: 1.02; max-width: 15ch; }
h3 { font-family: var(--round); font-weight: 650; font-size: 19px; line-height: 1.3; letter-spacing: -.005em; }
p { text-wrap: pretty; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 var(--gutter);
  font-family: var(--round); font-size: 15px;
  transition: background-color .4s, box-shadow .4s, backdrop-filter .4s;
}
.nav.is-scrolled { background: rgb(2 8 14 / .58); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 1px 0 var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a, .nav-company { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav nav a:hover, .nav-company:hover { color: var(--ink); }
.nav-company { padding-left: 24px; border-left: 1px solid var(--rule); }

/* ---------- Living artworks ---------- */
.art { position: relative; aspect-ratio: 1; }
.art img {
  width: 100%;
  /* As a plain picture, its own canvas fades into the page at the edges. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
  transition: opacity .5s;
}
.webgl .art.is-live img, .webgl .hero-art:not(.is-fallback) img { opacity: 0; }

.mark { flex: none; width: 18px; height: 18px; background: var(--c); -webkit-mask: var(--m, radial-gradient(circle, #000 45%, transparent 50%)) center / contain no-repeat; mask: var(--m, radial-gradient(circle, #000 45%, transparent 50%)) center / contain no-repeat; }
.tile-name { font-family: var(--round); font-weight: 650; font-size: 16px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { font-family: var(--round); font-size: 13.5px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: clamp(48px, 9vh, 112px); }
.hero-art { position: absolute; top: 50%; right: max(-3vw, calc(50% - 50vw)); width: min(62vw, 96vh); translate: 0 -44%; }
.hero-copy { position: relative; }
.hero h1 { font-size: clamp(58px, 9.6vw, 164px); line-height: .9; letter-spacing: -.04em; max-width: 8ch; }
.lede { margin-top: clamp(20px, 2.4vw, 34px); max-width: 30ch; font-size: clamp(19px, .9vw + 12px, 25px); line-height: 1.45; color: var(--body); }
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; font: 600 15px/1 var(--round); color: var(--ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(252 202 31 / .16); }
.hero-label { position: absolute; right: 0; bottom: clamp(48px, 9vh, 112px); display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center; width: auto; max-width: none; justify-content: end; }
.hero-label .tile-meta { grid-column: 2; }

/* ---------- Intros ---------- */
.intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 28px; align-items: end; }
.intro h2 { grid-column: 1 / span 7; }
.intro p { grid-column: 8 / -1; color: var(--body); max-width: 44ch; }

/* ---------- Four worlds ---------- */
.worlds-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); margin-top: clamp(56px, 9vh, 112px); }
.world { display: flex; flex-direction: column; }
.world:nth-child(2) { margin-top: clamp(40px, 9vw, 150px); }
.world:nth-child(3) { margin-top: clamp(16px, 3vw, 50px); }
.world:nth-child(4) { margin-top: clamp(64px, 13vw, 220px); }
.world .art { width: 118%; margin-left: -9%; }
.world h3 { margin-top: 14px; font-size: 21px; }
.world p { margin-top: 6px; color: var(--body); font-size: .92em; max-width: 30ch; }

/* ---------- Scrollytelling (paint, depth) ---------- */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); column-gap: clamp(24px, 4vw, 72px); margin-top: clamp(24px, 5vh, 64px); }
.scrolly-stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding-top: 48px; }
.stage-art { width: min(100%, 70svh); }
.steps { padding-block: 30svh 36svh; }
.step { min-height: 68svh; display: flex; flex-direction: column; justify-content: center; max-width: 34ch; transition: opacity .5s; }
.js .step { opacity: .28; }
.js .step.is-active { opacity: 1; }
.step-label { display: flex; align-items: center; gap: 10px; font: 600 14px/1 var(--round); color: var(--muted); letter-spacing: .01em; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 14px var(--c); }
.step h3 { margin-top: 14px; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 48; font-size: clamp(28px, 1.6vw + 14px, 40px); line-height: 1.08; letter-spacing: -.02em; }
.step p:last-child { margin-top: 12px; color: var(--body); }

.palette { display: flex; gap: clamp(8px, 1.2vw, 16px); }
.drop { display: block; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 42% 38%, color-mix(in srgb, var(--d, #888) 100%, white 25%), var(--d, #888) 46%, transparent 70%); transition: scale .6s var(--ease); }
.webgl .drop { background: none; }
.palette .drop.is-active { scale: 1.18; }

.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 56px); margin-top: clamp(40px, 8vh, 96px); color: var(--body); font-size: .94em; }
.notes strong { display: block; margin-bottom: 6px; font: 650 18px/1.3 var(--round); color: var(--ink); }

/* ---------- Facts ---------- */
.facts-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: clamp(24px, 5vw, 96px); row-gap: 24px; align-items: start; }
.facts-copy { grid-column: 1; }
.facts-copy p { margin-top: 24px; color: var(--body); max-width: 46ch; }
.facts-copy .facts-count { color: var(--muted); font-size: .92em; }
.facts-art { grid-column: 1; overflow: hidden; border-radius: 20px; }
.focus { position: absolute; border-radius: 14px; box-shadow: 0 0 0 100vmax rgb(2 8 14 / .72), inset 0 0 0 1px rgb(252 202 31 / .55); transition: left .6s var(--ease), top .6s var(--ease), width .6s var(--ease), height .6s var(--ease); pointer-events: none; }
.focus:not([style]) { display: none; }
.elements { grid-column: 2; grid-row: 1 / span 2; align-self: center; border-top: 1px solid var(--rule); }
.elements li { border-bottom: 1px solid var(--rule); }
.elements button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 0; border: 0; background: none; cursor: pointer; text-align: left; font: 650 17px/1.3 var(--round); color: var(--muted); transition: color .2s; }
.elements button:hover, .elements button[aria-expanded="true"] { color: var(--ink); }
.elements .n { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.elements button[aria-expanded="true"] .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.elements li p { padding: 0 0 18px 42px; color: var(--body); max-width: 42ch; }
.js .elements li p { display: none; }
.js .elements button[aria-expanded="true"] + p { display: block; }

/* ---------- Light ---------- */
.light-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 112px); align-items: center; }
.light-copy p { margin-top: 24px; color: var(--body); max-width: 46ch; }
.drops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 28px); }
.drops li { display: flex; flex-direction: column; align-items: center; gap: 12px; font: 600 15px/1 var(--round); color: var(--muted); }
.drop--big { width: clamp(52px, 7vw, 116px); height: clamp(52px, 7vw, 116px); }
.drops li:nth-child(even) { margin-top: clamp(32px, 5vw, 80px); }

/* ---------- Gather ---------- */
.gather-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 112px); align-items: center; }
.gather-copy p { margin-top: 24px; color: var(--body); max-width: 44ch; }
.replay { margin-top: 32px; padding: 12px 20px; border: 1px solid var(--rule); border-radius: 999px; background: rgb(3 13 23 / .6); cursor: pointer; font: 650 15px/1 var(--round); transition: border-color .2s, background-color .2s; }
.replay:hover { border-color: var(--accent); }

/* ---------- Gallery (the mural) ---------- */
.mural { margin-top: clamp(56px, 9vh, 112px); }
.mural-row { display: grid; column-gap: clamp(16px, 2.6vw, 40px); margin-top: clamp(28px, 4vw, 56px); }
.mural-row--1 { grid-template-columns: minmax(0, 1fr); }
.mural-row--1 .tile { width: min(58%, 680px); }
.mural-row--1:nth-of-type(4n + 1) .tile { margin-left: 8%; }
.mural-row--1:nth-of-type(4n + 3) .tile { margin-left: auto; margin-right: 6%; }
.mural-row--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-inline: 4%; column-gap: clamp(32px, 7vw, 120px); }
.mural-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile img { width: 100%; aspect-ratio: 1; }
.tile { will-change: transform; }
.tile figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; row-gap: 2px; align-items: center; margin-top: 4px; padding-inline: 6%; }
.tile .tile-meta { grid-column: 2; }

/* ---------- Details ---------- */
.details-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 112px); }
.details-copy p { margin-top: 24px; color: var(--body); max-width: 40ch; }
.details-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 56px); }
.details-list li { padding: 24px 0 28px; border-top: 1px solid var(--rule); }
.details-list p { margin-top: 8px; color: var(--body); font-size: .94em; }

/* ---------- Download ---------- */
.download { padding-bottom: var(--section); }
.download-layout { display: flex; flex-direction: column; align-items: center; text-align: center; }
.download-icon { width: 128px; height: 128px; border-radius: 29px; box-shadow: 0 0 0 1px rgb(238 225 203 / .08), 0 30px 80px -20px rgb(214 186 145 / .35); }
.download h2 { margin-top: 36px; max-width: 13ch; }
.download p { margin-top: 20px; color: var(--body); max-width: 40ch; }
.download .sibling { margin-top: 36px; font-size: .94em; color: var(--muted); }
.download .sibling a { color: var(--ink); text-decoration-color: rgb(252 202 31 / .7); text-underline-offset: 4px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule); font-family: var(--round); font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; gap: 24px; padding-block: 28px 36px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 22px; margin-left: auto; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer p a { color: var(--ink); }

/* ---------- Narrower screens ---------- */
@media (max-width: 1080px) {
  .nav nav { display: none; }
  .nav-company { margin-left: auto; border-left: 0; padding-left: 0; }
  .intro h2 { grid-column: 1 / -1; }
  .intro p { grid-column: 1 / span 9; }
  .worlds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
  .world:nth-child(n) { margin-top: 0; }
  .world:nth-child(even) { margin-top: 72px; }
  .notes { grid-template-columns: minmax(0, 1fr); max-width: 60ch; }
  .facts-layout, .light-layout, .gather-layout, .details-layout { grid-template-columns: minmax(0, 1fr); }
  .elements { grid-column: 1; grid-row: auto; }
  .hero-label { display: none; }
}

@media (max-width: 760px) {
  :root { --section: 112px; }
  .brand { font-size: 16px; }
  .hero { justify-content: flex-end; padding-bottom: 40px; }
  .hero-art { top: 58px; right: auto; left: 50%; width: min(112vw, 52svh); translate: -50% 0; }
  .hero-copy { text-shadow: 0 0 24px var(--page), 0 0 48px var(--page); }
  .hero h1 { font-size: clamp(52px, 15.5vw, 84px); }
  .intro p { grid-column: 1 / -1; }
  .worlds-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .world p { display: none; }
  .world h3 { font-size: 18px; }
  .scrolly { display: block; }
  .scrolly-stage { top: 56px; height: auto; padding: 0; gap: 10px; }
  .stage-art { width: min(100%, 46svh); }
  .palette .drop { width: 38px; height: 38px; }
  .steps { position: relative; z-index: 2; padding-block: 34svh 30svh; }
  .step { min-height: 72svh; justify-content: flex-end; max-width: none; }
  .step > * { position: relative; }
  .step { padding: 0 0 6svh; }
  .js .step { opacity: 1; }
  .step-label, .step h3, .step p:last-child { background: rgb(3 13 23 / .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); margin: 0; padding: 0 20px; }
  .step-label { padding-top: 18px; border-radius: 18px 18px 0 0; }
  .step h3 { padding-top: 12px; font-size: 26px; }
  .step p:last-child { padding-top: 10px; padding-bottom: 20px; border-radius: 0 0 18px 18px; }
  .js .step:not(.is-active) .step-label, .js .step:not(.is-active) h3, .js .step:not(.is-active) p:last-child { opacity: .5; }
  .mural-row--1 .tile, .mural-row--1:nth-of-type(n) .tile { width: 82%; margin-inline: auto; }
  .mural-row--2 { padding-inline: 0; column-gap: 16px; }
  .mural-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 28px; }
  .tile-name { font-size: 15px; }
  .details-list { grid-template-columns: minmax(0, 1fr); }
  .drops { column-gap: 6px; }
  .drops li { font-size: 13px; }
  .footer nav { margin-left: 0; }
}

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