/* OpenCalc — Shared Stylesheet
   All pages link to this file. Design changes here = updates everywhere.
   ─────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Brand */
  --brand:        #2563EB;   /* OpenCalc blue — the one accent color */
  --brand-dark:   #1D4ED8;
  --brand-light:  rgba(37,99,235,0.08);

  /* Neutrals */
  --paper:        #FAFAF8;
  --white:        #FFFFFF;
  --ink:          #111827;
  --ink-2:        #374151;
  --steel:        #6B7280;
  --line:         rgba(17,24,39,0.10);
  --line-strong:  rgba(17,24,39,0.22);

  /* Semantic */
  --positive:     #059669;
  --positive-bg:  rgba(5,150,105,0.08);
  --warning:      #D97706;
  --warning-bg:   rgba(217,119,6,0.08);
  --negative:     #DC2626;

  /* Layout */
  --max-content:  780px;
  --max-wide:     1100px;
  --radius:       10px;
  --radius-sm:    6px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Site header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 24px;
}
.site-logo {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo span { color: var(--ink); }
.site-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.site-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--steel);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}
.site-nav a:hover { background: var(--brand-light); color: var(--brand); }
.site-nav a.active { color: var(--brand); font-weight: 600; }

/* ── Page wrapper ────────────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.page-wrap-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Typography ──────────────────────────────────────────────────── */
h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 4.5vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 14px;
}
h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 3vw, 24px);
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}
h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 17px;
  margin: 24px 0 8px;
}
p { font-size: 16px; margin: 0 0 16px; }
.lead {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  color: var(--steel);
  max-width: 580px;
}

/* ── Eyebrow label ───────────────────────────────────────────────── */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 10px;
}

/* ── Tool panel (white card) ─────────────────────────────────────── */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.panel h2 { margin-top: 0; }

/* ── Form fields ─────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.hint {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--steel);
  display: block;
  margin-top: 4px;
}
input[type="number"],
input[type="text"],
input[type="range"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── Grid helpers ────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 620px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Verdict / result display ────────────────────────────────────── */
.verdict {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}
.verdict-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.verdict-amount {
  font-family: 'Inter', sans-serif;
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #60A5FA;  /* blue-400 — readable on dark */
  font-variant-numeric: tabular-nums;
}
.verdict-suffix {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

/* ── Breakdown table ─────────────────────────────────────────────── */
table.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
}
table.breakdown th {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 2px solid var(--ink);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--steel);
}
table.breakdown th.num,
table.breakdown td.num { text-align: right; }
table.breakdown td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
table.breakdown tr.total td {
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid var(--ink);
  padding-top: 13px;
}

/* ── Callout boxes ───────────────────────────────────────────────── */
.callout {
  border-left: 3px solid var(--brand);
  background: var(--brand-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 13px 16px;
  margin: 18px 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.callout.positive { border-color: var(--positive); background: var(--positive-bg); }
.callout.warning  { border-color: var(--warning);  background: var(--warning-bg);  }

/* ── CTA box ─────────────────────────────────────────────────────── */
.cta-box {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 26px;
  margin: 36px 0;
  text-align: center;
}
.cta-box p { color: rgba(255,255,255,0.72); margin: 8px 0 0; font-family: 'Inter', sans-serif; }
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--brand); color: var(--white); }
.btn-accent  { background: #60A5FA; color: var(--ink); }
.btn-outline { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.35); }
.btn-block   { width: 100%; text-align: center; display: block; }
.btn-lg      { padding: 14px 28px; font-size: 16px; }

/* ── Ad slot ─────────────────────────────────────────────────────── */
.ad-slot {
  margin: 32px 0;
  min-height: 90px; /* reserve space so layout doesn't jump */
}

/* ── Tool card (homepage grid) ───────────────────────────────────── */
.tool-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(37,99,235,0.10);
  transform: translateY(-2px);
}
.tool-card .icon { font-size: 28px; margin-bottom: 10px; display: block; }
.tool-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.tool-card p {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--steel);
  margin: 0;
  line-height: 1.45;
}
.tool-card .category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
  display: block;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 32px 24px;
  margin-top: 60px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--steel);
}
.site-footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--steel); text-decoration: none; margin-left: 16px; }
.site-footer a:hover { color: var(--brand); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .site-nav { display: none; }
  .page-wrap, .page-wrap-wide { padding: 0 16px 60px; }
}
