/*
  DESIGN SYSTEM — BASE
  v1 — resets + bare element styling. Import AFTER tokens.css.
  Goal: an unstyled HTML page should look reasonably on-brand the moment
  this file is linked, before any component classes are added.
*/

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

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

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-3) 0;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  line-height: 1.25;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); font-weight: 600; }

p {
  margin: 0 0 var(--space-4) 0;
  color: var(--color-text-secondary);
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: opacity var(--transition-base);
}
a:hover { opacity: 0.75; }

small { font-size: var(--text-xs); color: var(--color-text-tertiary); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

hr {
  border: none;
  border-top: var(--hairline);
  margin: var(--space-6) 0;
}

ul, ol {
  margin: 0 0 var(--space-4) 0;
  padding-left: var(--space-5);
  color: var(--color-text-secondary);
}

/* Bare buttons, before .btn variants are applied */
button {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  cursor: pointer;
  border: none;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Bare inputs, before .input class is applied */
input, textarea, select {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.14);
}
input::placeholder, textarea::placeholder { color: var(--color-text-tertiary); }

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  border-bottom: var(--hairline);
  padding: var(--space-3) var(--space-4);
}
td {
  padding: var(--space-3) var(--space-4);
  border-top: var(--hairline-quiet);
  color: var(--color-text-primary);
}

::selection {
  background: rgba(var(--brand-rgb), 0.2);
}

/* Utility: hairline-quiet border helper for anything not using a component class */
.u-border { border: var(--hairline); }
.u-muted { color: var(--color-text-tertiary); }
