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

/* Several of these are flex containers, and a bare `display: flex` quietly
   defeats the hidden attribute. */
[hidden] { display: none !important; }

:root {
  --bg: #0E0E10;
  --panel: #16161A;
  --ink: #FFFFFF;
  --dim: #8A8A93;
  --dimmer: #5A5A63;
  --edge: #26262C;
  --gut: 44px;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ── library ─────────────────────────────────────────────── */

#library { padding-bottom: 90px; }

header {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding: 48px var(--gut) 26px;
}

.wordmark {
  font-size: clamp(54px, 8vw, 96px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-transform: uppercase;
}

.tagline {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.9;
  padding-bottom: 4px;
}

nav {
  margin-left: auto;
  display: flex;
  gap: 3px;
  padding-bottom: 6px;
}

nav button {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 9px 15px;
  background: var(--panel);
  color: var(--dim);
  transition: background .18s, color .18s;
}

nav button:hover { color: var(--ink); }
nav button.on { background: var(--ink); color: var(--bg); }

#nudge {
  margin: 0 var(--gut) 18px;
  background: var(--panel);
  border-left: 3px solid #FF9F1C;
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.nudge-line {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 17px;
  border-bottom: 1px solid #1B1B20;
}

.nudge-line:last-child { border-bottom: 0; }
.nudge-line.bad { color: #E06A5A; }
#nudge b { color: var(--ink); font-weight: 500; }
#nudge code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }

.nudge-go {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 13px;
  background: var(--ink);
  color: var(--bg);
  transition: opacity .18s;
}

.nudge-go:hover { opacity: .82; }
.nudge-go:disabled { background: #2A2A31; color: var(--dim); cursor: default; }

/* ── shelves ─────────────────────────────────────────────── */

.sec { margin: 6px var(--gut) 0; padding-top: 26px; }
.sec + .sec { border-top: 1px solid #1B1B20; margin-top: 34px; }

.sec h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.sec h2 .c {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ── a project ───────────────────────────────────────────── */

.tile { position: relative; cursor: pointer; }

.pic {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #121215;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}

.tile:hover .pic { transform: translateY(-4px); }
.tile:hover .pic::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
}

.pic .shot,
.pic video,
.pic .fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.pic video { opacity: 0; transition: opacity .35s; }
.tile:hover video.ready { opacity: 1; }

/* Games are often bright at the bottom, where the chips sit. */
.pic .veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(14,14,16,0) 44%, rgba(14,14,16,.5) 78%, rgba(14,14,16,.92) 100%);
}

/* One segment per version, in that model's colour. */
.stripe { position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 3; display: flex; }
.stripe i { flex: 1; }

/* How many models took this brief. Absent when only one did — a "1" on every
   other tile would be noise, and the answer is already the tile itself. */
.pic .count {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 3;
  background: rgba(14,14,16,.86);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 9px;
}

.pic .count span { font-weight: 400; color: #C4C4CC; }

.pic .go {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 3;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(255,255,255,.93);
  color: #0E0E10;
  padding: 5px 10px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .22s, transform .22s;
}

.tile:hover .go { opacity: 1; transform: none; }

.tile .n {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-top: 11px;
}

.tile .m {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile.unbuilt { cursor: default; }
.tile.unbuilt .n { color: #5A5A63; }

/* ── locked, on the published copy ───────────────────────── */

.tile.shut .n { color: #6C6C76; }
.tile.shut .m { color: #4A4A52; }
.tile.shut:hover .n { color: #9A9AA4; }

/* A padlock drawn rather than fetched — the card has no picture by design. */
.pic .padlock {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 22px;
  height: 17px;
  margin: -22px 0 0 -11px;
  border: 2px solid #4A4A52;
  border-radius: 2px;
  transition: border-color .2s;
}

.pic .padlock::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 13px;
  height: 9px;
  margin-left: -8px;
  border: 2px solid #4A4A52;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  transition: border-color .2s;
}

.tile.shut:hover .padlock,
.tile.shut:hover .padlock::before { border-color: #8A8A93; }

/* ── the chooser ─────────────────────────────────────────── */

#pick {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(8,8,10,.86);
  display: flex;
  align-items: center;
  justify-content: center;
}

#pick-panel { width: min(1150px, 92vw); }

.p-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.p-head .n { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; text-transform: uppercase; line-height: 1; }
.p-head .s { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }

.p-head .esc {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  border: 2px solid var(--edge);
  padding: 8px 13px;
  transition: border-color .2s, color .2s;
}

.p-head .esc:hover { border-color: var(--ink); color: var(--ink); }

#pick .ring { display: flex; gap: 4px; height: min(380px, 52vh); }

.opt {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #121215;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition: flex .42s cubic-bezier(.2,.8,.2,1);
}

#pick .ring:hover .opt { flex: .86; }
#pick .ring .opt:hover { flex: 1.5; }

.opt img, .opt video, .opt .fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.opt video { opacity: 0; transition: opacity .35s; }
.opt:hover video.ready { opacity: 1; }

.opt .veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(14,14,16,0) 26%, rgba(14,14,16,.66) 64%, rgba(14,14,16,.97) 100%),
    linear-gradient(75deg, rgba(14,14,16,.7) 0%, rgba(14,14,16,.1) 46%, rgba(14,14,16,0) 70%);
}

.opt .lab { position: relative; z-index: 2; }

.opt .model {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
}

/* Anything true about a build that isn't its author — a working style, an
   upgrade in flight — rides beside the name instead of inside it. */
.opt .badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: none;
  white-space: nowrap;
}

.opt .meta {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #C4C4CC;
  margin-top: 9px;
}

.opt .newest {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: #fff;
  color: #0E0E10;
  padding: 5px 9px;
}

.opt .play {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(255,255,255,.93);
  color: #0E0E10;
  padding: 6px 11px;
  opacity: 0;
  transition: opacity .22s;
}

.opt:hover .play { opacity: 1; }

#pick .foot {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
}

#pick .foot kbd {
  font-family: inherit;
  background: var(--panel);
  padding: 4px 7px;
  color: var(--dim);
  letter-spacing: 0.1em;
  margin-right: 6px;
}

nav .unlock-pill {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 9px 15px;
  background: var(--panel);
  color: #FF9F1C;
  box-shadow: inset 0 0 0 1px #FF9F1C;
}

nav .unlock-pill:hover { background: #FF9F1C; color: var(--bg); }

#unlock {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8,8,10,.78);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16vh;
}

#unlock-panel { width: min(420px, 90vw); background: #141418; border: 2px solid var(--edge); padding: 26px; }
#unlock-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; }
#unlock-why { font-size: 12px; color: var(--dim); margin: 9px 0 18px; line-height: 1.55; }
#unlock-row { display: flex; gap: 3px; }

#unlock-input {
  flex: 1;
  padding: 13px 15px;
  background: #0E0E10;
  border: 1px solid var(--edge);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.14em;
  outline: none;
}

#unlock-input:focus { border-color: #FF9F1C; }
#unlock-input::placeholder { color: var(--dimmer); letter-spacing: 0.1em; }

#unlock-go {
  padding: 0 20px;
  background: var(--ink);
  color: var(--bg);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#unlock-go:hover { background: #FF9F1C; }

/* ── elsewhere ───────────────────────────────────────────── */

#elsewhere { margin: 52px var(--gut) 0; }

#elsewhere h2 {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 400;
  margin-bottom: 10px;
}

.else-row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  padding: 14px 18px;
  margin-bottom: 3px;
}

.else-row .name { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.else-row .why { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

.else-row .cmd {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #B9B9C2;
  padding: 5px 9px;
  background: #1D1D22;
  transition: color .18s, background .18s;
}

.else-row .cmd:hover { color: var(--bg); background: var(--ink); }

#legend {
  margin: 44px var(--gut) 0;
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
}

#legend .house { display: flex; align-items: center; gap: 7px; }
#legend .sw { width: 9px; height: 9px; }
#legend .keys { margin-left: auto; }
#legend kbd {
  font-family: inherit;
  background: var(--panel);
  padding: 4px 7px;
  color: var(--dim);
  letter-spacing: 0.1em;
}

/* ── stage ───────────────────────────────────────────────── */

#stage { position: fixed; inset: 0; z-index: 100; background: #000; }
#frames { position: absolute; inset: 0; }

#frames iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#frames iframe.live { opacity: 1; pointer-events: auto; }

#hotzone { position: absolute; top: 0; left: 0; width: 260px; height: 70px; z-index: 101; }

#pill {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 102;
  display: flex;
  align-items: stretch;
  gap: 1px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

#pill.show { opacity: 1; transform: none; pointer-events: auto; }

#pill button, #pill span {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 9px 14px;
  background: rgba(255,255,255,.94);
  color: #0E0E10;
  display: flex;
  align-items: center;
}

