/* fafinance.xyz — Net Worth Calculator
   Visual identity: teal + gold + cool white, modern sans medium,
   dashboard-tile grid layout, 6px corners. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  font-size: 15.5px; line-height: 1.65;
  color: #1a2832; background: #f7f5ef;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: #0f4c5c; text-decoration: none; border-bottom: 1px solid rgba(15, 76, 92, .3); }
a:hover { color: #e0a83a; border-bottom-color: #e0a83a; }

h1, h2, h3, h4 {
  font-family: -apple-system, "Segoe UI", "Inter", sans-serif;
  font-weight: 500;
  letter-spacing: -.015em;
  color: #0a3540; line-height: 1.25; margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 600; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-top: 1.6em; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }

code, kbd, samp, .mono {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .9em; background: #ebe6da; padding: .12em .4em; border-radius: 3px;
}

:root {
  --teal: #0f4c5c;
  --teal-dark: #0a3540;
  --teal-soft: #c8dde2;
  --gold: #e0a83a;
  --gold-dark: #b88825;
  --gold-soft: #f6e6c2;
  --cream: #f7f5ef;
  --paper: #ebe6da;
  --line: #d3cdba;
  --positive: #2d8659;
  --negative: #a93f3f;
  --text: #1a2832;
  --muted: #6c7680;
  --hi: #0a3540;
}

.container { width: min(1140px, 92%); margin: 0 auto; }

/* ---- Header ---- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; line-height: 1.1; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 6px;
  background: var(--teal); color: var(--cream);
  display: grid; place-items: center;
  font-weight: 600; font-size: .95rem; letter-spacing: -.5px;
  flex-shrink: 0;
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 12px 12px 0;
  border-color: transparent var(--gold) transparent transparent;
}
.brand-text { display: inline-flex; flex-direction: column; gap: 1px; }
.brand-name {
  color: var(--hi); font-weight: 700;
  font-size: 1rem; letter-spacing: -.01em;
}
.brand-tagline {
  font-size: .72rem; font-weight: 600; color: var(--gold-dark);
  letter-spacing: .04em;
}
@media (max-width: 720px) { .brand-tagline { display: none; } }

.nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; row-gap: .25rem; }
.nav a {
  font-weight: 600; color: var(--hi);
  font-size: .87rem; padding: .4rem .65rem;
  white-space: nowrap; border-radius: 4px;
  border-bottom: none;
}
.nav a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.nav-toggle {
  display: none; background: transparent; border: 0; padding: .4rem; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--teal);
  margin: 5px 0;
}

/* ---- Hero ---- */
.hero {
  padding: 3rem 0 2rem;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 760px; }
.eyebrow {
  display: inline-block;
  font-size: .73rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-dark); font-weight: 700;
  background: var(--gold-soft); padding: .3rem .8rem; border-radius: 4px;
  margin-bottom: 1rem;
}
.lead { font-size: 1.05rem; color: var(--muted); }

