/* ===== Custom Font Imports ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ===== Custom Properties ===== */
:root {
  --color-bg-deep: #1A1410;
  --color-bg-elevated: #201812;
  --color-bg-card: #241C16;
  --color-gold: #C8956C;
  --color-gold-light: #D4A574;
  --color-sand: #C4A882;
  --color-cream: #F5EDE4;
  --color-terracotta: #B85A3A;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-deep);
  color: var(--color-cream);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
}

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

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

/* ===== Scroll Reveal (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--transition-smooth), transform 0.7s var(--transition-smooth);
  }

  .reveal-section.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger children */
  .reveal-section.stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--transition-smooth), transform 0.5s var(--transition-smooth);
  }

  .reveal-section.stagger.revealed > *:nth-child(1) { transition-delay: 0.05s; }
  .reveal-section.stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
  .reveal-section.stagger.revealed > *:nth-child(3) { transition-delay: 0.15s; }
  .reveal-section.stagger.revealed > *:nth-child(4) { transition-delay: 0.2s; }
  .reveal-section.stagger.revealed > *:nth-child(5) { transition-delay: 0.25s; }
  .reveal-section.stagger.revealed > *:nth-child(6) { transition-delay: 0.3s; }

  .reveal-section.revealed > * {
    opacity: 1;
    transform: translateY(0);
  }

  /* Hero glows */
  .hero-glow {
    animation: glowPulse 6s ease-in-out infinite alternate;
  }

  .hero-glow:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 8s;
  }
}

@keyframes glowPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.08); }
}

/* ===== Navbar ===== */
#navbar {
  background: transparent;
  transition: background 0.4s var(--transition-smooth), box-shadow 0.4s var(--transition-smooth), padding 0.4s var(--transition-smooth);
}

#navbar.scrolled {
  background: rgba(26, 20, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(200, 149, 108, 0.08);
}

#navbar.scrolled .menu-line {
  background: var(--color-gold);
}

/* ===== Mobile Menu ===== */
#mobile-menu {
  transition: opacity 0.4s var(--transition-smooth), visibility 0.4s;
}

#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  transition: color 0.3s;
}

/* ===== Hero ===== */
#hero {
  position: relative;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--color-bg-deep), transparent);
  pointer-events: none;
}

/* ===== Smooth Scroll Offset ===== */
section[id] {
  scroll-margin-top: 80px;
}

/* ===== Button Focus States ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ===== Selection Color ===== */
::selection {
  background: rgba(200, 149, 108, 0.3);
  color: var(--color-cream);
}

/* ===== Custom Scrollbar ===== */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--color-bg-deep);
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(200, 149, 108, 0.25);
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 149, 108, 0.45);
  }
}

/* ===== Mobile Menu Animation ===== */
@media (max-width: 1023px) {
  #mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(26, 20, 16, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--transition-smooth), visibility 0.4s;
  }

  #mobile-menu.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-link {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-cream);
    transition: color 0.3s;
  }

  /* Hamburger animation */
  #menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }
  #menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  #menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.25rem;
  }
}

/* ===== Image Hover ===== */
.rounded-2xl overflow-hidden img {
  transition: transform 0.7s var(--transition-smooth);
}

.rounded-2xl.overflow-hidden:hover img {
  transform: scale(1.05);
}
