/* takehomepaycal.com
 *
 * Visual identity: warm editorial, not cold fintech. Paper-coloured ground,
 * ink-coloured text, a serif for headings and a system sans for the numbers.
 * Deliberately unlike the usual navy-and-green calculator look.
 *
 * No web fonts, no frameworks, no build step. Everything here is plain CSS
 * that works when the archive is extracted onto shared hosting.
 */

:root {
  color-scheme: light dark;

  /* Ground and ink */
  --paper:        #faf7f2;
  --paper-2:      #f2ede4;
  --paper-3:      #e8e1d5;
  --rule:         #ddd4c4;
  --rule-strong:  #c4b8a2;
  --ink:          #1c1a16;
  --ink-2:        #4a453c;
  --ink-3:        #736c60;

  /* Accents. Petrol for structure, ember for the number that matters,
     moss for a positive delta, clay for a negative one. */
  --petrol:       #0f5c63;
  --petrol-soft:  #dceaea;
  --petrol-deep:  #093f45;
  --ember:        #b4531b;
  --ember-soft:   #f7e6d8;
  --moss:         #3d6b33;
  --moss-soft:    #e2eddd;
  --clay:         #9b3025;
  --clay-soft:    #f6e0dd;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 40rem;
  --wide: 74rem;
  --radius: 3px;
}

html[data-theme="dark"] {
  --paper:        #14120f;
  --paper-2:      #1c1a16;
  --paper-3:      #262219;
  --rule:         #343029;
  --rule-strong:  #4d4740;
  --ink:          #ece7dd;
  --ink-2:        #bdb6a8;
  --ink-3:        #8b8477;
  --petrol:       #6fb5bb;
  --petrol-soft:  #14312f;
  --petrol-deep:  #9ed3d7;
  --ember:        #e2915c;
  --ember-soft:   #32211a;
  --moss:         #8fc07f;
  --moss-soft:    #1e2a1c;
  --clay:         #e08b80;
  --clay-soft:    #2e1c19;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --paper:        #14120f;
    --paper-2:      #1c1a16;
    --paper-3:      #262219;
    --rule:         #343029;
    --rule-strong:  #4d4740;
    --ink:          #ece7dd;
    --ink-2:        #bdb6a8;
    --ink-3:        #8b8477;
    --petrol:       #6fb5bb;
    --petrol-soft:  #14312f;
    --petrol-deep:  #9ed3d7;
    --ember:        #e2915c;
    --ember-soft:   #32211a;
    --moss:         #8fc07f;
    --moss-soft:    #1e2a1c;
    --clay:         #e08b80;
    --clay-soft:    #2e1c19;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, table { max-width: 100%; }
img { height: auto; }

/* ------------------------------------------------------------------ layout */

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.col  { max-width: var(--measure); }
main  { display: block; padding: 1.5rem 0 5rem; }
.crumbs + main { padding-top: 0.25rem; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
@media (min-width: 62rem) {
  .grid { grid-template-columns: minmax(0, 1fr) 17rem; gap: 3.5rem; align-items: start; }
  .grid > aside { position: sticky; top: 1.5rem; }
}

/* -------------------------------------------------------------- typography */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.008em;
  color: var(--ink);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.85rem, 1.2rem + 2.4vw, 2.9rem); margin-bottom: 0.35em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); margin-top: 2.4em; }
h3 { font-size: 1.16rem; margin-top: 2em; }
h4 { font-size: 1.02rem; margin-top: 1.6em; font-family: var(--sans); font-weight: 650; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); padding-left: 1.15rem; margin: 0 0 1.3em; }
li { margin-bottom: 0.5em; }
li > ul, li > ol { margin-top: 0.5em; margin-bottom: 0.5em; }

.lede {
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 42rem;
  margin-bottom: 2rem;
}

a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ember); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
  border-radius: 2px;
}

strong, b { font-weight: 650; }
small { font-size: 0.86rem; color: var(--ink-3); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--paper-2);
       padding: 0.1em 0.35em; border-radius: 2px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* ------------------------------------------------------------------ header */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: relative;
}
.masthead-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 4.25rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.24rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: 0.42rem; margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand .mark {
  display: inline-block; width: 0.6rem; height: 0.6rem;
  background: var(--ember); border-radius: 50%; flex: none;
}
.brand .tld { color: var(--ink-3); font-weight: 400; }

