:root {
  color-scheme: light;
  --paper: #f4efe6;
  --surface: #fffdf8;
  --ink: #23201d;
  --muted: #6e665e;
  --line: #d7cfc3;
  --accent: #ad4d36;
  --accent-dark: #873b2b;
  --error: #982f2f;
  --focus: #315f79;
  --shadow: rgba(66, 48, 33, 0.12);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

.shell {
  width: min(100%, 1440px);
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(330px, 0.8fr) minmax(540px, 1.2fr);
  background: var(--surface);
  box-shadow: 0 24px 80px var(--shadow);
}

.intro {
  min-height: 100dvh;
  padding: clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--ink);
  color: var(--surface);
  overflow: hidden;
  position: relative;
}

.intro::after {
  content: "";
  width: min(32vw, 420px);
  aspect-ratio: 1;
  position: absolute;
  right: -22%;
  bottom: 12%;
  border: clamp(28px, 5vw, 72px) solid rgba(255, 253, 248, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  display: inline-block;
  background: var(--accent);
  border-radius: 62% 38% 48% 52% / 52% 42% 58% 48%;
  transform: rotate(-12deg);
}

.intro-copy {
  max-width: 34rem;
  margin: clamp(4rem, 12vh, 9rem) 0 auto;
  position: relative;
  z-index: 1;
}

.eyebrow,
.step-label {
  margin: 0 0 0.9rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.6rem, 5.5vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  font-weight: 650;
}

.lede {
  max-width: 48ch;
  margin-bottom: 0;
  color: #cfc7bd;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.65;
}

.intro-cta {
  margin-top: 1.75rem;
  padding-bottom: 0.25rem;
  display: inline-block;
  position: relative;
  z-index: 1;
  color: var(--surface);
  border-bottom: 1px solid var(--accent);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.intro-cta:hover {
  color: #d9d0c7;
  border-color: #d9d0c7;
}

.intro-cta:active {
  transform: translateY(1px);
}

.intro-cta:focus-visible {
  outline: 3px solid var(--surface);
  outline-offset: 4px;
}

.promise {
  width: min(100%, 24rem);
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 253, 248, 0.2);
}

.promise > div {
  padding: 1.25rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: #bdb4aa;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.promise > div + div {
  padding-left: 1.5rem;
  border-left: 1px solid rgba(255, 253, 248, 0.2);
}

.promise-number {
  color: var(--surface);
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.service-area {
  margin: 3rem 0 0;
  position: relative;
  z-index: 1;
  color: #a79d92;
  font-size: 0.8rem;
}

.service-area span {
  color: var(--surface);
}

.calculator {
  min-height: 100dvh;
  padding: clamp(2rem, 6vw, 6.5rem) clamp(1.25rem, 7vw, 7rem) 2rem;
  display: flex;
  flex-direction: column;
}

.calculator-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 12rem);
  align-items: end;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.calculator-header h2 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.step-label {
  color: var(--muted);
}

.progress {
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.progress span {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--accent);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  transform: scaleX(0.25);
  transform-origin: left;
}

form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step {
  min-width: 0;
  margin: 0;
  padding: clamp(2.5rem, 6vh, 5rem) 0;
  border: 0;
  animation: step-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.step[hidden],
[hidden] {
  display: none !important;
}

legend {
  width: 100%;
  margin: 0 0 2rem;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

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

.choice {
  min-height: 9rem;
  display: block;
  position: relative;
  cursor: pointer;
}

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

.choice span {
  height: 100%;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.choice strong {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.choice small {
  max-width: 22ch;
  color: var(--muted);
  line-height: 1.45;
}

.choice:hover span {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.choice input:checked + span {
  color: var(--surface);
  border-color: var(--ink);
  background: var(--ink);
}

.choice input:checked + span small {
  color: #cec5bc;
}

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

.field,
.field-pair {
  margin-bottom: 1.4rem;
}

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

.field-pair .field {
  margin: 0;
}

.field label {
  margin-bottom: 0.55rem;
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
}

.field label span {
  color: var(--muted);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.78rem 0.9rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffcf7;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(49, 95, 121, 0.16);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error);
}

.help {
  margin-top: 0.45rem;
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.contact-help {
  margin: -0.8rem 0 1.4rem;
}

.form-actions {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 3.2rem;
  padding: 0.82rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

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

.button.primary {
  color: var(--surface);
  background: var(--accent);
  border-color: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.button.secondary:hover {
  border-color: var(--ink);
}

.notice {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid;
  font-size: 0.85rem;
}

.notice.error {
  color: var(--error);
  background: #fff0ec;
  border-color: var(--error);
}

.result {
  padding: clamp(2.5rem, 6vh, 5rem) 0 2rem;
  animation: step-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.range {
  margin-bottom: 0.8rem;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.06em;
}

.result-note {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.6;
}

.result-summary {
  margin: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-summary p {
  margin: 0;
  padding: 0.85rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.result-summary p:last-child {
  border-bottom: 0;
}

.result-summary span:first-child {
  color: var(--muted);
}

.result-summary span:last-child {
  text-align: right;
  font-weight: 700;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.copy-status {
  min-height: 1.25rem;
  margin: 0.8rem 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.brief {
  min-height: 13rem;
  color: #554e47;
  background: #f2ede5;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
}

.text-button {
  margin-top: 1rem;
  padding: 0.2rem 0;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.disclaimer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  line-height: 1.55;
}

.disclaimer strong {
  color: var(--ink);
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .shell {
    display: block;
  }

  .intro {
    min-height: auto;
    padding: 2rem 1.25rem 2.5rem;
  }

  .intro-copy {
    margin: 4rem 0 0;
  }

  h1 {
    max-width: 13ch;
    font-size: clamp(2.65rem, 12vw, 4.5rem);
  }

  .promise {
    margin-top: 3rem;
  }

  .service-area {
    margin-top: 1.5rem;
  }

  .calculator {
    min-height: 100dvh;
    padding: 2.5rem 1.25rem 1.5rem;
  }
}

@media (max-width: 560px) {
  .calculator-header {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .choice-grid,
  .field-pair {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 7.5rem;
  }

  .form-actions,
  .share-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions .button,
  .share-actions .button {
    width: 100%;
  }

  .range {
    font-size: clamp(2.55rem, 15vw, 4.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
