/* ==========================================================================
   AETHER DESIGN SYSTEM — BASE & RESET
   Source: docs/04-DESIGN-SYSTEM-OFICIAL.md
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-off-white);
  color: var(--color-deep-black);
  line-height: var(--leading-body);
  font-weight: 400;
  overflow-x: clip;
  width: 100%;
  min-width: 320px;
}

#main-content {
  overflow-x: clip;
  width: 100%;
}

/* Hard constraint: No justified text */
p, h1, h2, h3, h4, h5, h6, li, blockquote {
  text-align: left;
}

/* Headings */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Standard measure: 45–72 characters per line */
p {
  max-width: 68ch;
  overflow-wrap: break-word;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

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

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

ul, ol {
  list-style: none;
}

/* Accessible focus ring (WCAG AA Compliant) */
:focus-visible {
  outline: 2px solid var(--color-aether-blue);
  outline-offset: 2px;
}

/* On dark surfaces, focus outline becomes white/off-white */
.surface-dark :focus-visible,
.surface-blue :focus-visible {
  outline: 2px solid var(--color-off-white);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Skip link for keyboard accessibility */
.skip-to-content {
  position: absolute;
  top: -9999px;
  left: 20px;
  background: var(--color-deep-black);
  color: var(--color-off-white);
  padding: 12px 20px;
  z-index: 1000;
  font-family: var(--font-body);
  font-size: var(--text-ui-action);
  font-weight: 500;
}

.skip-to-content:focus {
  top: 20px;
}
