/* RetireDecoded — calm, cool, one bold element (the answer age). */
:root {
  --paper: #f2f4f1;
  --sheet: #ffffff;
  --ink: #14213d;
  --muted: #56617a;
  --line: #d3d9d2;
  --green: #2e6b5e;
  --green-soft: rgba(46, 107, 94, 0.12);
  --rose: #a8324a;
  --rose-soft: rgba(168, 50, 74, 0.08);
  --marigold: #d9a23a;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--green);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--sheet);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 {
  font-size: var(--step-4);
  font-weight: 650;
  max-width: 22ch;
}
h2 {
  font-size: var(--step-2);
  font-weight: 650;
}
h3 {
  font-size: var(--step-1);
  font-weight: 650;
  margin-top: 2rem;
}
p {
  margin: 0 0 1em;
}

/* ---------------------------------------------------------------- frame */
.site-header,
main,
.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.015em;
}
.mark {
  width: 2rem;
  height: 1.25rem;
  color: var(--ink);
}
.mark-dot {
  fill: var(--marigold);
}
.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 550;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--marigold);
  text-decoration-thickness: 2px;
}

main {
  padding-bottom: 4rem;
}
.intro {
  padding: 2rem 0 2.5rem;
  max-width: 44rem;
}
.intro p {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  padding-bottom: 3rem;
  color: var(--muted);
  font-size: var(--step--1);
}
.footer-promise {
  max-width: 40rem;
  color: var(--ink);
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.footer-small {
  margin: 0;
}

/* ---------------------------------------------------------------- forms */
.field {
  margin: 0 0 1.1rem;
  min-width: 0;
}
.field > label,
.field legend {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  margin-bottom: 0.35rem;
  padding: 0;
}
.field-input {
  display: flex;
  align-items: stretch;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.field-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-soft);
}
.field-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  outline: none;
}
.field-input input::-webkit-outer-spin-button,
.field-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-input input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.affix {
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  color: var(--muted);
}
.affix:first-child {
  padding-right: 0;
}
.affix:last-child {
  padding-left: 0;
}
.hint {
  font-size: var(--step--1);
  color: var(--muted);
  margin: 0.35rem 0 0;
}
fieldset.field {
  border: 0;
  padding: 0;
}
.choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.choice-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--sheet);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: var(--step--1);
  cursor: pointer;
}
.choice-options label.chosen {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.choice-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choice-options label:focus-within {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.9rem;
  align-items: end;
}

/* ---------------------------------------------------------------- planner and calculators */
.planner,
.calc {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 2.5rem 3.5rem;
  align-items: start;
}
.planner-inputs h2 {
  font-size: var(--step-1);
}
.lede {
  color: var(--muted);
}
.group {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 0.9rem;
}
.group summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}
.group summary::-webkit-details-marker {
  display: none;
}
.group summary::after {
  content: "+";
  color: var(--green);
  font-weight: 700;
}
.group[open] summary::after {
  content: "−";
}
.group-body {
  padding-top: 0.8rem;
}

.planner-result,
.calc-result {
  scroll-margin-top: 1rem;
  background: var(--sheet);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  border: 1px solid var(--line);
}
.headline h2 {
  font-size: var(--step-3);
  max-width: 24ch;
}
.age {
  font-size: 1.45em;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.age-optional {
  background: linear-gradient(transparent 72%, rgba(217, 162, 58, 0.55) 72%);
  padding: 0 0.08em;
}
.headline-sub {
  font-size: var(--step-1);
  color: var(--muted);
}
.calc-result h2 {
  font-size: var(--step-2);
}

.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.75rem 0 0.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.three > div {
  padding: 0.9rem 1rem 1rem 0;
}
.three > div + div {
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}
.three dt {
  font-size: var(--step--1);
  color: var(--muted);
}
.three dd {
  margin: 0.15rem 0 0;
  font-size: var(--step-2);
  font-weight: 650;
}
.three .short dd {
  color: var(--rose);
}
.three .ok dd {
  color: var(--green);
}
.note {
  font-size: var(--step--1);
  color: var(--muted);
}
.warning {
  border-left: 3px solid var(--rose);
  background: var(--rose-soft);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
}
.problem {
  font-size: var(--step-1);
  color: var(--rose);
}
.closer {
  font-size: var(--step-1);
  margin-top: 1.5rem;
}

.runway {
  margin: 1.5rem 0 0;
}
.runway svg {
  width: 100%;
  height: auto;
  display: block;
}
.runway figcaption {
  font-size: var(--step--1);
  color: var(--muted);
  margin-top: 0.4rem;
}
.rw-work {
  fill: rgba(20, 33, 61, 0.045);
}
.rw-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.rw-axis {
  fill: var(--muted);
  font-size: 12px;
}
.rw-area {
  fill: var(--green-soft);
}
.rw-area-short {
  fill: var(--rose-soft);
}
.rw-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.rw-line-short {
  stroke: var(--rose);
}
.rw-stop {
  stroke: var(--marigold);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.rw-out {
  fill: var(--rose);
}
.rw-label {
  fill: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.rw-label-short {
  fill: var(--rose);
}

.levers {
  list-style: none;
  padding: 0;
  margin: 0;
}
.levers li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.lever-result {
  font-weight: 650;
  white-space: nowrap;
}
.lever-gain {
  color: var(--green);
  font-weight: 600;
}

table {
  border-collapse: collapse;
  width: 100%;
}
.pots th,
.pots td,
.rules th,
.rules td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.pots th,
.rules tbody th {
  width: 11rem;
  font-weight: 650;
}
.rules thead th {
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 600;
}
.sources td {
  font-size: var(--step--1);
}
.tag {
  color: var(--muted);
}
.result-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------------------------------------------------------------- prose */
.prose {
  max-width: 44rem;
  padding-top: 2rem;
}
.prose.wide {
  max-width: none;
}
.prose h2 {
  margin-top: 2rem;
}
.prose ul {
  padding-left: 1.2rem;
}
.prose li {
  margin-bottom: 0.5rem;
}
.prose .lede {
  font-size: var(--step-1);
}
section.prose {
  margin-top: 1rem;
}

/* ---------------------------------------------------------------- small screens */
.answer-bar {
  display: none;
}
@media (max-width: 860px) {
  .answer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    bottom: 0.75rem;
    z-index: 5;
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    font-weight: 650;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-top: -1rem;
  }
  .answer-bar span {
    color: var(--marigold);
    white-space: nowrap;
    font-weight: 600;
  }
  .planner,
  .calc {
    grid-template-columns: 1fr;
  }
  .planner-result,
  .calc-result {
    padding: 1.5rem 1.25rem;
  }
}
@media (max-width: 520px) {
  h1 {
    font-size: var(--step-3);
  }
  .headline h2 {
    font-size: var(--step-2);
  }
  .three {
    grid-template-columns: 1fr;
  }
  .three > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }
  .row2 {
    grid-template-columns: 1fr;
  }
  .levers li {
    flex-direction: column;
    gap: 0.15rem;
  }
  .lever-result {
    white-space: normal;
  }
  .pots th,
  .rules tbody th {
    width: auto;
    display: block;
    border-bottom: 0;
    padding-bottom: 0;
  }
  .pots td,
  .rules tbody td {
    display: block;
  }
}
