:root {
  --paper: #f4efe5;
  --paper-deep: #e9dfca;
  --card: #fffdf7;
  --ink: #171914;
  --ink-soft: #51564f;
  --green: #1b4f3b;
  --green-light: #2f7455;
  --rust: #ae4f23;
  --mustard: #c9902c;
  --line: #d7ccb5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }

.nav {
  position: relative;
  z-index: 20;
  height: 74px;
  padding: 0 max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 229, 0.96);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 8px; }
.brand span { font: 600 28px/1 Fraunces, Georgia, serif; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--ink-soft); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-cta {
  justify-self: end;
  padding: 12px 18px;
  color: #fffdf7;
  background: var(--green);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: calc(100svh - 98px);
  max-height: 826px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.hero-copy {
  position: relative;
  z-index: 4;
  width: min(600px, calc(100% - 48px));
  margin-left: max(24px, calc((100vw - 1200px) / 2));
  padding-top: clamp(58px, 8vh, 92px);
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--rust);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
h1, h2, h3, blockquote { font-family: Fraunces, Georgia, serif; }
h1 {
  max-width: 13ch;
  margin: 0;
  font-size: 72px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0;
}
h1 span { color: var(--green); }
.hero-lede {
  max-width: 540px;
  margin: 26px 0 0;
  color: #343933;
  font-size: 20px;
  line-height: 1.55;
}
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }
.button {
  min-height: 50px;
  padding: 14px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}
.button-primary { color: #fffdf7; background: var(--green); }
.button-quiet { color: var(--green); background: rgba(255, 253, 247, 0.72); }
.button:active, .nav-cta:active, .join-form button:active, .paper-action:active { transform: translateY(2px); }
.beta-note { display: flex; gap: 0; margin: 20px 0 0; color: var(--ink-soft); font-size: 13px; }
.beta-note span::before { content: "·"; margin: 0 9px; color: var(--rust); }

.app-stage { position: absolute; z-index: 3; inset: 32px max(20px, calc((100vw - 1280px) / 2)) 0 49%; }
.phone {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 10px solid #171914;
  border-radius: 44px;
  background: #171914;
  box-shadow: 0 24px 45px rgba(51, 44, 28, 0.22);
}
.phone img { width: 100%; height: 100%; object-fit: cover; }
.phone-schedule { width: 300px; height: 648px; right: 315px; top: 126px; transform: rotate(-5deg); opacity: 0.92; }
.phone-today { width: 330px; height: 714px; right: 6px; top: 94px; transform: rotate(3deg); }
.motion-ready .phone-schedule { animation: schedule-settle 720ms cubic-bezier(0.2, 0.75, 0.25, 1) 80ms both; }
.motion-ready .phone-today { animation: today-settle 760ms cubic-bezier(0.2, 0.75, 0.25, 1) 180ms both; }
.hero-rule {
  position: absolute;
  z-index: 5;
  left: max(24px, calc((100vw - 1200px) / 2));
  bottom: 24px;
  width: min(565px, calc(100% - 48px));
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--green);
  font: 700 10px/1.2 Inter, sans-serif;
}
.hero-rule i { height: 1px; flex: 1; background: var(--line); }

.rooms {
  padding: 96px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 92px;
  background: var(--card);
}
.section-intro { position: sticky; top: 40px; align-self: start; }
.section-intro h2, .consequence h2, .story h2, .join h2 {
  margin: 0;
  color: var(--green);
  font-size: 52px;
  font-weight: 600;
  line-height: 1.08;
}
.section-intro > p:last-child, .consequence-copy > p:last-child, .story-copy > p, .join > div > p:last-child {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}
.room-ledger { position: relative; border-top: 4px solid var(--green); }
.motion-ready .room-ledger { border-top-color: transparent; }
.motion-ready .room-ledger::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  height: 4px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
}
.motion-ready .room-ledger .room { opacity: 0; transform: translateY(10px); }
.motion-ready .room-ledger.is-visible::before { animation: rule-draw 520ms ease-out forwards; }
.motion-ready .room-ledger.is-visible .room { animation: ledger-row 420ms ease-out forwards; }
.motion-ready .room-ledger.is-visible .room:nth-child(2) { animation-delay: 70ms; }
.motion-ready .room-ledger.is-visible .room:nth-child(3) { animation-delay: 140ms; }
.motion-ready .room-ledger.is-visible .room:nth-child(4) { animation-delay: 210ms; }
.motion-ready .room-ledger.is-visible .room:nth-child(5) { animation-delay: 280ms; }
.room {
  min-height: 112px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}
