/*  base.css — minimal, responsive starter sheet
    -------------------------------------------------------------- */

/* 0. CSS Reset (small) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 1. Root variables */
:root {
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --text: #1a1a1a;
  --text-soft: #4a5568;
  --primary: #2563eb;
  --border: #e2e8f0;
  --radius: 6px;
  --max-width: 65ch;
  --space: clamp(1rem, 2vw, 1.5rem);
}

/* 2. Base typography & colors */
body.base, body {
  font-family: var(--font-system);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 3. Layout helpers */
body.base { padding: var(--space); }
main, header, footer { max-width: var(--max-width); margin: 0 auto; }
section + section { margin-top: var(--space); }

/* 4. Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.5em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

/* 5. Links */
a { color: var(--primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* 6. Buttons */
button, .btn {
  cursor: pointer;
  display: inline-block;
  padding: 0.5em 1em;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  background: transparent;
  font: inherit;
  transition: background .15s;
}
button:hover, .btn:hover {
  background: var(--primary);
  color: #fff;
}

/* 7. Forms */
input, textarea, select {
  width: 100%;
  padding: 0.5em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}
label { display: block; margin-bottom: 0.25em; }

/* 8. Code */
pre, code {
  font-family: var(--mono);
  background: var(--bg-soft);
  border-radius: var(--radius);
}
pre { padding: 1em; overflow-x: auto; margin: 1em 0; }
code { padding: 0.125em 0.25em; }

/* 9. Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
th, td {
  padding: 0.5em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}


/* 10. Responsive images */
img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 11. Dark-mode toggle (optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --bg-soft: #1f2937;
    --text: #f9fafb;
    --text-soft: #d1d5db;
    --border: #374151;
  }
}