/* ── Design tokens ──────────────────────────────────── */
:root {
  --color-primary: #2563eb;
  --color-accent: #0ea5e9;
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #cbd5e1;

  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 30rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #60a5fa;
    --color-accent: #38bdf8;
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    --color-muted: #94a3b8;
    --color-border: #334155;
  }
}

/* ── Reset & base ──────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────── */
.app-header {
  text-align: center;
  padding: 1.25rem 1rem 0.5rem;
}

.app-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

/* ── Main ───────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* ── Controls ───────────────────────────────────────── */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* ── Footer ─────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.7rem;
  color: var(--color-muted);
}

.app-footer a {
  color: var(--color-accent);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ── Utilities ──────────────────────────────────────── */
@media (min-width: 400px) {
  .app-header {
    padding-top: 1.75rem;
  }
}
