/* Consort site. Graphite ground, bone type, ice only for what is live or chosen. */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-var.woff2') format('woff2-variations'), url('../fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face { font-family: 'Plex Mono'; src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ground: #0b0c0e;
  --ground-2: #111215;
  --panel: #16171a;
  --line: rgba(242, 239, 232, 0.1);
  --line-2: rgba(242, 239, 232, 0.18);
  --bone: #f2efe8;
  --bone-2: rgba(242, 239, 232, 0.66);
  --bone-3: rgba(242, 239, 232, 0.42);
  --ice: #bfe3ff;
  --ice-dim: rgba(191, 227, 255, 0.16);
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font: 400 17px/1.55 'Archivo', system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, canvas { display: block; }
a { color: inherit; }
::selection { background: var(--ice); color: var(--ground); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 {
  margin: 0;
  font-weight: 860;
  font-stretch: 92%;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 8.4vw, 132px); }
h2 { font-size: clamp(38px, 5.6vw, 88px); }
h3 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.02em; line-height: 1.05; }
.mono { font-family: 'Plex Mono', ui-monospace, monospace; letter-spacing: 0; }
.ice { color: var(--ice); }

/* grain over everything, very faint */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- arrival */
.arrive {
  position: fixed; inset: 0; z-index: 100; background: var(--ground);
  display: grid; place-items: center; cursor: pointer;
  transition: opacity 0.5s ease;
}
.arrive svg { width: min(64vw, 620px); height: auto; overflow: visible; }
.arrive.gone { opacity: 0; pointer-events: none; }
html:not(.arriving) .arrive { display: none; }
html.arriving body > :not(.arrive):not(.grain) { opacity: 0; }
body > * { transition: opacity 0.7s ease; }

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  padding: 20px var(--gutter);
  transition: background 0.4s ease, padding 0.4s var(--ease);
}
/* a plain dark band, not a blur: a blur behind the header would be worked out again on every frame the 3D room draws */
.nav.solid { background: rgba(11, 12, 14, 0.94); padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.nav .logo { height: 26px; width: auto; }
.nav .logo-link { display: block; border-radius: 6px; grid-column: 2; grid-row: 1; }
.nav-links { grid-column: 1; grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 28px; }
.nav-end { grid-column: 3; grid-row: 1; justify-self: end; }
.nav-links a.plain { text-decoration: none; color: var(--bone-2); font-size: 15px; transition: color 0.2s; }
.nav-links a.plain:hover { color: var(--bone); }

.btn {
  --mx: 0px; --my: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--ice); color: var(--ground);
  font: 600 15px/1 'Archivo', sans-serif; font-stretch: 100%; letter-spacing: 0;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transform: translate(var(--mx), var(--my));
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease, background 0.2s;
  box-shadow: 0 0 0 0 rgba(191, 227, 255, 0);
}
.btn:hover { box-shadow: 0 0 0 6px rgba(191, 227, 255, 0.14), 0 10px 40px -8px rgba(191, 227, 255, 0.5); }
.btn:active { transform: translate(var(--mx), var(--my)) scale(0.97); }
.btn.small { height: 40px; padding: 0 18px; font-size: 14px; }
.btn .arrow { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }

/* ---------------------------------------------------------------- hero (pinned) */
.hero { position: relative; height: 260vh; }
.hero .pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.9s ease; }
/* the still picture of the room's first frame stands in until the live room has drawn (room.js) */
html.room-live .hero .poster, html.still .hero .poster { opacity: 0; }
html.no-gl .hero .poster { opacity: 1; }
.hero .shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11,12,14,0.65) 0%, rgba(11,12,14,0) 22%),
    linear-gradient(0deg, rgba(11,12,14,0.92) 0%, rgba(11,12,14,0.5) 30%, rgba(11,12,14,0) 58%);
}
.hero-copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(36px, 8vh, 96px);
  max-width: var(--max); margin: 0 auto;
  will-change: opacity, transform;
}
.hero-copy h1 { max-width: 9.5em; }
.hero-copy h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-copy h1 .line > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
html.ready .hero-copy h1 .line > span { transform: none; }
html.ready .hero-copy h1 .line:nth-child(2) > span { transition-delay: 0.08s; }
.hero-copy .join { margin-top: clamp(24px, 4vh, 40px); opacity: 0; transform: translateY(14px); transition: opacity 0.8s ease 0.35s, transform 0.9s var(--ease) 0.35s; }
html.ready .hero-copy .join { opacity: 1; transform: none; }

