/* kifinance.xyz — Tax Bracket Calculator
   Visual identity: olive/khaki + deep red + bone, form-document aesthetic,
   ruled-line dividers, mixed serif/condensed-sans typography. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Iowan Old Style", serif;
  font-size: 16px; line-height: 1.65;
  color: #2c2a1f; background: #f3eed8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: #a8311e; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #5a5d2c; }

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: #2c2a1f; line-height: 1.2; margin: 0 0 .5em;
}
h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  text-align: center; padding-bottom: .4em;
  border-bottom: 3px double #5a5d2c;
}
h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-top: 1.6em;
  padding-bottom: .2em; border-bottom: 1px solid #c9c19f;
}
h3 { font-size: 1.05rem; font-weight: 700; }
h4 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 1em; }

code, kbd, samp, .mono {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .9em; background: #e8df9c; padding: .12em .4em; border-radius: 0;
  color: #5a5d2c;
}

.cap, .stamp {
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .15em; font-size: .75rem;
  color: #5a5d2c;
}

:root {
  --olive: #5a5d2c;
  --olive-dark: #3d3f1d;
  --olive-soft: #d4ce96;
  --red: #a8311e;
  --red-dark: #7c2114;
  --bone: #f3eed8;
  --paper: #ebe5c5;
  --line: #c9c19f;
  --line-dark: #a39c75;
  --text: #2c2a1f;
  --muted: #6a6651;
}

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

/* ---- Header ---- */
.site-header {
  background: var(--bone);
  border-bottom: 3px double var(--olive);
}
.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: 42px; height: 42px;
  background: var(--bone); color: var(--olive);
  border: 2px solid var(--olive);
  display: grid; place-items: center;
  font-family: Georgia, serif; font-weight: 700; font-size: .95rem; letter-spacing: 1px;
  flex-shrink: 0;
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 4px;
  border: .5px solid var(--olive);
}
.brand-text { display: inline-flex; flex-direction: column; gap: 1px; }
.brand-name {
  color: var(--olive-dark); font-family: Georgia, serif; font-weight: 700;
  font-size: 1.05rem;
}
.brand-tagline {
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  font-size: .68rem; font-weight: 700; color: var(--red);
  text-transform: uppercase; letter-spacing: .14em;
}
@media (max-width: 720px) { .brand-tagline { display: none; } }

.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; align-items: center; row-gap: .25rem; }
.nav a {
  font-family: Georgia, serif; font-weight: 600;
  color: var(--olive-dark); font-size: .92rem;
  text-decoration: none; padding: .3rem 0;
  white-space: nowrap;
}
.nav a:hover { color: var(--red); text-decoration: underline; text-decoration-style: double; }
.nav-toggle {
  display: none; background: transparent; border: 0; padding: .4rem; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--olive);
  margin: 5px 0;
}

/* ---- Hero ---- */
.hero {
  padding: 4rem 0 2.5rem;
  background: var(--bone);
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  font-weight: 700; font-size: .8rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
  padding: .25rem 1rem;
  border-top: 1px solid var(--red); border-bottom: 1px solid var(--red);
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; margin: 0 auto 1em; font-style: italic; }

/* ---- Tool ---- */
.tool {
  background: var(--bone);
  border: 2px solid var(--olive);
  padding: 0;
  margin: 2.5rem auto;
  max-width: 820px;
}
.tool-head {
  background: var(--olive); color: var(--bone);
  padding: 1rem 1.4rem;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 4px double var(--bone);
}
.tool-head h2 { color: var(--bone); margin: 0; font-size: 1.1rem; border: none; padding: 0; }
.tool-head .stamp { color: var(--olive-soft); }

.tool-body { padding: 1.6rem 1.8rem; }
.field { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.4rem; align-items: baseline; padding: .8rem 0; border-bottom: 1px dotted var(--line); }
.field:last-of-type { border-bottom: none; }
.field label {
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  font-weight: 700; color: var(--olive-dark);
  text-transform: uppercase; letter-spacing: .08em;
  font-size: .82rem;
}
.field input, .field select {
  font: inherit; font-family: "JetBrains Mono", Consolas, monospace;
  padding: .55rem .75rem;
  border: 1px solid var(--line-dark); border-radius: 0;
  background: var(--bone); color: var(--olive-dark);
  font-weight: 600; text-align: right;
}
.field select { font-family: Georgia, serif; text-align: left; }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--red);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--red);
}
.field .help {
  grid-column: 1 / -1; font-size: .82rem; color: var(--muted); font-style: italic;
  margin-top: -.3rem;
}

.tool-output {
  background: var(--paper);
  margin-top: 1.4rem;
  padding: 1.4rem 1.6rem;
  border-top: 3px double var(--olive);
  border-bottom: 3px double var(--olive);
}
.tool-output .summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.tool-output .item { padding: .6rem 0; border-bottom: 1px dotted var(--line-dark); }
.tool-output .item:last-child, .tool-output .item:nth-last-child(2) { border-bottom: none; }
.tool-output .item .k {
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  font-size: .72rem; margin-bottom: .25rem; display: block;
}
.tool-output .item .v {
  font-family: Georgia, serif; font-weight: 700; font-size: 1.2rem;
  color: var(--olive-dark);
}
.tool-output .item.headline .v { font-size: 1.7rem; color: var(--red); }
.tool-output .item.headline .k { color: var(--red); }

