:root {
  --ink: #102921;
  --muted: #677872;
  --cream: #f4f1e8;
  --paper: #fffefa;
  --lime: #ccff4a;
  --teal: #0d473b;
  --line: rgba(16, 41, 33, 0.12);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 12%, rgba(204, 255, 74, 0.24), transparent 24rem),
    var(--cream);
}

button, input { font: inherit; }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  opacity: 0.7;
}

.ambient-one {
  width: 22rem;
  height: 22rem;
  top: -14rem;
  right: -6rem;
  background: rgba(204, 255, 74, 0.3);
}

.ambient-two {
  width: 14rem;
  height: 14rem;
  bottom: 8rem;
  left: -9rem;
  border: 1px solid rgba(13, 71, 59, 0.12);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}

nav {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--lime);
  background: var(--teal);
  border-radius: 10px 10px 10px 3px;
  font-size: 18px;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
}

.nav-links a {
  padding: 8px 11px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.nav-links a.active, .nav-links a:hover {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 8px rgba(16, 41, 33, 0.06);
}

.nav-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #65b543;
  box-shadow: 0 0 0 4px rgba(101, 181, 67, 0.12);
}

.hero {
  padding: 76px 0 52px;
  max-width: 690px;
}

.eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(13, 71, 59, 0.16);
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 10px;
  font-weight: 700;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin: 20px 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(54px, 7vw, 86px);
  line-height: 0.94;
  letter-spacing: -5px;
}

h1 span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}

.hero p {
  max-width: 480px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.85fr);
  background: var(--paper);
  border: 1px solid rgba(16, 41, 33, 0.08);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(18, 45, 37, 0.08);
  overflow: hidden;
}

form { padding: 42px; }

.calculator > form {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

.form-heading > div:first-child, .breakdown {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 25px;
  border-radius: 99px;
  color: var(--teal);
  background: var(--lime);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

h2 {
  margin-bottom: 5px;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.form-heading p, .breakdown p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.unit-toggle {
  display: flex;
  padding: 4px;
  background: #efeee8;
  border-radius: 10px;
}

.unit-toggle input {
  position: absolute;
  opacity: 0;
}

.unit-toggle label {
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.unit-toggle input:checked + label {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 8px rgba(16, 41, 33, 0.08);
}

.unit-toggle input:focus-visible + label { outline: 2px solid var(--teal); }

.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.field > span:first-child {
  display: block;
  margin: 0 0 8px 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 61px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf6;
  transition: 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 71, 59, 0.08);
  background: white;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Manrope", sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.input-wrap small, .input-wrap b {
  color: var(--muted);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
}

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

input[type="number"]::-webkit-inner-spin-button { display: none; }

.round-trip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  width: max-content;
  cursor: pointer;
}

.round-trip > span:first-child { position: relative; }
.round-trip input { position: absolute; opacity: 0; }

.round-trip i {
  display: block;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: #d8dbd7;
  transition: 0.2s ease;
}

.round-trip i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.round-trip input:checked + i { background: var(--teal); }
.round-trip input:checked + i::after { transform: translateX(16px); }
.round-trip input:focus-visible + i { outline: 2px solid var(--lime); outline-offset: 2px; }

.round-trip strong, .round-trip small { display: block; }
.round-trip strong { font-size: 12px; }
.round-trip small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.result-card {
  display: flex;
  flex-direction: column;
  margin: 12px;
  padding: 30px;
  border-radius: 16px;
  color: white;
  background:
    radial-gradient(circle at 100% 0%, rgba(204, 255, 74, 0.2), transparent 16rem),
    var(--teal);
}

.result-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.route-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: var(--ink);
  background: var(--lime);
  font-size: 17px;
}

.total { margin: 32px 0 28px; }
.total > span { display: block; margin-bottom: 9px; color: rgba(255,255,255,.56); font-size: 11px; }

.total strong {
  display: flex;
  align-items: flex-start;
  font-family: "Manrope", sans-serif;
  font-size: clamp(45px, 5vw, 61px);
  line-height: 1;
  letter-spacing: -3px;
}

.total sup {
  margin: 7px 6px 0 0;
  color: var(--lime);
  font-size: 20px;
  letter-spacing: 0;
}

.divider { height: 1px; background: rgba(255, 255, 255, 0.13); }

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 25px;
}

.metrics span { display: block; margin-bottom: 7px; color: rgba(255,255,255,.5); font-size: 10px; }
.metrics strong { font-family: "Manrope", sans-serif; font-size: 16px; }

.result-foot {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 28px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
}

.result-foot b { color: rgba(255,255,255,.75); }

.breakdown {
  align-items: center;
  margin: 26px 0 76px;
  padding: 25px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.breakdown h2 { font-size: 15px; }

.formula {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.formula span {
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 600;
}

.formula i { font-style: normal; color: #91a099; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

footer span { color: var(--ink); font-family: "Manrope", sans-serif; font-weight: 800; }
footer p { margin: 0; }

@media (max-width: 820px) {
  .calculator { grid-template-columns: 1fr; }
  .result-card { min-height: 350px; }
  .breakdown { align-items: flex-start; flex-wrap: wrap; }
  .formula { width: 100%; margin: 10px 0 0 50px; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1120px); }
  nav { height: 72px; }
  .nav-pill { display: none; }
  .nav-links a { padding: 7px 8px; font-size: 9px; }
  .hero { padding: 55px 4px 36px; }
  h1 { font-size: 50px; letter-spacing: -3.5px; }
  .hero p { font-size: 15px; }
  form { padding: 28px 20px; }
  .form-heading { flex-direction: column; }
  .fields { grid-template-columns: 1fr; }
  .result-card { padding: 25px; }
  .breakdown { padding: 22px 18px; }
  .formula { margin-left: 0; }
  footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: no-preference) {
  .calculator { animation: rise 0.65s cubic-bezier(.2,.8,.2,1) both; }
  .hero > * { animation: rise 0.55s cubic-bezier(.2,.8,.2,1) both; }
  .hero h1 { animation-delay: 0.08s; }
  .hero p { animation-delay: 0.14s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
