/* ============================================================
   HomeSifu Tools — Shared Theme  (matches homesifu.app homepage)
   Clean · light · monochrome · heavy display type · pill buttons
   This file is self-contained so the folder can be dropped anywhere.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* palette */
  --bg:            #ffffff;
  --surface:       #ffffff;
  --surface-muted: #f6f6f7;
  --surface-sunk:  #f1f1f3;
  --ink:           #111113;
  --ink-soft:      #3f3f46;
  --muted:         #71717a;
  --faint:         #a1a1aa;
  --line:          #e8e8ea;
  --line-strong:   #d4d4d8;
  --black:         #111113;

  /* semantic (status) */
  --good:     #15803d;
  --good-bg:  #ecfdf3;
  --good-line:#bbf7d0;
  --warn:     #b45309;
  --warn-bg:  #fffbeb;
  --warn-line:#fde68a;
  --bad:      #b91c1c;
  --bad-bg:   #fef2f2;
  --bad-line: #fecaca;

  /* shape */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;

  /* shadow */
  --shadow-sm: 0 1px 2px rgba(17,17,19,.04), 0 1px 3px rgba(17,17,19,.06);
  --shadow-md: 0 4px 16px rgba(17,17,19,.06), 0 2px 6px rgba(17,17,19,.04);
  --shadow-lg: 0 24px 60px rgba(17,17,19,.10), 0 8px 24px rgba(17,17,19,.06);

  --maxw: 1100px;
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink);
  color: #fff; display: grid; place-items: center; font-family: var(--font-display);
  font-weight: 800; font-size: 16px;
}
.topbar .tag { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 36px 0 14px; }
.eyebrow {
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -.03em;
  font-size: clamp(34px, 6vw, 60px); line-height: .98; color: var(--ink);
}
.hero p.lede {
  margin: 18px auto 0; max-width: 560px; color: var(--muted);
  font-size: clamp(15px, 2.2vw, 18px);
}

/* ---------- calculator shell ---------- */
.app {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 22px;
  margin: 30px auto 0; align-items: start;
}
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-md);
}
.card.sticky { position: sticky; top: 20px; }