.bracket-table {
  margin-top: 1.4rem; padding: 1rem 1.6rem;
  border-top: 1px solid var(--line);
}
.bracket-table h4 {
  text-align: center; margin: 0 0 .8rem;
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  letter-spacing: .15em; text-transform: uppercase; color: var(--olive); font-weight: 700;
  font-size: .85rem;
}

.privacy-note {
  font-style: italic; font-size: .9rem; color: var(--muted);
  border-left: 2px solid var(--red);
  padding: .6rem 1rem; margin: 1.6rem;
  background: var(--paper);
}

/* ---- Content ---- */
.content { padding: 1.5rem 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(--bone); border: 1px solid var(--olive);
  border-left: 4px solid var(--red);
  margin: 1.2rem 0;
}
.author-avatar {
  width: 90px; height: 90px;
  background: var(--olive); color: var(--bone);
  border: 2px solid var(--olive); padding: 4px;
  display: grid; place-items: center;
  font-family: Georgia, serif;
  font-size: 1.85rem; font-weight: 700;
  position: relative;
}
.author-avatar::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--bone); }
.author-meta { color: var(--muted); font-size: .94rem; margin: .2rem 0 .5rem; font-style: italic; }
.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-dark);
  font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif;
  font-size: .72rem; color: var(--olive-dark);
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}

/* Reference / data tables */
.ref-table-wrap { overflow-x: auto; border: 1px solid var(--olive); background: var(--bone); }
.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(--olive); color: var(--bone);
  font-weight: 700; font-family: Georgia, serif;
  border-bottom: 2px solid var(--bone);
}
.ref-table tbody tr:nth-child(odd) td { background: var(--paper); }
.ref-table td.num { font-family: "JetBrains Mono", Consolas, monospace; font-size: .9rem; text-align: right; }

.callout {
  border-left: 3px solid var(--red);
  background: var(--paper);
  padding: 1rem 1.2rem; margin: 1.2rem 0;
  font-style: italic;
}
.callout strong { font-style: normal; }

/* Forms */
.form-card {
  background: var(--bone); border: 2px solid var(--olive);
  padding: 1.8rem;
  margin: 1rem 0 2rem;
}
.form-card label { display: grid; gap: .35rem; margin-bottom: 1rem; font-family: "Helvetica Neue Condensed Bold", "Arial Narrow", sans-serif; font-weight: 700; color: var(--olive-dark); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.form-card input, .form-card textarea, .form-card select {
  font: inherit; font-family: Georgia, serif; padding: .65rem .8rem;
  border: 1px solid var(--line-dark); background: var(--bone);
}
.form-card input:focus, .form-card textarea:focus, .form-card select:focus {
  outline: none; border-color: var(--red); background: #fff;
}
.btn {
  display: inline-block; padding: .7rem 1.5rem;
  font: inherit; font-family: Georgia, serif; font-weight: 700; font-size: 1rem;
  cursor: pointer;
  border: 2px solid var(--red); background: var(--red); color: var(--bone);
}
.btn:hover { background: var(--bone); color: var(--red); }

/* Footer */
.site-footer {
  background: var(--olive-dark); color: #c9c19f;
  padding: 2.6rem 0 1.4rem;
  border-top: 4px double var(--bone);
}
.site-footer a { color: var(--olive-soft); }
.site-footer a:hover { color: var(--bone); }
.site-footer .brand-mark { background: var(--bone); border-color: var(--bone); color: var(--olive-dark); }
.site-footer .brand-mark::after { border-color: var(--olive-dark); }
.site-footer .brand-name { color: var(--bone); }
.site-footer .brand-tagline { color: var(--olive-soft); }
.footer-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 1.4rem;
}
.site-footer h4 {
  color: var(--bone); font-family: Georgia, serif; font-size: 1rem;
  margin-bottom: .8rem; font-weight: 700;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; font-size: .92rem; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
  padding-top: 1.2rem; border-top: 1px solid rgba(243, 238, 216, .15);
  font-style: italic; font-size: .82rem; color: #9c9577;
}

/* Responsive */
@media (max-width: 880px) {
  .field { grid-template-columns: 1fr; gap: .35rem; }
  .field input, .field select { text-align: left; }
  .tool-output .summary { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .author-card { grid-template-columns: 1fr; }
  .author-avatar { width: 70px; height: 70px; font-size: 1.5rem; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; right: 4%; left: 4%; z-index: 50;
    background: var(--bone); border: 2px solid var(--olive); border-top: none;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .65rem .9rem; }
  .nav a:hover { background: var(--paper); text-decoration: none; }
}