.nav { display: flex; gap: 1.15rem; align-items: center; flex-wrap: wrap; }
/* On a phone the navigation scrolls sideways rather than wrapping onto three
   lines and pushing the page content off the screen. */
@media (max-width: 48rem) {
  .masthead-inner { min-height: 3.25rem; gap: 0.6rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .brand { font-size: 1.08rem; margin-right: 0; }
  .nav {
    order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 0.95rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: 0.15rem; margin-bottom: -0.15rem;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; font-size: 0.9rem; }
  .theme-toggle { margin-left: auto; }
  body { font-size: 16px; }
  h1 { line-height: 1.14; }
}
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.94rem;
  padding: 0.3rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ember); }

.theme-toggle {
  background: none; border: 1px solid var(--rule); color: var(--ink-2);
  font: inherit; font-size: 0.86rem; padding: 0.3rem 0.62rem;
  border-radius: var(--radius); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--rule-strong); color: var(--ink); }

/* ------------------------------------------------------------- breadcrumbs */

.crumbs { font-size: 0.87rem; color: var(--ink-3); padding: 1.1rem 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem;
             padding: 0; margin: 0; max-width: none; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--rule-strong); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ember); text-decoration: underline; }

/* ---------------------------------------------------------- the result rail */

.result {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ember);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 0 0 2rem;
}
.result-headline {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.05; color: var(--ink); letter-spacing: -0.02em;
  display: block; margin-bottom: 0.15rem;
}
.result-label { font-size: 0.9rem; color: var(--ink-3); display: block; }
.result-sub { font-size: 0.96rem; color: var(--ink-2); margin: 0.85rem 0 0; }

