:root {
  color-scheme: light;
  --charcoal: #151715;
  --ink: #262b25;
  --muted: #6e756d;
  --paper: #f4f0e8;
  --panel: #fffaf1;
  --line: #d6cab8;
  --green: #5c744f;
  --green-dark: #354b39;
  --terracotta: #b95f45;
  --terracotta-dark: #8f432f;
  --blue: #496f87;
  --shadow: 0 24px 70px rgba(21, 23, 21, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(21, 23, 21, 0.04), rgba(185, 95, 69, 0.08) 54%, rgba(244, 240, 232, 0)),
    var(--paper);
  color: var(--ink);
  font-family:
    ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header,
.site-footer,
.benchmark-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--charcoal);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 8px;
  background: var(--charcoal);
  box-shadow: 0 12px 26px rgba(21, 23, 21, 0.16);
}

.brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong,
.header-link,
.site-footer,
.eyebrow,
.hero__text,
.hero__note,
.tool-button,
.source-note,
.controls-card,
.settings-band,
.metric,
.table-card,
.details-grid,
.advisory-note {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.brand strong {
  font-size: 0.98rem;
  font-weight: 760;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.header-link,
.site-footer a {
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 760;
  text-decoration: none;
}

.header-link:hover,
.site-footer a:hover {
  color: var(--terracotta-dark);
}

.benchmark-shell {
  padding: 56px 0 64px;
}

.benchmark-hero {
  position: relative;
  max-width: 1040px;
  border-bottom: 1px solid rgba(21, 23, 21, 0.16);
}

.benchmark-hero::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: min(360px, 38vw);
  height: 1px;
  background: var(--terracotta);
  content: "";
}

.benchmark-hero__content {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 42px 0 58px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--terracotta-dark);
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 980px;
  margin-bottom: 18px;
  color: var(--charcoal);
  font-size: clamp(3.1rem, 7.2vw, 6.7rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  color: var(--charcoal);
  font-family:
    ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.75rem, 2.8vw, 2.45rem);
  font-weight: 520;
  line-height: 1.04;
}

h3 {
  margin-bottom: 10px;
  color: var(--charcoal);
  font-family:
    ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.16rem;
  font-weight: 620;
  line-height: 1.24;
}

.hero__text {
  max-width: 790px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.45vw, 1.18rem);
  line-height: 1.68;
}

.hero__note {
  max-width: 760px;
  margin: 18px 0 24px;
  color: var(--green-dark);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.62;
}

.hero-actions,
.controls-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.tool-button--primary {
  background: var(--charcoal);
  color: var(--paper);
}

.tool-button--primary:hover {
  border-color: var(--terracotta);
  background: var(--terracotta-dark);
  transform: translateY(-1px);
}

.tool-button--quiet {
  border-color: rgba(21, 23, 21, 0.24);
  background: rgba(255, 250, 241, 0.54);
  color: var(--green-dark);
}

.tool-button--quiet:hover {
  border-color: var(--green);
  background: rgba(255, 250, 241, 0.9);
}

.source-note,
.advisory-note {
  margin-top: 34px;
  border: 1px solid rgba(21, 23, 21, 0.12);
  border-left: 4px solid rgba(92, 116, 79, 0.52);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.42);
  padding: 20px 22px;
}

.source-note p,
.advisory-note p {
  max-width: 960px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.68;
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 44px;
}

.controls-card,
.table-card,
.details-grid article {
  border: 1px solid rgba(21, 23, 21, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.96), rgba(231, 221, 207, 0.58)),
    var(--panel);
  box-shadow: var(--shadow);
}

.controls-card {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 3vw, 30px);
}

.controls-card__header,
.table-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field,
.toggle {
  display: grid;
  gap: 8px;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 780;
  line-height: 1.35;
}

.field--wide {
  grid-column: 1 / -1;
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.58;
}

.field-note--wide {
  grid-column: 1 / -1;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(21, 23, 21, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.78);
  color: var(--ink);
  padding: 0 12px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(92, 116, 79, 0.28);
  outline-offset: 1px;
}

.toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(21, 23, 21, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.58);
  padding: 12px;
  cursor: pointer;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green-dark);
}

.settings-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid rgba(21, 23, 21, 0.12);
  padding-top: 22px;
}

.settings-band p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.62;
}

.advanced-assumptions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 820;
  cursor: pointer;
  list-style: none;
}

.advanced-assumptions summary::-webkit-details-marker {
  display: none;
}

