/* ==========================================================================
   Glow & Gather — Base Styles
   CSS reset, global typography, and foundational element styles.
   ========================================================================== */

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

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

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

ul,
ol {
  list-style: none;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* -------------------------------------------------------------------------
   Body
   ------------------------------------------------------------------------- */
body {
  background-color: var(--color-off-white);
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -------------------------------------------------------------------------
   Typography — Headings
   All headings use Playfair Display at weight 400.
   Sizes are mobile-first, scaling up at breakpoints.
   ------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-tight);
  color: var(--color-charcoal);
}

h1 {
  font-size: var(--font-size-2xl);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-xl);
}

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

h4 {
  font-size: var(--font-size-md);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--font-size-4xl);
  }

  h2 {
    font-size: var(--font-size-3xl);
  }

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

  h4 {
    font-size: var(--font-size-lg);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--font-size-5xl);
  }

  h2 {
    font-size: var(--font-size-4xl);
  }

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

/* -------------------------------------------------------------------------
   Typography — Body Elements
   ------------------------------------------------------------------------- */
p {
  margin-bottom: var(--space-4);
}

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

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

small {
  font-size: var(--font-size-sm);
}

/* -------------------------------------------------------------------------
   Links
   ------------------------------------------------------------------------- */
a {
  color: var(--color-charcoal);
  transition: color var(--transition-fast),
              text-decoration-color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-beige);
  text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------
   Selection
   ------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-beige);
  color: var(--color-charcoal);
}

::-moz-selection {
  background-color: var(--color-beige);
  color: var(--color-charcoal);
}

/* -------------------------------------------------------------------------
   Focus Styles (Accessibility)
   ------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-beige-dark);
  outline-offset: 2px;
}

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

/* -------------------------------------------------------------------------
   Skip Link (Accessibility)
   ------------------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 9999;
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-charcoal);
  color: var(--color-off-white);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateX(-50%) translateY(0);
  outline: 2px solid var(--color-beige-dark);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Screen Reader Only (Utility)
   ------------------------------------------------------------------------- */
.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;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
