/* PlainTerms — the app's palette and type, for the web. Colors from
   PlainTerms/Assets.xcassets, so the site and the app look like one product. */

:root {
  --bg: #F6F3EE; --surface: #FCFAF7; --elevated: #FFFFFF;
  --text: #1F1D1A; --text-2: #5A554E; --text-3: #6F6960;
  --accent: #2F5B4E; --accent-pressed: #24483D;
  --positive: #3C6B52; --caution: #8A5A1E; --negative: #93362B;
  --divider: #DED7CB; --divider-strong: #CFC6B7;
  --a: #2F5B6E; --a-soft: #DCE6EA; --b: #985836; --b-soft: #F0E2D6;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-card: 20px; --radius-field: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130F; --surface: #1E1B17; --elevated: #272320;
    --text: #F2EDE4; --text-2: #B5AEA3; --text-3: #948C7E;
    --accent: #8FBCA8; --accent-pressed: #A8CCBB;
    --positive: #86BF9B; --caution: #D7A868; --negative: #E08C7E;
    --divider: #302B25; --divider-strong: #3E3830;
    --a: #7FB0C4; --a-soft: #1B2A31; --b: #D59B6E; --b-soft: #2C2219;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.5 var(--sans); font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
a:hover { color: var(--accent-pressed); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
header.site { padding: 20px 0; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--text); text-decoration: none; }
nav.site { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
nav.site a { color: var(--text-2); text-decoration: none; }
nav.site a[aria-current="page"], nav.site a:hover { color: var(--accent); }
@media (max-width: 680px) {
  header.site .wrap { flex-direction: column; align-items: flex-start; gap: 6px; }
  nav.site { flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 16px; padding-bottom: 4px; }
  nav.site a { white-space: nowrap; }
}

.eyebrow { font-family: var(--serif); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 0 0 6px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 8px 0 12px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 6px; font-weight: 600; }
.lede { font-size: 19px; color: var(--text-2); max-width: 620px; margin: 0 0 28px; }
p { margin: 0 0 12px; max-width: 640px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; color: var(--text-3); }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 40px; }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-card); padding: 24px; }
.card + .card { margin-top: 16px; }
.result { position: sticky; top: 16px; }
@media (max-width: 820px) { .result { position: static; } }

fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 15px; color: var(--text-2); margin-bottom: 4px; }
.input { position: relative; }
.input input, select {
  width: 100%; font: inherit; color: var(--text); background: var(--elevated);
  border: 1px solid var(--divider-strong); border-radius: var(--radius-field);
  padding: 11px 12px; min-height: 46px;
}
.input input { padding-right: 52px; text-align: right; }
.input .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
input:focus-visible, select:focus-visible, button:focus-visible, .choice input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px;
}
.help { display: block; font-size: 14px; color: var(--text-3); margin-top: 4px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--divider-strong);
  background: var(--elevated); cursor: pointer; font-size: 15px;
}
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.hero-amount { font-family: var(--serif); font-size: clamp(36px, 6vw, 48px); line-height: 1.1; margin: 4px 0 8px; }
.split-bar { display: flex; height: 14px; border-radius: 10px; overflow: hidden; background: var(--divider); margin: 16px 0 12px; }
.split-bar .a { background: var(--a); }
.split-bar .b { background: var(--b); }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.person { border-radius: 14px; padding: 14px; }
.person.a { background: var(--a-soft); }
.person.b { background: var(--b-soft); }
.person .name { font-size: 15px; color: var(--text-2); }
.person .amount { font-family: var(--serif); font-size: 26px; }
.person.a .amount { color: var(--a); }
.person.b .amount { color: var(--b); }

table.lines { width: 100%; border-collapse: collapse; font-size: 16px; }
table.lines td { padding: 7px 0; border-bottom: 1px solid var(--divider); }
table.lines td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
table.lines tr.total td { font-weight: 600; border-bottom: 0; }

.note { border-left: 3px solid var(--caution); padding: 2px 0 2px 12px; margin: 16px 0 0; }
.note.good { border-color: var(--positive); }
.note h3 { margin-bottom: 2px; }
.note p { font-size: 15px; color: var(--text-2); margin: 0; }

.mt { margin-top: 12px; }
.not-found { padding-top: 16px; }
.not-found-icon { border-radius: 22px; display: block; margin-bottom: 20px; }
.input input.text { text-align: left; padding-right: 12px; }
.input input.plain { padding-right: 12px; }
.hero-amount.smaller { font-size: 32px; }
table.lines.compact { font-size: 15px; }
.cta-link { color: inherit; font-weight: 600; }
.cta-link:hover { color: inherit; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { border-radius: 7px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }

/* The app, and partners. Ads are always marked as ads. */
.app-cta { background: var(--accent); color: var(--bg); border-radius: var(--radius-card); padding: 22px 24px; margin-top: 16px; }
.app-cta h3 { color: var(--bg); }
.app-cta p { color: color-mix(in srgb, var(--bg) 85%, transparent); font-size: 15px; }
.app-cta .soon { display: inline-block; font-size: 14px; border: 1px solid color-mix(in srgb, var(--bg) 60%, transparent); border-radius: 999px; padding: 4px 12px; }

.partner { border: 1px dashed var(--divider-strong); border-radius: 14px; padding: 14px 16px; margin-top: 16px; background: var(--bg); }
.partner .ad-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.partner p { font-size: 15px; margin: 4px 0 0; color: var(--text-2); }
.partner[hidden] { display: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 8px 0 48px; }
.tile { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-card); padding: 22px; transition: border-color .15s; }
.tile:hover { border-color: var(--accent); color: var(--text); }
.tile p { color: var(--text-2); font-size: 15px; margin: 0; }
.tile .go { color: var(--accent); font-size: 15px; margin-top: 12px; display: block; }

footer.site { border-top: 1px solid var(--divider); padding: 24px 0 40px; margin-top: 24px; font-size: 14px; color: var(--text-3); }
footer.site p { max-width: 760px; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin: 12px 0 6px; border-bottom: 1px solid var(--divider-strong); position: relative; }
.chart .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-width: 2px; }
.chart .bar.a { background: var(--a); }
.chart .bar.b { background: var(--b); }
.chart .normal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--text-3); }

@media (prefers-reduced-motion: no-preference) {
  .split-bar .a, .split-bar .b { transition: flex-basis .35s ease; }
}
