/* ============================================
   DESA TALAGAWANGI — Design System & Global Styles
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--neutral-900);
  background-color: var(--neutral-50);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.25s ease;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Primary – Hijau Perhutanan Pakenjeng */
  --primary-900: #1B3A2D;
  --primary-800: #234D38;
  --primary-700: #2D6A4F;
  --primary-600: #40916C;
  --primary-500: #52B788;
  --primary-400: #74C69D;
  --primary-300: #95D5B2;
  --primary-200: #B7E4C7;
  --primary-100: #D8F3DC;
  --primary-50:  #EDF6F0;

  /* Accent – Emas Kayu & Panen */
  --accent-700:  #8B5E1A;
  --accent-600:  #C17817;
  --accent-500:  #DDA15E;
  --accent-400:  #E9C46A;
  --accent-300:  #F2D492;
  --accent-200:  #F5E0B0;
  --accent-100:  #FAF0D7;
  --accent-50:   #FDF8ED;

  /* Neutral */
  --neutral-900: #1A1E1C;
  --neutral-800: #2A2F2C;
  --neutral-700: #3D4440;
  --neutral-600: #556158;
  --neutral-500: #6F7E74;
  --neutral-400: #9DABA3;
  --neutral-300: #C8D1CB;
  --neutral-200: #DEE4E0;
  --neutral-100: #EFF2F0;
  --neutral-50:  #F7F9F8;
  --white:       #FFFFFF;

  /* Semantic */
  --success: #40916C;
  --info:    #2E86AB;
  --warning: #C17817;
  --danger:  #C1292E;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(27,58,45,0.06);
  --shadow-md:  0 4px 6px -1px rgba(27,58,45,0.08), 0 2px 4px -2px rgba(27,58,45,0.05);
  --shadow-lg:  0 10px 15px -3px rgba(27,58,45,0.10), 0 4px 6px -4px rgba(27,58,45,0.05);
  --shadow-xl:  0 20px 25px -5px rgba(27,58,45,0.12), 0 8px 10px -6px rgba(27,58,45,0.05);
  --shadow-glow: 0 0 20px rgba(82, 183, 136, 0.18);

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --container-max: 1200px;
  --container-padding: 24px;
  --section-padding: 80px;
  --navbar-height: 72px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--neutral-900);
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  color: var(--neutral-600);
  line-height: 1.8;
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--neutral-800);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

.section--alt {
  background-color: var(--primary-50);
}

.section--dark {
  background-color: var(--primary-900);
  color: var(--white);
}

.section--dark h2,
.section--dark h3,
.section--dark p {
  color: var(--white);
}

.section--dark p {
  color: var(--primary-200);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-400));
  border-radius: var(--radius-full);
}

.section-header p {
  max-width: 640px;
  margin: 16px auto 0;
  font-size: 1.05rem;
}

/* --- Grid System --- */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

.btn--outline {
  background: transparent;
  color: var(--primary-700);
  border-color: var(--primary-500);
}

.btn--outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-700);
  transform: translateY(-2px);
}

.btn--white {
  background: var(--white);
  color: var(--primary-700);
  box-shadow: var(--shadow-md);
}

.btn--white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--sm {
  padding: 8px 20px;
  font-size: 0.875rem;
}

.btn--lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge--green {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge--gold {
  background: var(--accent-100);
  color: var(--accent-700);
}

.badge--blue {
  background: #DBEAFE;
  color: #1D4ED8;
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* --- Accessibility --- */
.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--primary-700);
  color: var(--white);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
}

/* Focus styles */
:focus-visible {
  outline: 3px solid var(--primary-400);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .fade-in, .fade-in-left, .fade-in-right, .scale-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Selection --- */
::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}
