:root {
  --ground: #DEDFDA;
  --ink: #1D2025;
  --muted: #4F535A;
  --worldline: #5B4A9A;
  --glass: #15121C;
  --wax: #B79CF2;
  --font: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: max(16px, 4vw);
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
}

main { flex: 1; }

a { color: var(--worldline); }

:focus-visible {
  outline: 3px solid var(--worldline);
  outline-offset: 3px;
  border-radius: 4px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.num { font-variant-numeric: tabular-nums; }

/* Header */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
}

.brand img { display: block; width: 32px; height: 32px; }

.site-head nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-head nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}

.views {
  display: inline-flex;
  border: 1px solid var(--muted);
  border-radius: 999px;
}

.views[hidden] { display: none; }

.views button {
  min-height: 44px;
  min-width: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.views button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ground);
}

.intro {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter) 8px;
}

.text p { max-width: 66ch; }

/* List view: plates */

.plates {
  list-style: none;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
}

.plates[hidden] { display: none; }

.plate {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 16px 32px;
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--muted);
}

.plate:first-child { border-top: 0; }

.plate .media {
  display: block;
  width: 100%;
  height: auto;
}

.plate[data-aspect="1"] .media,
.plate[data-aspect="1"] .frame { max-width: 360px; }

/* Hover clip over the screenshot (List view, mouse only) */
.frame { position: relative; display: block; }
.frame .media { max-width: 100%; }
.frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.frame video.on { opacity: 1; }

.plate h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.plate .text p { margin: 0 0 12px; }

.facts {
  color: var(--muted);
  font-size: 15px;
}

.play {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--worldline);
  color: var(--ground);
  font-weight: 600;
  text-decoration: none;
}

.play:focus-visible { outline-color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }

.secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  font-weight: 600;
}

/* Request access form (site pages) */

.access {
  display: grid;
  gap: 14px;
  max-width: 480px;
  scroll-margin-top: 16px;
}

.access h1 { margin: 0; }

.access fieldset { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; }

.access legend { padding: 0; margin-bottom: 4px; font-size: 15px; font-weight: 600; }

.access label.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 18px; font-weight: 400; }

.access label.check input { width: 22px; min-height: 22px; height: 22px; margin: 0; accent-color: var(--worldline); }

.access .fine { margin: 0; color: var(--muted); font-size: 15px; }

.access label { display: grid; gap: 4px; font-size: 15px; font-weight: 600; }

.access .optional { color: var(--muted); font-weight: 400; }

.access input,
.access textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: #F4F4F1;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.access textarea { resize: vertical; }

.access button { justify-self: start; border: 0; font: inherit; font-weight: 600; cursor: pointer; }

.access .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.access .status { display: none; margin: 0; font-weight: 600; }
.access .status:target { display: block; }
.access .failed { color: #9A2B2B; }

/* Footer */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--gutter) 24px;
  color: var(--muted);
  font-size: 15px;
}

.site-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.about-foot { display: none !important; }

@media (max-width: 440px) {
  .about-head { display: none !important; }
  .about-foot { display: inline-flex !important; }
}

@media (max-width: 720px) {
  .plate { grid-template-columns: minmax(0, 1fr); }
  .plate[data-aspect="1"] .media,
  .plate[data-aspect="1"] .frame { max-width: 100%; }
}

/* Cradle view stage */

#stage {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: clamp(380px, 110vw, min(74svh, 760px));
  margin: 0 auto 8px;
}

#stage[hidden] { display: none; }

.cradle3d { position: absolute; inset: 0; }

.cradle3d canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ball3d {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  touch-action: none;
  cursor: grab;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.ball3d.dragging { cursor: grabbing; }

.ball3d[hidden] { display: none; }

.ball3d .hit { display: block; flex: none; border-radius: 50%; }

.name3d {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.name3d:focus-visible,
.name3d.picked { outline: 3px solid var(--worldline); outline-offset: -3px; }

/* Phones: names that don't fit in one row show one at a time (cradle3d.js). */
.compact .name3d { opacity: 0; pointer-events: none; }
.compact .name3d.shown,
.compact .name3d:focus-visible { opacity: 1; pointer-events: auto; transition: opacity 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .compact .name3d.shown,
  .compact .name3d:focus-visible { transition: none; }
}

/* A picked ball melting into its poster, growing to fill the window before the piece opens. */
.takeover {
  position: fixed;
  z-index: 10;
  overflow: hidden;
  background: var(--glass);
  pointer-events: none;
}

.takeover img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Plain pages (about, placeholders) */

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px var(--gutter) 48px;
}

.page h1 {
  margin: 0 0 12px;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
}

.page p { max-width: 66ch; }

.bio { display: flex; gap: 24px; align-items: center; }

.bio p { margin: 0 0 12px; }

.portrait { flex: none; width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }

@media (max-width: 480px) {
  .bio { flex-direction: column; align-items: flex-start; }
}

.page .media {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 16px 0;
}

.page .media.wide { max-width: 720px; }