.advanced-assumptions summary::after {
  color: var(--terracotta-dark);
  content: "+";
  font-size: 1.2rem;
  line-height: 1;
}

.advanced-assumptions[open] summary::after {
  content: "-";
}

.advanced-assumptions__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.advanced-assumptions__note {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(21, 23, 21, 0.12);
  padding-top: 18px;
}

.results-stack {
  display: grid;
  gap: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  display: grid;
  align-content: start;
  min-height: 160px;
  border: 1px solid rgba(21, 23, 21, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: 0 14px 36px rgba(21, 23, 21, 0.08);
  padding: 22px;
}

.metric::before {
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 16px;
  background: var(--green);
  content: "";
}

.metric--higher::before {
  background: var(--terracotta);
}

.metric span {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--charcoal);
  font-family:
    ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 560;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.metric small {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.52;
}

.table-card {
  overflow: hidden;
  padding: clamp(22px, 3vw, 30px);
}

.table-card__heading {
  margin-bottom: 20px;
}

.table-card__heading p {
  max-width: 320px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.62;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.9rem;
}

th:first-child,
td:first-child {
  width: 29%;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3) {
  width: 18%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 35%;
}

th,
td {
  border-bottom: 1px solid rgba(21, 23, 21, 0.1);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
  line-height: 1.48;
  overflow-wrap: anywhere;
}

td strong {
  color: var(--charcoal);
  font-weight: 760;
}

.line-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.mobile-breakdown {
  display: none;
}

.mobile-breakdown__item {
  border: 1px solid rgba(21, 23, 21, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.58);
  padding: 18px;
}

.mobile-breakdown__item h3 {
  margin-bottom: 8px;
}

.mobile-breakdown__item p,
.mobile-breakdown__item dd {
  color: var(--muted);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.58;
}

.mobile-breakdown__item p {
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.mobile-breakdown__item dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.mobile-breakdown__item div {
  display: grid;
  gap: 2px;
}

.mobile-breakdown__item dt {
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-breakdown__item dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.details-grid article {
  box-shadow: none;
  padding: 22px;
}

.details-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.details-grid li {
  color: var(--muted);
  line-height: 1.62;
}

.logic-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow-y: auto;
  background: rgba(21, 23, 21, 0.48);
  padding: min(7vh, 56px) 20px;
}

.logic-modal[hidden] {
  display: none;
}

.logic-modal__panel {
  width: min(920px, 100%);
  border: 1px solid rgba(21, 23, 21, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.98), rgba(231, 221, 207, 0.72)),
    var(--panel);
  box-shadow: 0 28px 90px rgba(21, 23, 21, 0.24);
  padding: clamp(24px, 4vw, 42px);
}

.logic-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(21, 23, 21, 0.12);
  padding-bottom: 20px;
}

.modal-close {
  min-height: 42px;
  border: 1px solid rgba(21, 23, 21, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.7);
  color: var(--green-dark);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-weight: 780;
  padding: 0 14px;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--green);
  background: rgba(255, 250, 241, 0.95);
}

.logic-modal__intro,
.definition-list p,
.logic-modal__note {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.logic-modal__intro {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.68;
}

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.definition-list article {
  border-top: 1px solid rgba(21, 23, 21, 0.12);
  padding-top: 16px;
}

.definition-list h3 {
  margin-bottom: 8px;
}

.definition-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.62;
}

.logic-modal__note {
  margin-top: 28px;
  border: 1px solid rgba(21, 23, 21, 0.12);
  border-left: 4px solid rgba(92, 116, 79, 0.52);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.52);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.66;
  padding: 18px 20px;
}

.logic-modal__note strong {
  color: var(--green-dark);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(21, 23, 21, 0.16);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
  padding: 24px 0 32px;
}

@media (max-width: 1040px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .benchmark-hero__content {
    min-height: auto;
  }

  .controls-card__header,
  .logic-modal__header,
  .table-card__heading,
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-nav {
    justify-content: flex-start;
  }

  .definition-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer,
  .benchmark-shell {
    width: min(100% - 24px, 1160px);
  }

  .benchmark-shell {
    padding-top: 34px;
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4.5rem);
  }

  .input-grid,
  .advanced-assumptions__content,
  .summary-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .mobile-breakdown {
    display: grid;
    gap: 12px;
  }

  .tool-button {
    width: 100%;
  }

  .logic-modal {
    padding: 12px;
  }
}
