:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #192a22;
  background: #f5f4f0;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

/* =========================
   GENERAL LAYOUT
   ========================= */

.shell {
  max-width: 1160px;
  margin: auto;
  padding: 0 36px;
}

/* =========================
   TOP BAR
   ========================= */

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid #dfdfd8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.07em;
  font-size: 23px;
  white-space: nowrap;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  background: #172c24;
  color: #c5f066;
  border-radius: 8px;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.brand-accent {
  color: #83a741;
  margin-left: 3px;
}

.edition,
.step,
.eyebrow,
.scenario-index,
.grade-strip > span,
.scenario-result span,
.difference-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.edition {
  color: #718077;
}

.edition-divider {
  margin: 0 12px;
  color: #b4bcb5;
}

/* Link back to edualonso.pro */

.site-link {
  margin-left: auto;
  color: #314738;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.11em;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.site-link:hover {
  color: #83a741;
}

.site-link:focus-visible {
  outline: 2px solid #87ac5c;
  outline-offset: 5px;
  border-radius: 2px;
}

/* =========================
   INTRO
   ========================= */

.intro {
  padding: 69px 0 56px;
  max-width: 770px;
}

.eyebrow {
  color: #6f8d58;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow-line {
  width: 23px;
  height: 2px;
  background: #8ead6d;
}

.intro h1 {
  font-size: clamp(46px, 6vw, 77px);
  letter-spacing: -0.075em;
  line-height: 1.08;
  margin: 21px 0 22px;
  font-weight: 800;
}

.intro h1 em {
  font-style: normal;
  color: #779450;
}

.intro p {
  font-size: 17px;
  line-height: 1.6;
  max-width: 560px;
  color: #68766c;
  margin: 0;
}

/* =========================
   WORKSPACE / PANELS
   ========================= */

.workspace {
  padding-bottom: 70px;
}

.panel {
  border: 1px solid #e5e8dd;
  background: #fff;
  border-radius: 19px;
  box-shadow: 0 12px 35px rgba(31, 47, 35, 0.035);
}

.route-panel {
  padding: 29px 32px 25px;
}

.section-heading,
.scenario-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step {
  color: #8aa273;
}

.section-heading h2,
.scenarios-title h2 {
  font-size: 24px;
  letter-spacing: -0.045em;
  margin: 8px 0 0;
}

.section-symbol {
  font-size: 30px;
  color: #91a574;
}

/* =========================
   ROUTE INPUTS
   ========================= */

.route-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 19px;
  margin-top: 30px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4a5a4e;
  min-width: 0;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap input {
  width: 100%;
  height: 54px;
  border: 1px solid #dfe5db;
  background: #fbfcf9;
  border-radius: 10px;
  padding: 0 55px 0 15px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: #22352a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input:focus {
  border-color: #89ac61;
  box-shadow: 0 0 0 3px #dcebc8;
}

.input-wrap input[aria-invalid="true"] {
  border-color: #bb695f;
}

.unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #809084;
  font-weight: 600;
}

/* =========================
   SEGMENTED CONTROLS
   ========================= */

.segmented {
  display: flex;
  height: 54px;
  padding: 4px;
  border: 1px solid #dfe5db;
  background: #f4f6f0;
  border-radius: 10px;
}

.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 7px;
  color: #758176;
  font-weight: 700;
  cursor: pointer;
}

.segmented button.active {
  color: #263c2d;
  background: white;
  box-shadow: 0 2px 8px #152b2114;
}

.segmented button:focus-visible {
  outline: 3px solid #87ac5c;
  outline-offset: 2px;
}

/* =========================
   GRADIENT
   ========================= */

.grade-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 21px;
  border-top: 1px solid #edf0e9;
  color: #718171;
}

.grade-strip strong {
  color: #243c2b;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.field-error {
  color: #a14236;
  font-size: 13px;
  margin: 11px 0 0;
}

/* =========================
   ATMOSPHERE
   ========================= */

.atmosphere-field {
  margin-top: 22px;
  max-width: 360px;
}

.field-hint {
  margin: 8px 0 0;
  color: #7b887e;
  font-size: 12px;
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-55%);
  font-size: 20px;
  color: #78906f;
  pointer-events: none;
}

.select-wrap select {
  appearance: none;
  width: 100%;
  height: 54px;
  border: 1px solid #dfe5db;
  background: #fbfcf9;
  border-radius: 10px;
  padding: 0 34px 0 13px;
  color: #22352a;
  font: 700 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  outline: none;
  cursor: pointer;
}

.select-wrap select:focus-visible {
  border-color: #89ac61;
  box-shadow: 0 0 0 3px #dcebc8;
}

/* =========================
   SCENARIOS
   ========================= */

.scenarios-title {
  padding: 49px 0 22px;
}

.scenarios-title p {
  margin: 8px 0 0;
  color: #7b887e;
  font-size: 14px;
}

.scenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.scenario {
  overflow: hidden;
  padding: 28px 29px 0;
}

.scenario-b {
  border-color: #cfe0b9;
}

.scenario-index {
  color: #869687;
}

.scenario-b .scenario-index {
  color: #6c9745;
}

