:root {
  --bg: #f5efe4;
  --bg-accent: #dfc49b;
  --panel: rgba(255, 252, 246, 0.82);
  --panel-strong: #fffdf8;
  --text: #1e1b18;
  --muted: #64584b;
  --border: rgba(49, 38, 24, 0.1);
  --shadow: 0 24px 80px rgba(64, 43, 9, 0.14);
  --principal: #2f6c5d;
  --taxes: #d9734e;
  --insurance: #ebb44a;
  --fees: #8c5f36;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 26rem),
    radial-gradient(circle at bottom right, rgba(223, 196, 155, 0.95), transparent 24rem),
    linear-gradient(135deg, #f7f1e7 0%, var(--bg) 48%, #eadcc0 100%);
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-copy {
  padding: 34px;
}

.hero-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(47, 108, 93, 0.1), rgba(255, 255, 255, 0.4)),
    var(--panel-strong);
}

.eyebrow,
.muted,
.hero-card-label,
.legend span,
.range-readout span {
  color: var(--muted);
  font-size: 0.94rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 9ch;
}

.lede {
  max-width: 58ch;
  line-height: 1.6;
  margin-bottom: 0;
}

.hero-card-value {
  font-size: clamp(2.8rem, 4vw, 4rem);
  line-height: 1;
  margin: 8px 0 12px;
  font-weight: 700;
}

.hero-card-breakdown {
  display: grid;
  gap: 8px;
}

.hero-card-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.panel {
  padding: 28px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.ghost-button {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

.ghost-button:hover {
  background: white;
}

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

label {
  display: grid;
  gap: 10px;
  font-size: 0.96rem;
  color: var(--muted);
}

input,
select {
  width: 100%;
  border: 1px solid rgba(49, 38, 24, 0.14);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
}

input:focus,
select:focus,
.ghost-button:focus {
  outline: 2px solid rgba(47, 108, 93, 0.25);
  outline-offset: 2px;
}

.full-span {
  grid-column: 1 / -1;
}

input[type="range"] {
  padding: 0;
  background: transparent;
}

.range-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.summary-grid article,
.visual-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
}

.summary-grid article {
  padding: 18px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-grid strong {
  font-size: 1.45rem;
}

.visual-card {
  padding: 20px;
}

.visual-header {
  margin-bottom: 18px;
}

.visual-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.stacked-bar {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(49, 38, 24, 0.08);
  margin-bottom: 16px;
}

.segment {
  transition: width 220ms ease;
}

.principal {
  background: var(--principal);
}

.taxes {
  background: var(--taxes);
}

.insurance {
  background: var(--insurance);
}

.fees {
  background: var(--fees);
}

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

.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

@media (max-width: 920px) {
  .hero,
  .calculator-grid,
  .form-grid,
  .summary-grid,
  .legend {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 24px 16px 40px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 22px;
  }
}
