/* pofinance.xyz — Retirement Savings Calculator
   Visual identity: forest green + sand + ivory, light serif headings,
   hexagonal brand mark, magazine-style content layout, 8px 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", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.7;
  color: #2c2820; background: #faf6ec;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: #2d4a2b; text-decoration: underline; text-decoration-color: #c9a96e; text-underline-offset: 3px; }
a:hover { color: #c9a96e; text-decoration-color: #2d4a2b; }

h1, h2, h3, h4 {
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-weight: 400;
  color: #1f3320; line-height: 1.25; margin: 0 0 .55em;
  letter-spacing: -.005em;
}
h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 400; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); margin-top: 1.6em; font-weight: 400; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

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

:root {
  --forest: #2d4a2b;
  --forest-dark: #1f3320;
  --moss: #5a7855;
  --sand: #c9a96e;
  --sand-soft: #ede4cd;
  --ivory: #faf6ec;
  --paper: #f3ecda;
  --line: #d8cdb4;
  --text: #2c2820;
  --muted: #6f6453;
}

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

/* ---- Header ---- */
.site-header {
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; line-height: 1.1; }
.brand-mark {
  width: 36px; height: 36px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--forest); color: var(--ivory);
  display: grid; place-items: center;
  font-family: Georgia, serif; font-weight: 400; font-size: .85rem; letter-spacing: 1px;
  flex-shrink: 0;
}
.brand-text { display: inline-flex; flex-direction: column; gap: 2px; }
.brand-name {
  color: var(--forest-dark); font-family: Georgia, serif; font-weight: 400;
  font-size: 1.05rem;
}
.brand-tagline {
  font-size: .72rem; font-weight: 500; color: var(--moss);
  text-transform: uppercase; letter-spacing: .14em;
}
@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-family: -apple-system, sans-serif; font-weight: 500; color: var(--forest-dark);
  font-size: .9rem; text-decoration: none;
  padding: .25rem 0; white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: var(--sand); color: var(--moss); }
.nav-toggle {
  display: none; background: transparent; border: 0; padding: .4rem; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--forest);
  margin: 5px 0;
}

/* ---- Hero (magazine 3-column) ---- */
.hero {
  padding: 4rem 0 3rem;
  background: var(--paper);
  border-bottom: 4px double var(--sand);
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem;
}
.hero-grid .lede { grid-column: 1 / 3; }
.eyebrow {
  font-size: .76rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sand); font-weight: 700;
  margin-bottom: 1rem; display: block;
  padding-bottom: .5rem; border-bottom: 1px solid var(--line);
}
.lead { font-size: 1.08rem; color: var(--muted); }

.hero-side {
  background: var(--forest); color: var(--ivory);
  padding: 1.6rem; border-radius: 8px;
  align-self: start;
}
.hero-side h3 {
  color: var(--sand); margin: 0 0 1rem; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .15em; font-family: -apple-system, sans-serif; font-weight: 600;
}
.hero-side .stat {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(201, 169, 110, .25);
}
.hero-side .stat:last-child { border-bottom: none; }
.hero-side .stat span:first-child { color: rgba(245, 239, 222, .7); font-size: .85rem; }
.hero-side .stat span:last-child { color: var(--ivory); font-weight: 600; font-family: Georgia, serif; font-size: 1rem; }

/* ---- Tool ---- */
.tool {
  background: var(--ivory); border: 1px solid var(--line);
  padding: 2rem; margin: 2.5rem 0;
  border-radius: 8px;
  border-top: 6px solid var(--forest);
}
.tool h2 { margin-top: 0; }
.tool-grid {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-family: Georgia, serif; font-weight: 600; color: var(--forest-dark); font-size: .92rem; }
.field input, .field select {
  font: inherit; padding: .65rem .8rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--ivory); color: var(--text);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45, 74, 43, .15); background: #fff;
}
.field small { color: var(--muted); font-size: .8rem; }

