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

/* Accessibility: Screen reader only */
.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;
}

.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: #d4a843;
  color: #fff;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f6f5f0;
}

::-webkit-scrollbar-thumb {
  background: #bab490;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #948c64;
}

/* ===== LOADER ===== */
#loader {
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-circle {
  animation: loader-draw 1.5s ease forwards;
}

@keyframes loader-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ===== CUSTOM CURSOR ===== */
#cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #d4a843;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: difference;
}

#cursor-follower {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

#cursor.hover {
  width: 40px;
  height: 40px;
  background: rgba(212, 168, 67, 0.15);
}

#cursor-follower.hover {
  width: 60px;
  height: 60px;
  border-color: rgba(212, 168, 67, 0.6);
}

/* ===== NAVIGATION ===== */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(246, 245, 240, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.05);
}

#navbar.scrolled .nav-logo-text span:last-child,
#navbar.scrolled .nav-link {
  color: #444136;
}

#navbar:not(.scrolled) .nav-logo-text span:last-child,
#navbar:not(.scrolled) .nav-link {
  color: #fff;
}

/* Navbar when mobile menu is open */
#navbar.menu-open {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

#navbar.menu-open .nav-logo-text span:last-child,
#navbar.menu-open .nav-link {
  color: #fff !important;
}

#navbar.menu-open .menu-line {
  background-color: #fff;
}

/* Mobile menu - display toggle only, no opacity (Tailwind CDN conflict) */
#mobile-menu {
  background: #1a1914;
}

/* Hamburger -> X animation
   3 lines: h-0.5 (2px) with gap-1.5 (6px)
   Line 1 center to Line 2 center = 2px + 6px = 8px
   Line 3 center to Line 2 center = 2px + 6px = 8px */
#menu-toggle.active .menu-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#menu-toggle.active .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#menu-toggle.active .menu-line:nth-child(3) {
  width: 24px;
  margin-left: 0;
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero-reveal {
  opacity: 0;
  transform: translateY(40px);
  animation: heroReveal 0.8s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll indicator */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Particles */
.particles {
  background-image:
    radial-gradient(circle at 20% 80%, rgba(212, 168, 67, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 40% 40%, rgba(212, 168, 67, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 80px 80px, 120px 120px, 60px 60px, 100px 100px;
  animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-80px); }
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

.reveal-up {
  transform: translateY(60px);
}

.reveal-left {
  transform: translateX(-60px);
}

.reveal-right {
  transform: translateX(60px);
}

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
  opacity: 1;
  transform: translate(0, 0);
}

/* ===== ABOUT CHAPTER NAV ===== */
.chapter-nav {
  text-decoration: none;
  white-space: nowrap;
}

/* ===== INVOLVE CARDS ===== */
.involve-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ===== SUB-PAGE COMMON ===== */
.subpage-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.subpage-section {
  padding: 6rem 0;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-icon {
  transition: transform 0.3s ease;
}

/* ===== NEWS TABS & CARDS ===== */
.news-tab {
  background: transparent;
  color: #948c64;
  border: 1px solid #d3cfb8;
}

.news-tab:hover {
  background: #e8e6da;
  color: #444136;
}

.news-tab.active {
  background: #444136;
  color: #fff;
  border-color: #444136;
}

.news-card {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.news-card.hidden-card {
  display: none;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== ACTIVITY CARDS ===== */
.activity-card {
  transition: transform 0.5s ease;
}

.activity-card:hover {
  transform: translateY(-8px);
}

/* ===== PARALLAX ===== */
.parallax-bg {
  will-change: transform;
}

/* ===== TIMELINE ===== */
.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 20px;
  width: 1px;
  height: 0;
  background: linear-gradient(to bottom, rgba(212, 168, 67, 0.3), transparent);
  transition: height 0.6s ease;
}

.timeline-item.revealed::before {
  height: calc(100% + 48px);
}

@media (min-width: 1024px) {
  .timeline-item::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ===== COUNTER ===== */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ===== FORM STYLES ===== */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

select option {
  padding: 8px;
}

/* ===== BACK TO TOP ===== */
#back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

/* ===== IMAGE HOVER EFFECTS ===== */
.grid img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .hero-reveal h1 {
    font-size: 2rem;
    line-height: 1.3;
  }

  #navbar.scrolled {
    background: rgba(246, 245, 240, 0.98);
  }
}

/* ===== GRAIN TEXTURE OVERLAY ===== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===== SMOOTH LINK TRANSITIONS ===== */
a {
  transition: color 0.3s ease;
}

/* ===== LOADING STATES ===== */
img {
  opacity: 0;
  transition: opacity 0.6s ease;
}

img.loaded,
img[src] {
  opacity: 1;
}

/* Force images to show after a delay even without JS */
@keyframes imgFadeIn {
  to { opacity: 1; }
}

img {
  animation: imgFadeIn 0.6s ease 0.3s forwards;
}

/* ===== MAGNETIC BUTTON EFFECT ===== */
.magnetic-btn {
  transition: transform 0.3s ease;
}

/* ===== SECTION TRANSITIONS ===== */
section {
  position: relative;
}

/* ===== GALLERY GRID HEIGHTS ===== */
.grid .row-span-2 {
  min-height: 400px;
}

.grid .row-span-2 img {
  min-height: 400px;
}

@media (max-width: 1024px) {
  .grid .row-span-2 {
    min-height: 250px;
  }
  .grid .row-span-2 img {
    min-height: 250px;
  }
}

/* ===== GLOW EFFECTS ===== */
.glow-gold {
  box-shadow: 0 0 40px rgba(212, 168, 67, 0.15);
}

/* ===== TEXT GRADIENT ===== */
.text-gradient {
  background: linear-gradient(135deg, #d4a843, #eb7520);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #d4a843;
  outline-offset: 2px;
}
