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

:root {
  --purple: #6c5ce7;
  --purple-dark: #5a4bd1;
  --purple-light: #a29bfe;
  --purple-glow: rgba(108, 92, 231, 0.15);
  --teal: #00cec9;
  --teal-dark: #00b5b1;
  --teal-light: #81ecec;
  --teal-glow: rgba(0, 206, 201, 0.12);
  --bg: #fafbfe;
  --bg-alt: #f0f1f8;
  --surface: #ffffff;
  --surface-hover: #f8f9ff;
  --text: #1a1a2e;
  --text-secondary: #545478;
  --text-muted: #8888a8;
  --border: #e4e6f0;
  --border-light: #eeeffb;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 26, 46, 0.1);
  --shadow-xl: 0 16px 48px rgba(26, 26, 46, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --gradient-main: linear-gradient(135deg, var(--purple), var(--teal));
  --gradient-purple: linear-gradient(135deg, var(--purple), var(--purple-light));
  --gradient-teal: linear-gradient(135deg, var(--teal), var(--teal-light));
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --nav-h: 72px;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVIGATION ===== */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(250, 251, 254, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.3s;
}
#main-nav.scrolled { box-shadow: var(--shadow-sm); }

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.logo-accent { color: var(--purple); }

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-link:hover {
  color: var(--purple);
  background: var(--purple-glow);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 80px) 0 100px;
  overflow: hidden;
  background: linear-gradient(165deg, #fafbfe 0%, #f0f1f8 35%, #e8e4ff 70%, #e0f7f7 100%);
}

.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.shape-1 { width: 500px; height: 500px; background: var(--purple-light); top: -120px; right: -100px; }
.shape-2 { width: 350px; height: 350px; background: var(--teal-light); bottom: -50px; left: -80px; }
.shape-3 { width: 200px; height: 200px; background: var(--purple); top: 50%; left: 50%; opacity: 0.15; }
.shape-4 { width: 280px; height: 280px; background: var(--teal); top: 10%; left: 20%; opacity: 0.12; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--purple);
  background: var(--purple-glow);
  border: 1px solid rgba(108, 92, 231, 0.2);
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 28px;
  letter-spacing: 0.03em;
  animation: fadeInUp 0.6s ease-out;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 36px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-cta-row {
  display: flex;
  gap: 14px;
  margin-bottom: 56px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 30px;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(108, 92, 231, 0.4);
}

.btn-outline {
  background: var(--surface);
  color: var(--purple);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--purple);
  background: var(--purple-glow);
  transform: translateY(-2px);
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 48px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== SECTIONS ===== */
.section {
  padding: 80px 0;
}
.section-alt { background: var(--bg-alt); }

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal-dark);
  background: var(--teal-glow);
  border: 1px solid rgba(0, 206, 201, 0.2);
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ===== CATEGORY PILLS ===== */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

.pill {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover { border-color: var(--purple-light); color: var(--purple); }
.pill.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* ===== TOOL CARDS ===== */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.tool-card:hover {
  border-color: rgba(108, 92, 231, 0.2);
  box-shadow: var(--shadow-md);
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  cursor: pointer;
  user-select: none;
}

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tool-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.expand-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.expand-btn:hover { background: var(--purple-glow); border-color: var(--purple-light); }
.tool-card.open .expand-btn { transform: rotate(180deg); }

.tool-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}
.tool-card.open .tool-card-body {
  max-height: 5000px;
}

.tool-content {
  padding: 0 28px 24px;
  max-width: 800px;
}

.tool-content p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.75;
}

.tool-content h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin: 24px 0 10px;
  letter-spacing: -0.01em;
}
.tool-content h4:first-of-type { margin-top: 8px; }

/* ===== COMPARISON TABLES ===== */
.comparison-table-wrap {
  padding: 0 28px 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.comparison-table thead th {
  background: linear-gradient(135deg, #f5f4ff, #f0f8f8);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.comparison-table thead th:first-child { color: var(--text-muted); }

.comparison-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
  font-weight: 600;
  color: var(--purple);
}

.comparison-table tbody tr:hover td { background: var(--surface-hover); }
.comparison-table tbody td:first-child {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

/* ===== GUIDE CARDS ===== */
.guides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.guide-card:hover {
  border-color: rgba(108, 92, 231, 0.15);
  box-shadow: var(--shadow-md);
}

.guide-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--guide-accent) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--guide-accent);
}

.guide-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.guide-content p {
  font-size: 0.93rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.75;
}

.guide-content h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin: 20px 0 8px;
}

/* ===== CALCULATOR ===== */
.calculator-wrap {
  max-width: 700px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.calc-method-toggle {
  display: flex;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 28px;
}

.calc-tab {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s;
}
.calc-tab.active {
  background: var(--surface);
  color: var(--purple);
  box-shadow: var(--shadow-sm);
}

.calc-panel { display: none; }
.calc-panel.active { display: block; }

.calc-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.65;
}

.calc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
}

.calc-field input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.calc-field input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.calc-field input::placeholder { color: var(--text-muted); }

.calc-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.calc-btn {
  width: 100%;
  margin-bottom: 20px;
}

.calc-result {
  min-height: 40px;
}

.calc-result-card {
  background: linear-gradient(135deg, #f5f4ff, #f0f8f8);
  border: 1px solid rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
}

.calc-result-card .result-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.calc-result-card .result-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
}

.calc-result-card .result-breakdown {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.calc-disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.6;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: border-color 0.3s;
}
.faq-item:hover { border-color: rgba(108, 92, 231, 0.15); }

.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 20px 24px;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--purple);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 24px 20px;
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ===== GLOSSARY ===== */
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.glossary-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.3s;
}
.glossary-item:hover { border-color: rgba(0, 206, 201, 0.2); }

.glossary-item dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
}

.glossary-item dd {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== AD SLOTS ===== */
.ad-slot {
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 24px;
}

.ad-placeholder {
  background: var(--bg-alt);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-slot-inline {
  grid-column: 1 / -1;
  padding: 0;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
}

.footer-tagline {
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 260px;
}

.footer-links-col h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 16px;
}

.footer-links-col ul { list-style: none; }
.footer-links-col li { margin-bottom: 10px; }
.footer-links-col a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-links-col a:hover { color: var(--teal-light); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
}

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .guides-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }

  .mobile-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 16px; }

  .hero { padding: calc(var(--nav-h) + 48px) 0 64px; }
  .hero h1 { font-size: 2.4rem; }
  .hero-cta-row { flex-direction: column; }
  .hero-stats { gap: 28px; }

  .tool-card-header { padding: 18px 20px; }
  .tool-icon { width: 44px; height: 44px; }
  .tool-icon svg { width: 24px; height: 24px; }
  .tool-card-header h3 { font-size: 1.05rem; }
  .tool-content { padding: 0 20px 20px; }
  .comparison-table-wrap { padding: 0 20px 20px; }

  .guide-card { padding: 24px; }

  .calc-fields { grid-template-columns: 1fr; }
  .calculator-wrap { padding: 28px; }

  .glossary-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .section { padding: 56px 0; }
  .section-header { margin-bottom: 36px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
  .comparison-table { font-size: 0.8rem; }
  .comparison-table thead th, .comparison-table tbody td { padding: 10px 10px; }
}
