/* prized hiring. The dashboard's dark token set (prized.dev/dashboard,
   controlplane/web/app/globals.css [data-theme='dark']), Inter at the
   Linear scale (12/13/15/24) and pills on the 24/28/32 ladder, but its own
   frame: a top bar over one reading column. Colour means state (the accent,
   ok, bad), never decoration. */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/InterVariable-core.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --window: lch(2.6% 0.4 272);
  --background: lch(5.5% 0.4 272);
  --foreground: #ffffff;
  --card: lch(7.3% 0.85 272);
  --muted: lch(9.4% 0.85 272);
  --muted-foreground: lch(61.8% 1.2 272);
  --secondary-foreground: lch(90.4% 1.2 272);
  --faint-foreground: lch(37% 1.2 272);
  --accent: lch(11% 0.85 272);
  --border-subtle: lch(9.8% 1.48 272);
  --border: lch(14.2% 1.48 272);
  --border-strong: lch(16.3% 1.48 272);
  --primary: #3b6cff;
  --ring: #6a9cff;
  --ok: #40b956;
  --bad: #ff5d5e;
  --shadow-resting: 0 0.5px 1px 1px rgb(0 0 0 / 0.3);
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  font-feature-settings: 'cv11' 0, 'calt';
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
::selection { background: color-mix(in oklch, var(--primary), transparent 55%); }
:focus-visible { outline: 1px solid var(--ring); outline-offset: 2px; }

/* ---- frame: a top bar and one reading column ---------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in oklch, var(--background), transparent 12%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  text-decoration: none;
  font-weight: 600;
}
.brand svg { width: 16px; height: 16px; fill: currentColor; }
.brand span { color: var(--muted-foreground); font-weight: 450; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 24px 112px;
}
.page.wide { max-width: 1040px; }

@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .brand span { display: none; }
  .page { padding: 40px 20px 80px; }
}

/* ---- type --------------------------------------------------------------- */

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.lede {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 24px;
  color: var(--secondary-foreground);
  max-width: 620px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 14px;
  color: var(--muted-foreground);
}
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 14px; height: 14px; color: var(--faint-foreground); }
.meta b { color: var(--foreground); font-weight: 500; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.title-row .copy-md { flex-shrink: 0; }
@media (max-width: 600px) {
  .title-row .copy-md { width: 28px; padding: 0; }
  .title-row .copy-md [data-copy-label] { display: none; }
}

section { margin-top: 56px; scroll-margin-top: 72px; }
h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
}
h3 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; }

.prose p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 24px;
  color: var(--secondary-foreground);
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--foreground); font-weight: 600; }

/* Inline code, as in the product docs (prized.dev/docs): JetBrains Mono at
   13px on a filled chip, no hairline. The fill is a step lighter than the
   docs' so it still reads on a card. */
