/* BuildCalc — shared styles. Modern, mobile-first, no external dependencies. */
:root {
  --ink: #0f1115;
  --ink-soft: #2b2f36;
  --muted: #6b7280;
  --faint: #9aa0aa;
  --bg: #e4e6ea;
  --card: #ffffff;
  --line: #e9eaee;
  --line-soft: #f1f2f5;
  --brand: #ff5c35;          /* warm, energetic accent */
  --brand-ink: #d8421f;
  --brand-tint: #fff1ec;
  --accent2: #1b1f24;        /* near-black for headers/buttons */
  --good: #0e9f6e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16,17,21,.04), 0 1px 3px rgba(16,17,21,.06);
  --shadow: 0 2px 4px rgba(16,17,21,.04), 0 12px 28px rgba(16,17,21,.07);
  --shadow-lg: 0 8px 24px rgba(16,17,21,.08), 0 24px 56px rgba(16,17,21,.10);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 50% -200px, #ffe9e2 0%, rgba(255,233,226,0) 70%),
    var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-ink); text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

/* Header */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  font-weight: 800; font-size: 20px; color: var(--ink);
  letter-spacing: -.4px; display: inline-flex; align-items: center; gap: 8px;
}
.brand::before {
  content: ""; width: 11px; height: 11px; border-radius: 4px;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint);
}
.brand .wm i { color: var(--brand); font-style: normal; }
header.site nav a {
  color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-left: 18px;
  padding: 7px 12px; border-radius: 9px; transition: background .12s ease, color .12s ease;
}
header.site nav a:hover { background: var(--line-soft); color: var(--ink); }

/* Hero */
.hero { padding: 54px 0 18px; text-align: center; }
.hero .eyebrow, .hero h1, .hero p { } /* centered via .hero */

/* Two-column layout for calculator pages */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px; align-items: start; margin: 26px 0;
}
.layout > .content, .col-stack > .calc { margin: 0; }
.col-stack { display: flex; flex-direction: column; }
.col-stack > .ad { margin: 22px 0 0; }
.hero .eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--brand-ink);
  background: var(--brand-tint); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 { font-size: 40px; line-height: 1.08; margin: 0 0 14px; letter-spacing: -1.2px; font-weight: 800; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 auto; max-width: 560px; }

/* Calculator card */
.calc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin: 26px 0;
}
.calc h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.7px; font-weight: 800; }
.calc .sub { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--ink-soft); }
.field .hint { font-weight: 400; color: var(--faint); font-size: 12.5px; }
.inputrow { display: flex; gap: 12px; }
.inputrow .field { flex: 1; }
input[type="number"], select {
  width: 100%; padding: 13px 15px; font-size: 16px; font-family: inherit; font-weight: 600;
  color: var(--ink); background: #f5f6f8; border: 1.5px solid transparent; border-radius: var(--radius-sm);
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 38px;
}
input[type="number"]:focus, select:focus {
  outline: none; background: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}

