/* WME Studio site. One typeface, glass islands, and a 3D stage per chapter.
   Colors are tokens so the page can switch between the script's three themes. */

@font-face {
  font-family: "Bricolage";
  src: url("assets/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --accent: #0099ff;
  --accent-ink: #06101b;
  --bg0: #02040a;
  --bg1: #10204a;
  --bg2: #070c1c;
  --fg: #f4f7fc;
  --dim: rgba(244, 247, 252, 0.74);
  --line: rgba(244, 247, 252, 0.15);
  --glass: rgba(22, 28, 40, 0.68);
  --glass-bd: rgba(255, 255, 255, 0.13);
  --wm-tint: rgba(236, 243, 255, 0.44);
  --dust: 156, 200, 255;
  --lift: 0 34px 90px rgba(0, 6, 24, 0.55);
  --pad: clamp(18px, 5vw, 96px);
  color-scheme: dark;
}
:root[data-theme="black"] {
  --bg0: #000;
  --bg1: #000;
  --bg2: #000;
  --glass: rgba(0, 0, 0, 0.8);
  --glass-bd: rgba(255, 255, 255, 0.2);
}
:root[data-theme="light"] {
  --bg0: #bcc6dc;
  --bg1: #f3f6fc;
  --bg2: #dbe2f0;
  --fg: #0a1020;
  --dim: rgba(10, 16, 32, 0.74);
  --line: rgba(10, 16, 32, 0.16);
  --glass: rgba(238, 243, 251, 0.72);
  --glass-bd: rgba(255, 255, 255, 0.85);
  --wm-tint: rgba(8, 16, 44, 0.16);
  --dust: 70, 100, 160;
  --lift: 0 30px 80px rgba(40, 60, 110, 0.3);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg0);
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse 80% 72% at 50% 44%, var(--bg1) 0%, var(--bg2) 52%, var(--bg0) 100%);
  transition: opacity 0.4s;
}
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

