:root {
  --ink: #173f35;
  --ink-soft: #31594e;
  --cream: #f7f2e8;
  --paper: #fffdf7;
  --orange: #e85e30;
  --orange-dark: #c84620;
  --mint: #c8e4d7;
  --mint-light: #e6f1eb;
  --line: rgba(23, 63, 53, 0.17);
  --shadow: 0 24px 70px rgba(23, 63, 53, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: clip; background: var(--cream); }
button, input, select { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; z-index: 99; left: 1rem; top: -5rem; padding: .7rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 850; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--orange); font-size: 1.2rem; }
nav { display: flex; align-items: center; gap: 2rem; font-size: .9rem; font-weight: 700; }
nav a { text-decoration: none; }
.nav-pill { padding: .72rem 1rem; color: white; background: var(--ink); border-radius: 999px; }

main { overflow: hidden; }
.hero {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, .7fr);
  gap: 7vw;
  align-items: center;
}
.hero-copy { min-width: 0; }
.eyebrow, .step-kicker { margin: 0 0 1rem; color: var(--orange-dark); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: .55rem; }
.eyebrow span { width: 28px; height: 2px; background: var(--orange); }
h1, h2, h3, p { text-wrap: balance; }
h1 { margin: 0; max-width: 820px; font-size: clamp(3.3rem, 7.2vw, 6.55rem); line-height: .91; letter-spacing: -.072em; font-weight: 840; }
h1 em { color: var(--orange); font-family: Georgia, serif; font-weight: 500; }
.hero-lede { max-width: 680px; margin: 2rem 0 1.8rem; color: var(--ink-soft); font-size: 1.14rem; line-height: 1.7; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .85rem; font-weight: 760; }
.trust-row span::first-letter { color: var(--orange); }
.hero-note { position: relative; padding: 2rem; transform: rotate(1.5deg); background: var(--mint); border: 1px solid rgba(23,63,53,.15); box-shadow: 10px 10px 0 rgba(23,63,53,.08); }
.hero-note::before { content: ""; position: absolute; top: -16px; left: 43%; width: 78px; height: 30px; background: rgba(255,255,255,.63); transform: rotate(-5deg); }
.hero-note span, .hero-note strong, .hero-note s { display: block; }
.hero-note s { margin: .5rem 0 1.8rem; color: #55766d; line-height: 1.5; }
.hero-note strong { margin-top: .45rem; font: 700 1.55rem/1.25 Georgia, serif; }
.note-label { font-size: .69rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.note-label.accent { color: var(--orange-dark); }
.scribble { width: 78%; height: 9px; margin: 1rem auto 0; border-top: 3px solid var(--orange); border-radius: 50%; transform: rotate(-2deg); }

.calculator-shell { padding: 76px max(20px, calc((100vw - 1180px) / 2)); background: var(--ink); color: white; }
.calculator-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .55fr); gap: 2rem; align-items: end; margin-bottom: 2.4rem; }
.calculator-intro h2, .explanation h2, .fees-section h2, .pro-card h2, .faq h2 { margin: 0; font-size: clamp(2.1rem, 4.5vw, 3.75rem); line-height: 1; letter-spacing: -.05em; }
.calculator-intro > p:last-child { margin: 0; color: #b6d2c7; line-height: 1.65; }
.calculator-shell .step-kicker { color: #ff9874; }
.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(370px, .85fr); gap: 22px; align-items: start; }
.input-panel, .result-card { border-radius: 24px; color: var(--ink); background: var(--paper); }
.input-panel { padding: clamp(22px, 4vw, 42px); }
.field-group { margin: 1.8rem 0 0; padding: 1.6rem 0 0; border: 0; border-top: 1px solid var(--line); }
.field-group legend { float: left; width: 100%; margin-bottom: 1.2rem; font-weight: 840; letter-spacing: -.02em; }
.field-group legend + * { clear: both; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .48rem; font-size: .86rem; font-weight: 760; }
.full-field { grid-column: 1 / -1; }
.field small, .switch-row small, .advanced p { color: #668078; font-size: .74rem; font-weight: 500; line-height: 1.45; }
select, .money-input { width: 100%; min-height: 49px; border: 1px solid var(--line); border-radius: 12px; background: white; }
select { padding: 0 2.7rem 0 .9rem; color: var(--ink); font-weight: 700; }
.money-input { display: grid; grid-template-columns: auto 1fr; align-items: center; overflow: hidden; }
.money-input b { padding-left: .9rem; color: #789087; font-size: .95rem; }
.money-input input { width: 100%; min-width: 0; padding: .78rem .8rem .78rem .45rem; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 800; }
.money-input:focus-within, select:focus { outline: 3px solid rgba(232,94,48,.22); border-color: var(--orange); }
.highlight-field { padding: 1.15rem; border-radius: 15px; color: white; background: var(--orange); }
.highlight-field > span:first-child { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.highlight-field .money-input { min-height: 60px; }
.highlight-field input { font-size: 1.4rem; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.segmented-control label { position: relative; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span { min-height: 55px; display: grid; place-content: center; text-align: center; padding: .65rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .85rem; font-weight: 800; }
.segmented-control small { display: block; color: #748b84; font-size: .63rem; font-weight: 600; }
.segmented-control input:checked + span { color: white; border-color: var(--ink); background: var(--ink); }
.segmented-control input:checked + span small { color: #c2d7cf; }
.segmented-control input:focus-visible + span { outline: 3px solid rgba(232,94,48,.28); }
.switch-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 1.6rem; cursor: pointer; }
.switch-row > span:first-child { display: grid; gap: .25rem; }
.switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #bccbc6; transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.16); transition: .2s; }
.switch input:checked + i { background: var(--orange); }
.switch input:checked + i::after { transform: translateX(20px); }
.advanced { margin-top: 1.7rem; padding: 1rem; border-radius: 12px; background: #f0eee6; }
.advanced summary { cursor: pointer; font-size: .82rem; font-weight: 800; }
.advanced p { margin: .9rem 0; }

.result-card { position: sticky; top: 20px; overflow: hidden; box-shadow: var(--shadow); }
.result-heading { padding: 36px 36px 28px; text-align: center; background: var(--mint); }
.result-heading p { margin: 0; color: var(--ink-soft); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.result-heading h3 { margin: .5rem 0 .35rem; color: var(--orange-dark); font-size: clamp(3.4rem, 7vw, 5.4rem); line-height: 1; letter-spacing: -.07em; }
.result-heading span { font-size: .78rem; color: var(--ink-soft); }
.result-proof { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.result-proof div { padding: 1.15rem 1.5rem; display: grid; gap: .2rem; text-align: center; }
.result-proof div + div { border-left: 1px solid var(--line); }
.result-proof span { color: #648078; font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.result-proof strong { font-size: 1.1rem; }
.breakdown { padding: 26px 36px 22px; }
.breakdown h4 { margin: 0 0 1rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.breakdown dl { margin: 0; }
.breakdown dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .54rem 0; color: #56736a; font-size: .8rem; }
.breakdown dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 720; }
.breakdown .subtotal { margin-top: .35rem; padding-top: .9rem; border-top: 1px dashed var(--line); font-weight: 800; }
.breakdown .profit-line { margin-top: .3rem; padding: .9rem .75rem; color: var(--ink); border-radius: 9px; background: var(--mint-light); font-weight: 850; }
.breakdown .profit-line dd { color: var(--orange-dark); }
.rounding-note { margin: 0; padding: 0 36px 26px; color: #6b837b; font-size: .7rem; text-align: center; }
.error { margin: 0 2rem 1rem; color: #8d251b; font-size: .8rem; }
.has-error .result-heading { background: #f7d4cf; }

.explanation, .fees-section, .faq { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.explanation { padding: 100px 0; display: grid; grid-template-columns: .95fr 1.05fr; gap: 9vw; }
.explanation ol { margin: 0; padding: 0; list-style: none; }
.explanation li { display: grid; grid-template-columns: 48px 1fr; gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.explanation li:first-child { padding-top: 0; }
.explanation li > span { color: var(--orange); font: italic 1.25rem Georgia, serif; }
.explanation strong { font-size: 1.06rem; }
.explanation p { margin: .35rem 0 0; color: var(--ink-soft); line-height: 1.55; }
.fees-section { padding: 80px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 7vw; border-radius: 28px; background: var(--mint); }
.fees-copy > p:not(.step-kicker) { color: var(--ink-soft); line-height: 1.65; }
.disclaimer { font-size: .78rem; }
.fee-table-wrap { min-width: 0; }
table { width: 100%; border-collapse: collapse; border-radius: 16px; overflow: hidden; background: var(--paper); box-shadow: 0 12px 40px rgba(23,63,53,.08); }
caption { padding: 1rem; text-align: left; color: var(--ink-soft); background: rgba(255,255,255,.65); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .79rem; }
th { color: #6c817a; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
td:first-child { font-weight: 760; }
.source-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.source-links a { font-size: .72rem; font-weight: 800; }
.pro-card { width: min(1020px, calc(100% - 40px)); margin: 100px auto; padding: 48px; display: grid; grid-template-columns: 1fr auto; column-gap: 3rem; align-items: center; color: white; border-radius: 24px; background: var(--orange); box-shadow: 12px 12px 0 var(--mint); }
.pro-card h2 { margin-top: .8rem; max-width: 660px; }
.pro-card p { max-width: 680px; color: #ffe7dc; line-height: 1.6; }
.pro-badge { padding: .4rem .65rem; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.pro-card button { padding: 1rem 1.25rem; color: var(--ink); border: 0; border-radius: 999px; background: white; font-weight: 850; cursor: pointer; }
.pro-card button:disabled { cursor: wait; opacity: .72; }
.pro-card small { grid-column: 2; margin-top: .5rem; color: #ffe7dc; text-align: center; }
.pro-workspace { grid-column: 1 / -1; margin-top: 2rem; padding: 1.4rem; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; color: var(--ink); border-radius: 16px; background: var(--paper); }
.pro-workspace[hidden] { display: none; }
.pro-workspace h3 { margin: 0 0 .35rem; }
.pro-workspace p { margin: 0; color: var(--ink-soft); font-size: .78rem; }
.pro-workspace code { font-size: .72rem; }
.csv-upload { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--mint-light); font-size: .78rem; font-weight: 850; cursor: pointer; }
.csv-upload input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.pro-workspace #csv-download { color: white; background: var(--ink); }
.pro-workspace #csv-status { grid-column: 1 / -1; }
.faq { max-width: 800px; padding: 0 0 100px; }
.faq h2 { margin-bottom: 2rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 1.25rem 2rem 1.25rem 0; cursor: pointer; font-weight: 800; }
.faq details p { max-width: 700px; margin: -.3rem 0 1.3rem; color: var(--ink-soft); line-height: 1.65; }
footer { padding: 30px max(20px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; gap: 2rem; color: #bfd0ca; background: var(--ink); font-size: .75rem; }
footer p { margin-right: auto; }
footer a:last-child { font-weight: 800; }

@media (max-width: 900px) {
  nav a:not(.nav-pill) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 3rem; padding-top: 62px; }
  .hero-note { max-width: 460px; }
  .calculator-grid, .calculator-intro, .explanation, .fees-section { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .fees-section { padding: 48px 36px; }
  .pro-card { grid-template-columns: 1fr; gap: 1rem; }
  .pro-card button { justify-self: start; }
  .pro-card small { grid-column: 1; text-align: left; }
  .pro-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header { width: min(100% - 28px, 1180px); min-height: 72px; gap: .75rem; }
  .site-header .brand { gap: .5rem; font-size: .94rem; }
  .site-header .brand-mark { width: 32px; height: 32px; }
  .nav-pill { padding: .64rem .8rem; white-space: nowrap; font-size: .8rem; }
  .hero { width: min(100% - 28px, 1180px); padding: 48px 0 56px; }
  h1 { font-size: clamp(2.8rem, 13vw, 4rem); letter-spacing: -.065em; }
  .eyebrow { align-items: flex-start; font-size: .68rem; line-height: 1.45; }
  .eyebrow span { flex: 0 0 28px; margin-top: .45rem; }
  .hero-lede { font-size: 1rem; }
  .calculator-shell { padding: 54px 14px; }
  .calculator-grid { gap: 14px; }
  .calculator-intro { padding: 0 8px; }
  .input-panel { padding: 22px 18px; border-radius: 18px; }
  .two-column { grid-template-columns: 1fr; }
  .result-card { border-radius: 18px; }
  .result-heading, .breakdown { padding-left: 22px; padding-right: 22px; }
  .result-heading h3 { font-size: clamp(3rem, 15vw, 4rem); }
  .rounding-note { padding-left: 22px; padding-right: 22px; }
  .explanation, .fees-section, .faq { width: min(100% - 28px, 1180px); }
  .explanation { padding: 72px 0; }
  .fees-section { padding: 36px 18px; }
  .fee-table-wrap { overflow-x: auto; }
  th, td { min-width: 105px; }
  .pro-card { width: min(100% - 28px, 1020px); margin: 72px auto; padding: 34px 22px; }
  footer { align-items: flex-start; flex-direction: column; gap: .7rem; }
  footer p { margin: .4rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