.room-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rust);
  color: var(--rust);
  font: 500 14px/1 Inter, sans-serif;
}
.room h3 { margin: 0 0 5px; color: var(--green); font-size: 28px; }
.room p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
.room strong { color: var(--rust); font-size: 11px; letter-spacing: 0; }

.consequence {
  padding: 96px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
  align-items: center;
  color: var(--ink);
  background: var(--paper-deep);
}
.work-order-demo { position: relative; min-height: 372px; isolation: isolate; }
.work-order { position: relative; z-index: 2; border: 2px solid var(--rust); background: var(--paper); box-shadow: 10px 10px 0 rgba(174, 79, 35, 0.16); transition: opacity 300ms ease, transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1); }
.work-order-head { min-height: 54px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--rust); font-size: 12px; font-weight: 800; letter-spacing: 0; }
.work-order-body { padding: 28px; }
.work-kicker { margin: 0 0 9px; color: var(--rust); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.work-order h3 { max-width: 16ch; margin: 0; color: var(--green); font-size: 35px; line-height: 1.08; }
.equation { margin-top: 30px; padding-top: 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; border-top: 1px solid var(--line); }
.equation div { display: grid; gap: 4px; }
.equation span { font-size: 10px; font-weight: 800; letter-spacing: 0; }
.equation strong { font: 600 27px/1.1 Fraunces, serif; color: var(--green); }
.equation small { color: var(--ink-soft); }
.equation b { max-width: 76px; color: var(--rust); font: 600 19px/1.05 Caveat, cursive; text-align: center; transform: rotate(-4deg); }
.equation .equation-risk strong { color: var(--rust); }
.paper-action {
  width: 100%;
  min-height: 50px;
  margin-top: 24px;
  padding: 12px 18px;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--green);
  background: var(--card);
  font: 700 14px Inter, sans-serif;
  cursor: pointer;
}
.paper-action span { display: inline-block; margin-left: 8px; }
.repair-invoice {
  position: absolute;
  z-index: 1;
  inset: 12px -10px -10px 12px;
  border: 2px solid var(--rust);
  background: #f2dfd3;
  box-shadow: 10px 10px 0 rgba(174, 79, 35, 0.12);
  opacity: 0;
  transform: translateY(16px) rotate(1deg);
  transition: opacity 260ms ease 100ms, transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}
