/* styles/base.css */
/* Reset, layout, typography, structure - THEME-AGNOSTIC */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(91, 191, 186, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(91, 191, 186, 0.03) 0%, transparent 40%),
    var(--color-bg-void);
  -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;
  color: inherit;
}

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

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

ul, ol {
  list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p {
  max-width: 65ch;
}

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

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.container-wide {
  max-width: var(--container-wide);
}

/* ===== ACCESSIBILITY ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  padding: var(--space-sm) var(--space-md);
  z-index: 9999;
  border-radius: var(--radius-sm);
  transition: top var(--transition-base);
}

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

/* Focus styles */
:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */
.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;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }

.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

/* ===== SECTION LAYOUTS ===== */
.section {
  padding: var(--space-4xl) 0;
}

.section-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-5xl) var(--space-lg);
}

.section-header {
  margin-bottom: var(--space-3xl);
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--font-size-3xl);
  font-weight: 400;
  text-align: center;
  color: var(--color-yellow);
  margin-bottom: var(--space-sm);
}

.section-divider {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: var(--space-lg) auto var(--space-2xl);
}

/* ===== GRID LAYOUTS ===== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-featured {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-xl);
}

/* ===== FLEX UTILITIES ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ===== SELECTION ===== */
::selection {
  background: var(--color-accent-dim);
  color: var(--color-text-primary);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-void);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
}

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

/* ===== PRINT STYLES ===== */
@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .cookie-banner,
  .theme-toggle,
  .mobile-menu-toggle,
  .btn {
    display: none !important;
  }

  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
}