code {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  padding: 0.0625rem 0.3125rem;
  border-radius: 4px;
  background: lch(13% 1.2 272);
  /* The docs' dark code palette: ink, and the token colours below. */
  color: #e8e8ec;
  white-space: nowrap;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
h3 code { font-size: 0.9em; }
.tk-verb { color: #6aa4ff; }
.tk-mod { color: #bf8fff; }
.tk-plumb { color: #a4a8b2; }

.muted { color: var(--muted-foreground); }
.faint { color: var(--faint-foreground); }

/* ---- cards and rows ----------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-head .glyph {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--secondary-foreground);
}
.card-head .glyph svg { width: 14px; height: 14px; }
.card-head .sub { margin-left: auto; color: var(--muted-foreground); font-size: 12px; }

.rows { margin: 0; padding: 0; list-style: none; }
.rows > li {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 4px 24px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}
.rows > li:first-child { border-top: 0; }
.rows .k { color: var(--foreground); font-weight: 500; }
.rows .v { color: var(--secondary-foreground); line-height: 20px; }
.rows.flush > li { padding-left: 0; padding-right: 0; }
.rows.flush > li:first-child { border-top: 0; }

@media (max-width: 600px) {
  .rows > li { grid-template-columns: minmax(0, 1fr); }
}

.callout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.callout .glyph { color: var(--primary); padding-top: 1px; }
.callout .glyph svg { width: 16px; height: 16px; }
.callout p { margin: 4px 0 0; color: var(--secondary-foreground); line-height: 20px; }

.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bullets li { position: relative; padding-left: 18px; font-size: 15px; line-height: 24px; color: var(--secondary-foreground); }
.bullets li::before { content: ''; position: absolute; left: 3px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint-foreground); }

.steps { counter-reset: step; list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 18px; }
.steps > li { counter-increment: step; position: relative; padding-left: 36px; font-size: 15px; line-height: 24px; color: var(--secondary-foreground); }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--border); background: var(--muted);
  font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--muted-foreground);
}
.steps strong { color: var(--foreground); font-weight: 600; }
.steps .checklist { margin-top: 10px; }

.checklist { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.checklist li { display: flex; gap: 8px; color: var(--secondary-foreground); line-height: 20px; }
.checklist svg { width: 14px; height: 14px; margin-top: 3px; flex-shrink: 0; color: var(--faint-foreground); }
@media (max-width: 600px) { .checklist { grid-template-columns: minmax(0, 1fr); } }

.index {
  font-variant-numeric: tabular-nums;
  color: var(--faint-foreground);
  font-weight: 500;
  margin-right: 8px;
}

/* ---- buttons and fields ------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, opacity 150ms;
}
.btn svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-resting); }
.btn-primary:hover { background: color-mix(in oklch, var(--primary), black 8%); }
.btn-secondary { background: var(--muted); border-color: var(--border); color: var(--secondary-foreground); box-shadow: var(--shadow-resting); }
.btn-secondary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { background: color-mix(in oklch, var(--accent), transparent 40%); color: var(--foreground); }
.btn-danger { background: transparent; color: var(--bad); }
.btn-danger:hover { background: color-mix(in oklch, var(--bad), transparent 90%); }
.btn-lg { height: 32px; padding: 0 12px; font-size: 13px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted-foreground); }
.input {
  height: 32px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  outline: none;
  transition: border-color 150ms;
}
.input::placeholder { color: var(--faint-foreground); }
.input:hover { border-color: color-mix(in oklch, var(--border-strong), white 6%); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }

/* ---- the upload --------------------------------------------------------- */

.drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 176px;
  padding: 28px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 150ms;
}
.drop:hover, .drop.over { background-color: color-mix(in oklch, var(--accent), transparent 30%); }
.drop.over { box-shadow: inset 0 0 0 1px var(--ring); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--muted);
  color: var(--secondary-foreground);
}
.drop .icon svg { width: 16px; height: 16px; }
.drop strong { font-size: 13px; font-weight: 500; }
.drop .hint { color: var(--muted-foreground); }
.drop .hint u { color: var(--foreground); text-decoration: none; border-bottom: 1px solid var(--border-strong); }

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.file-row .icon { color: var(--muted-foreground); display: grid; }
.file-row .icon svg { width: 16px; height: 16px; }
.file-row .name { min-width: 0; flex: 1; }
.file-row .name b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .name small { display: block; font-size: 12px; color: var(--muted-foreground); }
.file-row .ok { color: var(--ok); }

.bar { height: 2px; background: var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 200ms linear; }

.upload-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--muted-foreground);
  font-size: 12px;
}
.upload-foot .actions { margin-left: auto; display: flex; gap: 6px; }
.error { color: var(--bad); }

[hidden] { display: none !important; }

/* ---- admin -------------------------------------------------------------- */

.mint { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr auto; gap: 12px; align-items: end; padding: 16px; }
@media (max-width: 760px) { .mint { grid-template-columns: minmax(0, 1fr); } }

.minted { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border-subtle); background: color-mix(in oklch, var(--primary), transparent 94%); }
.minted .input { font-family: var(--mono); font-size: 12px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted-foreground);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table td small { display: block; color: var(--muted-foreground); font-size: 12px; margin-top: 2px; }
.table .num { font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table .row-actions { display: inline-flex; gap: 4px; }
.dim td { opacity: 0.55; }

@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 16px; border-top: 1px solid var(--border-subtle); }
  .table tr:first-child { border-top: 0; }
  .table td { padding: 2px 0; border: 0; }
  .table .right { text-align: left; padding-top: 8px; }
}

.timeline { list-style: none; margin: 0; padding: 6px 0; }
.timeline li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 5px 16px; }
.timeline .when { color: var(--faint-foreground); font-size: 12px; text-align: right; }
.timeline .what { color: var(--secondary-foreground); }

.empty { padding: 32px 16px; text-align: center; color: var(--muted-foreground); }

.center { min-height: 70svh; display: grid; place-items: center; }
.narrow { width: 100%; max-width: 360px; }
.narrow p { color: var(--muted-foreground); line-height: 20px; }

/* ---- the root page: a very faint Game of Life, nothing else (void.js) ---- */

body:has(.void-life) { background: #050506; }
.void-life {
  /* Fills the window; void.js sizes the grid to it and centres the rest. */
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--mono);
  white-space: pre;
  color: lch(11% 1.2 272);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  cursor: default;
}
.void-life i { font-style: normal; color: lch(17% 1.4 272); }
.void-life b { font-weight: 400; color: lch(42% 1.4 272); }
.void-life u { text-decoration: none; color: lch(7.5% 1 272); }
