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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.7;
  text-rendering: optimizeSpeed;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  margin: 0;
}

ul,
ol {
  list-style: none;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
}

/* Typography Base Styles - Apple-Inspired */
h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.4;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.4;
}

h6 {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.5;
}

p {
  font-size: var(--text-base);
  line-height: 1.7;
}

small {
  font-size: var(--text-sm);
}

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

/* ============================================
   ACCESSIBILITY (WCAG AA)
   ============================================ */

/* Global Focus Visible Styles */
*:focus-visible {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Remove default outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  padding: 12px 20px;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.3s ease;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* Screen Reader Only (visually hidden) */
.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;
}

/* Ensure sufficient color contrast for links */
a:not([class]) {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:not([class]):hover {
  color: var(--accent-cyan);
  text-decoration-thickness: 2px;
}
