/* === Theme Variables === */
:root {
  --green: #617C4D;
  --dark: #2c3e2a;
  --light: #f7f9f5;

  /* Derived — Apple-style minimal variance */
  --bg: #fff;
  --bg-alt: #fbfbfb;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #999;
  --border: rgba(0,0,0,0.04);
  --card-bg: #fff;
  --card-hover-shadow: rgba(0,0,0,0.04);
  --nav-text: #6e6e73;
  --nav-hover-bg: rgba(97,124,77,0.06);
  --footer-bg: #1d1d1f;
  --footer-text: rgba(255,255,255,0.45);
  --footer-link: rgba(255,255,255,0.45);
  --code-bg: #f5f5f7;
  --tag-bg: #f5f5f7;
  --tag-text: #86868b;
}

[data-theme="dark"] {
  --bg: #161616;
  --bg-alt: #1a1a1a;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --border: rgba(255,255,255,0.04);
  --card-bg: #1c1c1e;
  --card-hover-shadow: rgba(0,0,0,0.2);
  --nav-text: #a1a1a6;
  --nav-hover-bg: rgba(97,124,77,0.1);
  --footer-bg: #0d0d0d;
  --footer-text: rgba(255,255,255,0.35);
  --footer-link: rgba(255,255,255,0.35);
  --code-bg: #1c1c1e;
  --tag-bg: #1c1c1e;
  --tag-text: #6e6e73;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text); }
ul { list-style: none; }

/* === Layout === */
.container { max-width: 1140px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-alt); }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* === Typography === */
h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text);
}
h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3.5rem;
}
.section-header p {
  font-size: 1.1rem;
  color: var(--text);
}
h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
p { margin-bottom: 1rem; color: var(--text); }
.text-muted { color: var(--text); font-size: 0.9rem; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(97,124,77,0.3);
}
.btn-primary:hover {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(97,124,77,0.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: #fff;
}
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }

/* === Navbar === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.65);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  transition: box-shadow 0.3s, background 0.3s;
}
[data-theme="dark"] .navbar {
  background: rgba(22,22,22,0.65);
}
.navbar.scrolled {
  box-shadow: 0 1px 20px rgba(0,0,0,0.08);
}
.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: 0.04em;
}
.nav-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}
[data-theme="dark"] .nav-logo {
  filter: invert(1);
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
  color: var(--nav-text);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--nav-hover-bg); }
.nav-links a.active { color: var(--green); background: rgba(97,124,77,0.1); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
  margin-left: auto;
  margin-right: 0.5rem;
}

/* === Theme Toggle === */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.35rem 0.5rem;
  line-height: 1;
  transition: all 0.2s;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}
.theme-toggle:hover {
  border-color: var(--green);
  color: var(--green);
}

/* === Hero === */
.hero {
  padding: 10rem 0 6rem;
  background: var(--bg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-content { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.hero-logo {
  width: 140px;
  height: 140px;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}
.hero-badge {
  display: inline-block;
  background: rgba(97,124,77,0.12);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* === Cards === */
.card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
}
.card:hover {
  box-shadow: 0 8px 30px var(--card-hover-shadow);
  transform: translateY(-2px);
  border-color: rgba(97,124,77,0.15);
}
.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  background: rgba(97,124,77,0.1);
  border-radius: 12px;
}
.card p { font-size: 0.95rem; line-height: 1.7; }
.card .btn { margin-top: 0.5rem; }

/* === Feature Row (alternate layout) === */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 3rem 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--border); }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
.feature-text h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.feature-text p { font-size: 1rem; }
.feature-visual {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  overflow: hidden;
}
.feature-visual img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
}
[data-theme="dark"] .feature-visual .feature-logo {
  filter: invert(1);
}

/* === Card with Image === */
.card-with-image {
  padding: 0;
  overflow: hidden;
}
.card-with-image .card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.card-with-image .card-body {
  padding: 2rem 2.5rem 2.5rem;
}

/* === Stats Bar === */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  max-width: 600px;
  margin: 0 auto;
}
.stat { text-align: center; }
.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

/* === CTA Section === */
.cta-box {
  background: rgba(97,124,77,0.05);
  border: 1px solid rgba(97,124,77,0.15);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
}
.cta-box h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.cta-box p { margin-bottom: 1.5rem; }

/* === Footer === */
.footer {
  background: var(--bg);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.footer-left { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 0.8rem; margin-bottom: 0; }

/* === Page Hero (subpages) === */
.page-hero {
  padding: 8rem 0 4rem;
  background: var(--bg-alt);
  text-align: center;
}
.page-hero h1 { font-size: 2.75rem; }
.page-hero .hero-subtitle { margin-bottom: 1rem; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--green); }
.breadcrumb span { margin: 0 0.4rem; }

/* === Resource Cards === */
.resource-card {
  background: var(--card-bg);
  padding: 3rem 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.3s ease;
}
.resource-card:hover {
  box-shadow: 0 12px 40px var(--card-hover-shadow);
  transform: translateY(-3px);
}
.resource-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  background: rgba(97,124,77,0.1);
  border-radius: 18px;
}
.resource-card h3 { font-size: 1.3rem; }
.resource-card p { max-width: 280px; margin-left: auto; margin-right: auto; }
.resource-card .btn { margin-top: 1rem; }

/* === Featured Image === */
.featured-image { border-radius: 12px; overflow: hidden; }
.featured-image img { width: 100%; display: block; }

/* === Divider === */
.divider {
  width: 48px;
  height: 3px;
  background: var(--green);
  border-radius: 2px;
  margin: 0 auto 1.5rem;
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
  .feature-row { gap: 2.5rem; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature-row { grid-template-columns: 1fr; gap: 2rem; }
  .feature-row.reverse .feature-text,
  .feature-row.reverse .feature-visual { order: unset; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .hero { padding: 8rem 0 4rem; }
  .hero-logo { width: 100px; height: 100px; }
  .hero-subtitle { font-size: 1.05rem; }
  .section { padding: 4rem 0; }
  .card { padding: 2rem; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.82);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    padding: 0.75rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
  }
  [data-theme="dark"] .nav-links {
    background: rgba(22,22,22,0.82);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 0.9rem; }
  .btn-group { justify-content: center; }
  .footer-content { flex-direction: column; text-align: center; height: auto; padding: 1.5rem 0; gap: 0.5rem; }
  .footer-links { justify-content: center; }
}
@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  h1 { font-size: 1.85rem; }
  .hero { padding: 7rem 0 3.5rem; }
}
