/* Error / maintenance scenes — the animated ASCII galaxy.
   Standalone (base + type + fonts tokens only): used by not-found, forbidden,
   unauthorized, error, global-error and maintenance pages, never by the
   dashboard. Matches the landing's mono/ASCII language. */

/* Match the landing's body face (Geist), overriding type.css's system stack. */
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
}

.error-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 22px 24px 32px;
}

/* ── Top bar: brand left, tiny status right ── */
.error-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.error-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.error-brand img {
  width: 18px;
  height: 18px;
  display: block;
  opacity: 0.82;
}

.error-status {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Scene ── */
.error-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 28px;
  padding: 24px 0 8px;
}

/* Galaxy canvas: square-ish, centred, sized off the viewport. */
.error-galaxy {
  position: relative;
  width: min(56vmin, 460px);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
}

.error-galaxy__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Copy ── */
.error-copy {
  width: min(46rem, 100%);
  text-align: center;
}

.error-code {
  margin: 0;
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(52px, 13vw, 104px);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.error-code span {
  color: var(--text-faint);
}

.error-title {
  margin: 14px 0 0;
  font-size: var(--fs-title-lg);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-tight);
  color: var(--text);
}

.error-detail {
  margin: 10px auto 0;
  max-width: 40rem;
  font-size: var(--fs-body-lg);
  line-height: 1.5;
  color: var(--text-muted);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-snug);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.error-btn:hover {
  background: var(--bg-elev);
  border-color: var(--text-faint);
}

.error-btn--primary {
  background: #fafafa;
  border-color: #fafafa;
  color: #18181b;
}

.error-btn--primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
  color: #18181b;
}

html[data-theme="light"] .error-btn--primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.error-btn:active {
  transform: scale(0.985);
}

/* ── Foot: machine-ish detail line ── */
.error-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.error-foot b {
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

.error-foot .sep {
  opacity: 0.4;
}

@media (min-width: 900px) {
  .error-scene {
    gap: 34px;
  }
}