.figures {
  display: grid; gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: var(--radius);
  /* Always an exact number of columns, so a four-cell row never leaves a
     half-filled block of background showing. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.4rem 0 2rem; overflow: hidden;
}
@media (min-width: 30rem) and (max-width: 63.99rem) {
  .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 88rem) {
  .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.figure { background: var(--paper); padding: 0.85rem 1rem; }
.figure dt { font-size: 0.74rem; color: var(--ink-3); margin-bottom: 0.2rem;
             text-transform: uppercase; letter-spacing: 0.045em; }
.figure dd { margin: 0; font-size: 1.2rem; font-weight: 600;
             font-family: var(--serif); letter-spacing: -0.01em; }
.figure dd.pos { color: var(--moss); }
.figure dd.neg { color: var(--clay); }

/* ------------------------------------------------------------------ tables */

.table-scroll { overflow-x: auto; margin: 1.5rem 0 2rem;
                border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
caption { text-align: left; font-size: 0.88rem; color: var(--ink-3);
          padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--rule);
          background: var(--paper-2); }
th, td { padding: 0.58rem 0.9rem; text-align: left; border-bottom: 1px solid var(--rule);
         white-space: nowrap; }
th { font-weight: 650; font-size: 0.82rem; text-transform: uppercase;
     letter-spacing: 0.045em; color: var(--ink-3); background: var(--paper-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--paper-2); }
tr.highlight td { background: var(--ember-soft); font-weight: 600; }

/* The calculator and its answer sit side by side on a wide screen, so the
   number is visible while you are still changing the inputs. On a phone they
   stack, form first. */
.calc-layout {
  display: grid; gap: 1.5rem; margin: 0 0 2.5rem;
  grid-template-columns: minmax(0, 1fr);
}
.calc-layout > .calc, .calc-layout > .results { margin-bottom: 0; }
@media (min-width: 64rem) {
  .calc-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
  .calc-layout > .results { position: sticky; top: 1.25rem; }
}

/* ------------------------------------------------------------------- forms */

.calc {
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 0 0 2rem;
}
.calc h2, .calc h3 { margin-top: 0; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.86rem; font-weight: 600;
               margin-bottom: 0.32rem; color: var(--ink-2); line-height: 1.35; }
.field .hint { display: block; font-size: 0.82rem; color: var(--ink-3);
               font-weight: 400; margin-top: 0.2rem; }
input[type="number"], input[type="text"], select {
  width: 100%; font: inherit; font-size: 1rem; padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
select { cursor: pointer; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.checkline { display: flex; align-items: flex-start; gap: 0.55rem; margin-bottom: 0.55rem; }
.plans { display: grid; gap: 0.1rem 1rem;
         grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.plans .checkline { margin-bottom: 0.35rem; }
fieldset.plans-set { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.plans-set > legend { font-size: 0.88rem; font-weight: 600; color: var(--ink-2);
                              padding: 0; margin-bottom: 0.4rem; }
.checkline input { margin-top: 0.32rem; flex: none; }
.checkline label { font-weight: 400; font-size: 0.94rem; margin: 0; }
details.more { margin: 0.5rem 0 1rem; }
details.more > summary {
  cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--petrol);
  padding: 0.35rem 0; list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; font-weight: 700; }
details.more[open] > summary::before { content: "\2212 "; }

/* ------------------------------------------------------------------- notes */

.note {
  border-left: 3px solid var(--petrol); background: var(--petrol-soft);
  padding: 0.95rem 1.15rem; margin: 1.6rem 0; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem; max-width: 44rem;
}
.note p:last-child { margin-bottom: 0; }
.note.warn { border-left-color: var(--ember); background: var(--ember-soft); }
.note.uncertain { border-left-color: var(--clay); background: var(--clay-soft); }
.note .note-label {
  display: block; font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.07em; font-weight: 700; margin-bottom: 0.3rem; color: var(--ink-2);
}

.privacy-line {
  display: flex; gap: 0.55rem; align-items: baseline;
  font-size: 0.87rem; color: var(--ink-3); margin: 0.9rem 0 0;
}

/* ------------------------------------------------------------------- lists */

.linklist { list-style: none; padding: 0; max-width: none; }
.linklist li { margin-bottom: 0.55rem; }
.cardgrid {
  display: grid; gap: 1rem; padding: 0; list-style: none; max-width: none;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); margin: 1.5rem 0 2rem;
}
.cardgrid li { margin: 0; }
.cardgrid a {
  display: block; height: 100%; padding: 0.9rem 1rem; text-decoration: none;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2);
  color: var(--ink);
}
.cardgrid a:hover { border-color: var(--ember); background: var(--paper-3); }
.cardgrid .t { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.cardgrid .d { display: block; font-size: 0.86rem; color: var(--ink-3); line-height: 1.45; }

.pill {
  display: inline-block; font-size: 0.78rem; padding: 0.12rem 0.5rem;
  border-radius: 100px; background: var(--paper-3); color: var(--ink-2);
  border: 1px solid var(--rule);
}

/* -------------------------------------------------------------------- FAQ */

.faq { margin: 2rem 0; }
.faq details {
  border-bottom: 1px solid var(--rule); padding: 0.15rem 0;
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 0.85rem 0; font-family: var(--serif);
  font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between;
  gap: 1rem; align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ember); font-weight: 700; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding-bottom: 0.9rem; }
.faq details > div > p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ footer */

.foot {
  border-top: 1px solid var(--rule); margin-top: 4rem; padding: 2.5rem 0 3rem;
  background: var(--paper-2); font-size: 0.9rem; color: var(--ink-2);
}
.foot-grid {
  display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin-bottom: 2rem;
}
.foot h2 { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase;
           letter-spacing: 0.07em; color: var(--ink-3); margin: 0 0 0.7rem; }
.foot ul { list-style: none; padding: 0; margin: 0; max-width: none; }
.foot li { margin-bottom: 0.4rem; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ember); text-decoration: underline; }
.foot-base { border-top: 1px solid var(--rule); padding-top: 1.5rem;
             font-size: 0.85rem; color: var(--ink-3); }
.foot-base p { max-width: 46rem; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ember); color: #fff;
  padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; color: #fff; }

.sources { font-size: 0.88rem; color: var(--ink-3); }
.sources a { color: var(--ink-3); }
.updated { font-size: 0.85rem; color: var(--ink-3); margin-top: 2.5rem;
           padding-top: 1rem; border-top: 1px solid var(--rule); }

@media print {
  .masthead, .foot, .theme-toggle, .calc { display: none; }
  body { background: #fff; color: #000; }
}