.tool-output {
  margin-top: 1.6rem;
  display: grid; grid-template-columns: 2fr 1fr; gap: 1rem;
}
.tool-output .card {
  padding: 1.4rem 1.6rem; border-radius: 8px;
  background: var(--forest); color: var(--ivory);
}
.tool-output .card.alt { background: var(--sand); color: var(--forest-dark); }
.tool-output .card h3 {
  margin: 0 0 .5rem; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em;
  font-family: -apple-system, sans-serif; font-weight: 600;
}
.tool-output .card.alt h3 { color: var(--forest-dark); }
.tool-output .card .big {
  font-family: Georgia, serif; font-size: 2.4rem; font-weight: 400;
  line-height: 1.05;
}
.tool-output .card .sub { font-size: .9rem; opacity: .85; margin-top: .4rem; }
.gap-flag {
  margin-top: 1rem; padding: .8rem 1.1rem;
  border-radius: 6px;
  font-size: .92rem;
  background: var(--sand-soft); border-left: 4px solid var(--sand);
}
.gap-flag.warn { background: #f3dcdc; border-left-color: #b94a4a; }

.privacy-note {
  font-size: .9rem; color: var(--muted);
  border-left: 3px solid var(--moss);
  padding: .5rem .9rem; margin-top: 1rem;
  font-family: Georgia, serif; font-style: italic;
}

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

.author-card {
  display: grid; grid-template-columns: 90px 1fr; gap: 1.4rem;
  align-items: start; padding: 1.6rem;
  background: var(--paper);
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 1.2rem 0;
}
.author-avatar {
  width: 90px; height: 90px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--forest); color: var(--sand);
  font-size: 1.9rem; font-weight: 400; font-family: Georgia, serif;
  display: grid; place-items: center;
}
.author-meta { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; }
.cred-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.cred-row span {
  display: inline-block; padding: .2rem .6rem;
  background: var(--ivory); border: 1px solid var(--line);
  border-radius: 4px; font-size: .78rem; color: var(--forest-dark);
  font-weight: 600; font-family: -apple-system, sans-serif;
}

/* Reference / data tables */
.ref-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--ivory); }
.ref-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
.ref-table th, .ref-table td {
  padding: .7rem .9rem; text-align: left;
  border-bottom: 1px solid var(--line);
}
.ref-table thead th {
  background: var(--paper); color: var(--forest-dark);
  font-family: Georgia, serif; font-weight: 600;
  border-bottom: 2px solid var(--sand);
}
.ref-table tbody tr:hover td { background: var(--sand-soft); }

.callout {
  border-left: 3px solid var(--forest);
  background: var(--paper);
  padding: 1rem 1.2rem; margin: 1.2rem 0;
  border-radius: 0 8px 8px 0;
  font-size: .95rem;
}

/* Forms */
.form-card {
  background: var(--ivory); border: 1px solid var(--line);
  border-radius: 8px; padding: 1.8rem;
  margin: 1rem 0 2rem;
  border-top: 4px solid var(--forest);
}
.form-card label { display: grid; gap: .35rem; margin-bottom: 1rem; font-family: Georgia, serif; font-weight: 600; color: var(--forest-dark); font-size: .92rem; }
.form-card input, .form-card textarea, .form-card select {
  font: inherit; padding: .65rem .8rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--ivory);
}
.form-card input:focus, .form-card textarea:focus, .form-card select:focus {
  outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45, 74, 43, .15); background: #fff;
}
.btn {
  display: inline-block; padding: .7rem 1.4rem;
  font: inherit; font-family: Georgia, serif; font-weight: 600; font-size: 1rem;
  border-radius: 6px; cursor: pointer;
  border: 1px solid var(--forest); background: var(--forest); color: var(--ivory);
}
.btn:hover { background: var(--sand); border-color: var(--sand); color: var(--forest-dark); }

/* Footer */
.site-footer {
  background: var(--forest-dark); color: #b8b39c;
  padding: 2.6rem 0 1.4rem;
  border-top: 4px solid var(--sand);
}
.site-footer a { color: var(--sand); text-decoration: none; border-bottom: 1px solid transparent; }
.site-footer a:hover { color: var(--ivory); border-bottom-color: var(--sand); }
.site-footer .brand-mark { background: var(--sand); color: var(--forest-dark); }
.site-footer .brand-name { color: var(--ivory); }
.site-footer .brand-tagline { color: var(--sand); }
.footer-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 1.4rem;
}
.site-footer h4 {
  color: var(--ivory); font-family: Georgia, serif; font-size: 1rem; margin-bottom: .8rem; font-weight: 400;
}
.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(201, 169, 110, .15);
  font-size: .82rem; color: #8a7e63;
}

/* Responsive */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .lede { grid-column: auto; }
  .tool-output { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .author-card { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; right: 4%; left: 4%; z-index: 50;
    background: var(--ivory); border: 1px solid var(--line); border-radius: 6px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .6rem; box-shadow: 0 6px 18px rgba(45, 74, 43, .12);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .65rem .8rem; }
  .nav a:hover { background: var(--sand-soft); border-bottom-color: transparent; }
}