h1, h2, p, ul, dl, dd { margin: 0; }
h2 {
  font-size: clamp(38px, 6vw, 104px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
h2 + p, .text > p:not([class]) { color: var(--dim); font-size: clamp(18px, 1.7vw, 28px); line-height: 1.35; max-width: 34em; margin-top: 0.7em; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- islands: the glass surfaces ---------- */
.island, .caption {
  background: var(--glass);
  border: 1.5px solid var(--glass-bd);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: var(--lift);
}
.topbar {
  position: fixed;
  z-index: 20;
  top: 14px;
  left: 50%;
  width: min(1180px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 22px;
  border-radius: 20px;
  transform: translate(-50%, -160%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.topbar.on { transform: translate(-50%, 0); }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; text-decoration: none; }
.soon { font-size: 15px; font-weight: 600; padding: 9px 16px; border-radius: 30px; color: var(--accent-ink); background: var(--accent); }

.rail {
  position: fixed;
  z-index: 20;
  left: 14px;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 18px;
  transform: translate(-140%, -50%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.rail.on { transform: translate(0, -50%); }
.rail a { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; text-decoration: none; }
.rail i { width: 9px; height: 9px; border-radius: 9px; background: var(--fg); opacity: 0.38; transition: transform 0.2s, opacity 0.2s, background 0.2s; }
.rail a:hover i, .rail a:focus-visible i { opacity: 0.9; }
.rail a.here i { background: var(--accent); opacity: 1; transform: scale(1.7); }
.rail span {
  position: absolute;
  left: 46px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--fg);
  background: var(--glass);
  border: 1.5px solid var(--glass-bd);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }

/* ---------- scroll scenes ---------- */
.scene.sticky { height: var(--len, 300vh); position: relative; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: clip; }
.vp { position: absolute; inset: 0; }
.world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 911px;
  margin: -455.5px 0 0 -960px;
  transform-style: preserve-3d;
  will-change: transform;
}
.world.free { width: 0; height: 0; margin: 0; }
.world img, .world div, .world canvas, .world svg { position: absolute; max-width: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.world .grp { left: 0; top: 0; width: 100%; height: 100%; transform-style: preserve-3d; backface-visibility: visible; }
.plane {
  left: 0;
  top: 0;
  width: 1920px;
  height: 911px;
  border-radius: 22px;
  box-shadow: 0 70px 180px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(255, 255, 255, 0.1), 0 0 120px color-mix(in srgb, var(--accent) 22%, transparent);
}
.sh { background: rgba(0, 6, 28, 0.6); }
.patch { background: rgba(5, 7, 11, 0.92); filter: blur(7px); }
.cardimg { filter: drop-shadow(0 46px 60px rgba(0, 0, 0, 0.55)); }

.caption {
  position: absolute;
  left: var(--pad);
  bottom: clamp(18px, 5vh, 56px);
  max-width: min(calc(100% - 2 * var(--pad)), 900px);
  padding: clamp(18px, 2.2vw, 30px) clamp(20px, 3vw, 44px);
  border-radius: clamp(22px, 2.6vw, 38px);
  opacity: 0;
  visibility: hidden;
}
.caption h2 { font-size: clamp(34px, 5.4vw, 96px); }
.caption p { font-size: clamp(17px, 1.7vw, 30px); margin-top: 0.45em; }
.caption.top { top: clamp(84px, 13vh, 140px); bottom: auto; opacity: 1; visibility: visible; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }

/* ---------- hero ---------- */
.hero-copy { position: absolute; inset: 0 0 auto 0; padding-top: clamp(40px, 7vh, 80px); display: flex; flex-direction: column; align-items: center; text-align: center; will-change: transform, opacity; }
.hero .pin::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, var(--bg0) 0%, transparent 46%); opacity: var(--veil, 0.85); z-index: 1; }
.hero-copy, .cue { z-index: 2; }
.wordmark {
  /* tight letter-spacing pulls the box in past the last letter; the padding gives the fill room to cover it */
  padding: 0 0.08em;
  margin: 0 -0.08em;
  font-size: clamp(60px, 13.2vw, 252px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.1;
  white-space: nowrap;
  font-variation-settings: "opsz" 96;
  color: transparent;
  background-image: linear-gradient(var(--wm-tint), var(--wm-tint)), url("assets/map-coast.webp");
  background-size: auto, 8.6em auto;
  background-position: 0 0, -0.7em calc(-1.15em + var(--wm-y, 0px));
  -webkit-background-clip: text;
  background-clip: text;
}
.wordmark.small { font-size: clamp(48px, 6.5vw, 116px); }
.tagline { font-size: clamp(20px, 3vw, 58px); letter-spacing: -0.03em; color: var(--fg); opacity: 0.9; }
.pill { display: inline-block; margin-top: clamp(18px, 3vh, 38px); padding: 0.33em 0.9em; border-radius: 3em; font-size: clamp(20px, 3vw, 58px); font-weight: 700; letter-spacing: -0.02em; color: var(--accent-ink); background: var(--accent); box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 50%, transparent); }
.cue {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 4vh, 40px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 16px;
  border-radius: 40px;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: cue-bob 2.4s ease-in-out infinite;
}
.cue svg { animation: cue-chev 1.6s ease-in-out infinite; }
.mouse { position: relative; flex: none; width: 22px; height: 34px; border: 2px solid var(--fg); border-radius: 12px; }
.mouse i { position: absolute; left: 50%; top: 6px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--accent); animation: cue-wheel 1.6s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 7px; } }
@keyframes cue-wheel { 0% { translate: 0 0; opacity: 1; } 70%, 100% { translate: 0 11px; opacity: 0; } }
@keyframes cue-chev { 0%, 100% { translate: 0 -2px; } 50% { translate: 0 3px; } }

/* ---------- content blocks ---------- */
.block { padding: clamp(80px, 16vh, 190px) 0; position: relative; }
.wrap { width: min(1560px, calc(100% - 2 * var(--pad))); margin: 0 auto; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 90px); align-items: center; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip > .text { order: 2; }
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 90px); align-items: end; }
.intro .plain { margin-top: 0; }
.vp.card.wide { margin-top: clamp(20px, 4vw, 60px); }
.vp.card { position: relative; inset: auto; width: 100%; aspect-ratio: 2 / 1; }
.vp.card.tall { aspect-ratio: 5 / 7; max-height: 86vh; justify-self: center; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 130px); }
.pair h2 { font-size: clamp(34px, 4.4vw, 76px); }

