/**
 * VICTORY GRACEJOHNS - BASE STYLES & RESET
 * Accessible reset, fluid typography base, layout containers, and utilities.
 */

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

html {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-body);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  text-decoration: none;
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--text-heading);
  outline-offset: 2px;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-family: var(--font-primary);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-body);
  font-size: var(--text-base);
  font-weight: 400;
}

p.lead {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.65;
}

small, .caption {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

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

a:hover {
  color: var(--accent-hover);
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

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

ul, ol {
  list-style: none;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: clamp(3.5rem, 3rem + 3vw, 7rem);
  padding-bottom: clamp(3.5rem, 3rem + 3vw, 7rem);
  position: relative;
}

.section--bordered {
  border-top: 1px solid var(--border-color);
}

/* Editorial Dividers */
.divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
  margin: var(--space-8) 0;
  border: none;
}

/* Flex & Grid Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

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