/*
 * Vector-First Design Standard v1.0 — Base styles.
 * Reset + body + theme attribute hooks. Consumers attach data-theme to
 * the html root and the SDK takes it from there.
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="system"] {
  color-scheme: light dark;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-base);
  background-color: var(--bg-dark);
  color: var(--fg-dark);
  /* Vector-First grid background — visible only on dark theme. */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  overflow-x: hidden;
  transition:
    background-color var(--motion-base),
    color var(--motion-base),
    border-color var(--motion-base);
}

html[data-theme="light"] body {
  background-color: var(--bg-light);
  color: var(--fg-light);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] body {
    background-color: var(--bg-light);
    color: var(--fg-light);
    background-image:
      linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  }
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--motion-base);
}

a:hover {
  opacity: 0.7;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
}

/* Display type — hero and serifed brand voice */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--fs-2xl); margin-bottom: var(--space-5); }
h3 { font-size: var(--fs-xl); margin-bottom: var(--space-3); }
h4 { font-size: var(--fs-lg); margin-bottom: var(--space-3); font-weight: 600; }
h5, h6 { font-size: var(--fs-md); margin-bottom: var(--space-2); font-weight: 600; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

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

/* Vector-First principle — no raster images in the SDK itself.
   Consumers may include their own logos/banners (per DEC-009). */

/* Skip-to-content for keyboard / screen-reader users (a11y baseline). */
.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;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  padding: var(--space-2) var(--space-4);
  background: var(--fg-dark);
  color: var(--bg-dark);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  z-index: var(--z-toast);
  transition: top var(--motion-fast);
}

html[data-theme="light"] .skip-link {
  background: #1a1a1a;
  color: #ffffff;
}

.skip-link:focus {
  top: var(--space-3);
}

/* Reduce-motion users get instant transitions. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
