/* ==========================================================================
   VN FOLKS — Digital Folklore Archive
   Main Stylesheet & Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  /* Official Palette */
  --c-golden-butter: #E8D1A7;
  --c-toasted-caramel: #84592B;
  --c-spiced-wine: #743014;
  --c-olive-harvest: #9D9167;
  --c-cowhide-cocoa: #442D1C;

  /* Atmospheric Parchment & Dark Tones */
  --bg-parchment: #F4EAD8;
  --bg-parchment-warm: #EBDDC3;
  --bg-dark-archive: #1B110A;
  --bg-dark-card: #251810;
  --bg-modal-overlay: rgba(18, 10, 6, 0.88);

  /* Typography Variables */
  --font-display: 'Creepster', cursive, serif;
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'EB Garamond', 'Times New Roman', serif;

  /* Borders & Dividers */
  --border-fine: 1px solid rgba(132, 89, 43, 0.28);
  --border-gold: 1px solid rgba(232, 209, 167, 0.35);
  --border-wine: 1px solid rgba(116, 48, 20, 0.4);

  /* Transitions */
  --tr-fast: 0.2s ease;
  --tr-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  background-color: var(--bg-parchment);
  color: var(--c-cowhide-cocoa);
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-parchment);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(232, 209, 167, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(132, 89, 43, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, rgba(244, 234, 216, 0.98) 0%, rgba(235, 221, 195, 0.95) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Global Layout Containers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 960px;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(244, 234, 216, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(132, 89, 43, 0.3);
  transition: background-color var(--tr-smooth), border-color var(--tr-smooth);
}

.site-header.dark-header {
  background-color: rgba(27, 17, 10, 0.96);
  border-bottom: 1px solid rgba(157, 145, 103, 0.3);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.site-logo {
  display: inline-block;
  text-decoration: none;
  color: var(--c-cowhide-cocoa);
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  transition: opacity var(--tr-fast), transform var(--tr-fast);
}

.site-header.dark-header .site-logo {
  color: var(--c-golden-butter);
}

.site-logo:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2.2rem;
}

.nav-item a {
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cowhide-cocoa);
  position: relative;
  padding: 0.4rem 0;
  transition: color var(--tr-fast);
}

.site-header.dark-header .nav-item a {
  color: var(--c-golden-butter);
}

.nav-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: var(--c-spiced-wine);
  transition: width var(--tr-smooth);
}

.site-header.dark-header .nav-item a::after {
  background-color: var(--c-golden-butter);
}

.nav-item a:hover::after,
.nav-item a.active::after {
  width: 100%;
}

.nav-item a:hover,
.nav-item a.active {
  color: var(--c-spiced-wine);
}

.site-header.dark-header .nav-item a:hover,
.site-header.dark-header .nav-item a.active {
  color: #fff;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--c-cowhide-cocoa);
}

.site-header.dark-header .mobile-toggle {
  color: var(--c-golden-butter);
}

.hamburger-line {
  display: block;
  width: 26px;
  height: 2px;
  margin: 5px 0;
  background-color: currentColor;
  transition: transform var(--tr-smooth), opacity var(--tr-smooth);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  background-color: var(--bg-parchment-warm);
  border-bottom: 2px solid var(--c-toasted-caramel);
  padding: 2rem 0;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.site-header.dark-header + .mobile-nav-drawer,
body.dark-mode .mobile-nav-drawer {
  background-color: var(--bg-dark-card);
  border-bottom: 2px solid var(--c-spiced-wine);
}

.mobile-nav-drawer.open {
  display: block;
  animation: slideDown 0.3s ease forwards;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.mobile-nav-links a {
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-cowhide-cocoa);
}

body.dark-mode .mobile-nav-links a {
  color: var(--c-golden-butter);
}

/* --------------------------------------------------------------------------
   Typography & Atmospheric Elements
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--c-cowhide-cocoa);
  line-height: 1.25;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

p {
  margin-bottom: 1.2rem;
}

.lead-text {
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--c-cowhide-cocoa);
  opacity: 0.9;
}

/* Ornamental Horizontal Divider */
.ornamental-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem auto;
  width: 100%;
  max-width: 480px;
  opacity: 0.5;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--c-toasted-caramel);
}

/* Buttons */
.btn-archive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.85rem 2.2rem;
  border: 1px solid var(--c-cowhide-cocoa);
  background-color: transparent;
  color: var(--c-cowhide-cocoa);
  cursor: pointer;
  position: relative;
  transition: all var(--tr-smooth);
}

.btn-archive::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px solid transparent;
  transition: border-color var(--tr-smooth);
}

.btn-archive:hover {
  background-color: var(--c-cowhide-cocoa);
  color: var(--c-golden-butter);
  box-shadow: 0 6px 18px rgba(68, 45, 28, 0.2);
  transform: translateY(-2px);
}

