/* === HIDDEN SPRINGS SUMMIT — Pacific Northwest Organic === */

:root {
  --color-forest: #2D4A3E;
  --color-forest-deep: #1B3028;
  --color-cedar: #C4813D;
  --color-cedar-light: #D9A96A;
  --color-cream: #F7F3ED;
  --color-cream-warm: #F0EAE0;
  --color-bark: #2C2416;
  --color-sage: #8BA888;
  --color-sage-muted: #A8C4A2;
  --color-moss: #5C7A5E;
  --color-stone: #9B958C;
  --color-fog: #E8E4DD;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Nunito Sans', -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-organic: 60% 40% 50% 50% / 40% 60% 40% 60%;

  --nav-link-color: rgba(247, 243, 237, 0.84);
  --nav-link-active: #F7F3ED;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-bark);
  background-color: var(--color-cream);
  line-height: 1.7;
  font-weight: 300;
  overflow-x: hidden;
  position: relative;
}

/* Subtle grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 9999;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-forest-deep);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); }

p {
  max-width: 65ch;
  margin-bottom: var(--space-sm);
}

a {
  color: var(--color-cedar);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--color-forest);
}

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem var(--space-md);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  transition: all 0.4s ease;
}

.nav--scrolled {
  background: rgba(27, 48, 40, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.7rem var(--space-md);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-cream);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.nav--scrolled .nav__brand {
  opacity: 1;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  white-space: nowrap;
}

.nav__link {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nav-link-color);
  text-decoration: none;
  transition: color 0.25s ease;
  position: relative;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-cedar);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav__link:hover {
  color: var(--nav-link-active);
}

.nav__link.active {
  color: var(--nav-link-active);
}

.nav__link.active::after {
  transform: scaleX(1);
}

@media (max-width: 600px) {
  .nav {
    padding: 0.85rem 0.85rem;
    grid-template-columns: 1fr;
  }
  .nav--scrolled {
    padding: 0.65rem 0.85rem;
  }
  .nav__links {
    grid-row: 1;
    grid-column: 1;
    gap: 0.7rem;
    justify-self: center;
    align-items: center;
  }
  .nav__link {
    font-size: 0.62rem;
    line-height: 1;
  }
  .nav__brand {
    display: none;
  }
  .nav .theme-toggle {
    grid-row: 1;
    grid-column: 1;
    position: static;
    justify-self: end;
    align-self: center;
  }
  .nav .theme-toggle:hover {
    transform: rotate(15deg);
  }
}

/* === HERO SECTION === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background: linear-gradient(
    175deg,
    var(--color-forest-deep) 0%,
    var(--color-forest) 40%,
    var(--color-moss) 100%
  );
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(139, 168, 136, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(196, 129, 61, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 120px;
  background: var(--color-cream);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  animation: fadeUp 1.2s ease-out;
}

.hero__badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-sage-muted);
  border: 1px solid rgba(168, 196, 162, 0.4);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.hero__title {
  color: var(--color-cream);
  margin-bottom: var(--space-sm);
  font-weight: 700;
  text-shadow: 0 2px 30px rgba(0,0,0,0.2);
}

.hero__subtitle {
  color: rgba(247, 243, 237, 0.85);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 300;
  max-width: 550px;
  margin: 0 auto var(--space-lg);
  line-height: 1.8;
}

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-sage-muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: gentleBounce 3s ease-in-out infinite;
}

.hero__scroll svg {
  width: 16px;
  height: 16px;
}

/* Decorative tree silhouettes */
.hero__trees {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  height: 200px;
  opacity: 0.12;
  background-repeat: repeat-x;
  background-position: bottom center;
  background-size: auto 100%;
  pointer-events: none;
}

/* === MAIN CONTENT === */
.main {
  position: relative;
  z-index: 1;
}

/* === SECTIONS === */
.section {
  padding: var(--space-xl) var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}

.section--intro {
  text-align: center;
  padding-top: var(--space-lg);
}

.section__header {
  max-width: 65ch;
  margin: 0 auto var(--space-lg);
  text-align: center;
}

.section__eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-cedar);
  margin-bottom: var(--space-xs);
}

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

.section__desc {
  color: var(--color-stone);
  font-size: 1.05rem;
  margin: 0 auto;
}

