/* ===== SUNWATT — Energy / Solar Tools =====
   Design language: bright, warm, sky-and-sun. Light background, gauge-style
   headline numbers, gradient sun accents. Deliberately distinct from
   CarCost/SellerKit's dark theme. */

:root {
  --sky: #eef6fb;
  --sky-deep: #dcedf7;
  --paper: #fffdf8;
  --ink: #1c2430;
  --ink-soft: #5b6b7a;
  --ink-faint: #94a3b3;
  --line: #e4ecf1;
  --sun: #f5a524;
  --sun-deep: #e0790f;
  --sun-glow: #fff4de;
  --leaf: #2e9e6b;
  --leaf-soft: #e5f6ee;
  --sky-blue: #2f8fd6;
  --sky-blue-soft: #e6f2fb;
  --bad: #dd4b3e;
  --bad-soft: #fdeceb;
  --radius: 16px;
  --radius-sm: 10px;
  --sans: "Vazirmatn", Tahoma, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(28,36,48,.04), 0 8px 24px -8px rgba(28,36,48,.10);
  --shadow-lg: 0 4px 8px rgba(28,36,48,.05), 0 20px 48px -12px rgba(28,36,48,.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--sky);
  background-image: radial-gradient(circle at 15% -10%, #fff6e4 0%, transparent 45%),
                     radial-gradient(circle at 100% 0%, #e3f1fb 0%, transparent 40%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
a { color: var(--sky-blue); }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); }

/* ---------- HEADER ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,253,248,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head__row { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 0; font-family: var(--sans); font-weight: 800; font-size: 19px; color: var(--ink); }
.logo__mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd873, var(--sun) 60%, var(--sun-deep));
  box-shadow: 0 0 0 4px var(--sun-glow), 0 4px 14px -4px rgba(224,121,15,.55);
  font-size: 16px;
}
.logo__sub { font-weight: 600; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); margin-right: 4px; }
.burger { display: none; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 38px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.burger span { width: 17px; height: 2px; background: var(--ink-soft); display: block; border-radius: 2px; }

.nav { border-top: 1px solid var(--line); display: none; background: var(--paper); }
.nav.is-open { display: block; }
.nav__inner { display: flex; flex-wrap: wrap; gap: 3px; padding: 10px 24px; }
.nav__link {
  background: none; border:1px solid rgba(255,255,255,.10); color: var(--ink-soft); cursor: pointer;
  padding: 8px 13px; font-size: 13px; font-weight: 600; border-radius: 999px;
  font-family: var(--sans); white-space: nowrap; transition: .15s; text-shadow:0 0 9px rgba(255,255,255,.16),0 0 2px rgba(255,255,255,.22);}
.nav__link:hover { background: var(--sky-deep); color: var(--ink); text-shadow:0 0 12px rgba(255,255,255,.30),0 0 3px rgba(255,255,255,.35);border-color:rgba(255,255,255,.28);}
.nav__link.is-on { background: var(--sun); color: #fff; }
@media (min-width: 980px) {
  .burger { display: none; }
  .nav { display: block; border-top: 0; background: transparent; }
  .nav__inner { padding: 10px 24px; border-top: 1px solid var(--line); justify-content: center; }
}

/* ---------- HOME HERO ---------- */
.home-hero { position: relative; padding: 76px 0 40px; text-align: center; }
.home-hero h1 { font-size: clamp(32px, 6vw, 54px); line-height: 1.08; margin-bottom: 18px; }
.home-hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--sun-deep), var(--sun) 55%, #ffcf6e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero p.lead { margin: 0 auto; max-width: 60ch; color: var(--ink-soft); font-size: 17px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--sun-deep);
  background: var(--sun-glow); padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
  border: 1px solid #ffe3ad;
}
.badges { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 22px; }
.badge {
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); }

