/* ==========================================================================
   Base — Reset, Body, Grain Overlay, Typography Defaults
   ========================================================================== */

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

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

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

ul,
ol {
  list-style: none;
}

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

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

input,
textarea,
select {
  font: inherit;
}

/* ---- Body ---- */
body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: var(--body-leading);
  color: var(--deep-teal);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Grain Overlay (4% opacity per Brand Guide) ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  line-height: 1.2;
  color: var(--deep-teal);
}

h1 {
  font-size: var(--h1-size);
  letter-spacing: var(--h1-tracking);
  font-weight: var(--heading-weight-bold);
}

h2 {
  font-size: var(--h2-size);
  letter-spacing: var(--h2-tracking);
}

h3 {
  font-size: var(--h3-size);
}

/* ---- Body Text ---- */
p {
  margin-bottom: var(--space-sm);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: var(--body-weight-medium);
}

.text-large {
  font-size: 1.125rem;
  line-height: 1.8;
}

.text-small {
  font-size: var(--small-size);
}

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

.text-data {
  font-family: var(--font-data);
  font-weight: var(--body-weight-medium);
}

/* ---- Links ---- */
.link {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.link:hover {
  color: var(--burnt-coral);
}

/* ---- Spacing Utilities ---- */
.mb-xs { margin-bottom: var(--space-xs); }
.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); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

/* ---- Selection ---- */
::selection {
  background-color: var(--amber-light);
  color: var(--deep-teal);
}
