:root {
  --sky: #F3F6F8;      /* page */
  --paper: #FFFFFF;    /* panels */
  --ink: #16263A;      /* text, deep navy */
  --slate: #4F6070;    /* secondary text */
  --line: #D5DEE5;     /* borders */
  --pine: #1F6B55;     /* money lasts */
  --amber: #E9A23B;    /* runway lights, action */
  --amber-deep: #B9761A;
  --short: #B5482F;    /* runs out early */
  --serif: "Literata", Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 400 1.1875rem/1.6 var(--sans);   /* 19px */
}
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--pine); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 32px, 760px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--sky); }
.top-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 650 1.15rem/1 var(--serif); color: var(--ink); }
.brand-mark { width: 32px; height: 32px; color: var(--ink); }
.top-link { font-weight: 700; font-size: 1rem; }

/* type */
h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); letter-spacing: -0.015em; max-width: 17ch; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 64ch; }
.lede { font-size: 1.3rem; color: var(--slate); max-width: 46ch; }

.hero { padding: 56px 0 24px; }

/* calculator */
.calc { margin-bottom: 72px; }
.calc-grid {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 28px;
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font: 650 1.05rem/1.2 var(--serif); margin-bottom: 12px; padding: 0; }
label { display: block; font-weight: 700; font-size: 1rem; margin-bottom: 18px; }
label small { display: block; font-weight: 400; color: var(--slate); font-size: .9rem; margin-top: 6px; line-height: 1.4; }
input, select {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 1.15rem; font-weight: 400;
  color: var(--ink); background: var(--sky); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px;
  min-height: 50px;
}
input:focus, select:focus { border-color: var(--ink); outline: none; background: #fff; }
input::placeholder { color: #8C9AA6; }
input[aria-invalid="true"] { border-color: var(--short); }
.money, .pct { position: relative; display: block; }
.money input { padding-left: 30px; }
.money::before { content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-38%); color: var(--slate); font-weight: 400; font-size: 1.15rem; }
.pct input { padding-right: 34px; }
.pct::after { content: "%"; position: absolute; right: 13px; top: 50%; transform: translateY(-38%); color: var(--slate); font-weight: 400; }
.assume { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }
.assume summary { cursor: pointer; font-weight: 700; font-size: 1rem; color: var(--slate); margin-bottom: 12px; }
.assume label { max-width: 360px; }
.calc-actions { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.form-error { grid-column: 1 / -1; color: var(--short); font-weight: 700; margin: 12px 0 0; }

.btn {
  display: inline-block; font: 700 1.1rem/1 var(--sans); color: var(--ink); background: var(--amber);
  border: 0; border-radius: 10px; padding: 16px 26px; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 -3px 0 var(--amber-deep);
}
.btn:hover { background: #F0B357; color: var(--ink); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--amber-deep); }
.btn-quiet { font: 700 1rem/1 var(--sans); background: none; border: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px 4px; }

/* result: the runway */
.result {
  margin-top: 20px; background: var(--ink); color: #EAF0F4; border-radius: 14px; padding: 30px 28px 28px;
}
.result a:not(.btn) { color: #fff; }
.result-head { font: 650 clamp(1.45rem, 3.4vw, 1.95rem)/1.25 var(--serif); color: #fff; max-width: 30ch; margin-bottom: 26px; }
.runway { margin-bottom: 26px; }
.runway-track { position: relative; height: 34px; background: #24384F; border-radius: 6px; overflow: visible; }
.runway-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--pine);
  transition: width 1.1s cubic-bezier(.2,.7,.2,1);
}
.runway-fill.short { background: var(--short); }
.runway-fill.close { background: #A6812C; }
.runway-lights {
  position: absolute; left: 10px; right: 10px; top: 50%; height: 4px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 14px, transparent 14px 34px); pointer-events: none;
}
.mark { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--amber); }
.mark span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .85rem; color: var(--amber); font-weight: 700; }
.runway-scale { display: flex; justify-content: space-between; font-size: .85rem; color: #A9BACA; margin-top: 8px; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 18px; }
.figures div { border-top: 1px solid #33496A; padding-top: 10px; }
.figures dt { font-size: .9rem; color: #A9BACA; }
.figures dd { margin: 4px 0 0; font: 650 1.45rem/1.2 var(--serif); color: #fff; }
.result-note { color: #EAF0F4; }
.result .fine { color: #A9BACA; }
.fine { font-size: .9rem; color: var(--slate); line-height: 1.5; }

/* content sections */
.why, .what { margin-bottom: 64px; }
.decisions { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 0; }
.decisions li { padding: 16px 0 16px 26px; border-top: 1px solid var(--line); position: relative; max-width: 64ch; }
.decisions li::before { content: ""; position: absolute; left: 0; top: 26px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.decisions li:last-child { border-bottom: 1px solid var(--line); }
.nothing { margin-top: 28px; padding: 22px 24px; background: var(--paper); border-left: 6px solid var(--pine); border-radius: 0 12px 12px 0; }
.nothing p { margin: 0; }

/* sign-up */
.join { margin-bottom: 72px; }
.signup { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 560px; }
.opt { font-weight: 400; color: var(--slate); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 3px 0 0; flex: none; accent-color: var(--pine); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup .btn { margin: 6px 0 14px; }
.thanks { background: var(--paper); border-left: 6px solid var(--pine); border-radius: 0 12px 12px 0; padding: 22px 24px; max-width: 560px; }
.thanks p { margin: 0; }

.foot { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: .95rem; color: var(--slate); }
.foot a { color: var(--slate); }

@media (max-width: 760px) {
  .calc-grid { grid-template-columns: 1fr; padding: 22px; }
  .figures { grid-template-columns: 1fr; }
  .result { padding: 24px 20px; }
  .hero { padding-top: 36px; }
  .top-link { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .runway-fill { transition: none; }
}
