/*
 * base.css — Modern CSS reset + CSS custom properties + base typography.
 * Mobile-first. No framework, no CDN.
 */

/* ─── Custom Properties (spec §11.6 VERBATIM) ─────────────────────────── */
:root {
  --color-bg:          #0f1117;
  --color-surface:     #1a1d27;
  --color-surface-2:   #252836;
  --color-border:      #2e3147;
  --color-text:        #e8eaf0;
  --color-text-muted:  #7c7f99;
  --color-accent:      #c89b3c;   /* oro MtG */
  --color-owned:       #4caf50;
  --color-missing:     #ef5350;
  --color-new:         #42a5f5;
  --color-foil:        #b39ddb;
  --radius-card:       8px;
  --radius-badge:      4px;

  /* Additional tokens */
  --color-btn-primary-bg:   var(--color-accent);
  --color-btn-primary-text: #0f1117;
  --color-btn-secondary-bg: var(--color-surface-2);
  --color-btn-secondary-text: var(--color-text);
  --color-danger:            #ef5350;
  --font-family:             system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-size-base:          15px;
  --line-height-base:        1.55;
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  line-height: var(--line-height-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ─── Base Typography ──────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  color: var(--color-text);
  font-weight: 700;
}

h1 { font-size: 1.6rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.6rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 0.75rem;
}

/* ─── Links ────────────────────────────────────────────────────────────── */
a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--color-text);
  text-decoration: underline;
}

/* ─── Focus ring (accessibility) ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ─── Scrollbar (optional, dark theme) ────────────────────────────────── */
::-webkit-scrollbar             { width: 8px; }
::-webkit-scrollbar-track       { background: var(--color-bg); }
::-webkit-scrollbar-thumb       { background: var(--color-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
