/* Base Typography, Reset, and Document Foundations */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-on-surface);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
  padding-top: var(--header-height);
}

body:has(.site-announcement-bar) main {
  padding-top: var(--header-height);
}

main.admin-main {
  padding-top: 0;
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* Typographic Scale Classes */
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

.text-display-xl {
  font-family: var(--font-display);
  font-size: var(--text-4xl); /* 48px */
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.text-headline-lg {
  font-family: var(--font-display);
  font-size: var(--text-3xl); /* 36px */
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.text-headline-md {
  font-family: var(--font-display);
  font-size: var(--text-2xl); /* 28px */
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0;
}

.text-headline-sm {
  font-family: var(--font-display);
  font-size: var(--text-xl); /* 22px */
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: 0;
}

.text-title-md {
  font-family: var(--font-body);
  font-size: var(--text-lg); /* 18px */
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: 0.01em;
}

.text-body-lg {
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px */
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
}

.text-body-md {
  font-family: var(--font-body);
  font-size: var(--text-base); /* 16px */
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

.text-body-sm {
  font-family: var(--font-body);
  font-size: var(--text-sm); /* 14px */
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: 0.01em;
}

.text-label-caps {
  font-family: var(--font-body);
  font-size: var(--text-xs); /* 11px */
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-metadata-mono {
  font-family: var(--font-body);
  font-size: var(--text-xs); /* 12px */
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: 0.04em;
}

/* Material Symbols icon helper */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-feature-settings: 'liga';
  font-weight: normal;
  font-style: normal;
  font-size: 1em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Reduced Motion Override */
@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;
  }
}
