/* ─────────────────────────────────────────────
   BASE · reset + typography
   X3D Studio — Technical Control Surface
   ───────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
}

body {
  min-height: 100dvh;
  /* subtle noise texture across all surfaces */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.018'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); margin: 0; }

img, video, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul, ol { list-style: none; margin: 0; padding: 0; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ── type roles ────────────────────────────── */

.display {
  font-family: var(--font-serif);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  font-weight: 400;
  color: var(--text);
}

/* ── utilities ─────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