/* Result */
.result {
  margin-top: 10px;
  background: linear-gradient(135deg, #1b1f24 0%, #2a2f37 100%);
  border-radius: var(--radius); padding: 22px 24px; color: #fff;
  box-shadow: var(--shadow);
}
.result .big {
  font-size: 34px; font-weight: 800; letter-spacing: -.8px; color: #fff;
  display: flex; align-items: baseline; gap: 8px;
}
.result .big::before { content: "="; color: var(--brand); font-weight: 800; }
.result .lines { margin-top: 14px; }
.result .lines div {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-top: 1px solid rgba(255,255,255,.10); font-size: 14.5px; color: #c8ccd2;
}
.result .lines div:first-child { border-top: 0; }
.result .lines span:last-child { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

/* Buy / affiliate CTA */
.buy {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; background: var(--brand); color: #fff; font-weight: 700;
  padding: 15px; border-radius: var(--radius-sm); font-size: 15.5px;
  box-shadow: 0 6px 16px rgba(255,92,53,.28); transition: transform .1s ease, box-shadow .1s ease, filter .1s ease;
}
.buy:hover { filter: brightness(1.03); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(255,92,53,.34); }

/* Ad slot */
.ad {
  margin: 26px 0; border: 1.5px dashed #d5d8de; border-radius: var(--radius-sm);
  color: var(--faint); text-align: center; padding: 26px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .3px; text-transform: uppercase; background: #fbfbfc;
}

/* Content sections */
.content {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin: 26px 0; box-shadow: var(--shadow-sm);
}
.content h2 { font-size: 21px; margin: 0 0 12px; letter-spacing: -.4px; font-weight: 800; }
.content h3 { font-size: 16px; margin: 22px 0 6px; font-weight: 700; }
.content p, .content li { color: var(--ink-soft); font-size: 15.5px; }
.example {
  background: var(--brand-tint); border: 1px solid #ffe0d6; border-radius: var(--radius-sm);
  padding: 16px 18px; font-size: 15px; color: var(--ink-soft); line-height: 1.7;
}

/* Search + category filter (home) */
.tools-bar { margin: 26px 0 4px; }
.search {
  width: 100%; padding: 15px 16px 15px 46px; font-size: 16px; font-family: inherit; font-weight: 600;
  color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm); transition: border-color .12s ease, box-shadow .12s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239aa0aa' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px center;
}
.search::placeholder { color: var(--faint); font-weight: 500; }
.search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chip:hover { border-color: #d3d6dc; }
.chip.active { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.noresults { text-align: center; color: var(--muted); padding: 30px 0; font-size: 15px; }

/* Calculator grid (home) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 20px 0 8px; }
.tile.hide { display: none; }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #ffd2c5; }
.tile .emoji {
  font-size: 22px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); border-radius: 12px; margin-bottom: 14px;
}
.tile .name { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.tile .desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.tile .go { color: var(--brand-ink); font-weight: 700; font-size: 13.5px; margin-top: 12px; display: inline-flex; align-items: center; gap: 5px; }

/* Embed-code box (on full calculator pages) */
.embed-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin: 0 0 26px; box-shadow: var(--shadow-sm);
}
.embed-box h2 { font-size: 19px; margin: 0 0 6px; letter-spacing: -.3px; font-weight: 800; }
.embed-box p { color: var(--muted); margin: 0 0 12px; font-size: 14.5px; }
.embed-code {
  width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.5; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #f7f8fa; color: var(--ink-soft); resize: vertical;
}
.embed-code:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.embed-actions { margin-top: 12px; display: flex; align-items: center; }
.embed-copy {
  background: var(--accent2); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: filter .12s ease;
}
.embed-copy:hover { filter: brightness(1.15); }
.embed-copied { margin-left: 12px; color: var(--good); font-weight: 700; font-size: 13.5px; }

/* Slim embeddable page (loaded inside an iframe on other sites) */
body.embed { background: #fff; }
body.embed .container { padding: 14px; max-width: 480px; }
body.embed .calc { margin: 0; border: 0; box-shadow: none; padding: 4px; }
body.embed .inputrow { flex-direction: row; gap: 10px; }
body.embed .inputrow .field { min-width: 0; }
.embed-credit { display: block; text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.embed-credit:hover { color: var(--ink-soft); }
.embed-credit b { color: var(--brand-ink); font-weight: 800; }

/* Static content pages (about, privacy, contact) */
.prose { max-width: 720px; margin: 26px auto; }
.prose h1 { font-size: 30px; letter-spacing: -.6px; margin: 0 0 16px; font-weight: 800; }
.prose h2 { font-size: 19px; margin: 26px 0 8px; letter-spacing: -.3px; font-weight: 800; }
.prose p, .prose li { color: var(--ink-soft); font-size: 15.5px; }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose li { margin: 5px 0; }
.prose a { color: var(--brand-ink); text-decoration: underline; }
.muted-date { color: var(--muted); font-size: 13.5px; margin-top: 0; }

/* Footer */
footer.site { margin-top: 40px; padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-nav { margin-bottom: 12px; }
.foot-nav a { color: var(--ink-soft); font-weight: 600; }
.foot-nav a:hover { color: var(--brand-ink); }
footer.site a { color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--faint); margin-top: 8px; line-height: 1.6; }

/* Stack the calculator + explainer once the screen gets narrow */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .layout > .calc { margin-bottom: 22px; }
}

@media (max-width: 560px) {
  .hero { padding: 38px 0 10px; }
  .hero h1 { font-size: 30px; letter-spacing: -.8px; }
  .hero p { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .inputrow { flex-direction: column; gap: 0; }
  .calc, .content { padding: 20px; }
}