/* ---- Tool (dashboard tile layout) ---- */
.tool {
  margin: 2rem 0;
}
.tool-header {
  display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.4rem;
}
.tool-header h2 { margin: 0; }
.dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.2rem;
}
.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.2rem;
}
.tile-h {
  font-size: .73rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin: 0 0 .6rem;
}
.tile-input { display: flex; flex-direction: column; gap: .5rem; }
.tile-input label {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-size: .9rem; color: var(--text); font-weight: 500;
}
.tile-input input {
  font: inherit; font-family: "JetBrains Mono", Consolas, monospace;
  text-align: right; width: 130px;
  padding: .35rem .6rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--cream); color: var(--hi);
  font-weight: 600;
}
.tile-input input:focus {
  outline: none; border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 76, 92, .12);
}
.tile-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: .9rem; padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.tile-total .label {
  font-size: .85rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.tile-total .v {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 1.2rem; font-weight: 700; color: var(--hi);
}
.tile-total.assets .v { color: var(--positive); }
.tile-total.liab .v { color: var(--negative); }

.summary-tile {
  background: var(--teal); color: var(--cream);
  border-radius: 6px;
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: .8rem;
}
.summary-tile h3 {
  color: var(--gold); margin: 0;
  font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
}
.summary-tile .net {
  font-family: -apple-system, sans-serif;
  font-size: 2.4rem; font-weight: 600; color: var(--cream);
  letter-spacing: -.02em; line-height: 1;
}
.summary-tile .row {
  display: flex; justify-content: space-between;
  padding: .4rem 0;
  font-family: "JetBrains Mono", Consolas, monospace; font-size: .9rem;
  border-top: 1px solid rgba(244, 241, 234, .15);
}
.summary-tile .row .k { color: rgba(244, 241, 234, .65); }
.summary-tile .row .v { color: var(--gold); font-weight: 600; }

.cohort-flag {
  margin-top: 1rem; padding: .9rem 1.1rem;
  background: var(--gold-soft); border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  font-size: .92rem;
}

.privacy-note {
  font-size: .85rem; color: var(--muted);
  border-left: 2px solid var(--teal); background: var(--cream);
  padding: .55rem .9rem; margin-top: 1rem;
  border-radius: 0 4px 4px 0;
}

/* ---- Content ---- */
.content { padding: 1.5rem 0 3rem; }
.content section { margin-bottom: 2rem; }

.author-card {
  display: grid; grid-template-columns: 88px 1fr; gap: 1.4rem;
  align-items: center; padding: 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 1.2rem 0;
  border-left: 4px solid var(--gold);
}
.author-avatar {
  width: 88px; height: 88px; border-radius: 6px;
  background: var(--teal); color: var(--gold);
  font-size: 1.8rem; font-weight: 600;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.author-avatar::after {
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 24px 24px 0;
  border-color: transparent var(--gold) transparent transparent;
}
.author-meta { color: var(--muted); font-size: .9rem; margin: 0 0 .4rem; }
.cred-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.cred-row span {
  display: inline-block; padding: .2rem .65rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 4px; font-size: .76rem; color: var(--teal-dark);
  font-weight: 600;
}

/* Reference / data tables */
.ref-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
.ref-table th, .ref-table td {
  padding: .65rem .85rem; text-align: left;
  border-bottom: 1px solid var(--line);
}
.ref-table thead th {
  background: var(--paper); color: var(--hi);
  font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.ref-table tbody tr:hover td { background: var(--cream); }
.ref-table td.num { font-family: "JetBrains Mono", Consolas, monospace; font-size: .9rem; text-align: right; }

.callout {
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
  padding: .9rem 1.2rem; margin: 1.2rem 0;
  border-radius: 0 6px 6px 0;
  font-size: .95rem;
}

/* Forms */
.form-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 1.6rem;
  margin: 1rem 0 2rem;
  border-top: 3px solid var(--gold);
}
.form-card label { display: grid; gap: .35rem; margin-bottom: 1rem; font-size: .87rem; color: var(--hi); font-weight: 600; }
.form-card input, .form-card textarea, .form-card select {
  font: inherit; padding: .6rem .8rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--cream);
}
.form-card input:focus, .form-card textarea:focus, .form-card select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 76, 92, .12); background: #fff;
}
.btn {
  display: inline-block; padding: .65rem 1.4rem;
  font: inherit; font-weight: 700; font-size: .88rem;
  border-radius: 4px; cursor: pointer;
  border: 1px solid var(--teal); background: var(--teal); color: var(--cream);
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--teal-dark); }

/* Footer */
.site-footer {
  background: var(--teal-dark); color: #c2cfd6;
  padding: 2.4rem 0 1.4rem;
}
.site-footer a { color: var(--gold); border-bottom: none; }
.site-footer a:hover { color: var(--cream); }
.site-footer .brand-mark { background: var(--gold); color: var(--teal-dark); }
.site-footer .brand-mark::after { border-right-color: var(--cream); }
.site-footer .brand-name { color: var(--cream); }
.site-footer .brand-tagline { color: var(--gold); }
.footer-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 1.4rem;
}
.site-footer h4 {
  color: var(--cream); font-size: .85rem;
  margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; font-size: .9rem; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
  padding-top: 1.2rem; border-top: 1px solid rgba(244, 241, 234, .12);
  font-size: .82rem; color: #8c98a0;
}

/* Responsive */
@media (max-width: 880px) {
  .dashboard { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .author-card { grid-template-columns: 1fr; }
  .tile-input input { width: 110px; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; right: 4%; left: 4%; z-index: 50;
    background: var(--cream); border: 1px solid var(--line); border-radius: 6px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem; box-shadow: 0 6px 18px rgba(15, 76, 92, .12);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .65rem .85rem; }
}