.hero-word { position: absolute; left: 0; top: 0; transform-origin: 0 50%; opacity: 0; pointer-events: none; will-change: transform, opacity; }
.hero-word svg { width: 100%; height: auto; }
.hero-say {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(36px, 8vh, 96px);
  max-width: 30em; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; color: var(--bone-2);
  opacity: 0; transform: translateY(16px); pointer-events: none;
}
.hero-say strong { color: var(--bone); font-weight: 600; }
.scroll-cue {
  position: absolute; right: var(--gutter); bottom: clamp(36px, 8vh, 96px);
  display: flex; align-items: center; gap: 12px; color: var(--bone-3); font-size: 13px;
}
.scroll-cue i { display: block; width: 1px; height: 44px; background: linear-gradient(var(--bone-3), transparent); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 40%; background: var(--ice); transform: translateY(-100%); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { to { transform: translateY(250%); } }

/* ---------------------------------------------------------------- the join form (hero and closing) */
.join { position: relative; display: flex; gap: 8px; max-width: 520px; }
.join .field {
  flex: 1; min-width: 0; height: 56px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(18, 19, 22, 0.82);
  color: var(--bone); font: 400 16px/1 'Archivo', sans-serif; font-stretch: 100%;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.join .field::placeholder { color: var(--bone-3); }
.join .field:hover { border-color: rgba(242, 239, 232, 0.3); }
.join .field:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 4px var(--ice-dim); background: rgba(22, 23, 26, 0.85); }
.join .btn { height: 56px; padding: 0 26px; }
.join .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join-note { min-height: 1.5em; margin-top: 12px; font-size: 15px; color: var(--bone-2); }
.join-note.bad { color: #ffc9c2; }
.join-note.good { color: var(--ice); }
.join.sent .field, .join.sent .btn { pointer-events: none; }
.join.busy .btn { opacity: 0.7; }

/* ---------------------------------------------------------------- sections */
section { position: relative; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.says { list-style: none; margin: 0; padding: 0; }
.says li { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; color: var(--bone-2); }
.says li strong { color: var(--bone); font-weight: 600; }
.says .fig { white-space: nowrap; font-family: 'Plex Mono', monospace; color: var(--ice); font-weight: 500; font-size: 0.92em; }

/* the waterfall scene */
.decay { height: 340vh; }
.decay .pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-columns: minmax(300px, 0.85fr) 1.6fr; align-items: center; }
.decay .text { position: relative; z-index: 2; padding-left: var(--gutter); padding-right: 24px; }
.decay h2 { max-width: 7.5em; }
.decay .says { position: relative; margin-top: 36px; min-height: 9em; }
.decay .says li { position: absolute; left: 0; top: 0; max-width: 21em; opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.8s var(--ease); }
.decay .says li.on { opacity: 1; transform: none; }
.decay .stage { position: relative; height: 100%; }
.decay canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.decay .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
html.no-gl .decay .poster { display: block; }
.decay .tag {
  position: absolute; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 999px;
  background: rgba(11, 12, 14, 0.8); border: 1px solid var(--line-2);
  font: 500 12px/1 'Plex Mono', monospace; color: var(--bone); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.4s;
}
.decay .tag.on { opacity: 1; }
.decay .axis { position: absolute; transform: translate(-50%, 0); font: 400 11px/1 'Plex Mono', monospace; color: var(--bone-3); pointer-events: none; white-space: nowrap; }
.decay .key { position: absolute; right: var(--gutter); bottom: 36px; display: flex; gap: 22px; font-size: 14px; color: var(--bone-3); }
.decay .key span { display: inline-flex; align-items: center; gap: 8px; transition: color 0.4s; }
.decay .key span::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.decay .key .before.on { color: var(--bone); }
.decay .key .after.on { color: var(--ice); }
.progress-rail { position: absolute; left: var(--gutter); bottom: 36px; width: 120px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-rail i { display: block; height: 100%; width: 100%; background: var(--ice); transform-origin: 0 50%; transform: scaleX(0); }

/* every seat */
.seats { padding: clamp(110px, 16vh, 200px) 0; }
.seats .grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(40px, 6vw, 110px); align-items: center; }
.seats .says { margin-top: 32px; }
.seats .says li + li { margin-top: 16px; }
.positions { position: relative; aspect-ratio: 236 / 112; }
.positions canvas { display: block; width: 100%; height: auto; }

/* results */
.results { padding: clamp(110px, 16vh, 200px) 0; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--ground) 0%, var(--ground-2) 100%); }
.results h2 { max-width: 11em; }
.results h2 .num { color: var(--ice); font-variant-numeric: tabular-nums; }
.rows { margin-top: clamp(56px, 8vh, 96px); display: grid; gap: 0; }
.row { display: grid; grid-template-columns: minmax(150px, 1fr) 3fr minmax(150px, auto); gap: 32px; align-items: center; padding: 26px 0; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row .name { font-size: 18px; color: var(--bone); }
.bars { position: relative; height: 30px; }
.bars i { position: absolute; left: 0; height: 12px; border-radius: 6px; transform-origin: 0 50%; transition: transform 1.4s var(--ease); }
.bars .was { top: 0; background: rgba(242, 239, 232, 0.22); }
.bars .now { top: 17px; height: 12px; background: var(--ice); transform: scaleX(0); transition-delay: 0.25s; }
.row .figs { font: 500 18px/1.2 'Plex Mono', monospace; text-align: right; white-space: nowrap; }
.row .figs .from { color: var(--bone-3); }
.row .figs .to { color: var(--ice); }
.basis { margin-top: 28px; max-width: 46em; font-size: 14px; line-height: 1.6; color: var(--bone-3); }

/* room report: the app's report graph (js/report.js) under word tabs */
.report { padding: clamp(110px, 16vh, 200px) 0; }
.rp { margin-top: clamp(40px, 6vh, 72px); }
.rp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.rp-tabs { display: flex; gap: clamp(20px, 2.6vw, 36px); overflow-x: auto; scrollbar-width: none; }
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tabs button {
  appearance: none; background: none; border: 0; border-radius: 0; padding: 10px 0 12px; position: relative;
  font: 500 16px/1 'Archivo', sans-serif; color: var(--bone-3); white-space: nowrap; cursor: pointer; transition: color 0.2s;
}
.rp-tabs button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px; background: var(--ice); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.35s var(--ease); }
.rp-tabs button:hover { color: var(--bone-2); }
.rp-tabs button[aria-selected="true"] { color: var(--bone); }
.rp-tabs button[aria-selected="true"]::after { transform: none; }
.rp-switch { position: relative; display: inline-flex; align-items: center; gap: 12px; font-size: 15px; color: var(--bone-2); cursor: pointer; user-select: none; transition: opacity 0.3s; }
.rp-switch.off { opacity: 0; pointer-events: none; }
.rp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rp-switch .track { position: relative; width: 40px; height: 22px; border-radius: 11px; background: rgba(242, 239, 232, 0.16); transition: background 0.25s; }
.rp-switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bone); transition: transform 0.25s var(--ease); }
.rp-switch input:checked + .track { background: var(--ice); }
.rp-switch input:checked + .track::after { transform: translateX(18px); }
.rp-switch input:focus-visible + .track { outline: 2px solid var(--ice); outline-offset: 3px; }
.rp-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%); align-items: center; gap: 18px 48px; margin: clamp(20px, 3vh, 36px) 0 clamp(8px, 2vh, 20px); }
.rp-words { max-width: 30em; }
.rp-words .rp-say { margin-top: clamp(20px, 3vh, 32px); }
/* the room the page is about, as the app draws it behind its report: one picture per page, crossfading */
.rp-room { position: relative; aspect-ratio: 6 / 5; }
.rp-room img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s var(--ease); }
.rp-room img.on { opacity: 1; }
html.still .rp-room img { transition: none; }
.rp-fig { margin: 0; font-size: clamp(52px, 7vw, 112px); font-weight: 860; font-stretch: 92%; letter-spacing: -0.04em; line-height: 0.9; white-space: nowrap; }
.rp-say { margin: 0; color: var(--bone-2); font-size: 17px; line-height: 1.5; min-height: 4.5em; }
.rp-graph { position: relative; height: clamp(260px, 24vw, 330px); }
.rp-graph canvas { display: block; }