.plain { list-style: none; padding: 0; margin-top: 1.6em; border-top: 1.5px solid var(--line); max-width: 26em; }
.plain li { padding: 0.62em 0 0.68em; border-bottom: 1.5px solid var(--line); font-size: clamp(17px, 1.45vw, 24px); font-weight: 600; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.3em; }
.choices button, .switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: clamp(16px, 1.3vw, 21px);
  font-weight: 600;
  color: var(--fg);
  background: var(--glass);
  border: 1.5px solid var(--glass-bd);
  border-radius: 40px;
  padding: 0 1.2em;
  min-height: 46px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.choices button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.swatches { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 1.5em; }
.swatches > button { width: 56px; height: 56px; border-radius: 56px; border: 0; padding: 0; cursor: pointer; background: var(--c); box-shadow: 0 0 0 0 transparent; transition: box-shadow 0.18s; }
.swatches > button[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--bg2), 0 0 0 7px var(--fg); }
/* the fifth swatch: your own color in the middle, the spectrum around it */
.swatches > .pick { background: radial-gradient(circle, var(--c) 0 50%, transparent 53%), conic-gradient(#ff3b30, #ffcc00, #34c759, #00c7be, #0a84ff, #bf5af2, #ff3b30); }

.picker { position: absolute; z-index: 30; left: 0; top: calc(100% + 16px); width: min(300px, 100%); padding: 14px; border-radius: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.picker[hidden] { display: none; }
.sv {
  position: relative;
  height: 176px;
  border-radius: 14px;
  cursor: crosshair;
  touch-action: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--hue, 339) 100% 50%));
}
.sv i { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 22px; border: 3px solid #fff; background: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); pointer-events: none; }
.picker .hue { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 4px 0; border-radius: 16px; cursor: pointer; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.picker .hue::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 24px; border: 3px solid #fff; background: hsl(var(--hue, 339) 100% 50%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.picker .hue::-moz-range-thumb { width: 18px; height: 18px; border-radius: 24px; border: 3px solid #fff; background: hsl(var(--hue, 339) 100% 50%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.pick-row { display: flex; align-items: center; gap: 10px; }
.pick-row .dot { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); }
.pick-row input { flex: 1 1 0; width: 0; min-width: 0; height: 44px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); font: inherit; font-size: 18px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.pick-row button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); cursor: pointer; }
.pick-row button[hidden] { display: none; }
.hex { margin-top: 0.5em; font-size: clamp(34px, 4vw, 70px); font-weight: 700; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }

.controls { margin-top: 1.6em; display: grid; gap: 12px; max-width: 26em; }
.controls label { display: flex; justify-content: space-between; font-size: clamp(17px, 1.4vw, 23px); font-weight: 600; }
.controls output { font-variant-numeric: tabular-nums; color: var(--dim); }
#bright { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin: 16px 0; border-radius: 8px; cursor: pointer; background: linear-gradient(to right, var(--accent) var(--fill, 100%), var(--line) var(--fill, 100%)); }
#bright::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 26px; border: 3px solid #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
#bright::-moz-range-thumb { width: 20px; height: 20px; border-radius: 26px; border: 3px solid #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.switch { gap: 12px; justify-self: start; padding-left: 0.7em; }
.switch i { position: relative; flex: none; width: 46px; height: 26px; border-radius: 26px; background: var(--line); transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 20px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transition: transform 0.2s; }
.switch[aria-checked="true"] i { background: var(--accent); }
.switch[aria-checked="true"] i::after { transform: translateX(20px); }
.note { font-size: 15px; margin-top: 1.4em; color: var(--dim); }

