/* =========================
   RESET
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
p,
ul,
li,
a {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =========================
   ROOT
========================= */
:root {
  --primary: #166534;
  --primary-dark: #14532d;
  --accent: #f59e0b;
  --text: #1f2937;
  --muted: #6b7280;
  --white: #ffffff;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --container: 1200px;
  --transition: all 0.3s ease;
}

/* =========================
   BASE
========================= */
body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(92%, var(--container));
  margin: 0 auto;
}

.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.section-title p {
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto;
}

.btn {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-light {
  background: var(--white);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}

.btn-light:hover {
  background: #f3f4f6;
}

/* =========================
   FINAL HEADER / NAVBAR
========================= */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.logo a {
  font-size: 1.3rem;
  font-weight: 800;
  color: #14532d;
  text-decoration: none;
}

.navbar {
  margin-left: auto;
}

.navbar > ul {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar li {
  position: relative;
}

.navbar a,
.dropdown-toggle {
  color: #1f2937;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.navbar a:hover,
.dropdown-toggle:hover {
  color: #166534;
}

.has-dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: "▾";
  font-size: 0.8rem;
  line-height: 1;
}

/* Desktop dropdown */

/* =========================
   FIX DROPDOWN BEHAVIOR
========================= */

.has-dropdown {
  position: relative;
}

/* FIX GAP ISSUE */
.dropdown-menu {
  position: absolute;
  top: 100%; /* IMPORTANT change */
  margin-top: 6px;

  left: 50%;
  transform: translateX(-50%) translateY(8px);

  width: 320px;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);

  padding: 10px;
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 6px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1000;
}

/* SHOW DROPDOWN */
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* PREVENT FLICKER */
.has-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #ffffff;
}

.nav-toggle-label span {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: #14532d;
  transition: all 0.3s ease;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: #14532d;
  transition: all 0.3s ease;
}

.nav-toggle-label span::before {
  top: -6px;
}

.nav-toggle-label span::after {
  top: 6px;
}

/* =========================
   HERO
========================= */
.hero {
  padding: 95px 0 75px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.15), transparent 20%),
    radial-gradient(circle at left, rgba(22, 101, 52, 0.10), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hero-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.1;
  color: var(--primary-dark);
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.hero-text p {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 26px;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: all 0.35s ease;
}

.hero-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
}

.hero-box h3 {
  color: var(--primary-dark);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.hero-box ul {
  display: grid;
  gap: 12px;
}

.hero-box li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-weight: 600;
  transition: var(--transition);
}

.hero-box li a:hover {
  background: #eefbf2;
  color: var(--primary-dark);
  transform: translateX(4px);
}

/* =========================
   CALCULATOR GRID
========================= */
.calculators {
  background: var(--white);
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.calculator-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
}

.calculator-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.09);
  border-color: rgba(22, 101, 52, 0.18);
}

.calculator-card h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.calculator-card p {
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 16px;
}

.calculator-card a {
  color: var(--primary);
  font-weight: 700;
}

.calculator-card a:hover {
  color: var(--primary-dark);
}

.calculator-card a.card-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  text-indent: -9999px;
}

.calculator-card::after {
  content: "Open Calculator";
  display: inline-block;
  margin-top: 14px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.calculator-card:hover::after {
  color: var(--primary-dark);
}

/* =========================
   SEO TEXT BLOCK
========================= */
.seo-block {
  background: #f8fafc;
}

.seo-box {
  max-width: 920px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.seo-box h2 {
  color: var(--primary-dark);
  margin-bottom: 14px;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

.seo-box p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 1rem;
}

/* =========================
   SMALL INTRO
========================= */
.home-intro {
  background: #f8fafc;
}

.home-intro .intro-box {
  max-width: 850px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 34px;
  box-shadow: var(--shadow);
  text-align: center;
}

.home-intro h2 {
  color: var(--primary-dark);
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 2vw, 2.3rem);
}

.home-intro p {
  color: var(--muted);
  margin-bottom: 12px;
}

/* =========================
   FAQ
========================= */
.faq {
  background: var(--white);
}

.faq-list {
  max-width: 850px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.faq-item {
  background: #fcfcfc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
  border-color: rgba(22, 101, 52, 0.18);
}

.faq-item h3 {
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.faq-item p {
  color: var(--muted);
  font-size: 0.96rem;
}

/* =========================
   FOOTER
========================= */
.site-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.8);
  padding: 55px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 26px;
}

.site-footer h3,
.site-footer h4 {
  color: var(--white);
  margin-bottom: 12px;
}

.site-footer p,
.site-footer li {
  color: rgba(255, 255, 255, 0.7);
}

.site-footer ul {
  display: grid;
  gap: 10px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  transition: var(--transition);
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.64);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1200px) {
  .dropdown-menu {
    width: 680px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .hero-wrap {
    grid-template-columns: 1fr;
  }

  .calculator-grid,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .nav-toggle-label {
    display: inline-flex;
  }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.06);
    padding: 14px 16px 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
  }

  .navbar > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .navbar a,
  .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 12px 0;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    border: 0;
    box-shadow: none;
    background: #f8fafc;
    display: none;
    grid-template-columns: 1fr;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .has-dropdown:hover .dropdown-menu,
  .has-dropdown:focus-within .dropdown-menu {
    display: grid;
    transform: none;
  }

  .nav-toggle:checked ~ .navbar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
  }

  .nav-toggle:checked + .nav-toggle-label span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle:checked + .nav-toggle-label span::after {
    top: 0;
    transform: rotate(-45deg);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .site-header .container {
    min-height: 74px;
  }

  .calculator-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 70px 0 50px;
  }

  .hero-box,
  .home-intro .intro-box,
  .seo-box {
    padding: 22px;
  }
}

@media (max-width: 576px) {
  .logo a {
    font-size: 1.12rem;
  }

  .site-header .container {
    min-height: 70px;
  }

  .dropdown-menu a {
    font-size: 0.94rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(94%, var(--container));
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}