/* ── Base Element Defaults ───────────────────────────────────────────────
   Element-level styles only. No class selectors.
   All values reference design tokens — zero hardcoded values.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Body ──────────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Links ─────────────────────────────────────────────────────────────── */

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: color-mix(in srgb, var(--color-accent) 80%, #fff);
}

/* ── Headings ──────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); }
h4 { font-size: var(--text-sm); }
h5 { font-size: var(--text-sm); }
h6 { font-size: var(--text-xs); }

/* ── Inputs & Textareas ────────────────────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  min-height: var(--input-height-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

button {
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Code & Pre ────────────────────────────────────────────────────────── */

code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-bg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ── Tables ────────────────────────────────────────────────────────────── */

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

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* ── Labels ────────────────────────────────────────────────────────────── */

label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

/* ── Images ────────────────────────────────────────────────────────────── */

img {
  max-width: 100%;
  height: auto;
}

/* ── Selection ─────────────────────────────────────────────────────────── */

::selection {
  background: color-mix(in srgb, var(--color-accent) 30%, transparent);
  color: var(--color-text);
}

/* ── Scrollbars ────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}
