@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/source-sans-3-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/fraunces-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/fraunces-latin-600-normal.woff2") format("woff2");
}

:root {
  --paper: #f2f1ee;
  --card: #fafaf8;
  --inset: #e6e5e1;
  --ink: #1a1c1e;
  --muted: #5c6166;
  --faint: #8b9094;
  --line: #d9dbdd;
  --accent: #2c3844;
  --title: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem);
  --display: clamp(2.75rem, 1.8rem + 3vw, 4.25rem);
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display-font: "Fraunces", Georgia, serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

h1,
h2 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 2px;
}

.ad {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.ad-inner {
  display: flex;
  width: 100%;
  max-width: 64rem;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.ad-label {
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--faint);
}

.ad-slot {
  display: block;
  width: 100%;
  max-width: 48rem;
  min-height: 6rem;
}

.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
}

.wrap {
  display: flex;
  width: 100%;
  max-width: 64rem;
  flex-direction: column;
  gap: 1.5rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 7rem;
}

.mast {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

h1 {
  font-family: var(--display-font);
  font-size: var(--title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.year {
  font-size: 0.875rem;
  color: var(--faint);
}

.layout {
  display: grid;
  align-items: start;
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card);
  padding: 1rem;
}

form.card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pair,
.triple,
.adjust-grid {
  display: grid;
  gap: 0.75rem;
}

.pair,
.adjust-grid {
  grid-template-columns: 1fr 1fr;
}

.triple {
  grid-template-columns: 1fr 1fr 0.8fr;
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.control {
  position: relative;
}

.prefix {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

input,
select {
  width: 100%;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--paper);
  padding: 0 0.75rem;
  font-variant-numeric: tabular-nums;
}

input.with-prefix {
  padding-left: 1.75rem;
}

select {
  appearance: none;
  padding-right: 2.25rem;
}

.chevron {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.select-chevron {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.hint,
.note {
  margin-top: -0.75rem;
  font-size: 0.875rem;
  color: var(--faint);
}

.note {
  color: var(--muted);
}

.linkish {
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.segment {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  border-radius: 0.5rem;
  background: var(--inset);
  padding: 0.125rem;
}

.segment button {
  height: 2.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.segment button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
}

.adjust {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.adjust-toggle {
  display: flex;
  width: 100%;
  height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
}

.adjust-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.adjust-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.adjust-body[hidden] {
  display: none;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.presets button {
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.reset {
  align-self: flex-start;
  height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.takehome {
  font-family: var(--display-font);
  font-size: var(--display);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.summary,
.after-hour {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.after-hour {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.share {
  display: flex;
  height: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--inset);
}

.share span {
  transition: flex-grow 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.seg-net { background: var(--accent); }
.seg-federal { background: color-mix(in srgb, var(--accent) 70%, transparent); }
.seg-state { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.seg-fica { background: color-mix(in srgb, var(--ink) 25%, transparent); }
.seg-other { background: var(--faint); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
}

.cols {
  display: none;
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding: 0.625rem 0;
}

.rows li:first-child {
  border-top: 0;
}

.rows li.net {
  padding: 0.75rem 0;
}

.row-copy {
  min-width: 0;
  flex: 1;
}

.row-label {
  display: block;
  font-size: 0.875rem;
}

.rows li.net .row-label,
.rows li.net .check {
  font-weight: 600;
  font-size: 1rem;
}

.row-detail {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--faint);
}

.check,
.year-col {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.check {
  width: 6rem;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.year-col {
  display: none;
  width: 7rem;
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.disclaimer {
  max-width: 48rem;
  font-size: 0.875rem;
  color: var(--faint);
}

.dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
}

.dock-inner {
  display: flex;
  width: 100%;
  max-width: 64rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
}

.dock-kicker {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.dock-pay {
  font-family: var(--display-font);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dock-gross {
  text-align: right;
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dock-gross span {
  display: block;
  color: var(--faint);
}

@media (min-width: 40rem) {
  .ad-inner,
  .wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .wrap {
    padding-top: 2.5rem;
  }

  .cols {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--faint);
  }

  .cols span:first-child {
    flex: 1;
  }

  .cols .check,
  .cols .year-col,
  .year-col {
    display: block;
  }
}

@media (min-width: 64rem) {
  .wrap {
    padding-bottom: 2.5rem;
  }

  .layout {
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  }

  .result {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100dvh - 3rem);
    overflow: auto;
    padding: 1.5rem;
  }

  .dock {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share span,
  .chevron {
    transition: none;
  }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.25rem;
}

.site-nav a {
  display: inline-flex;
  height: 2.75rem;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  background: var(--inset);
  color: var(--ink);
}

.page {
  width: 100%;
  max-width: 48rem;
}

.page h1 {
  font-family: var(--display-font);
  font-size: var(--title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  margin-top: 0.75rem;
  max-width: 65ch;
  color: var(--muted);
}

.article {
  display: flex;
  max-width: 65ch;
  flex-direction: column;
  gap: 1rem;
}

.article h2 {
  margin: 0.5rem 0 0;
  font-family: var(--display-font);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.article ul {
  margin: 0;
  padding-left: 1.25rem;
}

.article li + li {
  margin-top: 0.25rem;
}

.article a,
.site-footer a {
  color: inherit;
  font-weight: 500;
  text-underline-offset: 2px;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.post-list,
.faq-list,
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post,
.faq-list details,
.contact-form {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card);
  padding: 1rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 500;
}

.faq-list p,
.post p {
  color: var(--muted);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--ink);
}

.contact-form button {
  height: 2.75rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #f4f6f7;
  font-size: 0.875rem;
  font-weight: 500;
}

