@font-face { font-family: Inter; src: url(fonts/inter.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(fonts/space-grotesk.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #0a0a0f; --line: #23232f;
  --text: #f1f3f8; --muted: #a3abbd;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: Inter, ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

header { display: flex; align-items: center; gap: 10px; padding: 20px 0; }
header img { width: 28px; height: 28px; }
.brand { font: 700 20px var(--display); letter-spacing: -.01em; }
a.brand { color: inherit; text-decoration: none; }
.narrow p a { color: #b78bff; }

.shop { display: grid; gap: 48px; grid-template-columns: minmax(0, 720px); }
.hero { padding: 24px 0 32px; }
h1 { font: 700 clamp(34px, 4.4vw, 52px)/1.04 var(--display); letter-spacing: -.035em; margin: 0 0 16px; text-wrap: balance; }
.hero p { color: var(--muted); font-size: 18px; max-width: 40ch; margin: 0; }

.list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.row {
  --accent: var(--text);
  position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 0 18px;
  padding: 18px 20px; border-top: 1px solid var(--line);
  color: inherit; text-decoration: none; transition: background-color .2s;
}
.row::before {
  content: ""; position: absolute; left: 0; top: -1px; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .25s;
}
/* With JS the selected row is .on and stays selected; without it, plain hover does the job. */
.row.on, .row:focus-visible, html:not(.js) .row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.row.on::before, .row:focus-visible::before, html:not(.js) .row:hover::before { transform: scaleY(1); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row img { width: 52px; height: 52px; border-radius: 12px; }
.name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
h2 { font: 600 clamp(24px, 2.6vw, 30px)/1.15 var(--display); letter-spacing: -.02em; margin: 0; }
.status { font-size: 13px; font-weight: 500; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
/* One colour per project. The row's class picks it; the 3D object reads it from here. */
.unaforge { --accent: #57ab5a; }
.ngi-bench { --accent: #e8a33d; }
.physics { --accent: #8fc2ff; }
.design { --accent: #b78bff; }

.row p { color: var(--muted); margin: 6px 0 10px; }
.go { font-weight: 600; color: var(--accent); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: text-decoration-color .2s; }
.row.on .go, .row:focus-visible .go, html:not(.js) .row:hover .go { text-decoration-color: currentColor; }

/* The 3D stage only exists once three.js has a working renderer (html.three). */
.stage { display: none; pointer-events: none; }
.three .stage { display: block; position: fixed; inset: 0; z-index: -1; opacity: .45; }
.stage canvas { display: block; width: 100%; height: 100%; }

footer { color: var(--muted); font-size: 14px; padding: 44px 0 32px; }

@media (max-width: 599px) {
  .row { grid-template-columns: 40px 1fr; gap: 0 14px; padding: 18px 14px; }
  .row img { width: 40px; height: 40px; border-radius: 10px; }
}
@media (min-width: 900px) {
  .three .shop { grid-template-columns: minmax(0, 620px) 1fr; }
  .three .stage { position: sticky; inset: auto; top: 24px; align-self: start; z-index: 0; opacity: 1; height: min(calc(100vh - 48px), 720px); }
}
@media (prefers-reduced-motion: reduce) { .row, .row::before, .go { transition: none; } }

/* Owner sign-in and admin page (served by worker.js, not a static file). */
.narrow { max-width: 460px; padding: 24px 0; }
.narrow h1 { font-size: 34px; }
.narrow p { color: var(--muted); }
form.signin { display: grid; gap: 14px; margin-top: 24px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
input { font: inherit; color: var(--text); background: #12121a; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus-visible, button:focus-visible { outline: 2px solid #b78bff; outline-offset: 2px; }
button { font: 600 16px var(--body); color: var(--bg); background: var(--text); border: 0; border-radius: 8px; padding: 11px 16px; cursor: pointer; }
button.quiet { color: var(--muted); background: none; border: 1px solid var(--line); font-weight: 500; }
.error { color: #ff9a8f; margin: 16px 0 0; }
.signout { margin-top: 28px; }
