:root {
  color-scheme: light;
  --ink: #241d18;
  --muted: #71675d;
  --paper: #f8f3e8;
  --panel: #fffaf0;
  --clay: #b85f40;
  --clay-dark: #813f2a;
  --moss: #556b48;
  --teal: #2f6f73;
  --gold: #d6a94f;
  --line: rgba(36, 29, 24, 0.16);
  --shadow: 0 22px 55px rgba(47, 40, 31, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(248, 243, 232, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand,
nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--gold);
  font-size: 12px;
  letter-spacing: 0;
}

nav {
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

main {
  overflow: hidden;
}

.hero {
  position: relative;
  display: grid;
  min-height: clamp(640px, calc(100vh - 72px), 820px);
  padding: clamp(32px, 5vw, 58px) clamp(18px, 4vw, 56px) 28px;
  align-items: center;
  background: linear-gradient(180deg, #95c4bf 0%, #f4d98b 58%, #f1c071 100%);
}

.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.moon {
  position: absolute;
  top: 9%;
  right: 9%;
  width: clamp(70px, 10vw, 126px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff4c2;
  box-shadow: 0 0 55px rgba(255, 244, 194, 0.75);
}

.hill {
  position: absolute;
  right: -12vw;
  bottom: -16vw;
  width: 72vw;
  aspect-ratio: 1.8;
  border-radius: 50% 50% 0 0;
  background: var(--moss);
}

.hill-two {
  right: auto;
  left: -20vw;
  bottom: -15vw;
  width: 82vw;
  background: #657b51;
}

.cabin {
  position: absolute;
  bottom: clamp(48px, 8vw, 86px);
  width: clamp(190px, 24vw, 330px);
  aspect-ratio: 1.45;
  background: #70462f;
  border: 4px solid #432a1c;
  box-shadow: var(--shadow);
  transform: rotate(-1deg);
}

.cabin::before {
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  top: -54px;
  height: 70px;
  background: #3f2d23;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.cabin span {
  position: absolute;
  bottom: 18%;
  width: 20%;
  height: 34%;
  background: #f4c56b;
  border: 3px solid #342117;
}

.cabin span:first-child {
  left: 12%;
}

.cabin span:nth-child(2) {
  left: 41%;
  height: 52%;
  background: #4b3123;
}

.cabin span:nth-child(3) {
  right: 12%;
}

.cabin-a {
  right: clamp(46px, 9vw, 150px);
}

.cabin-b {
  display: none;
}

.fence {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 54px;
  height: 18px;
  background: repeating-linear-gradient(90deg, #5a3a28 0 42px, transparent 42px 68px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(790px, 100%);
  padding-bottom: clamp(18px, 3vw, 36px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--clay-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(46px, 7.8vw, 104px);
  line-height: 0.94;
  letter-spacing: 0;
  max-width: 780px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 21px;
}

.hero-copy p:not(.eyebrow),
.calculator p,
footer p {
  max-width: 680px;
  color: #382e26;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
}

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

.button,
button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(36, 29, 24, 0.12);
}

.primary {
  color: #fffaf0;
  background: var(--clay);
}

.ghost {
  background: rgba(255, 250, 240, 0.55);
}

.quick-match,
.calculator,
.application {
  padding: clamp(46px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 880px;
  margin-bottom: 22px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf6;
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

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

.match-card {
  display: grid;
  min-height: 390px;
  align-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(65, 48, 34, 0.1);
}

.card-top {
  display: grid;
  gap: 14px;
}

.profile-scene {
  position: relative;
  min-height: 136px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #b6d5cc, #efd37f);
}

.profile-scene::before,
.profile-scene::after {
  content: "";
  position: absolute;
}

.profile-scene::before {
  left: 0;
  right: 0;
  bottom: -45px;
  height: 90px;
  border-radius: 50% 50% 0 0;
  background: var(--moss);
}

.profile-scene::after {
  left: 28px;
  bottom: 32px;
  width: 96px;
  height: 70px;
  border: 3px solid #3d281d;
  background: var(--scene-color, #8e5840);
  box-shadow: 18px 14px 0 rgba(36, 29, 24, 0.15);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fffaf0;
  background: var(--teal);
  font-size: 12px;
  font-weight: 850;
}

.match-card p {
  color: var(--muted);
  line-height: 1.5;
}

.meter {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eee1c9;
}

.meter span {
  display: block;
  height: 100%;
  width: var(--score);
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--clay));
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: start;
  background: #dce8db;
  border-block: 1px solid var(--line);
}

.calc-panel,
.application-form,
.plea {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(65, 48, 34, 0.08);
}

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

output {
  display: block;
  min-height: 94px;
  padding: 18px;
  border-radius: 8px;
  color: #fffaf0;
  background: var(--teal);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 900;
  line-height: 1.08;
}

.application {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.application .section-heading {
  grid-column: 1 / -1;
}

.plea {
  min-height: 100%;
}

.plea p {
  color: var(--muted);
  line-height: 1.5;
}

footer {
  padding: 28px clamp(18px, 4vw, 56px);
  background: var(--ink);
}

footer p {
  margin: 0;
  color: #fffaf0;
  font-size: 15px;
}

@media (max-width: 900px) {
  .filters,
  .match-grid,
  .calculator,
  .application,
  .household-counts {
    grid-template-columns: 1fr;
  }

  .cabin-b {
    display: none;
  }

  .cabin-a {
    left: auto;
    right: 16px;
    opacity: 0.42;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 760px;
  }

  .hero-copy {
    padding-bottom: 10px;
  }

  .cabin-a {
    left: auto;
    right: -42px;
    bottom: 86px;
    opacity: 0.28;
  }
}
