:root {
  --bg: #f4efe4;
  --paper: #fffcf3;
  --paper-strong: #fff8e9;
  --stone: #dfd4bf;
  --stone-soft: #ece2d0;
  --ink: #151411;
  --ink-soft: #37322b;
  --muted: #756d60;
  --line: #d3c5ad;
  --gold: #a7782b;
  --gold-deep: #6f501d;
  --green: #d9e6cf;
  --amber: #ead7ad;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 30px;
  --shadow-soft: 0 28px 90px rgba(39, 32, 21, 0.13);
  --shadow-tight: 0 10px 32px rgba(45, 36, 20, 0.10);
  --max: 1280px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(167, 120, 43, 0.16), transparent 24rem),
    radial-gradient(circle at 88% 4%, rgba(94, 122, 80, 0.14), transparent 22rem),
    linear-gradient(180deg, rgba(255, 252, 243, 0.86), rgba(244, 239, 228, 0.96) 38rem),
    var(--bg);
  font-family: "Instrument Sans", "Avenir Next", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.33;
  background-image:
    linear-gradient(rgba(21, 20, 17, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 20, 17, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 76%);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(167, 120, 43, 0.36);
  outline-offset: 3px;
}

.site-header {
  width: min(calc(100% - 40px), var(--max));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.brand-text small,
.header-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.header-links {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.header-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.page-shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 14px 0 118px;
}

.hero-grid {
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 0.78fr);
  gap: 72px;
  align-items: center;
}

.hero-copy {
  max-width: 700px;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--gold-deep);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 18px 0 0;
  max-width: 10ch;
  font-size: 5.8rem;
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.hero-line {
  max-width: 35rem;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 1.22rem;
  line-height: 1.58;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.trust-strip span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(21, 20, 17, 0.13);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.62);
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.weigh-tray,
.value-receipt,
.steps-section,
.around-house,
.category-proof,
.save-panel,
.legal-note {
  border: 1px solid rgba(82, 63, 35, 0.18);
  background: rgba(255, 252, 243, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.weigh-tray {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 24px;
}

.weigh-tray::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(167, 120, 43, 0.14), transparent 28%),
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.92), transparent 12rem);
}

.weigh-tray > * {
  position: relative;
}

.tray-top,
.form-heading,
.receipt-top,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tray-top > span:first-child,
.input-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(21, 20, 17, 0.12);
  border-radius: 999px;
  background: var(--green);
  padding: 0 12px;
  color: #2d432c;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.is-fallback {
  background: var(--amber);
  color: #5e471e;
}

.tray-intro {
  margin-top: 32px;
}

.tray-intro h2 {
  margin: 8px 0 0;
  max-width: 12ch;
  font-size: 3.3rem;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.category-button,
.pill-option,
.room-suggestions button,
.mode-toggle button,
.item-actions button {
  min-height: 44px;
  border: 1px solid rgba(21, 20, 17, 0.13);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.76);
  padding: 0 15px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.category-button:hover,
.category-button:focus-visible,
.category-button.is-active,
.pill-option:hover,
.pill-option:focus-visible,
.pill-option.is-active,
.mode-toggle button.is-active,
.room-suggestions button:hover,
.item-actions button:hover {
  border-color: var(--ink);
  background: var(--stone-soft);
  transform: translateY(-1px);
}

.tray-surface {
  min-height: 172px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 26px;
  border: 1px solid rgba(21, 20, 17, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 248, 233, 0.96), rgba(231, 220, 200, 0.62)),
    var(--paper);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--shadow-tight);
}

.tray-object {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 20, 17, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff8d7, #c49438 46%, #68461a 100%);
  box-shadow: 0 20px 35px rgba(82, 56, 21, 0.18);
}

.tray-object span {
  width: 46px;
  height: 12px;
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(-18deg);
}

.tray-surface h3 {
  margin: 4px 0 0;
  font-size: 2.15rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.tray-surface p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  border: 1px solid var(--ink);
  padding: 0 20px;
}

.primary-button {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(21, 20, 17, 0.18);
}

.secondary-button {
  background: rgba(255, 252, 243, 0.88);
  color: var(--ink);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tray-surface .primary-button {
  grid-column: 1 / -1;
  width: 100%;
}

.estimate-form {
  margin-top: 24px;
  border-top: 1px solid rgba(21, 20, 17, 0.12);
  padding-top: 22px;
}

.form-heading h2 {
  margin: 5px 0 0;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(21, 20, 17, 0.12);
  border-radius: 999px;
  background: rgba(244, 239, 228, 0.66);
}

.mode-toggle button {
  min-height: 36px;
  border: 0;
  padding: 0 12px;
}

.input-count {
  display: inline-flex;
  margin-top: 14px;
}

.field-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.field-group {
  display: grid;
  gap: 9px;
}

.field-group label,
.email-form label > span {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-input,
.email-form input[type="email"],
.email-form input[type="text"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(21, 20, 17, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 243, 0.9);
  padding: 0 14px;
  color: var(--ink);
}

.slider-wrap {
  display: grid;
  gap: 10px;
}

.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--range-fill, 50%), var(--stone-soft) var(--range-fill, 50%), var(--stone-soft) 100%);
  outline: 0;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fffaf0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(21, 20, 17, 0.18);
}

.range-input::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fffaf0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(21, 20, 17, 0.18);
}

.range-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.estimate-output {
  margin-top: 24px;
  border-top: 1px solid rgba(21, 20, 17, 0.12);
  padding-top: 22px;
  animation: reveal 260ms var(--ease);
}