#pill span { background: rgba(20,20,24,.9); color: #fff; }
#pill button:hover { background: #FF9F1C; }

/* ── switcher ────────────────────────────────────────────── */

#switcher {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8,8,10,.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}

#switcher-panel { width: min(560px, 90vw); background: #141418; border: 2px solid var(--edge); }

#switcher-input {
  width: 100%;
  padding: 18px 20px;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--edge);
  color: var(--ink);
  font-size: 17px;
  font-family: inherit;
  letter-spacing: 0.02em;
  outline: none;
}

#switcher-input::placeholder { color: var(--dimmer); }

#switcher-list { list-style: none; max-height: 46vh; overflow-y: auto; }

#switcher-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #1B1B20;
}

#switcher-list li .sw { width: 8px; height: 8px; flex: none; }
#switcher-list li .t { font-size: 14px; font-weight: 500; }
#switcher-list li .m { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-left: auto; }
#switcher-list li.sel { background: #1E1E24; }
#switcher-list li.sel .t { color: #FF9F1C; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  :root { --gut: 20px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  #pick .ring { flex-direction: column; height: auto; max-height: 70vh; overflow-y: auto; }
  #pick .ring .opt, #pick .ring:hover .opt, #pick .ring .opt:hover { flex: none; height: 170px; }
  .p-head .n { font-size: 28px; }
  header { flex-wrap: wrap; }
}
