/* =============================================
   Ian & Nicole Wedding Website
   Base Styles, Custom Properties, Reset, Layout
   ============================================= */

/* --- Custom Properties --- */
:root {
  /* Colors — Hunter Green & Rust Orange wedding palette */
  --color-forest: #2C4A2E;
  --color-forest-deep: #1a331c;
  --color-moss: #5B7F5E;
  --color-sage: #7A9B7D;
  --color-parchment: #F5F0E8;
  --color-stone: #E8E0D4;
  --color-wine: #7A2E3B;
  --color-rust: #B85C38;
  --color-rust-light: #D4845E;
  --color-rust-deep: #8B4028;
  --color-amber: #C9963B;
  --color-copper: #C47A4A;
  --color-wood-dark: #3B2F2A;
  --color-wood-light: #6B5D52;
  --color-candlelight: #F0D9A0;
  --color-linen: #FDFBF7;

  /* Atmospheric palette — moody section backgrounds */
  --color-section-warm: #3D3229;
  --color-section-moss: #2A3E2B;
  --color-section-deep: #252220;
  --color-section-twilight: #2E2926;
  --color-section-hearth: #352D28;

  /* Typography */
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Lora', 'Georgia', serif;
  --font-accent: 'Cinzel', 'Times New Roman', serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-hero: clamp(3rem, 8vw, 6rem);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-section: clamp(4rem, 8vw, 8rem);

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-form: 600px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease-out;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(59, 47, 42, 0.06);
  --shadow-md: 0 4px 20px rgba(59, 47, 42, 0.08);
  --shadow-lg: 0 8px 40px rgba(59, 47, 42, 0.12);
  --shadow-hover: 0 12px 48px rgba(59, 47, 42, 0.16);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-parchment);

  /* Persistent atmospheric gradient — matches the hero */
  background:
    linear-gradient(
      135deg,
      rgba(44, 74, 46, 0.85) 0%,
      rgba(59, 47, 42, 0.75) 40%,
      rgba(44, 74, 46, 0.8) 100%
    ),
    radial-gradient(ellipse at 20% 50%, rgba(91, 127, 94, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 150, 59, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(122, 46, 59, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, #1a331c 0%, #2C4A2E 30%, #3B2F2A 70%, #1a1512 100%);
  background-attachment: fixed;
  background-color: var(--color-forest-deep); /* fallback */

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--color-amber);
}

a:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

fieldset {
  border: none;
  padding: 0;
}

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

h1 { font-size: var(--text-hero); }
h2 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p + p {
  margin-top: var(--space-md);
}

.accent-text {
  font-family: var(--font-accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

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

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  position: relative;
  z-index: 1;
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--form {
  max-width: var(--max-width-form);
}

.section {
  padding: var(--space-section) 0;
  position: relative;
}

/* Warm sections — subtle warmth, body gradient dominates */
.section--parchment {
  background-color: rgba(59, 47, 42, 0.07);
}

.section--parchment::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(59, 47, 42, 0.06) 0%,
      transparent 12%
    ),
    linear-gradient(
      165deg,
      rgba(184, 92, 56, 0.015) 0%,
      rgba(201, 150, 59, 0.01) 40%,
      transparent 70%
    );
  pointer-events: none;
  z-index: 0;
}

/* Cool sections — subtle coolness, body gradient dominates */
.section--stone {
  background-color: rgba(26, 51, 28, 0.06);
}

.section--stone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 51, 28, 0.07) 0%,
    transparent 12%
  );
  pointer-events: none;
  z-index: 0;
}

/* Forest accent sections */
.section--forest {
  background-color: rgba(44, 74, 46, 0.05);
  color: var(--color-linen);
}

.section--forest::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(44, 74, 46, 0.06) 0%,
    transparent 12%
  );
  pointer-events: none;
  z-index: 0;
}

.section--forest h2,
.section--forest h3,
.section--forest h4 {
  color: var(--color-linen);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__title {
  margin-bottom: var(--space-md);
}

.section__subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-rust-light);
  font-weight: 400;
  opacity: 0.85;
}

.section--forest .section__subtitle {
  color: var(--color-rust-light);
  opacity: 0.9;
}

/* --- Section Divider --- */
.section-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-lg) 0;
}

.section-divider svg {
  width: 200px;
  height: auto;
  color: var(--color-amber);
}

/* --- Section Wave Transition --- */
.section-wave {
  position: relative;
  margin-top: -1px;
  line-height: 0;
  overflow: hidden;
}

.section-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* --- Section Mist Transition (layered organic SVG fog) --- */
.section-mist {
  position: relative;
  line-height: 0;
  margin-top: -80px;
  margin-bottom: -20px;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.section-mist svg {
  display: block;
  width: 100%;
  height: clamp(60px, 12vw, 120px);
  opacity: 0.6;
  filter: blur(2px);
}

/* --- Section Leaf Divider --- */
.section-leaf-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-lg) 0;
  position: relative;
  z-index: 3;
}

.section-leaf-divider svg {
  width: 160px;
  height: auto;
  color: var(--color-rust);
  opacity: 0.45;
}

/* Alternate divider colors for visual rhythm */
.section--stone + .section-leaf-divider svg {
  color: var(--color-amber);
}

/* --- Card Component --- */
.card {
  background: rgba(253, 251, 247, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(253, 251, 247, 0.08);
  border-top: 3px solid var(--color-rust);
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  backdrop-filter: blur(4px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  background: rgba(253, 251, 247, 0.09);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-lg);
  color: var(--color-amber);
}

.card__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

.card__text {
  color: rgba(245, 240, 232, 0.7);
  line-height: 1.8;
}

/* --- Button Component --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background-color: var(--color-wine);
  color: var(--color-linen);
  border: 2px solid var(--color-wine);
}

.btn--primary:hover {
  background-color: #8D3545;
  border-color: #8D3545;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(122, 46, 59, 0.3);
  color: var(--color-linen);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-candlelight);
  border: 2px solid rgba(240, 217, 160, 0.4);
}

.btn--secondary:hover {
  background-color: rgba(240, 217, 160, 0.12);
  color: var(--color-candlelight);
  border-color: var(--color-candlelight);
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
}

/* --- Grid Utilities --- */
.grid {
  display: grid;
  gap: var(--space-2xl);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-forest);
  color: var(--color-linen);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-size: var(--text-sm);
}

.skip-link:focus {
  top: var(--space-md);
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-overlay__monogram {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  color: var(--color-candlelight);
  opacity: 0;
  animation: fadeInScale 0.8s ease forwards;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Textured Background Utility --- */
.bg-textured {
  background-image:
    radial-gradient(circle at 25% 25%, rgba(91, 127, 94, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(91, 127, 94, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* --- Selection --- */
::selection {
  background-color: rgba(201, 150, 59, 0.35);
  color: var(--color-linen);
}

/* --- Ambient Atmosphere --- */
/* Soft vignette bleed at section edges for depth */
.section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(40px, 8vw, 80px);
  pointer-events: none;
  z-index: 1;
  bottom: 0;
  background: linear-gradient(to top,
    rgba(26, 51, 28, 0.08) 0%,
    transparent 100%);
}

/* Warm sections get a warm bottom edge */
.section--parchment::after {
  background: linear-gradient(to top,
    rgba(59, 47, 42, 0.07) 0%,
    transparent 100%);
}

/* Hero doesn't need bottom mist */
.hero::after {
  display: none;
}

/* Footer doesn't need bottom mist */
.footer::after {
  display: none;
}