.section__header .section__desc {
  max-width: 60ch;
}

.section--map .map-container {
  max-width: 100ch;
  margin: 0 auto;
}

/* === INTRO FEATURES === */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.feature {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--color-fog);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-forest), var(--color-sage));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(45, 74, 62, 0.08);
}
.feature:hover::before {
  transform: scaleX(1);
}

.feature__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-sage-muted), var(--color-sage));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  font-size: 1.4rem;
}

.feature__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-forest-deep);
  margin-bottom: 0.5rem;
}

.feature__text {
  color: var(--color-stone);
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: center;
}

/* === DOCUMENTS SECTION === */
.section--docs {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-fog);
  padding: var(--space-lg);
  margin: var(--space-lg) auto;
  max-width: 1100px;
  box-shadow: 0 4px 30px rgba(45, 74, 62, 0.04);
}

.docs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .docs-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

.docs-category__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-fog);
}

.docs-category__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.docs-category__icon--public {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  color: var(--color-forest);
}

.docs-category__icon--members {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  color: var(--color-cedar);
}

.docs-category h3 {
  font-size: 1.2rem;
}

.docs-category__note {
  font-size: 0.9rem;
  color: var(--color-stone);
  margin-bottom: var(--space-sm);
}

.doc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: var(--color-bark);
}

.doc-item:hover {
  background: var(--color-cream);
  transform: translateX(4px);
  color: var(--color-forest-deep);
}

.doc-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--color-cream-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.doc-item__name {
  font-weight: 400;
  font-size: 0.95rem;
}

.doc-item__badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--color-fog);
  color: var(--color-stone);
  flex-shrink: 0;
}

/* === JOIN SECTION === */
.section--join {
  text-align: center;
  position: relative;
}

.join-card {
  background: linear-gradient(
    160deg,
    var(--color-forest-deep) 0%,
    var(--color-forest) 50%,
    var(--color-moss) 100%
  );
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  color: var(--color-cream);
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.join-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(168, 196, 162, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(196, 129, 61, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.join-card__content {
  position: relative;
  z-index: 1;
}

.join-card h2 {
  color: var(--color-cream);
  margin-bottom: var(--space-sm);
}

.join-card p {
  color: rgba(247, 243, 237, 0.8);
  max-width: 50ch;
  margin: 0 auto var(--space-md);
  font-size: 1.05rem;
}

.join-card__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--color-cedar);
  color: white;
  box-shadow: 0 4px 20px rgba(196, 129, 61, 0.3);
}
.btn--primary:hover {
  background: var(--color-cedar-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(196, 129, 61, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--color-cream);
  border: 1.5px solid rgba(247, 243, 237, 0.4);
}
.btn--outline:hover {
  background: rgba(247, 243, 237, 0.1);
  color: white;
  border-color: rgba(247, 243, 237, 0.7);
}

/* === NOTICE SECTION === */
.notice {
  background: linear-gradient(135deg, #FFF8E1, #FFFDF5);
  border: 1px solid #F0E6C8;
  border-left: 4px solid var(--color-cedar);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  max-width: 700px;
  margin: var(--space-lg) auto;
}

.notice__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-cedar);
  margin-bottom: 0.5rem;
}

.notice__text {
  font-size: 0.95rem;
  color: var(--color-bark);
  line-height: 1.7;
}

.notice__text a {
  font-weight: 600;
}

/* === MAP SECTION === */
.section--map {
  padding-bottom: var(--space-lg);
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-fog);
  box-shadow: 0 4px 30px rgba(45, 74, 62, 0.06);
  aspect-ratio: 16 / 9;
  max-height: 450px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* === GALLERY SECTION === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-fog);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-stone);
  font-size: 0.85rem;
  font-style: italic;
  border: 1px dashed rgba(155, 149, 140, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(45, 74, 62, 0.08);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === FOOTER === */
.footer {
  background: var(--color-forest-deep);
  color: rgba(247, 243, 237, 0.6);
  padding: calc(var(--space-lg) + 2.5rem) var(--space-md) var(--space-md);
  text-align: center;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--color-cream);
  clip-path: ellipse(55% 100% at 50% 0%);
}

.footer__content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.footer__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: #F7F3ED;
  margin-bottom: 0.5rem;
}

