:root {
  color-scheme: light;
  --ink: #18241d;
  --muted: #59645d;
  --paper: #f4f1e8;
  --card: #fffdf7;
  --line: #c9cec6;
  --green: #426650;
  --green-dark: #203b2b;
  --red: #c84e3c;
  --yellow: #e6c65f;
  --shadow: 0 24px 70px rgba(29, 50, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(230, 198, 95, 0.22), transparent 23rem),
    var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

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

button,
select,
input[type="radio"] {
  cursor: pointer;
}

a {
  color: inherit;
}

.tool-header,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-header {
  min-height: 82px;
  border-bottom: 1px solid rgba(24, 36, 29, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.brand > span:first-child {
  color: var(--red);
  font-size: 24px;
}

.brand em,
h1 i,
h2 i {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

.prototype-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 8vw;
  padding: 70px 0 90px;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

h1,
h2 {
  margin: 0;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.93;
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(42px, 5vw, 70px);
}

.lede {
  max-width: 620px;
  margin: 30px 0;
  color: var(--muted);
  font-size: 20px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-row span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.hero-diagram {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--green-dark);
  background: #d9dfcf;
  box-shadow: 24px 24px 0 var(--green-dark);
  overflow: hidden;
}

.corner-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(32, 59, 43, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 59, 43, 0.13) 1px, transparent 1px);
  background-size: 30px 30px;
}

.shelf-shape {
  position: absolute;
  right: 18%;
  bottom: 10%;
  width: 42%;
  height: 70%;
  border: 8px solid var(--green-dark);
  border-top-width: 12px;
}

.shelf-shape span {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--green-dark);
}

.shelf-shape span:nth-child(1) {
  top: 23%;
}

.shelf-shape span:nth-child(2) {
  top: 52%;
}

.shelf-shape span:nth-child(3) {
  top: 80%;
}

.measure {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--red);
  font-weight: 800;
}

.measure-width {
  right: 7%;
  bottom: 2%;
}

.measure-height {
  right: 6%;
  top: 4%;
}

.measure-depth {
  left: 9%;
  bottom: 14%;
  background: var(--green-dark);
}

.planner-shell {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(40px, 8vw, 110px);
  padding: 100px 0;
  border-top: 1px solid rgba(24, 36, 29, 0.2);
}

.section-heading > p:last-child {
  max-width: 410px;
  color: var(--muted);
  font-size: 17px;
}

.planner-form {
  padding: clamp(24px, 4vw, 50px);
  background: var(--card);
  box-shadow: var(--shadow);
}

fieldset {
  margin: 0;
  padding: 0 0 30px;
  border: 0;
}

fieldset + fieldset {
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

legend {
  width: 100%;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.dimension-grid label,
.select-grid label,
.select-row {
  display: grid;
  gap: 8px;
}

label > span {
  font-size: 13px;
  font-weight: 700;
}

input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #aeb7ae;
  border-radius: 0;
  background: #fff;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
.result-shell:focus-visible,
.form-errors:focus-visible {
  outline: 3px solid rgba(200, 78, 60, 0.35);
  outline-offset: 3px;
}

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

.choice-grid label {
  position: relative;
}

.choice-grid input {
  position: absolute;
  opacity: 0;
}

.choice-grid span {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: white;
  text-align: center;
}

.choice-grid input:checked + span {
  color: white;
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.choice-grid input:focus-visible + span {
  outline: 3px solid rgba(200, 78, 60, 0.35);
  outline-offset: 3px;
}

.select-row {
  grid-template-columns: 1fr 1fr;
  align-items: center;
  margin-top: 16px;
}

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

.form-errors {
  margin: 0;
  padding: 0;
  color: #9c291d;
  font-weight: 700;
  list-style-position: inside;
}

.form-errors:not(:empty) {
  margin-bottom: 18px;
  padding: 14px;
  background: #fbe6e1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.primary-button {
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  color: white;
  background: var(--red);
  font-weight: 800;
}

.primary-button:hover {
  background: #a83c2d;
}

.text-button,
.result-actions button {
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-weight: 700;
}

.form-note,
.scope-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-shell {
  margin: 20px 0 100px;
  padding: clamp(30px, 6vw, 78px);
  color: white;
  background: var(--green-dark);
  box-shadow: var(--shadow);
}

.result-shell .eyebrow {
  color: #bbd5c2;
}

.result-kicker,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-actions button {
  color: white;
}

.result-summary {
  max-width: 850px;
  margin: 30px 0;
  color: #dbe4dc;
  font-size: 18px;
}

.envelope-card {
  display: grid;
  gap: 10px;
  margin: 42px 0;
  padding: 28px;
  color: var(--ink);
  background: var(--yellow);
}

.envelope-card > span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.envelope-card strong {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

.envelope-card p {
  max-width: 850px;
  margin: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
}

.check-list,
.risk-list,
.read-next ul {
  margin: 0;
  padding: 0;
}

.check-list {
  padding-left: 24px;
}

.check-list li {
  padding: 10px 0 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.risk-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.risk-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-left: 5px solid #d7b948;
  background: rgba(255, 255, 255, 0.08);
}

.risk-stop {
  border-left-color: #ef705e;
}

.risk-card span {
  color: #dbe4dc;
  font-size: 14px;
}

.read-next {
  margin-top: 50px;
}

.read-next ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  list-style: none;
}

.read-next li {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  color: var(--ink);
  background: var(--card);
}

.read-next a {
  font-size: 17px;
  font-weight: 800;
}

.read-next span {
  color: var(--muted);
  font-size: 13px;
}

.scope-note {
  padding-top: 24px;
  color: #acb9af;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

footer {
  min-height: 130px;
  border-top: 1px solid rgba(24, 36, 29, 0.2);
}

footer p {
  color: var(--muted);
}

.copy-helper {
  position: fixed;
  left: -9999px;
}

@media (max-width: 860px) {
  .hero,
  .planner-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 50px;
    padding-top: 50px;
  }

  .hero-diagram {
    min-height: 360px;
  }

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

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

  .read-next ul {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .tool-header,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .prototype-label {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 48px 0 70px;
  }

  .hero-diagram {
    min-height: 290px;
    box-shadow: 12px 12px 0 var(--green-dark);
  }

  .planner-shell {
    padding: 70px 0;
  }

  .planner-form {
    padding: 22px 16px;
  }

  .dimension-grid,
  .choice-grid,
  .select-grid,
  .select-row,
  .read-next ul {
    grid-template-columns: 1fr;
  }

  .choice-grid span {
    min-height: 50px;
  }

  .select-row {
    gap: 8px;
  }

  .result-shell {
    margin-inline: -12px;
    padding: 34px 20px;
  }

  .result-kicker {
    align-items: flex-start;
    flex-direction: column;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  footer p {
    margin: 0;
  }
}

@media print {
  body {
    background: white;
  }

  .tool-header,
  .hero,
  .planner-shell,
  footer,
  .result-actions {
    display: none;
  }

  main {
    width: 100%;
  }

  .result-shell {
    margin: 0;
    padding: 0;
    color: black;
    background: white;
    box-shadow: none;
  }

  .result-shell .eyebrow,
  .result-summary,
  .risk-card span,
  .scope-note {
    color: #333;
  }

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

  .envelope-card,
  .read-next li {
    border: 1px solid #999;
  }
}

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