/* Sagara v2 — base. Layer 2 of 5: element defaults only, no classes. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-md) / var(--lh) var(--sans);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, kbd, samp, pre { font-family: var(--mono); font-size: 0.92em; }
kbd {
  padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: var(--r-sm); color: var(--ink-2); background: var(--surface-2);
  font-size: var(--t-xs);
}

hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 500; }

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 6px 9px; min-height: 32px;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

::selection { background: var(--accent-soft); color: var(--ink); }

img, svg, canvas { display: block; max-width: 100%; }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
