/* styles.css — design tokens, reset, base typography, shared primitives.
   Dark "observatory" theme: a deep night palette with a warm amber accent (echoing
   the town's sun and the agent selection ring). System fonts only (no external
   dependencies); accessible focus styles; prefers-reduced-motion support. */

:root {
  /* Palette — deep night with high-contrast text */
  --bg: #0a0e18;           /* page / deep space */
  --panel: #131a29;        /* card surface */
  --panel-2: #1a2333;      /* raised / inset surface */
  --ink: #e9edf6;          /* primary text — ~14:1 on --panel */
  --muted: #97a3bb;        /* secondary text — ~6:1 on --panel */
  --line: #28324a;
  --line-strong: #3b4763;
  --accent: #f4b740;       /* warm amber */
  --accent-ink: #1b1400;   /* text on amber */
  --accent-dim: #c98f1f;
  --danger: #ff6b6b;
  --ok: #57c98a;

  /* Memory / timeline type accents — brightened for dark surfaces */
  --c-observation: #5b9cff;
  --c-action: #d6a64a;
  --c-conversation: #46c98a;
  --c-reflection: #b07cff;
  --c-event: #ff7a52;
  --c-movement: #34c5cf;
  --c-plan: #97a3bb;

  /* Spacing / shape */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.25; }
p { margin: 0 0 var(--space-2); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

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

/* ---- Buttons & form controls ---- */
.btn {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 650;
}
.btn--primary:hover:not(:disabled) { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn--ghost { background: transparent; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.select,
.input {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  min-width: 0;
}
.input--seed { width: 150px; }

/* Accessible focus (visible on keyboard) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
