/* ===========================================================
   WattWise — shared stylesheet
   Plain CSS, no build step. One external font request (Manrope,
   for headings/brand only) — body text stays on the fast system
   font stack.
   =========================================================== */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2430;
  --text-muted: #57606f;
  --border: #e2e6ec;
  --primary: #0d6e6e;
  --primary-dark: #094f4f;
  --primary-tint: #e6f3f3;
  --accent: #d97706;
  --accent-dark: #a85c05;
  --accent-tint: #fdf0dc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 40, 0.06), 0 4px 16px rgba(20, 30, 40, 0.06);
  --max-width: 880px;
  --font-heading: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b212a;
    --text: #eef1f5;
    --text-muted: #a4adba;
    --border: #2b3340;
    --primary: #3fb6b6;
    --primary-dark: #7fd4d4;
    --primary-tint: #17302f;
    --accent: #f0a94e;
    --accent-dark: #f6c179;
    --accent-tint: #35270f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 20px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

img, svg { max-width: 100%; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

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

/* ---------- Header / Nav ---------- */

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-row {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.brand span.mark {
  color: var(--primary);
}

nav.main-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.94rem;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
}

nav.main-nav a:hover { color: var(--primary); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background:
    radial-gradient(600px 240px at 15% 0%, var(--primary-tint), transparent 65%),
    radial-gradient(500px 220px at 100% 10%, var(--accent-tint), transparent 60%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 52px 20px 34px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.hero p.lede {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 640px;
  margin: 0 0 22px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-badges span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- Calculator card grid (homepage) ---------- */

.tool-grid {
  max-width: 1040px;
  margin: 30px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

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

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(20,30,40,0.08), 0 12px 26px rgba(20,30,40,0.12);
  border-color: var(--primary);
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  background: var(--primary-tint);
}

.tool-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary);
}

.tool-card:nth-child(even) .tool-icon {
  background: var(--accent-tint);
}

.tool-card:nth-child(even) .tool-icon svg {
  stroke: var(--accent-dark);
}

.tool-card:nth-child(even) .eyebrow {
  color: var(--accent-dark);
}

.tool-card .eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 700;
}

.tool-card h3 {
  font-family: var(--font-heading);
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.005em;
}

.tool-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* ---------- Tool page layout ---------- */

main.tool-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 70px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

article h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}

article > p.intro {
  color: var(--text-muted);
  margin: 0 0 26px;
  max-width: 640px;
}

/* ---------- Calculator widget ---------- */

.calc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 8px;
}

.mode-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 20px;
}

.mode-toggle button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.mode-toggle button.active {
  background: var(--primary);
  color: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 6px;
}

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

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

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

.field input[type="number"],
.field input[type="text"],
.field select {
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  font-family: inherit;
  transition: border-color 0.12s ease;
}

.field input:hover,
.field select:hover {
  border-color: var(--primary);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.result-box {
  margin-top: 22px;
  background: var(--primary-tint);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.result-box .result-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.result-box .result-value {
  font-family: var(--font-heading);
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--text);
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.result-breakdown .item {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.result-breakdown .item .k {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.result-breakdown .item .v {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- Content sections ---------- */

section.explainer {
  margin-top: 40px;
}

section.explainer h2 {
  font-family: var(--font-heading);
  font-size: 1.32rem;
  font-weight: 800;
  margin: 0 0 10px;
}

section.explainer p, section.explainer li {
  color: var(--text);
  font-size: 0.98rem;
}

.formula-box {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  margin: 14px 0;
  overflow-x: auto;
  border-left: 3px solid var(--accent);
}

/* FAQ, no JS needed */

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 16px;
  margin-bottom: 10px;
  transition: border-color 0.12s ease;
}

.faq details[open] {
  border-color: var(--primary);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--primary);
  font-weight: 800;
}

.faq details[open] summary::before {
  content: "\2212";
}

.faq details p {
  margin: 0 0 14px 1.6em;
  color: var(--text-muted);
}

/* ---------- Related tools ---------- */

.related-tools {
  margin-top: 40px;
}

.related-tools h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-list a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface);
}

.related-list a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-row {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--primary); }

/* ---------- Simple content pages (about/privacy/contact) ---------- */

main.page-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 70px;
}

main.page-main h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  margin-bottom: 8px;
}

main.page-main h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  margin-top: 30px;
  font-size: 1.2rem;
}

/* ---------- Utility ---------- */

.disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}
