/* Freelancer Tax Tools — main stylesheet
 * Design goals: fast, legible, trustworthy for a finance audience,
 * Lighthouse-friendly (no webfonts, no heavy animations, tiny footprint).
 */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-card: #ffffff;
  --border: #e4e8ef;
  --text: #1a1f2b;
  --text-soft: #4a5468;
  --text-muted: #7a8394;
  --brand: #0b6fbf;
  --brand-dark: #084f89;
  --accent: #0e9f6e;
  --accent-soft: #e6f7f1;
  --warn: #b45309;
  --warn-soft: #fff8e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 10px;
  --max-width: 900px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-header nav a {
  font-size: 15px;
  color: var(--text-soft);
  margin-left: 18px;
}

main { padding: 28px 0 60px; }

h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 19px;
  line-height: 1.35;
  margin: 24px 0 8px;
}
p { margin: 10px 0; color: var(--text-soft); }
ul, ol { color: var(--text-soft); }

.lede {
  font-size: 18px;
  color: var(--text-soft);
  margin: 0 0 22px;
}

/* ---------- Reviewer / trust block ---------- */
.trust {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 24px;
}
.trust strong { color: var(--text); }

/* ---------- Calculator card ---------- */
.calc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin: 20px 0 30px;
}
.calc h2 { margin-top: 0; }
.calc .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 6px;
}
.calc .field { display: flex; flex-direction: column; margin-bottom: 14px; }
.calc label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.calc .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.calc input[type="number"], .calc select {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.calc input[type="number"]:focus, .calc select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 111, 191, .12);
  outline: none;
}

/* ---------- Result panel ---------- */
.result {
  margin-top: 22px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid #b9e6d3;
}
.result .big {
  font-size: 32px;
  font-weight: 700;
  color: #0a6e4e;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.result .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0a6e4e;
  font-weight: 700;
}
.breakdown {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  font-size: 15px;
}
.breakdown div span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.breakdown div strong { color: var(--text); font-size: 17px; }

.disclaimer {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--warn-soft);
  border: 1px solid #f4d58f;
  border-radius: 8px;
  font-size: 13px;
  color: #6b4100;
}

/* ---------- Article content ---------- */
article h2 { border-top: 1px solid var(--border); padding-top: 28px; }
article h2:first-of-type { border-top: none; padding-top: 0; }
article p, article li { font-size: 17px; }
article ul, article ol { padding-left: 22px; }
article li { margin: 6px 0; }

.faq details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  background: var(--bg-card);
}
.faq summary {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+ ";
  color: var(--brand);
  font-weight: 700;
}
.faq details[open] summary::before { content: "− "; }

/* ---------- Related cards ---------- */
.related {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.related h2 { margin-top: 0; }
.related .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.related a.card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.related a.card:hover { border-color: var(--brand); transform: translateY(-1px); text-decoration: none; }
.related a.card strong { display: block; margin-bottom: 4px; }
.related a.card span { font-size: 14px; color: var(--text-muted); }

/* ---------- Footer ---------- */
footer.site-footer {
  margin-top: 60px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.site-footer a { color: var(--text-soft); }
.site-footer p { margin: 6px 0; color: var(--text-muted); }

/* ---------- Homepage ---------- */
.hero {
  text-align: center;
  padding: 20px 0 10px;
}
.hero h1 { font-size: 40px; }
.hero p { font-size: 19px; max-width: 620px; margin-left: auto; margin-right: auto; }

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.calc-grid a {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.calc-grid a:hover { border-color: var(--brand); transform: translateY(-1px); text-decoration: none; }
.calc-grid a strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.calc-grid a span { font-size: 14px; color: var(--text-muted); }
.calc-grid a.coming { opacity: 0.55; pointer-events: none; }
.calc-grid a.coming strong::after { content: " · coming soon"; font-weight: 400; font-size: 12px; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  h1 { font-size: 28px; }
  .hero h1 { font-size: 32px; }
  .calc .row { grid-template-columns: 1fr; gap: 0; }
  .breakdown { grid-template-columns: 1fr; }
  .related .grid, .calc-grid { grid-template-columns: 1fr; }
  .site-header nav a { margin-left: 12px; font-size: 14px; }
}