.footer__location {
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.footer__divider {
  width: 60px;
  height: 1px;
  background: rgba(247, 243, 237, 0.2);
  margin: var(--space-md) auto;
}

.footer__copy {
  font-size: 0.8rem;
  opacity: 0.5;
}

[data-theme="dark"] .footer__name {
  color: #F7F3ED;
}

[data-theme="dark"] .footer__location,
[data-theme="dark"] .footer__copy {
  color: rgba(247, 243, 237, 0.72);
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }

/* === DARK MODE === */
[data-theme="dark"] {
  --color-cream: #1a1f1c;
  --color-cream-warm: #222820;
  --color-fog: #2a3028;
  --color-bark: #e8e4dd;
  --color-stone: #b5b0a8;
  --color-forest-deep: #0d1a14;
  --nav-link-color: rgba(232, 228, 221, 0.92);
  --nav-link-active: #F5F1EA;
}

/* Headings use --color-forest-deep which goes near-black in dark mode; override to a light value */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: #dde8da;
}

[data-theme="dark"] .section__title {
  color: #dde8da;
}

[data-theme="dark"] .section__eyebrow {
  color: var(--color-cedar-light);
}

[data-theme="dark"] .section__desc {
  color: var(--color-stone);
}

[data-theme="dark"] .feature__title {
  color: #dde8da;
}

[data-theme="dark"] .feature__text {
  color: var(--color-stone);
}

[data-theme="dark"] .feature {
  background: #222820;
  border-color: #2a3028;
}

[data-theme="dark"] .section--docs {
  background: #222820;
  border-color: #2a3028;
}

[data-theme="dark"] .docs-category__title {
  border-color: #3a4038;
}

[data-theme="dark"] .docs-category h3 {
  color: #dde8da;
}

[data-theme="dark"] .doc-item {
  color: var(--color-bark);
}

[data-theme="dark"] .doc-item:hover {
  background: #1a1f1c;
  color: #dde8da;
}

[data-theme="dark"] .doc-item__icon {
  background: #2a3028;
}

[data-theme="dark"] .doc-item__badge {
  background: #2a3028;
  color: var(--color-stone);
}

[data-theme="dark"] .notice {
  background: #2a2618;
  border-color: #3d3520;
}

[data-theme="dark"] .notice__title {
  color: var(--color-cedar-light);
}

[data-theme="dark"] .notice__text {
  color: var(--color-bark);
}

[data-theme="dark"] .footer::before {
  background: #1a1f1c;
}

[data-theme="dark"] .gallery-item {
  background: #222820;
  border-color: rgba(168, 196, 162, 0.15);
}

[data-theme="dark"] .docs-category__icon--public {
  background: linear-gradient(135deg, #1e3320, #243d28);
  color: var(--color-sage-muted);
}

[data-theme="dark"] .docs-category__icon--members {
  background: linear-gradient(135deg, #2e2210, #3a2c14);
  color: var(--color-cedar-light);
}

/* override brand for dark to use bark color */
[data-theme="dark"] .nav__brand {
  color: var(--color-bark);
}

[data-theme="dark"] .nav__link,
[data-theme="dark"] .theme-toggle {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* Dark mode toggle — lives in nav */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  position: static;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  margin-left: 0;
  color: var(--nav-link-color);
  transition: color 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
  transform: none;
}

.theme-toggle:hover {
  color: var(--nav-link-active);
  transform: rotate(15deg);
}

.theme-toggle__icon--dark { display: none; }
[data-theme="dark"] .theme-toggle__icon--light { display: none; }
[data-theme="dark"] .theme-toggle__icon--dark { display: block; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero {
    min-height: 85vh;
    padding: var(--space-md);
  }

  .section {
    padding: var(--space-lg) var(--space-sm);
  }

  .section--docs {
    padding: var(--space-md);
    margin: var(--space-md) var(--space-sm);
    border-radius: var(--radius-md);
  }

  .join-card {
    padding: var(--space-md);
    margin: 0 var(--space-sm);
  }

  .features {
    grid-template-columns: 1fr;
  }

  .notice {
    margin: var(--space-md) var(--space-sm);
  }
}

@media (max-width: 480px) {
  .doc-item__badge {
    display: none;
  }
}