/* waitlist */
.waitlist { padding: clamp(110px, 16vh, 200px) 0 clamp(90px, 12vh, 160px); border-top: 1px solid var(--line); background: radial-gradient(70% 90% at 85% 0%, rgba(191, 227, 255, 0.07), transparent 60%); }
.wl { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: end; }
.wl p.lead { margin: 22px 0 0; max-width: 26em; color: var(--bone-2); font-size: clamp(17px, 1.4vw, 19px); }
.wl-form .join { max-width: none; }
.setups { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.setups legend { padding: 0; margin-bottom: 12px; font-size: 14px; color: var(--bone-3); }
.setups label { position: relative; }
.setups input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.setups span {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--bone-2); font-size: 14px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.setups label:hover span { border-color: rgba(242, 239, 232, 0.35); color: var(--bone); }
.setups input:checked + span { background: var(--ice); border-color: var(--ice); color: var(--ground); }
.setups input:focus-visible + span { outline: 2px solid var(--ice); outline-offset: 3px; }
.wl-done { display: none; }
.wl-done .place { font: 500 clamp(48px, 7vw, 96px)/1 'Plex Mono', monospace; color: var(--ice); letter-spacing: -0.03em; }
.wl-done p { margin: 14px 0 0; color: var(--bone-2); }
.wl-form.sent .wl-done { display: block; }
.wl-form.sent .wl-ask { display: none; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 44px 0 56px; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer .lockup { height: 30px; width: auto; }
footer small { color: var(--bone-3); font-size: 14px; }

/* things that rise into view */
.rise { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 1.1s var(--ease); }
.rise.in { opacity: 1; transform: none; }
.rise.d1 { transition-delay: 0.08s; } .rise.d2 { transition-delay: 0.16s; } .rise.d3 { transition-delay: 0.24s; }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1080px) {
  .wl { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .decay .pin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; padding-top: 96px; }
  .decay .text { padding-right: var(--gutter); }
  .decay .says { margin-top: 18px; min-height: 5.6em; }
  .decay .key { left: var(--gutter); right: auto; bottom: 28px; }
  .progress-rail { display: none; }
  .seats .grid { grid-template-columns: 1fr; }
  .positions { margin: 8px calc(-1 * var(--gutter)) 0; }
  .row { grid-template-columns: 1fr auto; gap: 10px 20px; }
  .row .bars { grid-column: 1 / -1; grid-row: 2; }
  .scroll-cue { display: none; }
  .rp-top { grid-template-columns: 1fr; }
  .rp-room { aspect-ratio: 1 / 1; margin: 0 calc(-1 * var(--gutter)); }
  .rp-say { min-height: 7.5em; }
  .rp-graph { height: 250px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .join { flex-direction: column; }
  .join .field { flex: none; width: 100%; }
  .join .btn { width: 100%; }
  .nav .logo { height: 22px; }
  .nav .btn .wide { display: none; }
  .row .figs { font-size: 15px; }
}

/* ---------------------------------------------------------------- still mode: no scroll scenes, final states */
html.still .hero, html.still .decay { height: auto; }
html.still .hero .pin { position: relative; }
html.still .decay .pin { position: relative; height: auto; min-height: 100vh; }
html.still .decay .says li { position: static; opacity: 1; transform: none; margin-bottom: 14px; }
html.still .rise { opacity: 1; transform: none; transition: none; }
html.still .hero-copy h1 .line > span, html.still .hero-copy .join { transform: none; opacity: 1; transition: none; }
html.still .bars .now { transition: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