.btn-archive:hover::before {
  border-color: rgba(232, 209, 167, 0.5);
}

.btn-archive.btn-wine {
  border-color: var(--c-spiced-wine);
  color: var(--c-spiced-wine);
}

.btn-archive.btn-wine:hover {
  background-color: var(--c-spiced-wine);
  color: var(--c-golden-butter);
}

.btn-archive.btn-gold {
  border-color: var(--c-golden-butter);
  color: var(--c-golden-butter);
}

.btn-archive.btn-gold:hover {
  background-color: var(--c-golden-butter);
  color: var(--c-cowhide-cocoa);
}

/* --------------------------------------------------------------------------
   HOMEPAGE SPECIFIC (Matching Reference Image)
   -------------------------------------------------------------------------- */
.home-hero-section {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #E8D1A7;
  overflow: hidden;
  border-bottom: 1px solid rgba(132, 89, 43, 0.35);
}

/* Desktop reference image background setup */
.hero-visual-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/homebackground.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.95;
  z-index: 1;
}

/* Subtle overlay vignette for readability */
.hero-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(232, 209, 167, 0.2) 20%, rgba(200, 175, 135, 0.3) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Hero Centered Typography */
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 780px;
  padding: 3rem 1.5rem;
  margin: auto;
}

.hero-tagline-small {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--c-cowhide-cocoa);
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.hero-main-title {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 8.5vw, 7.2rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--c-cowhide-cocoa);
  text-shadow: 0 3px 6px rgba(68, 45, 28, 0.15);
  margin-bottom: 1.2rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-style: italic;
  color: var(--c-spiced-wine);
  letter-spacing: 0.05em;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Responsive fallback elements for screens where background image crops */
.hero-responsive-elements {
  display: none; /* Only triggered in mobile breakpoint */
}

/* Home Intro Section Below Hero */
.home-intro-section {
  padding: 5.5rem 0;
  background-color: var(--bg-parchment);
  border-bottom: 1px solid rgba(132, 89, 43, 0.25);
  text-align: center;
}

.intro-box {
  max-width: 820px;
  margin: 0 auto;
}

.intro-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  font-style: italic;
  line-height: 1.8;
  color: var(--c-cowhide-cocoa);
  margin-bottom: 2.5rem;
  position: relative;
  padding: 0 1rem;
}

/* Four Pillars Featurette */
.home-pillars-section {
  padding: 5rem 0;
  background-color: var(--bg-parchment-warm);
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-spiced-wine);
  text-align: center;
  margin-bottom: 0.6rem;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  text-align: center;
  color: var(--c-cowhide-cocoa);
  margin-bottom: 1.2rem;
}

.section-sub {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-style: italic;
  text-align: center;
  max-width: 650px;
  margin: 0 auto 3.5rem;
  opacity: 0.85;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.pillar-card {
  background-color: var(--bg-parchment);
  border: 1px solid rgba(132, 89, 43, 0.3);
  padding: 2.2rem 1.6rem;
  text-align: center;
  transition: transform var(--tr-smooth), box-shadow var(--tr-smooth);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(68, 45, 28, 0.12);
  border-color: var(--c-spiced-wine);
}

.pillar-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}

.pillar-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer Section
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-dark-archive);
  color: var(--c-golden-butter);
  border-top: 2px solid var(--c-spiced-wine);
  padding: 4.5rem 0 2.5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid rgba(232, 209, 167, 0.15);
}

.footer-brand h4 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  color: var(--c-golden-butter);
  margin-bottom: 0.8rem;
}

.footer-brand p {
  font-size: 1rem;
  font-style: italic;
  opacity: 0.8;
  max-width: 440px;
}

.footer-nav h5,
.footer-info h5 {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-golden-butter);
  margin-bottom: 1.2rem;
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li {
  margin-bottom: 0.6rem;
}

.footer-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: rgba(232, 209, 167, 0.75);
  transition: color var(--tr-fast);
}

.footer-nav a:hover {
  color: #fff;
}

.footer-disclaimer-text {
  font-size: 0.88rem;
  line-height: 1.6;
  opacity: 0.7;
}

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.65;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.8s var(--tr-smooth) forwards;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-visual-canvas {
    background-position: center top;
    opacity: 0.9;
  }

  .hero-content {
    background: rgba(244, 234, 216, 0.88);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(132, 89, 43, 0.35);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(68, 45, 28, 0.12);
    margin: 1.5rem;
    padding: 2.2rem 1.4rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .nav-wrapper {
    height: 70px;
  }

  .home-hero-section {
    min-height: 85vh;
  }

  .hero-content {
    padding: 1.8rem 1rem;
    margin: 1rem;
  }

  .btn-archive {
    width: 100%;
    padding: 0.8rem 1.5rem;
  }
}
