@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Newsreader:opsz,wght@6..72,400;6..72,600&display=swap");

:root {
  color-scheme: dark;
  --ink: #f2efe7;
  --muted: #aaa79e;
  --paper: #1b1b18;
  --surface: #24241f;
  --line: #42423a;
  --accent: #d99572;
  --good: #90a87d;
  --bad: #c97b70;
  --space: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}

.site-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 500;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
}

main {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
}

.intro {
  padding: clamp(64px, 10vw, 136px) 0 64px;
  max-width: 850px;
}

.eyebrow,
.step {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 16px 0 24px;
  font-family: "Newsreader", serif;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 400;
}

.lede {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  border: 1px solid var(--line);
}

.inputs,
.results {
  padding: clamp(24px, 4vw, 48px);
}

.inputs {
  border-right: 1px solid var(--line);
}

.results {
  background: var(--surface);
}

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

.form-heading h2 {
  margin: 4px 0 0;
  font-family: "Newsreader", serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
}

.step {
  margin: 0;
}

.text-button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--muted);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

.calculate-button {
  width: 100%;
  min-height: 48px;
  margin-top: 32px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.money-input,
.suffix-input {
  min-height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
}

.money-input:focus-within,
.suffix-input:focus-within {
  border-color: var(--accent);
}

input {
  width: 100%;
  min-width: 0;
  padding: 12px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.status {
  padding: 7px 10px;
  border: 1px solid var(--good);
  color: var(--good);
  font-size: 12px;
}

.status.loss {
  border-color: var(--bad);
  color: var(--bad);
}

.hero-result {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-result p,
.hero-result span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hero-result strong {
  display: block;
  margin: 8px 0;
  color: var(--accent);
  font-family: "Newsreader", serif;
  font-size: clamp(56px, 7vw, 84px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metrics {
  margin: 0;
}

.metrics div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.metrics dt {
  color: var(--muted);
  font-size: 12px;
}

.metrics dd {
  margin: 0;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.cost-stack {
  padding-top: 32px;
}

.stack-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.bar {
  display: flex;
  height: 12px;
  margin: 12px 0 20px;
  overflow: hidden;
  background: #35352f;
}

.bar span {
  min-width: 2px;
}

.cost-stack ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 11px;
}

.cost-stack li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: var(--swatch);
}

.interpretation {
  margin: 32px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 13px;
}

.method {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}

.method h2 {
  max-width: 520px;
  margin: 12px 0 0;
  font-family: "Newsreader", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.1;
}

.method p {
  color: var(--muted);
}

.method a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  color: var(--accent);
}

footer {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 64px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .inputs {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .method {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 540px) {
  .site-header p {
    display: none;
  }
  main,
  footer {
    width: min(100% - 32px, 1320px);
  }
  .intro {
    padding-top: 64px;
  }
  .intro h1 {
    font-size: clamp(44px, 14vw, 64px);
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .inputs,
  .results {
    padding: 24px 16px;
  }
  .form-heading {
    align-items: center;
  }
  .cost-stack ul {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.brand,
footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