.estimate-main span,
.total-card span,
.signal-row span,
.route-line span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estimate-main strong,
.total-card strong {
  display: block;
  margin-top: 7px;
  font-size: 3.15rem;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.signal-row article {
  min-width: 0;
  border: 1px solid rgba(21, 20, 17, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 243, 0.72);
  padding: 12px;
}

.signal-row strong {
  display: block;
  margin-top: 5px;
  font-size: 0.98rem;
}

.route-line {
  display: grid;
  gap: 4px;
  margin: 16px 0 0;
}

.route-line strong {
  font-size: 1.05rem;
}

.estimate-copy {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.prompt-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--amber);
  padding: 0 12px;
  color: #4f3f1d;
  font-size: 0.8rem;
  font-weight: 800;
}

.estimate-actions,
.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.value-receipt {
  margin: -24px auto 64px;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 900px;
}

.receipt-top h2,
.section-heading h2,
.save-panel h2 {
  margin: 5px 0 0;
  font-size: 2.45rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.total-card {
  margin-top: 20px;
  border-radius: 22px;
  background: var(--green);
  padding: 20px;
}

.value-list-items {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.value-list-item {
  border: 1px solid rgba(21, 20, 17, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 243, 0.76);
  padding: 14px;
}

.value-list-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.value-list-item h3 {
  margin: 0;
  font-size: 1.02rem;
}

.value-list-item-top span {
  border-radius: 999px;
  background: var(--stone-soft);
  padding: 5px 9px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.value-list-item strong {
  display: block;
  margin-top: 7px;
  font-size: 1.25rem;
}

.item-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.item-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.empty-state,
.list-insights p,
.save-panel p,
.legal-note p,
.step-line p {
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  margin: 16px 0 0;
}

.list-insights {
  margin-top: 18px;
  border-top: 1px solid rgba(21, 20, 17, 0.1);
  padding-top: 14px;
}

.list-insights p {
  margin: 7px 0 0;
}

.steps-section,
.around-house,
.category-proof,
.save-panel,
.legal-note {
  margin-top: 32px;
  border-radius: var(--radius-lg);
  padding: 28px;
}

.step-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.step-line article {
  min-height: 190px;
  display: grid;
  align-content: space-between;
  border-top: 1px solid rgba(21, 20, 17, 0.18);
  padding-top: 16px;
}

.step-line span {
  color: var(--gold-deep);
  font-size: 0.82rem;
  font-weight: 800;
}

.step-line h3 {
  margin: 20px 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.step-line p {
  margin: 10px 0 0;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

.room-button {
  min-height: 76px;
  border: 1px solid rgba(21, 20, 17, 0.13);
  border-radius: 18px;
  background: rgba(255, 252, 243, 0.76);
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.room-button:hover,
.room-button:focus-visible,
.room-button.is-active {
  border-color: var(--ink);
  background: var(--stone-soft);
  transform: translateY(-1px);
}

.room-suggestions {
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.room-suggestions .section-label {
  width: 100%;
}

.category-proof ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.category-proof li {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(21, 20, 17, 0.12);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.72);
  padding: 0 13px;
  font-weight: 800;
}

.save-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
}

.email-form {
  display: grid;
  gap: 12px;
}

.email-form label {
  display: grid;
  gap: 6px;
}

.consent-line {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.consent-line input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.save-message {
  min-height: 22px;
  margin: 0;
  font-weight: 700;
}

.legal-note {
  box-shadow: none;
}

.legal-note summary {
  font-weight: 800;
  cursor: pointer;
}

.refresh-link {
  min-height: 36px;
}

.mobile-total {
  display: none;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    align-items: start;
  }

  .hero-copy {
    padding-top: 24px;
  }

  .hero-copy h1 {
    max-width: 13ch;
    font-size: 4.8rem;
  }

  .weigh-tray {
    max-width: 740px;
  }

  .room-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  .page-shell {
    width: min(calc(100% - 24px), var(--max));
  }

  .site-header {
    min-height: 74px;
  }

  .header-links {
    display: none;
  }

  .hero-grid {
    min-height: auto;
  }

  .hero-copy h1 {
    font-size: 3.35rem;
  }

  .hero-line {
    font-size: 1.05rem;
  }

  .weigh-tray,
  .value-receipt,
  .steps-section,
  .around-house,
  .category-proof,
  .save-panel,
  .legal-note {
    border-radius: 22px;
    padding: 18px;
  }

  .tray-top,
  .form-heading,
  .receipt-top,
  .section-heading {
    flex-direction: column;
  }

  .tray-intro h2 {
    font-size: 2.55rem;
  }

  .tray-surface {
    grid-template-columns: 1fr;
  }

  .tray-object {
    width: 86px;
    height: 86px;
  }

  .signal-row,
  .step-line,
  .save-panel {
    grid-template-columns: 1fr;
  }

  .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-top h2,
  .section-heading h2,
  .save-panel h2 {
    font-size: 2rem;
  }

  .estimate-main strong,
  .total-card strong {
    font-size: 2.35rem;
  }

  .value-receipt {
    margin-top: 28px;
  }
}

@media (max-width: 560px) {
  .brand-text small {
    display: none;
  }

  .hero-copy h1 {
    font-size: 2.95rem;
  }

  .starter-chips,
  .pill-grid,
  .trust-strip {
    gap: 7px;
  }

  .category-button,
  .pill-option,
  .room-suggestions button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

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

  .mobile-total:not([hidden]) {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    background: var(--ink);
    color: #ffffff;
    padding: 10px;
    box-shadow: var(--shadow-soft);
  }

  .mobile-total span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-total strong {
    display: block;
    font-size: 0.96rem;
  }

  .mobile-total a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 800;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
