:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --ink: #101010;
  --muted: #68645d;
  --line: #c9c2b6;
  --soft: #ebe5da;
  --accent: #ff5a2f;
  --white: #fffdf8;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select { font: inherit; }

a { color: inherit; }

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 13px;
  text-decoration: none;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-note,
.edition {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero {
  padding: 92px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 64px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  grid-column: 1;
  margin: 0;
  max-width: 790px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 7.7vw, 104px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: var(--accent);
  font-weight: 400;
}

.hero-copy {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1.06fr);
  border: 1px solid var(--ink);
  background: var(--white);
}

#trip-form,
.result {
  padding: clamp(28px, 4vw, 54px);
}

#trip-form { border-right: 1px solid var(--ink); }

.form-heading,
.result-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 42px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.field {
  display: grid;
  gap: 8px;
  align-content: start;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.input-wrap {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid #d3cdc2;
  border-radius: 6px;
  background: #faf8f3;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.input-wrap:focus-within {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(255, 90, 47, 0.16);
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

.input-wrap select {
  align-self: stretch;
  height: 58px;
  padding: 0 32px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select-wrap {
  position: relative;
  align-items: center;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: calc(50% - 6px);
  right: 18px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  pointer-events: none;
}

.field-note {
  margin: 1px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.input-wrap small,
.price-input b {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.input-wrap input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.input-wrap input[type="number"]::-webkit-inner-spin-button,
.input-wrap input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.trip-type {
  margin: 25px 0 0;
  padding: 0;
  border: 0;
}

.trip-type legend {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid #d3cdc2;
  border-radius: 6px;
  background: #faf8f3;
}

.segmented-control label { position: relative; }

.segmented-control label + label { border-left: 1px solid var(--line); }

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  min-height: 48px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.segmented-control input:checked + span {
  background: var(--ink);
  color: white;
}

.segmented-control input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }

.price-block {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.price-field { max-width: calc(50% - 10px); }

.price-input { max-width: none; }

.price-input b { color: var(--ink); font-size: 16px; }

.price-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.status-dot[data-state="loading"]::before { animation: pulse 1.1s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.3; } }

#reset-price {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
}

.form-error { margin: 16px 0 0; color: #b2231c; font-size: 13px; }

.calculate-button {
  width: 100%;
  min-height: 58px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.calculate-button:hover { background: #ff6d48; }

.calculate-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.result {
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--white);
}

.result-heading { border-color: #444; color: #aaa; }

.result-kicker {
  margin: 6px 0 0;
  color: #aaa;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.total-cost {
  margin: 8px 0 28px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(74px, 10vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.result h2 {
  margin: 0;
  max-width: 620px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.result h2 strong { color: var(--accent); font-weight: 400; }

.result-breakdown {
  margin: auto 0 0;
  padding-top: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.result-breakdown div {
  min-width: 0;
  padding: 15px 14px 0;
  border-top: 1px solid #444;
}

.result-breakdown div:first-child { padding-left: 0; }

.result-breakdown div + div { border-left: 1px solid #444; }

.result-breakdown dt {
  color: #999;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-breakdown dd { margin: 7px 0 0; font-size: 15px; font-weight: 800; }

.estimate-note { margin: 28px 0 0; color: #878787; font-size: 11px; line-height: 1.55; }

.method {
  margin: 120px 0;
  padding: 50px 0 0 34%;
  border-top: 1px solid var(--ink);
}

.method h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 67px);
  font-weight: 400;
  letter-spacing: -0.05em;
}

.method > p:last-child {
  max-width: 660px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

footer {
  min-height: 130px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 12px;
}

.footer-signature {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-style: italic;
}

footer nav { display: flex; gap: 18px; }

footer a { text-underline-offset: 4px; }

@media (max-width: 860px) {
  .page-shell { width: min(100% - 30px, 680px); }
  .site-header { min-height: 78px; }
  .brand-note, .edition { font-size: 9px; }
  .hero { padding: 62px 0 46px; display: block; }
  .hero h1 { font-size: clamp(51px, 15vw, 78px); }
  .hero-copy { margin-top: 30px; font-size: 16px; }
  .calculator { grid-template-columns: 1fr; }
  #trip-form { border-right: 0; border-bottom: 1px solid var(--ink); }
  .result { min-height: 560px; }
  .method { margin: 80px 0; padding-left: 0; }
  footer { grid-template-columns: 1fr auto; padding: 28px 0; }
  footer > span:nth-child(2) { display: none; }
}

@media (max-width: 520px) {
  .page-shell { width: calc(100% - 22px); }
  .wordmark { display: grid; gap: 2px; }
  .brand-name { font-size: 21px; }
  .edition { max-width: 90px; text-align: right; line-height: 1.4; }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: clamp(47px, 15.5vw, 69px); }
  .field-grid { grid-template-columns: 1fr; }
  .price-field { max-width: none; }
  #trip-form, .result { padding: 25px 20px; }
  .form-heading, .result-heading { margin-bottom: 30px; }
  .price-input { max-width: none; }
  .total-cost { font-size: 84px; }
  .result { min-height: 530px; }
  .result-breakdown { grid-template-columns: 1fr; gap: 14px; padding-top: 40px; }
  .result-breakdown div, .result-breakdown div:first-child { padding: 10px 0 0; }
  .result-breakdown div + div { border-left: 0; }
  .result-breakdown dd { font-size: 15px; }
  footer { gap: 14px; }
  footer nav { display: grid; gap: 8px; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot[data-state="loading"]::before { animation: none; }
}
