/* BACKROOM. Warm greys, cream marks, amber light. No blue. Flat panels, square-ish controls. */
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("/assets/fonts/silkscreen.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0b0a09; --panel: rgba(23, 21, 20, .86); --panel-solid: #171514; --line: rgba(237, 230, 214, .13); --line-2: rgba(237, 230, 214, .24);
  --text: #ede6d6; --muted: #a39989; --dim: #6f675b; --amber: #ffb15e; --amber-d: #d9822b; --red: #e0674a; --green: #9fc07a;
  --r: 8px; --head: "Space Grotesk", "Geist", system-ui, sans-serif; --ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: 16px; --bar: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

#office { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#office.dragging { cursor: grabbing; }
#vignette { position: fixed; inset: 0; pointer-events: none; box-shadow: inset 0 0 160px 40px rgba(0, 0, 0, .55); }
body.is-gate #vignette { opacity: 0; }

/* ---------- name tags and speech bubbles over the 3D scene ---------- */
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; background: rgba(15, 13, 12, .72); backdrop-filter: blur(3px); padding: 3px 8px 4px; border-radius: 5px; text-align: left; line-height: 1.15; border-left: 2px solid var(--amber); will-change: transform; white-space: nowrap; }
.tag .n { display: block; font: 600 12px var(--head); letter-spacing: .02em; color: var(--text); }
.tag .r { display: block; font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.compact .tag .r { display: none; } .compact .tag { padding: 2px 7px 3px; } .compact .tag .n { font-size: 11.5px; }
.tag:hover, .tag.sel { background: rgba(255, 177, 94, .95); }
.tag:hover .n, .tag.sel .n { color: #1a1612; } .tag:hover .r, .tag.sel .r { color: #4a3a28; }
.bubble { position: absolute; left: 0; top: 0; max-width: 220px; background: #f1ead9; color: #1c1a19; font: 500 12.5px/1.3 var(--ui); padding: 6px 10px 7px; border-radius: 9px; pointer-events: none; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
body.is-gate #tags { display: none; }

/* ---------- top bar ---------- */
.bar { position: fixed; z-index: 5; left: 0; right: 0; top: 0; height: var(--bar); padding: 0 var(--gut); display: flex; align-items: center; gap: 16px; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { display: block; border-radius: 6px; }
/* the wordmark, matched to the logo: chunky pixel letters, gold face, dark extrusion, warm glow */
.word, .logo-word, .modal h2.logo-word { font: 700 19px "Silkscreen", var(--head); letter-spacing: .06em; line-height: 1; white-space: nowrap; color: #ffd36a;
  background: linear-gradient(180deg, #fff1b8 0%, #ffd36a 45%, #e8a32c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 1px 0 #7a4a12) drop-shadow(1px 1px 0 #4a2a08) drop-shadow(0 0 6px rgba(255, 190, 80, .55)); }
.ticker { margin: 0 auto; display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 14px; min-width: 0; max-width: min(560px, 46vw); }
.t-stage { font: 700 11px var(--head); letter-spacing: .18em; color: var(--amber); flex: none; }
.t-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); min-width: 0; }
.t-bar { flex: none; width: 70px; height: 4px; background: rgba(237, 230, 214, .12); border-radius: 2px; overflow: hidden; }
.t-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .4s ease; }
.links { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ticker + .links { margin-left: 0; }
.ic { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; min-width: 36px; padding: 0 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; font: 500 12.5px var(--ui); }
.ic svg, .ic img { width: 18px; height: 18px; flex: none; display: block; }
.ic:hover { border-color: var(--line-2); background: #221f1d; }
.ic[aria-disabled="true"] { opacity: .5; cursor: default; }
.ic .mono { font-family: "Geist", ui-monospace, monospace; letter-spacing: .02em; }
.ic.on { border-color: var(--amber); }

/* ---------- panels ---------- */
.panel { position: fixed; z-index: 4; top: calc(var(--bar) + 6px); background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; max-height: calc(100% - var(--bar) - 84px); display: flex; flex-direction: column; overflow: hidden; }
.panel.left { left: var(--gut); width: 330px; }
.panel.right { right: var(--gut); width: 350px; padding: 16px; overflow-y: auto; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; background: none; border: 0; padding: 11px 6px; color: var(--muted); font: 600 12px var(--head); letter-spacing: .12em; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--amber); }
.tabs button b { font-weight: 600; color: var(--amber); margin-left: 3px; }
.tabs .x { flex: none; width: 38px; font-size: 18px; letter-spacing: 0; }
section[role="tabpanel"] { overflow-y: auto; min-height: 0; flex: 1; }
.counts { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.counts div { padding: 10px 4px 9px; text-align: center; border-right: 1px solid var(--line); }
.counts div:last-child { border-right: 0; }
.counts dt { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.counts dd { margin: 2px 0 0; font: 600 18px var(--head); }
.counts #c-boom { color: var(--red); } .counts #c-pub { color: var(--amber); }
.log { list-style: none; margin: 0; padding: 4px 0; }
.log li { display: grid; grid-template-columns: 9px 1fr auto; gap: 9px; align-items: baseline; padding: 7px 14px; border-bottom: 1px solid rgba(237, 230, 214, .06); font-size: 12.5px; animation: in .5s ease; }
.log li i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); align-self: center; }
.log li[data-k="pass"] i, .log li[data-k="publish"] i { background: var(--amber); } .log li[data-k="fail"] i { background: var(--red); } .log li[data-k="review"] i, .log li[data-k="file"] i { background: var(--green); } .log li[data-k="idea"] i { background: #f0a0b8; } .log li[data-k="test"] i { background: #ff7a3d; }
.log time { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
@keyframes in { from { opacity: 0; transform: translateY(-5px); background: rgba(255, 177, 94, .12); } to { opacity: 1; transform: none; } }
.note { flex: none; padding: 9px 14px 11px; font-size: 11px; color: var(--dim); border-top: 1px solid var(--line); line-height: 1.4; }

.crew { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.card-c { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.card-c:hover { border-color: var(--amber); background: rgba(255, 177, 94, .06); }
.card-c img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: #1d1a18; display: block; }
.card-c b { font: 600 13px var(--head); } .card-c span { font-size: 11px; color: var(--muted); } .card-c em { font-style: normal; font-size: 10.5px; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf { list-style: none; margin: 0; padding: 4px 0; }
.shelf li { padding: 10px 14px; border-bottom: 1px solid rgba(237, 230, 214, .06); display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; animation: in .5s ease; }
.shelf li.empty { display: block; color: var(--muted); font-size: 12.5px; }
.shelf .cube { width: 34px; height: 34px; border-radius: 6px; background: #2a2725; border: 1px solid var(--line); display: grid; place-items: center; }
.shelf .cube i { width: 16px; height: 16px; background: var(--c, #a4a2a0); border-radius: 3px; box-shadow: 0 0 10px var(--c, transparent); }
.shelf b { display: block; font: 600 13px var(--head); } .shelf span { font-size: 11.5px; color: var(--muted); }
.fab { position: fixed; z-index: 4; left: var(--gut); top: calc(var(--bar) + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; font: 600 12px var(--head); letter-spacing: .1em; text-transform: uppercase; }

.x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; }
.x:hover { color: var(--text); }
.panel.right .x { position: absolute; right: 8px; top: 6px; }
.who { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; padding-right: 20px; }
.who img { border-radius: 10px; background: #1d1a18; flex: none; }
.who .tagline { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.who h2 { font: 600 24px/1.1 var(--head); margin-top: 3px; }
.who .role { color: var(--muted); font-size: 13px; margin-top: 2px; }
.bio { color: #cfc6b4; font-size: 13.5px; margin-bottom: 14px; }
.facts { margin: 0 0 14px; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: #1b1918; }
.facts dt { color: var(--muted); font-size: 12px; } .facts dd { margin: 0; text-align: right; font-size: 13px; font-weight: 500; }
.actions { display: flex; gap: 8px; }
.btn { background: var(--amber); color: #1a1410; border: 0; border-radius: var(--r); padding: 10px 16px; font: 600 13px var(--head); letter-spacing: .04em; }
.btn:hover { background: #ffc07a; }
.btn.ghost { background: none; color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.btn[aria-pressed="true"] { background: #ffd09a; }

/* ---------- dock ---------- */
.dock { position: fixed; z-index: 4; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; align-items: stretch; max-width: calc(100% - 2 * var(--gut)); }
.rooms, .tools { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rooms { overflow-x: auto; scrollbar-width: none; } .rooms::-webkit-scrollbar { display: none; }
.dock button { background: var(--panel-solid); border: 0; padding: 0 13px; height: 38px; color: var(--muted); font: 600 11.5px var(--head); letter-spacing: .06em; white-space: nowrap; }
.dock button:hover { color: var(--text); background: #221f1d; }
.dock button[aria-pressed="true"] { color: #1a1410; background: var(--amber); }
.tools button { min-width: 38px; padding: 0 10px; font-size: 15px; }
.tools #auto { font-size: 11.5px; }

/* ---------- the gate ---------- */
.gate { position: fixed; inset: 0; z-index: 10; background: var(--bg); transition: opacity 1.4s ease; }
.gate.out { opacity: 0; pointer-events: none; }
#gate-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gate-top { position: absolute; z-index: 2; left: 0; right: 0; top: 0; padding: 16px var(--gut); display: flex; align-items: center; justify-content: space-between; }
.gate-copy { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 0 var(--gut) clamp(20px, 5vh, 52px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; background: none; transition: opacity .6s ease, transform .6s ease; }
.gate.opening .gate-copy, .gate.opening .gate-top { opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .6s ease, transform .6s ease; }
.kicker { font: 600 11px var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--amber); }
.gate-copy h1 { font: 500 clamp(15px, 1.9vw, 20px)/1.45 var(--ui); max-width: 640px; color: #d8d0be; text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }
.enter { position: relative; display: flex; align-items: center; gap: 14px; background: rgba(18, 16, 15, .82); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 24px 10px 12px; backdrop-filter: blur(6px); touch-action: none; user-select: none; -webkit-user-select: none; transition: border-color .2s, transform .2s; }
.enter:hover { border-color: var(--amber); }
.enter.holding { border-color: var(--amber); transform: scale(.985); }
.enter svg { width: 58px; height: 58px; flex: none; transform: rotate(-90deg); }
.enter circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: rgba(237, 230, 214, .16); }
.ring { stroke: var(--amber); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.enter .lbl { text-align: left; display: flex; flex-direction: column; gap: 2px; }
.enter b { font: 600 16px var(--head); letter-spacing: .16em; text-transform: uppercase; }
.enter small { color: var(--muted); font-size: 11.5px; }
.gate-flash { position: absolute; inset: 0; z-index: 3; background: #ffe2b8; opacity: 0; pointer-events: none; transition: opacity .55s ease; }
.gate-flash.on { opacity: 1; }
.gate-load { position: absolute; z-index: 2; right: var(--gut); bottom: 14px; font-size: 11px; color: var(--dim); letter-spacing: .08em; }
.gate-load.done { display: none; }

.nogl { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; background: var(--bg); }
.nogl h1 { font-size: 34px; } .nogl p { max-width: 460px; color: #cfc6b4; } .nogl .small { color: var(--muted); font-size: 13px; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(8, 7, 6, .72); backdrop-filter: blur(4px); }
.modal .card { position: relative; width: min(440px, 100%); max-height: 90vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; padding: 24px; display: grid; gap: 12px; }
.modal .card img { border-radius: 10px; }
.modal h2 { font: 600 20px var(--head); letter-spacing: .24em; }
.modal p { color: #d3cab8; font-size: 14px; } .modal .small { color: var(--muted); font-size: 12.5px; } .keys b { color: var(--text); }
.modal .x { position: absolute; right: 10px; top: 8px; }
.modal label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.modal input { background: #0f0d0c; border: 1px solid var(--line-2); border-radius: 7px; color: var(--text); padding: 10px 12px; font: 14px var(--ui); }
.modal input:focus { border-color: var(--amber); outline: 0; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) { .ticker .t-bar { display: none; } .ticker { max-width: 40vw; } }
@media (max-width: 860px) {
  :root { --bar: 54px; }
  .word { font-size: 15px; }
  .ticker { display: none; }
  .ic .lab { display: none; }
  .panel.left, .panel.right { left: 0; right: 0; width: auto; top: auto; bottom: 0; border-radius: 14px 14px 0 0; max-height: 52%; }
  .panel.right { padding-bottom: 20px; }
  .dock { bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.sheet .dock { display: none; }
  .fab { top: auto; bottom: calc(60px + env(safe-area-inset-bottom)); left: var(--gut); }
  .crew { grid-template-columns: repeat(3, 1fr); }
  .gate-copy h1 { font-size: 14px; }
}
@media (max-width: 520px) { .tools #r-left, .tools #r-right { display: none; } .dock button { padding: 0 10px; } .links .ic.copy .mono { display: none; } }
@media (prefers-reduced-motion: reduce) { .log li, .shelf li { animation: none; } .gate { transition-duration: .2s; } }

/* ---------- scrollbars: thin, dark, amber on hover ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(237, 230, 214, .22) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(237, 230, 214, .18); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--amber); background-clip: content-box; }
*::-webkit-scrollbar-button, *::-webkit-scrollbar-corner { display: none; width: 0; height: 0; }
section[role="tabpanel"], .panel.right { scrollbar-gutter: stable; }
.rooms { scrollbar-width: none; }
