/* ==========================================================================
   SUJUD NOIR DESIGN SYSTEM — CSS Reset & Global Baseline
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none;
  text-shadow: none;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--app-bg);
}

html, body {
  max-width: 100%;
  overflow-x: clip;
  position: relative;
  width: 100%;
  background-color: var(--app-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  line-height: var(--body-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-size: var(--body);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: var(--h4); }

p {
  color: var(--text-secondary);
  line-height: var(--body-line-height);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

input, textarea, select {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

::selection {
  background-color: var(--selection);
  color: var(--text-primary);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--app-bg);
  border-left: 1px solid var(--app-border-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--app-border);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Skip to main content landmark */
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: var(--small);
  font-weight: var(--weight-bold);
  text-decoration: none;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* Accessible Keyboard Focus Outline */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Anchor scroll clearance for sticky header */
section[id] {
  scroll-margin-top: calc(var(--nav-height) + 16px);
}

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