.card h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: -.02em; margin-bottom: 4px;
}
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ---------- form ---------- */
.section-label {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; margin: 24px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-label:first-of-type { margin-top: 0; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.field { margin-bottom: 14px; }
.field > label {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px;
}
.field .hint { font-weight: 500; color: var(--faint); font-size: 12px; cursor: help; }

.input-money { position: relative; display: flex; align-items: center; }
.input-money .cur {
  position: absolute; left: 14px; font-weight: 600; color: var(--faint); font-size: 15px; pointer-events: none;
}
input[type="number"], input[type="text"], select {
  width: 100%; font-family: var(--font-body); font-size: 16px; font-weight: 600;
  color: var(--ink); background: var(--surface-muted);
  border: 1.5px solid transparent; border-radius: var(--r-md);
  padding: 13px 14px; transition: border-color .15s, background .15s, box-shadow .15s;
  appearance: none; -moz-appearance: textfield;
}
.input-money input { padding-left: 42px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus {
  outline: none; background: #fff; border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(17,17,19,.06);
}
input::placeholder { color: var(--faint); font-weight: 500; }
select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px){ .two-col { grid-template-columns: 1fr; } }

/* slider */
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type="range"]{ flex:1; -webkit-appearance:none; appearance:none; height:6px; border-radius:99px; background:var(--surface-sunk); }
.slider-row input[type="range"]::-webkit-slider-thumb{ -webkit-appearance:none; width:22px;height:22px;border-radius:50%; background:var(--ink); cursor:pointer; box-shadow:var(--shadow-sm); border:3px solid #fff; }
.slider-row input[type="range"]::-moz-range-thumb{ width:18px;height:18px;border-radius:50%;background:var(--ink);cursor:pointer;border:3px solid #fff; }
.slider-val { font-family:var(--font-display); font-weight:800; font-size:18px; min-width:54px; text-align:right; }

/* toggle pill group */
.pillset { display: inline-flex; background: var(--surface-sunk); padding: 4px; border-radius: var(--pill); gap: 2px; }
.pillset button {
  border: none; background: transparent; font-family: var(--font-body); font-weight: 600;
  font-size: 13.5px; color: var(--muted); padding: 8px 16px; border-radius: var(--pill); cursor: pointer;
  transition: all .15s;
}
.pillset button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* repeatable rows */
.commit-row { display: grid; grid-template-columns: 1fr 130px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.commit-row input { background: var(--surface-muted); }
.commit-row .rm-btn {
  border: none; background: var(--surface-sunk); color: var(--muted); border-radius: 9px;
  width: 34px; height: 44px; cursor: pointer; font-size: 18px; transition: all .15s;
}
.commit-row .rm-btn:hover { background: var(--bad-bg); color: var(--bad); }
.add-btn {
  margin-top: 4px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--ink-soft);
  font-family: var(--font-body); font-weight: 600; font-size: 14px; padding: 11px; width: 100%;
  border-radius: var(--r-md); cursor: pointer; transition: all .15s;
}
.add-btn:hover { border-color: var(--ink); background: var(--surface-muted); }

/* ---------- result panel ---------- */
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.result-head .label { font-size: 13px; letter-spacing:.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.big-number {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -.03em;
  font-size: clamp(52px, 12vw, 76px); line-height: 1; transition: color .2s;
}
.big-number .pct { font-size: .42em; font-weight: 800; vertical-align: baseline; margin-left: 2px; color: var(--muted); }

.verdict {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px;
  padding: 7px 14px; border-radius: var(--pill); margin-top: 14px; border: 1px solid;
}
.verdict.good { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.verdict.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.verdict.bad  { color: var(--bad);  background: var(--bad-bg);  border-color: var(--bad-line); }
.verdict .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* gauge bar */
.gauge { margin: 22px 0 6px; }
.gauge .track { position: relative; height: 14px; border-radius: 99px; background: var(--surface-sunk); overflow: hidden; }
.gauge .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; width: 0; transition: width .5s cubic-bezier(.2,.8,.2,1), background .3s; }
.gauge .cap-mark { position: absolute; top: -5px; bottom: -5px; width: 2.5px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); }
.gauge .cap-label { position: absolute; top: 22px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.gauge .scale { display: flex; justify-content: space-between; margin-top: 26px; font-size: 11px; color: var(--faint); font-weight: 600; }

/* breakdown list */
.breakdown { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.breakdown .row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: 14.5px; }
.breakdown .row + .row { border-top: 1px dashed var(--line); }
.breakdown .row .k { color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.breakdown .row .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown .row.total { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 14px; font-size: 16px; }
.breakdown .row.total .k { font-weight: 700; color: var(--ink); }
.breakdown .row.total .v { font-family: var(--font-display); font-weight: 800; }
.breakdown .row .v.pos { color: var(--good); }
.breakdown .row .v.neg { color: var(--bad); }

/* headroom callout */
.callout {
  margin-top: 20px; border-radius: var(--r-lg); padding: 18px; font-size: 14.5px; line-height: 1.55;
  border: 1px solid var(--line); background: var(--surface-muted);
}
.callout.good { background: var(--good-bg); border-color: var(--good-line); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.callout.bad  { background: var(--bad-bg);  border-color: var(--bad-line); }
.callout strong { font-weight: 800; }
.callout .hl { font-family: var(--font-display); font-weight: 800; }

/* buttons */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 15px; border-radius: var(--pill);
  padding: 13px 22px; cursor: pointer; border: 1.5px solid transparent; transition: all .15s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- explainer (education) ---------- */
.learn { margin: 64px auto 0; }
.learn h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: -.02em; font-size: clamp(26px,4vw,38px); text-align: center; }
.learn .lede { text-align: center; color: var(--muted); max-width: 600px; margin: 12px auto 0; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; margin-top: 34px; }
.learn-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; transition: all .2s; }
.learn-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.learn-card .num { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--ink); line-height: 1; }
.learn-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin: 12px 0 8px; letter-spacing: -.01em; }
.learn-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.learn-card .tip { margin-top: 10px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* FAQ */
.faq { margin: 56px auto 0; max-width: 760px; }
details {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 0; margin-bottom: 10px; background: var(--surface);
  overflow: hidden; transition: box-shadow .2s;
}
details[open] { box-shadow: var(--shadow-sm); }
summary {
  list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 700; font-size: 15.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-family: var(--font-display); font-size: 22px; color: var(--muted); font-weight: 600; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details .body { padding: 0 20px 20px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

/* disclaimer + footer */
.disclaimer {
  margin: 40px auto 0; max-width: 760px; text-align: center; font-size: 13px; color: var(--faint);
  line-height: 1.6; border-top: 1px solid var(--line); padding-top: 24px;
}
footer { text-align: center; padding: 48px 24px 56px; color: var(--faint); font-size: 13px; }
footer a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* entrance animation */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .19s; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } * { transition: none !important; } }

.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
