/* ═══════════════════════════════════════════════════════════
   Base — reset, typography, scrollbars, form primitives
═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { min-height: 100%; }

h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

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

::selection { background: var(--accent-soft); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-4); background-clip: padding-box; }

/* form primitives */
input, select, textarea, button { font-family: inherit; }

input, select, textarea {
  background: var(--inset);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--r1);
  padding: .5rem .7rem;
  width: 100%;
  outline: none;
  font-size: .9rem;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-4); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="number"] { font-family: var(--font-mono); }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: left 1rem center, calc(left 1rem center);
  background-position: left .85rem center, left .6rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 1.6rem;
  cursor: pointer;
}

input[type="checkbox"] { width: auto; accent-color: var(--accent); }
input[type="file"] { padding: .4rem; font-size: .82rem; }
input[type="date"], input[type="time"] { font-family: var(--font-mono); }

label { font-size: .76rem; color: var(--text-2); font-weight: 600; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }
.faint { color: var(--text-4); }

/* utility text */
.u-tiny  { font-size: .7rem; }
.u-sm    { font-size: .8rem; }
.u-up    { text-transform: uppercase; letter-spacing: .08em; }
.u-bold  { font-weight: 700; }
.u-right { text-align: right; }
.u-center{ text-align: center; }
.u-nowrap{ white-space: nowrap; }
.u-wrap  { white-space: normal; word-break: break-word; }

.visually-hidden {
  position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0);
}