.scenario-head h3 {
  font-size: 22px;
  letter-spacing: -0.05em;
  margin: 8px 0 0;
}

.badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 19px;
}

.badge-a {
  background: #eef1eb;
  color: #54705b;
}

.badge-b {
  background: #e2f5c4;
  color: #4b7f24;
}

.scenario-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px 14px;
  margin: 30px 0 27px;
}

.scenario-fields .full {
  grid-column: 1 / -1;
}

/* =========================
   RESULTS
   ========================= */

.scenario-result {
  background: #f3f5f0;
  margin: 0 -29px;
  padding: 23px 29px 25px;
}

.scenario-b .scenario-result {
  background: #edf6df;
}

.scenario-result > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scenario-result > div:first-child strong {
  font-size: 38px;
  letter-spacing: -0.07em;
  color: #213a2b;
  white-space: nowrap;
}

.scenario-result span {
  color: #728273;
}

.result-line {
  display: block;
  height: 1px;
  background: #dce5d7;
  margin: 15px 0 18px;
}

.metrics {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.metrics > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.metrics > div:last-child {
  text-align: right;
}

.metrics strong {
  font-size: 17px;
  letter-spacing: -0.04em;
}

/* =========================
   DIFFERENCE
   ========================= */

.difference {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 21px;
  background: #1d3528;
  border-radius: 16px;
  padding: 24px 28px;
  color: #fff;
}

.difference-mark {
  font-size: 27px;
  color: #c5ef7b;
  background: #334e37;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
}

.difference-label {
  color: #acc28f;
}

.difference p {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.difference > strong {
  margin-left: auto;
  font-size: 34px;
  letter-spacing: -0.06em;
  color: #d0f394;
  white-space: nowrap;
}

/* =========================
   METHOD / SOURCES
   ========================= */

.method {
  margin-top: 27px;
  color: #66756a;
  font-size: 13px;
  line-height: 1.6;
  max-width: 850px;
}

.method summary {
  color: #486049;
  font-weight: 700;
  cursor: pointer;
}

.method p {
  margin: 12px 0;
}

.method-sources {
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid #dfe5db;
}

.method-sources > strong {
  color: #385640;
}

.method-sources ul {
  padding-left: 20px;
  margin: 10px 0;
}

.method-sources li {
  margin: 7px 0;
}

.method-sources a {
  color: #477433;
  text-underline-offset: 2px;
}

.method-sources a:hover {
  color: #294f20;
}

.method-sources a:focus-visible {
  outline: 2px solid #87ac5c;
  outline-offset: 2px;
}

/* =========================
   FOOTER
   ========================= */

footer {
  border-top: 1px solid #dfe2d9;
  padding: 24px 0 30px;
  display: flex;
  justify-content: space-between;
  color: #7c887c;
  font-size: 12px;
}

footer span:first-child {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #314738;
}

/* =========================
   TABLET
   ========================= */

@media (max-width: 800px) {
  .shell {
    padding: 0 22px;
  }

  .route-fields {
    grid-template-columns: repeat(2, 1fr);
  }

  .route-fields .field:last-child {
    grid-column: 1 / -1;
  }

  .scenarios {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 53px 0 45px;
  }

  .scenarios-title {
    padding-top: 43px;
  }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 520px) {
  .shell {
    padding: 0 17px;
  }

  .topbar {
    min-height: 72px;
    gap: 12px;
  }

  .brand {
    font-size: 20px;
  }

  .edition {
    display: none;
  }

  .site-link {
    font-size: 14px;
    letter-spacing: 0.08em;
  }

  .intro {
    padding: 46px 0 39px;
  }

  .intro h1 {
    font-size: 44px;
    margin: 17px 0;
  }

  .intro p {
    font-size: 15px;
  }

  .route-panel {
    padding: 23px 19px;
  }

  .route-fields {
    gap: 17px 11px;
    margin-top: 23px;
  }

  .section-heading h2,
  .scenarios-title h2 {
    font-size: 22px;
  }

  .field {
    font-size: 12px;
  }

  .input-wrap input {
    height: 51px;
    font-size: 18px;
  }

  .segmented {
    height: 51px;
  }

  .atmosphere-field {
    max-width: none;
  }

  .scenario-fields .field:has(select) {
    grid-column: 1 / -1;
  }

  .select-wrap select {
    height: 51px;
  }

  .scenario {
    padding: 24px 20px 0;
  }

  .scenario-fields {
    gap: 16px 11px;
    margin-top: 25px;
  }

  .scenario-result {
    margin: 0 -20px;
    padding: 22px 20px;
  }

  .scenario-result > div:first-child strong {
    font-size: 34px;
  }

  .difference {
    gap: 11px;
    padding: 19px;
    flex-wrap: wrap;
  }

  .difference-mark {
    width: 39px;
    height: 39px;
  }

  .difference-label {
    font-size: 9px;
  }

  .difference p {
    font-size: 15px;
  }

  .difference > strong {
    width: 100%;
    margin: 7px 0 0 50px;
    font-size: 31px;
  }

  footer {
    gap: 20px;
  }

  footer span:last-child {
    text-align: right;
  }
}