.video { margin-top: clamp(24px, 4vw, 56px); border-radius: clamp(16px, 2vw, 30px); padding: clamp(6px, 0.8vw, 12px); }
.video video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: clamp(10px, 1.4vw, 20px); background: #000; }

.end .text { text-align: left; }
.end .tagline { font-size: clamp(20px, 2.4vw, 44px); }
.end .pill { font-size: clamp(20px, 2.4vw, 44px); }
.features > div { padding: 0.75em 0 0.85em; border-top: 1.5px solid var(--line); }
.features > div:first-child { border-top: 0; }
.features dt { font-size: clamp(22px, 2.2vw, 38px); font-weight: 700; letter-spacing: -0.035em; }
.features dd { color: var(--dim); font-size: clamp(16px, 1.35vw, 22px); margin-top: 2px; }

.foot { padding: 34px var(--pad) 46px; border-top: 1.5px solid var(--line); color: var(--dim); font-size: 15px; }

/* room for the navigation island beside the text */
@media (min-width: 901px) {
  :root { --pad: clamp(100px, 7vw, 132px); }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .rail { display: none; }
  .split, .split.flip, .pair, .intro { grid-template-columns: 1fr; }
  .split.flip > .text { order: 0; }
  .vp.card.tall { width: min(100%, 420px); }
  .caption.top { top: 78px; }
  .brand { font-size: 19px; }
}

/* Scrolling still drives the scenes; only the self-running motion is switched off. */
@media (prefers-reduced-motion: reduce) {
  .topbar, .rail, .rail i, .rail span, .swatches > button, .switch i, .switch i::after { transition: none; }
  .cue, .cue svg, .mouse i { animation: none; }
}

.tcard { border-radius: 18px; box-shadow: 0 60px 140px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(255, 255, 255, 0.1); }

/* Labels in pills and buttons. Where the browser can trim a line of text to the height of its
   capital letters, equal padding above and below centers the letters exactly. */
.soon, .pill, .rail span { display: inline-block; line-height: 1; }
.lbl { display: block; line-height: 1; }
@supports (text-box: trim-both cap alphabetic) {
  .soon, .pill, .lbl, .rail span { text-box: trim-both cap alphabetic; }
  .soon { padding: 11px 16px; }
  .pill { padding: 0.48em 0.9em; }
  .rail span { padding: 9px 12px; }
}
@supports not (text-box: trim-both cap alphabetic) {
  /* older browsers: this typeface sits a hair high in its line, so nudge it down */
  .soon, .pill, .lbl, .rail span { position: relative; top: 0.035em; }
  .rail span { position: absolute; top: auto; margin-top: 0.035em; }
}

/* Text inside boxes: captions, list rows and the feature list get the same treatment as the
   button labels, so the space above the capitals equals the space below the baseline. */
@supports (text-box: trim-both cap alphabetic) {
  .caption h2, .caption p, .plain li { text-box: trim-both cap alphabetic; }
  .caption:not(.top) { padding: clamp(22px, 2.5vw, 38px) clamp(22px, 3vw, 46px); }
  .caption p { margin-top: 0.8em; }
  .plain li { padding: 0.95em 0; }
  .features dt { text-box: trim-start cap alphabetic; }
  .features dd { text-box: trim-end cap alphabetic; margin-top: 6px; }
  .features > div { padding: 1.05em 0; }
}

/* ---------- scrollbar: slim, rounded, in the accent ---------- */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 14px; height: 14px; }
  ::-webkit-scrollbar-track { background: var(--bg0); }
  ::-webkit-scrollbar-thumb { border-radius: 14px; border: 4px solid transparent; background: color-mix(in srgb, var(--accent) 78%, transparent) padding-box; }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background: var(--accent) padding-box; border-width: 3px; }
  ::-webkit-scrollbar-corner { background: var(--bg0); }
}
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg0); }
}
