/* ============================================================
   calc.css — shared styles for jasperliu.com calculators
   Matches main site tokens. Used by all pages under /calculators/
   ============================================================ */
:root {
  --paper: #F2EEE6;
  --paper-2: #E8E2D6;
  --ink: #1C231F;
  --green: #22372C;
  --green-2: #2F4A3B;
  --brass: #B08542;
  --brass-soft: #C9A765;
  --line: #C9C1B2;
  --muted: #5C6359;
  --white: #FBFAF6;
  --radius: 14px;
  --maxw: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Inter", system-ui, sans-serif; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
a { color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

/* nav */
header.nav { position: sticky; top: 0; z-index: 50; background: rgba(242,238,230,.86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: "Fraunces", serif; font-size: 20px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.brand span { color: var(--brass); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; font-size: 15px; text-decoration: none; padding: 13px 20px; border-radius: 999px; border: 1px solid transparent; transition: transform .15s, background .15s, color .15s; cursor: pointer; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { transform: translateY(-1px); background: var(--green-2); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-ghost:hover { background: var(--green); color: var(--white); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* page header */
.page-head { padding: 48px 0 28px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(30px, 5vw, 44px); margin: 10px 0 12px; }
.page-head h1 em { font-style: italic; color: var(--green); }
.page-head p { color: var(--muted); font-size: 17px; max-width: 52ch; margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--green); text-decoration: none; margin-bottom: 14px; }
.back:hover { text-decoration: underline; }

/* calculator layout */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  padding: 32px 0 80px;
}
@media (max-width: 800px) { .calc-layout { grid-template-columns: 1fr; } }

/* input panel */
.input-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.input-panel h2 { font-size: 18px; margin-bottom: 22px; color: var(--ink); }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.field label .opt { font-weight: 400; color: var(--line); font-size: 12px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* prefix/suffix inputs */
.inp-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  transition: border-color .15s;
}
.inp-wrap:focus-within { border-color: var(--green); }
.inp-wrap .adorn {
  padding: 0 12px;
  font-size: 14px;
  color: var(--muted);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-right: 1.5px solid var(--line);
  user-select: none;
}
.inp-wrap .adorn.right { border-right: none; border-left: 1.5px solid var(--line); }
.inp-wrap input {
  border: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.inp-wrap input[type=number] { -moz-appearance: textfield; }
.inp-wrap input[type=number]::-webkit-inner-spin-button,
.inp-wrap input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
.toggle-adorn {
  padding: 0 14px;
  background: var(--paper-2);
  border: none;
  border-left: 1.5px solid var(--line);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .15s;
}
.toggle-adorn:hover { background: var(--line); }

/* term tabs */
.term-tabs { display: flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.term-tab {
  flex: 1; padding: 10px 6px; text-align: center; background: var(--paper);
  border: none; border-right: 1px solid var(--line);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted);
  transition: background .15s, color .15s;
}
.term-tab:last-child { border-right: none; }
.term-tab:hover { background: var(--paper-2); color: var(--ink); }
.term-tab.active { background: var(--green); color: var(--white); }

/* result panel */
.result-panel { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 800px) { .result-panel { position: static; } }

.result-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.result-card.primary { border-color: var(--green); border-width: 1.5px; }

.big-number {
  font-family: "Fraunces", serif;
  font-size: 44px;
  font-weight: 500;
  color: var(--green);
  line-height: 1;
  margin: 6px 0 4px;
}
.big-number sup { font-size: 24px; vertical-align: super; }
.big-number .suffix { font-size: 22px; color: var(--muted); margin-left: 2px; }
.big-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.breakdown { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.brow { display: flex; justify-content: space-between; font-size: 14px; }
.brow span:first-child { color: var(--muted); }
.brow span:last-child { font-weight: 600; }
.brow.total { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 2px; }
.brow.total span { font-weight: 700; color: var(--ink); }

/* stats grid */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat .s-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat .s-value { font-family: "Fraunces", serif; font-size: 20px; font-weight: 500; }

/* amortization */
.amort-toggle {
  width: 100%; background: none; border: none; padding: 0;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--green);
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 6px;
}
.amort-toggle:hover { text-decoration: underline; }
.amort-wrap { margin-top: 16px; overflow-x: auto; }
.amort-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.amort-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.amort-table td { padding: 7px 8px; border-bottom: 1px solid var(--paper-2); }
.amort-table tr:last-child td { border-bottom: none; }
.amort-table tr:hover td { background: var(--paper); }

/* calc CTA */
.calc-cta {
  background: var(--green);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--white);
}
.calc-cta p { font-size: 14.5px; color: #C7D3CA; margin: 0 0 14px; }
.calc-cta .btn-primary { background: var(--brass); color: #231a08; font-size: 14px; padding: 11px 18px; }
.calc-cta .btn-primary:hover { background: var(--brass-soft); }

/* tools hub grid */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 36px 0 80px; }
@media (max-width: 760px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(28,35,31,.08); }
.tool-icon { font-size: 28px; margin-bottom: 14px; }
.tool-card h2 { font-size: 21px; margin-bottom: 8px; }
.tool-card p { font-size: 14.5px; color: var(--muted); margin: 0 0 18px; flex: 1; }
.tool-card .more { font-size: 14px; font-weight: 600; color: var(--green); }

/* comparison table (rent vs buy) */
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th { padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); text-align: right; }
.compare-table th:first-child { text-align: left; }
.compare-table td { padding: 8px 12px; border-bottom: 1px solid var(--paper-2); text-align: right; }
.compare-table td:first-child { text-align: left; color: var(--muted); }
.compare-table tr.breakeven td { background: #F0F7F2; font-weight: 700; color: var(--green); }
.compare-table tr:hover td { background: var(--paper); }

/* section divider */
.section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 10px; }

/* utility */
.note { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.pmi-note { background: #FFF8EE; border: 1px solid #E8D5A0; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #5C4A1A; }

/* footer */
footer { background: var(--ink); color: #C9CFC9; font-size: 13px; margin-top: 40px; }
footer .wrap { padding: 40px 22px 48px; }
.foot-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid #313a33; padding-bottom: 24px; margin-bottom: 22px; }
.foot-brand { font-family: "Fraunces", serif; font-size: 22px; color: var(--white); }
.eho { display: flex; align-items: center; gap: 12px; }
.eho small { color: #9AA39B; }
.compliance { color: #8E978F; line-height: 1.7; max-width: 80ch; }
.compliance a { color: #B9C6BC; }
.legal { margin-top: 18px; color: #6E776F; font-size: 12px; }