.invoice-head { min-height: 54px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--rust); font-size: 12px; font-weight: 800; }
.invoice-body { padding: 28px; }
.invoice-body h3 { max-width: 17ch; margin: 0 0 24px; color: var(--green); font-size: 32px; line-height: 1.08; }
.invoice-line { padding: 14px 0; display: flex; justify-content: space-between; gap: 22px; border-top: 1px solid rgba(174, 79, 35, 0.25); color: var(--ink-soft); font-size: 13px; }
.invoice-line strong { color: var(--rust); font: 600 22px/1 Fraunces, serif; text-align: right; }
.invoice-note { margin: 16px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.paper-action-back { margin-top: 18px; border-color: var(--rust); color: var(--rust); }
.work-order-demo.is-revealed .work-order { opacity: 0; pointer-events: none; transform: translate(-34px, -18px) rotate(-2deg); }
.work-order-demo.is-revealed .repair-invoice { z-index: 3; opacity: 1; transform: translate(0) rotate(0); }

.proof-strip {
  padding: 88px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  background: var(--green);
}
.proof-screen { margin: 0; }
.proof-screen img { width: 100%; aspect-ratio: 0.63; object-fit: cover; object-position: top; border: 7px solid #151814; border-radius: 30px; box-shadow: 0 22px 36px rgba(0,0,0,0.22); }
.proof-screen figcaption { padding: 20px 4px 0; display: grid; gap: 4px; color: #fffdf7; }
.proof-screen strong { font: 600 25px/1.2 Fraunces, serif; }
.proof-screen span { color: #dce6df; font-size: 14px; }
.proof-forecast { transform: translateY(28px) rotate(-1deg); }
.proof-household { transform: translateY(16px) rotate(1deg); }

@keyframes schedule-settle {
  from { opacity: 0; transform: translate(-24px, 34px) rotate(-9deg); }
  to { opacity: 0.92; transform: translate(0) rotate(-5deg); }
}
@keyframes today-settle {
  from { opacity: 0; transform: translate(34px, 46px) rotate(7deg); }
  to { opacity: 1; transform: translate(0) rotate(3deg); }
}
@keyframes rule-draw { to { transform: scaleX(1); } }
@keyframes ledger-row { to { opacity: 1; transform: translateY(0); } }

.story {
  padding: 104px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 88px;
  align-items: center;
  background: var(--paper);
}
.story blockquote { margin: 30px 0 0; padding: 22px 0 22px 24px; border-left: 3px solid var(--rust); color: var(--green); font-size: 25px; line-height: 1.4; }
.story-signature { color: var(--green) !important; font: 600 25px/1 Caveat, cursive !important; }
.story-photos { position: relative; min-height: 500px; }
.photo { position: absolute; margin: 0; padding: 12px 12px 44px; background: white; box-shadow: 0 18px 38px rgba(51,44,28,0.18); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { padding-top: 10px; color: var(--green); font: 600 22px/1 Caveat, cursive; text-align: center; }
.photo-book { width: 260px; height: 360px; left: 10px; top: 65px; transform: rotate(-5deg); }
.photo-family { width: 325px; height: 410px; right: 0; top: 5px; transform: rotate(4deg); }

.join {
  padding: 86px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 76px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.join-form label { display: block; margin-bottom: 9px; color: var(--green); font-size: 13px; font-weight: 800; }
.join-form > div { display: grid; grid-template-columns: 1fr auto; }
.join-form input { min-width: 0; height: 58px; padding: 0 18px; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; background: white; color: var(--ink); font: 16px Inter, sans-serif; }
.join-form button { padding: 0 22px; border: 0; border-radius: 0 6px 6px 0; color: white; background: var(--green); font: 700 15px Inter, sans-serif; }
.join-form button:disabled { cursor: wait; opacity: 0.7; }
.join-form small { display: block; margin-top: 12px; color: var(--ink-soft); line-height: 1.5; }
.field-error { margin: 10px 0 0; color: var(--rust); font-size: 13px; font-weight: 700; }
.join-success {
  padding: 24px;
  border: 2px solid var(--green);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(27, 79, 59, 0.12);
}
.join-success .eyebrow { margin-bottom: 8px; }
.join-success h3 { margin: 0; color: var(--green); font-size: 31px; }
.join-success > p:not(.eyebrow) { margin: 8px 0 16px; color: var(--ink-soft); }
.invite-link { padding: 13px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--green); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.invite-actions { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.invite-actions button { min-height: 48px; padding: 10px 14px; border: 1px solid var(--green); border-radius: 4px; color: var(--green); background: var(--card); font-weight: 700; }
.invite-actions button:first-child { color: #fffdf7; background: var(--green); }
.join-success small { display: block; margin-top: 12px; color: var(--ink-soft); line-height: 1.5; }

footer {
  min-height: 112px;
  padding: 28px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: #fffdf7;
  background: var(--ink);
}
footer p { color: #ccd2cc; }
footer > div { justify-self: end; display: flex; gap: 22px; }
footer > div a { color: #fffdf7; font-size: 13px; text-decoration: none; }

@media (max-width: 940px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .hero { min-height: 850px; max-height: 850px; }
  .hero-copy { width: min(47%, 540px); padding-top: 62px; }
  .hero-copy h1 { font-size: 58px; }
  .app-stage { left: 52%; opacity: 1; }
  .phone-schedule { display: none; }
  .phone-today { width: 300px; height: 648px; right: 0; top: 92px; }
  .rooms, .consequence, .story, .join { grid-template-columns: 1fr; gap: 54px; }
  .section-intro { position: static; }
  .proof-strip { grid-template-columns: repeat(3, minmax(260px, 1fr)); overflow-x: auto; }
}

@media (max-width: 740px) {
  .nav { height: 66px; padding: 0 18px; }
  .brand img { width: 34px; height: 34px; }
  .brand span { font-size: 24px; }
  .nav-cta { padding: 10px 13px; font-size: 12px; }
  .hero { min-height: 900px; max-height: 900px; }
  .hero-copy { width: calc(100% - 36px); margin-left: 18px; padding-top: 32px; }
  .eyebrow { margin-bottom: 12px; font-size: 10px; }
  h1 { max-width: 10ch; font-size: 48px; }
  .hero-lede { max-width: 31ch; margin-top: 18px; font-size: 16px; line-height: 1.48; }
  .hero-actions { margin-top: 20px; }
  .button { min-height: 46px; padding: 12px 15px; font-size: 13px; }
  .button-quiet { display: none; }
  .beta-note { margin-top: 14px; font-size: 11px; }
  .app-stage { inset: 610px -20px auto auto; width: 300px; height: 570px; opacity: 1; }
  .phone-today { width: 220px; height: 476px; top: 38px; right: 12px; border-width: 7px; border-radius: 32px; transform: rotate(3deg); }
  .hero-rule { bottom: 15px; left: 18px; width: calc(100% - 36px); gap: 7px; font-size: 8px; }

  .rooms, .consequence, .story, .join { padding: 68px 20px; }
  .section-intro h2, .consequence h2, .story h2, .join h2 { font-size: 39px; }
  .room { grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; }
  .room-number { width: 38px; height: 38px; }
  .room h3 { font-size: 24px; }
  .room strong { grid-column: 2; margin-top: -8px; }
  .work-order-body { padding: 22px; }
  .work-order h3 { font-size: 30px; }
  .equation { grid-template-columns: 1fr; gap: 12px; }
  .equation b { max-width: none; text-align: left; }
  .proof-strip { padding: 58px 24px 72px; grid-template-columns: repeat(3, 250px); gap: 20px; }
  .proof-strip { scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .proof-strip::-webkit-scrollbar { display: none; }
  .proof-screen { scroll-snap-align: start; }
  .proof-screen img { border-radius: 26px; }
  .proof-forecast, .proof-household { transform: none; }
  .story-photos { min-height: 390px; }
  .photo-book { width: 190px; height: 282px; left: 0; }
  .photo-family { width: 225px; height: 315px; }
  .join-form > div { grid-template-columns: 1fr; gap: 8px; }
  .join-form input { border-right: 1px solid var(--line); border-radius: 6px; }
  .join-form button { min-height: 54px; border-radius: 6px; }
  .join-success { padding: 20px; }
  .invite-actions { grid-template-columns: 1fr; }
  footer { padding: 28px 20px; grid-template-columns: 1fr auto; }
  footer p { display: none; }
  footer > div { gap: 14px; }
}

@media (max-width: 360px) {
  .hero { min-height: 950px; max-height: 950px; }
  .hero-copy h1 { font-size: 40px; }
  .app-stage { top: 650px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .motion-ready .room-ledger::before { transform: scaleX(1); }
  .motion-ready .room-ledger .room { opacity: 1; transform: none; }
}
