/* Perception Lab v3: white field, live spectral light behind the page, bold black grotesk, soft white pills. */

@font-face {
  font-family: "Archivo";
  src: url("./fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Martian Mono";
  src: url("./fonts/martian-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --field: #fbfbfc;
  --paper: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #3d3f44;
  --ink-3: #6c6f76;
  --ink-4: #9a9da4;
  --hair: rgba(11, 11, 12, .1);
  --hair-2: rgba(11, 11, 12, .18);
  --shadow: 0 1px 2px rgba(11, 11, 12, .06), 0 6px 20px rgba(11, 11, 12, .07);
  --shadow-lift: 0 2px 4px rgba(11, 11, 12, .06), 0 14px 36px rgba(11, 11, 12, .12);
  /* Thin-film hues, used only as small accents (active step, reveal, loading edge). The big light is WebGL. */
  --film: linear-gradient(90deg, #35d7ff, #7a7bff 26%, #ff5fd2 50%, #ffcf3f 76%, #4fe6b4);
  --focus: #0b0b0c;
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --top: 64px;
}

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

html, body { height: 100%; margin: 0; }

body {
  background: var(--field);
  color: var(--ink);
  font: 400 16px/1.45 var(--sans);
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--top) minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  -webkit-font-smoothing: antialiased;
}

/* The light: fixed behind everything, never takes pointer events. */
.light {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.light.is-on { opacity: 1; }
.topbar, .views { position: relative; z-index: 1; }

h1, h2, p, ol, figure, fieldset { margin: 0; padding: 0; }
ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

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

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 12px 16px; font-weight: 700; text-decoration: none; border-radius: 999px;
}
.skip:focus { top: 12px; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Marks: bold black, drawn in plates.js, each with one thin-film detail. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.m-ink { fill: var(--ink); }
.m-mid { fill: #4a4d53; }
.m-paper { fill: var(--paper); }
.m-film { fill: url(#film-pen); }
.m-film-fill { fill: url(#film); }
.m-seam { stroke-width: .9; stroke-linejoin: round; }
.m-ink.m-seam { stroke: var(--ink); }
.m-mid.m-seam { stroke: #4a4d53; }
.m-film.m-seam { stroke: url(#film-pen); }
.m-stroke { fill: none; stroke: var(--ink); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.m-film-line { fill: none; stroke: url(#film); stroke-width: 7; stroke-linecap: round; }
.m-thick { stroke-width: 11; }
.m-paper-line { fill: none; stroke: var(--paper); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.m-hair { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; stroke-linecap: round; }

/* Prism internals */
.prism-side { fill: url(#prism-side); }
.prism-ray { fill: none; stroke-width: 3.2; stroke-linecap: round; opacity: .95; }
.ray-1 { stroke: #2fd3ff; }
.ray-2 { stroke: #7276ff; }
.ray-3 { stroke: #ff57cf; }
.ray-4 { stroke: #ffc93a; }
.prism-beam { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 34 14; }
.prism-flare { fill: url(#prism-flare); }

.kicker, .mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Pills: soft white, or solid ink for the one primary action. */
.pill, .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -.005em;
  text-decoration: none;
  text-align: left;
  transition: background-color .18s, box-shadow .25s var(--ease), transform .25s var(--ease), color .18s;
}
.pill .icon, .btn .icon { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.pill:hover .icon, .btn:hover:not(:disabled) .icon { transform: translateX(3px); }
.pill-lg { min-height: 56px; padding: 0 28px; font-size: 16px; }
.pill-ink, .btn-primary { background: var(--ink); color: var(--paper); }
.pill-ink:hover, .btn-primary:hover:not(:disabled) { background: #26272b; }
.pill-soft, .btn-outline, .btn-ghost { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.pill-soft:hover, .btn-outline:hover:not(:disabled), .btn-ghost:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: progress; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 16px; }

/* The reveal action: ink pill ringed by a thin band of film colour. */
.btn-reveal {
  background: linear-gradient(var(--ink), var(--ink)) padding-box, var(--film) border-box;
  border: 2px solid transparent;
}
.btn-reveal:hover:not(:disabled) { background: linear-gradient(#26272b, #26272b) padding-box, var(--film) border-box; }
.btn-film { background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--film) border-box; border: 2px solid transparent; }
.btn-film:hover:not(:disabled) { background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--film) border-box; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: box-shadow .2s, opacity .2s;
}
.icon-btn:hover:not(:disabled) { box-shadow: var(--shadow-lift); }
.icon-btn:disabled { cursor: default; color: var(--ink-4); background: rgba(255, 255, 255, .82); box-shadow: none; }

/* Top bar: floats on the field. */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
}
.brand { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; }
.brand img { display: block; }
.wordmark {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
  padding: 12px 0;
}
.rail {
  display: flex;
  gap: 2px;
  margin: 0 auto;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.rail-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: color .15s, background-color .2s;
}
.rail-link:hover { color: var(--ink); }
.rail-link[aria-current="page"] { color: var(--paper); background: var(--ink); }
.rail-num { font-family: var(--mono); font-size: 10px; color: var(--ink-4); }
.rail-link[aria-current="page"] .rail-num { color: rgba(255, 255, 255, .6); }
.topnav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-steps { display: none; align-items: center; gap: 6px; }
.top-count { font-family: var(--mono); font-size: 11px; min-width: 40px; text-align: center; color: var(--ink-3); }
.all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: box-shadow .2s;
}
.all-link .icon { width: 18px; height: 18px; }
.all-link:hover { box-shadow: var(--shadow-lift); }

body[data-view="entrance"] .rail,
body[data-view="entrance"] .topnav { visibility: hidden; }

/* Views share one cell; only the active one is visible and interactive. */
.views { display: grid; min-height: 0; }
.view {
  grid-area: 1 / 1;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility 0s .4s;
}
.view.is-active { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }

@media (max-width: 1240px) {
  .rail-link:not([aria-current="page"]) .rail-name { display: none; }
  .rail-link:not([aria-current="page"]) { padding: 0 11px; }
}

@media (max-width: 760px) {
  :root { --top: 58px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .rail { display: none; }
  .wordmark { font-size: 15px; }
  body[data-view="exhibit"] .wordmark { display: none; }
  body[data-view="entrance"] .topnav { display: none; }
  .top-steps { display: flex; }
  .all-text { display: none; }
  .all-link { width: 44px; padding: 0; justify-content: center; }
  .topnav { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
}
