/* ============================================================
   Hisab-Kitab — India Calculator Hub
   Design language: modern Indian fintech — deep violet/indigo,
   white cards, rounded geometry, confident numbers.
   Inspired by the visual register of apps like Groww: bold
   single accent gradient, clean cards, generous whitespace.
   ============================================================ */

:root {
  --bg: #100D1B;
  --surface: #191430;
  --surface-2: #1F1A3A;
  --ink: #F1EEFA;
  --ink-soft: #B6B0D1;
  --ink-faint: #837DA3;

  --violet: #A78BFA;
  --violet-deep: #7C3AED;
  --indigo: #818CF8;
  --violet-tint: #241C42;
  --violet-tint-2: #2C2350;

  --mint: #34D399;
  --mint-tint: #113228;
  --amber: #FBBF24;

  --border: #2C2650;
  --border-strong: #3C3568;

  --grad: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);

  --display: "Plus Jakarta Sans", "Inter", -apple-system, "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --max: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--indigo); }

img { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.4em;
  color: var(--ink);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.08rem; }

p { max-width: 62ch; color: var(--ink-soft); }
p.wide { max-width: 74ch; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- layout shells ---------- */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-top {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }

.brand-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.brand-mark { font-family: var(--display); font-weight: 700; font-size: 1.28rem; color: var(--ink); white-space: nowrap; }
.brand-sub { display: none; }

.header-tagline {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-faint);
  white-space: nowrap;
}

.header-nav-row {
  border-top: 1px solid var(--border);
}
.header-nav-row .wrap {
  padding: 9px 24px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.header-nav a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
.header-nav a:hover { color: var(--violet); }

/* category dropdowns (native <details>/<summary>, closed via nav.js accordion + click-outside) */
.nav-dropdown { position: relative; }
.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
  user-select: none;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown:hover summary,
.nav-dropdown[open] summary { color: var(--violet); }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 30;
}
.dropdown-panel a {
  display: block;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 0.87rem;
  font-weight: 400;
  color: var(--ink-soft);
  white-space: nowrap;
}
.dropdown-panel a:hover { background: var(--violet-tint); color: var(--violet); }

.nav-toggle-checkbox { display: none; }
.nav-toggle-btn {
  display: none;
  cursor: pointer;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  flex-shrink: 0;
}

@media (max-width: 780px) {
  .nav-toggle-btn { display: flex; }
  .header-tagline { display: none; }
  .header-nav-row {
    display: none;
    border-top: 1px solid var(--border);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .header-nav-row .wrap { padding: 8px 24px 16px; }
  .header-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .header-nav > a {
    width: 100%;
    padding: 11px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 0.96rem;
  }
  .nav-dropdown {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .nav-dropdown summary {
    width: 100%;
    padding: 11px 4px;
    font-size: 0.96rem;
  }
  .dropdown-panel {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--surface-2);
    margin: 0 0 8px;
    width: 100%;
  }
  .nav-toggle-checkbox:checked ~ .header-nav-row { display: block; }
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding: 20px 0 0;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--violet); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 36px 0 48px;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--violet); }

/* ---------- home hero ---------- */

.hero {
  padding: 64px 0 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px; right: -160px;
  width: 560px; height: 560px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.22;
  z-index: -1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--violet);
  background: var(--violet-tint);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.hero h1 { max-width: 17ch; }

.hero-sub {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 56ch;
  margin-top: 16px;
}

.hero-stats { display: flex; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--violet); }
.hero-stat .label { font-size: 0.82rem; color: var(--ink-faint); margin-top: 2px; }

/* ---------- category pills ---------- */

.cat-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 36px;
}
.cat-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: default;
}

/* ---------- calculator card grid (home) ---------- */

.calc-section { margin-bottom: 46px; }

.calc-section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-card:hover {
  border-color: var(--violet);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -14px rgba(91, 33, 182, 0.35);
}

.calc-card-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.55);
}

.calc-card-name { font-family: var(--display); font-weight: 700; font-size: 1.08rem; }
.calc-card-desc { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }
.calc-card-go { color: var(--violet); font-size: 0.85rem; font-weight: 600; margin-top: auto; padding-top: 4px; }

/* ---------- calculator page ---------- */

.calc-hero { padding: 30px 0 8px; }
.calc-hero .kicker {
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--violet);
  background: var(--violet-tint);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 14px;
}
.calc-hero p { color: var(--ink-soft); }

.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  margin: 30px auto 56px;
  align-items: start;
}

@media (max-width: 800px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
}

.panel h2 { font-size: 1.05rem; margin-bottom: 18px; color: var(--ink); font-family: var(--display); font-weight: 700; }

.field { padding: 15px 0; border-bottom: 1px solid var(--border); }
.field:first-child { padding-top: 0; }
.field:last-child { border-bottom: none; padding-bottom: 0; }

.field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 8px; font-weight: 500;
}
.field label .val { font-family: var(--mono); color: var(--violet); font-size: 0.95rem; font-weight: 600; }

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
}

.field input[type="number"]:focus,
.field input[type="text"]:focus,
.field select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}

.field input[type="range"] { width: 100%; accent-color: var(--violet); margin-top: 10px; }

.toggle-group { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.toggle-group button {
  flex: 1;
  min-width: fit-content;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.toggle-group button.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

/* results panel */

.result-panel { background: var(--grad); color: #fff; border: none; }
.result-panel h2 { color: rgba(255,255,255,0.85); }

.result-figure {
  padding: 6px 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 16px;
}
.result-figure .label { font-size: 0.83rem; color: rgba(255,255,255,0.7); }
.result-figure .value { font-family: var(--mono); font-size: 2.15rem; font-weight: 600; color: #fff; margin-top: 6px; word-break: break-word; }

.result-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.14); font-size: 0.92rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .k { color: rgba(255,255,255,0.72); }
.result-row .v { font-family: var(--mono); color: #fff; font-weight: 600; }

.result-note { margin-top: 18px; font-size: 0.8rem; color: rgba(255,255,255,0.65); }

/* content / SEO body */

.content-section { padding: 8px 0 40px; border-top: 1px solid var(--border); }
.content-section:first-of-type { margin-top: 8px; }
.content-section h2 { margin-top: 0; }

.formula-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 0.92rem;
  overflow-x: auto;
  margin: 16px 0;
  color: var(--ink);
}

.faq-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin-bottom: 6px; font-family: var(--sans); font-weight: 600; }
.faq-item p { margin: 0; }

.related { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.related a {
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.related a:hover { border-color: var(--violet); color: var(--violet); background: var(--violet-tint); }

.disclaimer { font-size: 0.78rem; color: var(--ink-faint); margin-top: 10px; }

/* legacy ledger classes kept as aliases in case referenced elsewhere */
.category-label { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--violet); margin: 44px 0 4px; }

/* utility */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn-primary {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
}
.btn-primary:hover { color: #fff; opacity: 0.92; }