/* ---------- SECTIONS ---------- */
.section { padding: 40px 0; }
.group-label {
  font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); margin: 34px 0 14px; display: flex; align-items: center; gap: 10px;
}
.group-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- TOOL GRID (home) ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.tile {
  position: relative; display: flex; gap: 14px; padding: 19px; text-align: right;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile__icon {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: var(--sun-glow); font-size: 19px;
}
.tile__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile__title { font-weight: 750; font-size: 15.5px; color: var(--ink); }
.tile__desc { color: var(--ink-soft); font-size: 13px; line-height: 1.55; }

/* ---------- CALCULATOR HERO/BENCH ---------- */
.hero { padding: 46px 0 6px; }
.hero h1 { font-size: clamp(27px, 5vw, 40px); line-height: 1.12; margin-bottom: 8px; }
.hero p { margin: 0; color: var(--ink-soft); font-size: 16px; max-width: 62ch; }
.breadcrumb { font-size: 12.5px; color: var(--ink-faint); margin: 22px 0 0; }
.breadcrumb a { color: var(--ink-faint); text-decoration: none; background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.breadcrumb a:hover { color: var(--sun-deep); }

.bench {
  position: relative; margin: 26px 0; padding: 26px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
}
@media (min-width: 700px) { .bench { padding: 32px; } }
.bench h2 { font-size: 16px; font-weight: 750; margin: 0 0 4px; color: var(--ink); }

.grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.input, .select {
  width: 100%; padding: 11px 13px; font-family: var(--sans); font-size: 15px;
  background: var(--sky); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: .15s;
}
.input--lg { font-size: 19px; padding: 13px; font-weight: 750; background: var(--paper); }
.input::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 4px var(--sun-glow); background: var(--paper); }
.select { appearance: none; padding-left: 34px; padding-right: 13px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(0% + 13px) center, calc(0% + 18px) center; background-size: 5px 5px; background-repeat: no-repeat; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; padding-bottom: 11px; font-weight: 600; }
.chk input { width: 17px; height: 17px; accent-color: var(--sun); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 700;
  transition: .15s;
}
.btn:hover { background: var(--sky-deep); }
.btn--go { background: linear-gradient(135deg, var(--sun), var(--sun-deep)); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -8px rgba(224,121,15,.55); }
.btn--go:hover { filter: brightness(1.06); }

/* ---------- RESULTS ---------- */
.out:empty { display: none; }
.out { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--line); }
.qty-big { font-size: clamp(32px, 6vw, 54px); font-weight: 800; letter-spacing: -.03em; color: var(--sun-deep); line-height: 1.05; }
.qty-sub { color: var(--ink-soft); font-size: 15px; margin-top: 4px; }

.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 18px; }
.stat { background: var(--sky); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px; }
.stat__v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-family: var(--mono); }
.stat__l { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; letter-spacing: .02em; }

.row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.row:last-child { border-bottom: 0; }
.row span:first-child { color: var(--ink-soft); }
.row b { font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--ink); }
.row--total { margin-top: 8px; padding-top: 16px; border-top: 2px solid var(--sun-glow); font-size: 18px; }
.row--total b { color: var(--sun-deep); }

.verdict { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); margin-top: 18px; font-size: 14.5px; line-height: 1.7; }
.verdict--ok { background: var(--leaf-soft); border: 1px solid #b9e6cf; color: #1b6b46; }
.verdict--warn { background: var(--sun-glow); border: 1px solid #ffdf9e; color: #8a5a10; }
.verdict--bad { background: var(--bad-soft); border: 1px solid #f6c6c0; color: #a4291d; }
.verdict b { display: block; color: var(--ink); margin-bottom: 3px; }
.err:empty { display: none; }
.err { margin-top: 16px; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; background: var(--bad-soft); border: 1px solid #f6c6c0; color: #a4291d; }

.note { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.7; background: var(--sky-blue-soft); border: 1px solid #c9e2f5; color: #235d84; }

/* ---------- PROSE ---------- */
.prose { max-width: 74ch; margin: 0 auto; }
.prose h2 { font-size: 24px; font-weight: 750; margin: 40px 0 12px; }
.prose h3 { font-size: 17.5px; font-weight: 700; margin: 26px 0 8px; }
.prose p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.85; }
.prose ul, .prose ol { margin: 0 0 16px; padding-right: 22px; padding-left: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.85; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--sun); }
.prose strong { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.prose th { text-align: right; padding: 10px 12px; background: var(--sky); color: var(--ink-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.prose td:first-child { color: var(--ink); font-weight: 600; }

.keytake { background: var(--sun-glow); border: 1px solid #ffe3ad; border-radius: var(--radius-sm); padding: 18px 22px; margin: 22px 0; }
.keytake h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--sun-deep); }
.keytake ul { margin: 0; padding-right: 20px; padding-left: 0; color: var(--ink); }

.related { display: grid; gap: 11px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 16px; }
.related button { text-align: right; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 17px; cursor: pointer; color: var(--ink); font: inherit; transition: .15s; }
.related button:hover { border-color: var(--sun); background: var(--sun-glow); }
.related b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.related span { font-size: 12.5px; color: var(--ink-soft); }

.table-scroll { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: right; padding: 10px 12px; color: var(--ink-faint); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); background: var(--sky); }
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
table.tbl td:first-child { color: var(--ink); font-weight: 600; }
table.tbl tr:last-child td { border-bottom: 0; }

/* ---------- FOOTER ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 36px 0; margin-top: 20px; }
.foot__line { margin: 0 0 14px; color: var(--ink-soft); font-size: 14.5px; }
.foot__copy { margin: 0; color: var(--ink-faint); font-size: 12.5px; }

.section-page { display: none; }
.section-page.active { display: block; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
