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

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

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.admin-bar {
  padding-top: 32px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 5vw, var(--font-size-4xl)); font-weight: var(--font-weight-black); }
h2 { font-size: clamp(1.6rem, 3.5vw, var(--font-size-3xl)); }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--font-size-xl)); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  line-height: var(--line-height-base);
  color: var(--color-text-soft);
}

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

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

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

ul, ol { list-style: none; }

button {
  font-family: var(--font-primary);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
}

/* Selection */
::selection {
  background: var(--color-accent);
  color: #fff;
}

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

/* Scroll margin for anchors */
[id] { scroll-margin-top: calc(var(--nav-height) + 20px); }

/* Screen reader only */
.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;
}

/* Accent text */
.text-accent { color: var(--color-accent) !important; }
.text-muted  { color: var(--color-text-muted) !important; }
.text-white  { color: var(--color-text) !important; }
.text-dark   { color: var(--color-text-dark) !important; }

/* On cream background, adjust heading color */
.section-cream h1,
.section-cream h2,
.section-cream h3,
.section-cream h4,
.section-cream p { color: var(--color-text-dark); }

.section-cream p { color: #4a4a4a; }

.section-cream a { color: var(--color-accent-dark); }
