body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  background: var(--gradient-page);
  background-color: var(--color-background);
  background-attachment: fixed;
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

::selection {
  background: rgba(227, 28, 35, 0.18);
  color: var(--color-text-primary);
}

.container {
  width: min(100% - var(--space-8), var(--container-max));
  margin-inline: auto;
}

.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.page-content { flex: 1; padding-top: calc(var(--header-height) + var(--space-6)); }
#navbar-container { position: relative; z-index: var(--z-fixed); }
#footer-container { flex-shrink: 0; }

/* Glass utilities */
.glass {
  background: var(--color-glass-panel);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
  border: 1px solid var(--color-border-glass);
  box-shadow: var(--shadow-glass);
}

.glass-panel {
  background: var(--color-glass-strong);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
}

.surface {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.surface-elevated {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-blue { color: var(--color-accent); }

.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;
}

.skip-link:focus {
  position: fixed; top: var(--space-4); left: var(--space-4); z-index: 9999;
  width: auto; height: auto; padding: 0.75rem 1rem; margin: 0;
  clip: auto; overflow: visible; white-space: normal;
  background: var(--color-accent); color: #fff;
  border-radius: var(--radius-button);
  text-decoration: none; font-weight: var(--font-weight-semibold);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-full);
}
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

/* Sections */
.section { padding: var(--space-20) 0; }

.section--alt {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  border-block: 1px solid var(--color-border);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-12);
}

.section-header h1,
.section-header h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
  letter-spacing: var(--letter-spacing-display);
  color: var(--color-text-primary);
}

.section-header p {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}

.section-head-row h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-primary);
}

.section-head-row a,
.view-all-link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.section-head-row a:hover,
.view-all-link:hover { opacity: 0.75; }

.ad-slot { display: none; min-height: 0; }
.ad-slot[data-ad-active] { display: block; min-height: 90px; }
