/* Global setup */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (min-width: 1024px) {
  html {
    font-size: 17px;
  }
}

body {
  font-family: var(--font-body);
  color: var(--color-charcoal);
  background-color: var(--color-off-white);
  line-height: var(--leading-body);
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-display);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-charcoal);
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.75rem, 4vw, var(--text-3xl)); }
h3 { font-size: clamp(1.5rem, 3.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
  color: var(--color-text-mid);
}

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

/* Italic accent word */
.accent-word {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--color-aqua-dark);
}

/* Section headings */
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-aqua-dark);
  margin-bottom: var(--space-2);
}

/* ── Form Error states ──────────────────── */
.form-error {
  border-color: #ff3333;
}
.error-msg {
  color: #ff3333;
  font-size: var(--text-xs);
  margin-top: 4px;
}

/* ── Floating Background Vectors ────────── */
.floating-vector {
  position: absolute;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
  max-width: 250px;
}

@media (max-width: 960px) {
  .floating-vector {
    max-width: 180px;
    opacity: 0.15;
  }
}

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

/* ── Search Modal ───────────────────────── */
.search-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.search-modal.is-active {
  opacity: 1;
}
.search-modal-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.search-modal-content {
  position: relative;
  background: var(--color-white);
  max-width: 600px;
  margin: 100px auto 0;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}
.search-modal.is-active .search-modal-content {
  transform: translateY(0);
}
.search-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 8px;
}
.search-modal-close:hover {
  color: var(--color-charcoal);
}
.search-modal h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-4);
  text-align: center;
}
.search-modal-form {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.search-modal-form input {
  flex: 1;
  padding: 16px 24px;
  font-size: 1.1rem;
  border: 2px solid var(--color-charcoal);
  border-radius: var(--radius-full);
  outline: none;
}
.search-modal-form input:focus {
  border-color: var(--color-aqua-dark);
}
.search-modal-form button {
  padding: 0 32px;
}
.search-modal-popular {
  display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center;
  align-items: center; font-size: 0.9rem;
}
.search-modal-popular span {
  color: var(--color-text-light);
}
.search-modal-popular a {
  color: var(--color-charcoal);
  text-decoration: underline;
  text-decoration-color: var(--color-baby-pink-dark);
  text-underline-offset: 4px;
}
.search-modal-popular a:hover {
  color: var(--color-aqua-dark);
}

@media (max-width: 600px) {
  .search-modal-content {
    margin: 60px 16px 0;
    padding: var(--space-4);
  }
  .search-modal-form {
    flex-direction: column;
  }
  .search-modal-form button {
    padding: 16px;
  }
}

/* ── Utilities ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--color-charcoal);
  color: var(--color-white);
  border-color: var(--color-charcoal);
}
.btn-primary:hover {
  background: transparent;
  color: var(--color-charcoal);
}

.btn-secondary {
  background: transparent;
  color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}
.btn-secondary:hover {
  background: var(--color-charcoal);
  color: var(--color-white);
}

.btn-pink {
  background: var(--color-baby-pink-dark);
  color: var(--color-white);
  border-color: var(--color-baby-pink-dark);
}
.btn-pink:hover {
  background: transparent;
  color: var(--color-baby-pink-dark);
}

.btn-aqua {
  background: var(--color-aqua-dark);
  color: var(--color-white);
  border-color: var(--color-aqua-dark);
}
.btn-aqua:hover {
  background: transparent;
  color: var(--color-aqua-dark);
}

/* ── Section wrapper ────────────────────── */
.section-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 5vw;
}

/* ── Forms ──────────────────────────────── */
.form-group {
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1.5px solid var(--color-muted);
  border-radius: var(--radius-full);
  background-color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-charcoal);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-aqua-mid);
  box-shadow: 0 0 0 3px rgba(107, 207, 200, 0.2);
}

/* ── Accessibility ──────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Utility: text colours */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
