/* Plotline launch site. Tokens follow docs/site/BRIEF.md; no raw colour outside these declarations. */

:root {
  --paper: #f7f3ec;
  --surface: #fffdf9;
  --sunken: #efe9df;
  --ink: #1f1c18;
  --ink-muted: #5d554b;
  --line: #e2d9cb;
  --clay: #b4532f;
  --clay-strong: #963f1f;
  --clay-soft: #f6e1d5;
  --on-clay: #fffaf5;
  --sage: #5e7560;
  --sage-soft: #e1e9de;
  --sand-soft: #f1e6c8;
  --sand-ink: #6f5512;
  --window: #f6d9a8;
  --focus: #2f6db4;

  --hill-1: #e8c3ad;
  --hill-2: #d39a7a;
  --hill-3: #c3d3be;
  --hill-4: #97b098;
  --hill-5: #5e7560;
  --roof: #2c3a2d;
  --sun: #e7a27f;
  --sky-top: var(--clay-soft);
  --sky-bottom: var(--paper);

  /* Community cover palettes for the "every community has a face" tile. */
  --slate-1: #e3e3e6;
  --slate-2: #9a9aa6;
  --slate-3: #4a4a52;
  --lake-1: #dde7ef;
  --lake-2: #8fb0c8;
  --lake-3: #3f6480;
  --plum-1: #efe1ea;
  --plum-2: #b48aa3;
  --plum-3: #6b3f5a;

  --shadow: 0 1px 2px rgb(60 40 20 / 0.06), 0 8px 24px rgb(60 40 20 / 0.08);
  --shadow-hover: 0 2px 4px rgb(60 40 20 / 0.08), 0 16px 36px rgb(60 40 20 / 0.12);
  --shadow-deep: 0 2px 6px rgb(60 40 20 / 0.08), 0 30px 70px rgb(60 40 20 / 0.16);

  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --wrap: min(72rem, 100vw - 2 * var(--gutter));
  --section-gap: clamp(5rem, 12vw, 9rem);
  --line-w: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171513;
    --surface: #211e1b;
    --sunken: #12100e;
    --ink: #f1ebe2;
    --ink-muted: #b5aa9b;
    --line: #38322c;
    --clay: #e08a63;
    --clay-strong: #eda07c;
    --clay-soft: #4a2b1e;
    --on-clay: #1c120c;
    --sage: #9db69e;
    --sage-soft: #26332a;
    --sand-soft: #3d3218;
    --sand-ink: #e6cf8c;
    --window: #f0c27a;
    --focus: #8fb8ee;

    --hill-1: #30402f;
    --hill-2: #3d5240;
    --hill-3: #4d6650;
    --hill-4: #5a3424;
    --hill-5: #73412b;
    --roof: #0e1510;
    --sun: #f3d6c4;
    --sky-top: #17211a;
    --sky-bottom: #26332a;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-hover: 0 2px 4px rgb(0 0 0 / 0.35), 0 16px 36px rgb(0 0 0 / 0.45);
    --shadow-deep: 0 2px 6px rgb(0 0 0 / 0.35), 0 30px 70px rgb(0 0 0 / 0.55);
  }
}

@media (min-width: 64rem) {
  :root {
    --line-w: 3px;
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: lining-nums tabular-nums;
}

a {
  color: var(--clay-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
main:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

svg {
  display: block;
}

section {
  scroll-margin-top: 5rem;
}

.wrap {
  width: min(72rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--clay);
  color: var(--on-clay);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--sage);
  font-family: var(--ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title {
  max-width: 22ch;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.small-note {
  margin-top: 1rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.center {
  text-align: center;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--clay-strong);
  font-weight: 600;
  text-underline-offset: 0.2em;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.375rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease),
    transform 120ms var(--ease),
    box-shadow 200ms var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--clay);
  color: var(--on-clay);
}

.btn-primary:hover {
  background: var(--clay-strong);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--sunken);
}

.btn-small {
  padding: 0 1.125rem;
  font-size: 0.9375rem;
}

.btn-large {
  min-height: 3.25rem;
  padding: 0 1.75rem;
  font-size: 1.0625rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (max-width: 29.99rem) {
  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}

/* Pills, in the app's badge colours */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  width: fit-content;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-family: var(--ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.pill::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
}

.pill-planning {
  background: var(--line);
  color: var(--ink-muted);
}

.pill-prelaunch {
  background: var(--sand-soft);
  color: var(--sand-ink);
}

.pill-selling {
  background: var(--sage-soft);
  color: var(--sage);
}

.pill-yours {
  background: var(--clay-soft);
  color: var(--clay-strong);
}

.pill-soldout {
  background: var(--sunken);
  color: var(--ink-muted);
}

.pill-clay {
  background: var(--clay);
  color: var(--on-clay);
}

.pill-clay::before {
  display: none;
}

/* Logo */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--ink);
  text-decoration: none;
}

.mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.logo-large .mark {
  width: 40px;
  height: 40px;
}

.mark-plot {
  fill: var(--clay-soft);
}

.mark-house {
  fill: var(--ink);
}

.mark-window {
  fill: var(--window);
}

.mark-line {
  fill: none;
  stroke: var(--clay);
}

.wordmark {
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--ink);
}

/* 0. Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 4rem;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms var(--ease);
}

.js .site-header:not(.scrolled) {
  border-bottom-color: transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  display: none;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--clay-strong);
}

@media (min-width: 48rem) {
  .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
}

/* The plot line under a phrase */

.underlined {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.underline {
  position: absolute;
  left: 0;
  bottom: -0.14em;
  /* The period sits inside the phrase so it never wraps alone; the line stops short of it. */
  width: calc(100% - 0.3em);
  height: 0.3em;
  overflow: visible;
}

.underline path {
  fill: none;
  stroke: var(--clay);
  stroke-width: var(--line-w);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.br-wide {
  display: none;
}

/* 1. Hero */

.hero {
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 2.5rem 0;
}

.hero-title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.6rem, 6.2vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-copy .lede {
  max-width: 34rem;
}

.hero-art {
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
}

.hero-art svg {
  width: 100%;
  height: 100%;
}

.sky-top {
  stop-color: var(--sky-top);
}

.sky-bottom {
  stop-color: var(--sky-bottom);
}

.sun {
  fill: var(--sun);
}

.hill-1 {
  fill: var(--hill-1);
}

.hill-2 {
  fill: var(--hill-2);
}

.hill-3 {
  fill: var(--hill-3);
}

.hill-4 {
  fill: var(--hill-4);
}

.hill-5,
.trees {
  fill: var(--hill-5);
}

.roof {
  fill: var(--roof);
}

.window {
  fill: var(--window);
}

.survey,
.ticks path {
  fill: none;
  stroke: var(--clay);
  stroke-width: 3;
  stroke-linecap: round;
}

@media (min-width: 64rem) {
  .br-wide {
    display: inline;
  }

  .hero-grid {
    grid-template-columns: 5fr 7fr;
    align-items: center;
    gap: 3rem;
    min-height: calc(min(100svh, 56rem) - 4rem);
    padding-block: 3rem;
  }

  .hero-art {
    align-self: stretch;
    aspect-ratio: auto;
    margin-right: calc((100vw - var(--wrap)) / -2);
    border-radius: 24px 0 0 24px;
  }
}

/* 2. Proof strip */

.proof {
  margin-top: clamp(3rem, 7vw, 5rem);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.fact {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.25rem;
}

.fact dd {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}

.fact dt {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

@media (min-width: 48rem) {
  .proof-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 3. The town */

@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

.town {
  --p: 1;
  margin-top: var(--section-gap);
}

/* The scene spans the full width of the stage; the captions keep to the column. */
.town-stage {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.town-inner {
  order: 2;
  width: 100%;
}

.town-frame {
  order: 1;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  min-height: 15rem;
}

.town-art {
  width: 100%;
  height: 100%;
}

.captions {
  display: grid;
  gap: 1.75rem;
  counter-reset: step;
}

.caption h2 {
  margin: 0.6rem 0 0.35rem;
  font-size: 1.375rem;
}

.caption p:last-child {
  color: var(--ink-muted);
}

@media (min-width: 48rem) {
  .town-frame {
    aspect-ratio: 1200 / 420;
    min-height: 0;
  }

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

@media (min-width: 64rem) {
  .town-frame {
    width: 100%;
    height: min(58svh, 36rem);
    aspect-ratio: auto;
  }
}

.lot {
  --h: clamp(0, (var(--p) - var(--s)) * 10, 1);
}

.rise {
  transform-box: fill-box;
  transform: translateY(calc((1 - var(--h)) * 100%));
}

.lot-outline {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: calc(1 - var(--h));
}

.win {
  fill: var(--window);
  opacity: clamp(0, (var(--p) - var(--w)) * 60, 1);
}

.ground {
  fill: var(--hill-3);
  opacity: 0.45;
}

.street,
.street-ticks {
  fill: none;
  stroke: var(--clay);
  stroke-width: 3;
  stroke-linecap: round;
}

@media (prefers-color-scheme: dark) {
  .win,
  .closing-street .lit {
    filter: drop-shadow(0 0 6px var(--window));
  }
}

/* Scrubbed by scroll: wide screens, motion allowed, main.js present. */
@media (min-width: 48rem) and (prefers-reduced-motion: no-preference) {
  .scrub .town {
    height: 220vh;
  }

  .scrub .town-stage {
    position: sticky;
    top: 0;
    display: grid;
    align-content: center;
    height: 100svh;
    gap: clamp(1.5rem, 4svh, 3rem);
  }

  .scrub .town-inner {
    order: 0;
  }

  .scrub .captions {
    grid-template-columns: 1fr;
    min-height: 9.5rem;
    text-align: center;
  }

  /* Captions hand over in sequence: the old one fades out, then the new one fades in. */
  .scrub .caption {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 120ms var(--ease),
      transform 120ms var(--ease);
  }

  .scrub .caption:not(.current) {
    visibility: hidden;
    transition:
      opacity 120ms var(--ease),
      transform 120ms var(--ease),
      visibility 0s linear 120ms;
  }

  .scrub .caption .pill {
    margin-inline: auto;
  }

  .scrub .caption h2 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    letter-spacing: -0.02em;
  }

  .scrub .caption.current {
    opacity: 1;
    transform: none;
    transition:
      opacity 240ms var(--ease) 120ms,
      transform 240ms var(--ease) 120ms,
      visibility 0s linear 120ms;
  }
}

@keyframes town-progress {
  from {
    --p: 0;
  }
  to {
    --p: 1;
  }
}

@supports (animation-timeline: view()) {
  @media (min-width: 48rem) and (prefers-reduced-motion: no-preference) {
    .scrub .town {
      animation: town-progress linear both;
      animation-timeline: view();
      animation-range: contain 0% contain 100%;
    }
  }
}

/* Sunken bands */

.band {
  margin-top: var(--section-gap);
  padding-block: var(--section-gap);
  background: var(--sunken);
}

/* 4. How it works */

.steps {
  --gap: 2.5rem;
  display: grid;
  gap: var(--gap);
  margin-top: 3rem;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 1.25rem;
}

.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(1.5rem - var(--line-w) / 2);
  top: 1.5rem;
  width: var(--line-w);
  height: calc(100% + var(--gap));
  background: var(--clay);
  transform-origin: top;
}

.step-num {
  position: relative;
  z-index: 1;
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--clay);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}

.step h3 {
  margin: 0.6rem 0 0.5rem;
  font-size: 1.375rem;
}

.step p {
  color: var(--ink-muted);
}

@media (min-width: 64rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .step:not(:last-child)::before {
    left: 1.5rem;
    top: calc(1.5rem - var(--line-w) / 2);
    width: calc(100% + var(--gap));
    height: var(--line-w);
    transform-origin: left;
  }

  .step-num {
    grid-row: auto;
  }

  .step h3 {
    margin-top: 1.5rem;
  }
}

/* 5. Features */

.features {
  margin-top: var(--section-gap);
}

.bento {
  display: grid;
  gap: 1.25rem;
  margin-top: 3rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease),
    opacity 360ms var(--ease);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.tile h3 {
  font-size: 1.375rem;
}

.tile-copy {
  margin-bottom: 0.75rem;
  color: var(--ink-muted);
}

@media (min-width: 40rem) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile-estimator,
  .tile-compare {
    grid-column: span 2;
  }
}

@media (min-width: 64rem) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
  }

  .tile-estimator {
    grid-column: span 3;
    grid-row: span 2;
  }

  .tile-filters,
  .tile-compare {
    grid-column: span 3;
  }

  .tile-faces,
  .tile-status,
  .tile-builders {
    grid-column: span 2;
  }
}

/* Estimator */

.estimator {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: auto;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.est-panel {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: var(--clay-soft);
}

.est-result {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.est-figure {
  font-family: var(--display);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--clay-strong);
  font-variant-numeric: lining-nums tabular-nums;
}

.est-unit {
  color: var(--ink-muted);
  font-weight: 600;
}

.est-note {
  margin-top: 0.35rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

@media (max-width: 24rem) {
  .estimator {
    grid-template-columns: 1fr;
  }
}

/* Filters */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.chip {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.875rem;
  font-weight: 500;
}

.chip:first-child {
  border-color: var(--clay);
  color: var(--clay-strong);
}

/* Compare */

.compare-scroll {
  overflow-x: auto;
  margin-top: auto;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 0.9375rem;
}

.compare th,
.compare td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.compare thead th {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare tbody th {
  color: var(--ink-muted);
  font-weight: 600;
}

.compare tbody tr:last-child > * {
  border-bottom: 0;
}

/* Faces */

.faces {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: auto;
}

.face {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.f-sky {
  fill: var(--a);
}

.f-sun {
  fill: var(--surface);
  opacity: 0.85;
}

.f-hill-1 {
  fill: var(--b);
}

.f-hill-2 {
  fill: var(--c);
}

.f-roof {
  fill: var(--roof);
}

.pal-clay {
  --a: var(--clay-soft);
  --b: var(--hill-2);
  --c: var(--clay);
}

.pal-sage {
  --a: var(--sage-soft);
  --b: var(--hill-4);
  --c: var(--sage);
}

.pal-sand {
  --a: var(--sand-soft);
  --b: var(--window);
  --c: var(--sand-ink);
}

.pal-slate {
  --a: var(--slate-1);
  --b: var(--slate-2);
  --c: var(--slate-3);
}

.pal-lake {
  --a: var(--lake-1);
  --b: var(--lake-2);
  --c: var(--lake-3);
}

.pal-plum {
  --a: var(--plum-1);
  --b: var(--plum-2);
  --c: var(--plum-3);
}

/* Status and builders */

.status-list {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
}

.builder-names {
  display: grid;
  gap: 0.9rem;
  margin-top: auto;
}

.builder-names li {
  padding-top: 0.6rem;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--clay), var(--sage)) 1;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
}

/* 6. Live app */

.live .lede {
  margin-top: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2.5rem 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: none;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms var(--ease);
}

.tab:hover {
  background: var(--paper);
}

.tab[aria-pressed="true"] {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--on-clay);
}

.browser {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-deep);
}

.browser-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding-inline: 1rem;
  border-bottom: 1px solid var(--line);
}

.dots {
  position: absolute;
  left: 1rem;
  display: flex;
  gap: 6px;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.address {
  padding: 0.2rem 1rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.app-frame {
  display: block;
  width: 100%;
  height: 40rem;
  border: 0;
  background: var(--paper);
}

@media (min-width: 48rem) {
  .app-frame {
    height: min(78vh, 52rem);
  }
}

.live .center {
  margin-top: 1.5rem;
}

/* 7. For builders */

.builders {
  margin-top: var(--section-gap);
}

.builders-grid {
  display: grid;
  gap: 4rem;
}

.body-copy {
  margin-top: 1.25rem;
  color: var(--ink-muted);
}

.points {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.points li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 1rem;
}

.point-num {
  color: var(--clay);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: lining-nums tabular-nums;
}

.points h3 {
  font-size: 1.1875rem;
}

.points p {
  color: var(--ink-muted);
}

.builders {
  overflow-x: clip;
}

.listing-stage {
  position: relative;
  max-width: 30rem;
  /* Room for the ghost card's 24 px offset, so nothing spills past the edge. */
  width: calc(100% - 2rem);
  margin: 0 auto 1.5rem;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-ghost {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  transform: translate(24px, 24px) rotate(3deg);
}

.card-main {
  position: relative;
  box-shadow: var(--shadow-deep);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
}

.card-cover svg {
  width: 100%;
  height: 100%;
}

.c-sky {
  fill: var(--clay-soft);
}

.card-status {
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
}

.card-yours {
  position: absolute;
  right: 0.85rem;
  top: 0.85rem;
}

.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.card-builder,
.card-city,
.card-facts {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.card-name {
  margin: 0.15rem 0;
  font-family: var(--display);
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.2;
}

.card-price {
  margin: 0.75rem 0 0.25rem;
  color: var(--clay);
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}

@media (min-width: 64rem) {
  .builders-grid {
    grid-template-columns: 5fr 7fr;
    align-items: center;
  }
}

/* 8. Straight talk */

.talk {
  margin-top: var(--section-gap);
}

.talk-inner {
  width: min(40rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.talk-title {
  font-size: 1.75rem;
}

.talk-list {
  margin-top: 2rem;
}

.talk-list > div {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.talk-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.talk-list dt {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
}

.talk-list dd {
  margin-top: 0.25rem;
  color: var(--ink-muted);
}

/* 9. Closing */

.closing {
  position: relative;
  margin-top: var(--section-gap);
  padding-block: var(--section-gap) clamp(9rem, 22vw, 16rem);
  overflow: hidden;
  background: var(--clay-soft);
  text-align: center;
}

.closing-title {
  max-width: 18ch;
  margin-inline: auto;
  font-size: clamp(2.6rem, 6.2vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Small enough that each underlined phrase fits on one line from 360 px up. */
@media (max-width: 30rem) {
  .hero-title,
  .closing-title {
    font-size: clamp(2.1rem, 9vw, 2.6rem);
  }
}

.closing .lede {
  margin-top: 1.5rem;
  color: var(--ink);
}

.closing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 47.99rem) {
  .closing-actions {
    flex-direction: column;
  }
}

@media (max-width: 29.99rem) {
  .closing-actions .btn {
    width: 100%;
  }
}

.closing-street {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: clamp(7rem, 20vw, 15rem);
}

.tone {
  fill: var(--clay);
  opacity: 0.35;
}

.closing-street .lit {
  fill: var(--window);
}

/* 10. Footer */

.site-footer {
  padding-block: 3rem 2rem;
  background: var(--sunken);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.footer-brand p {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
}

.legal {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

/* Motion. Everything above is the final state; these only run when main.js says motion is allowed. */

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance */
  .motion .survey {
    stroke-dasharray: 1;
    animation: draw 1.4s var(--ease) both;
  }

  .motion .hero-title .underline path {
    stroke-dasharray: 1;
    animation: draw 900ms var(--ease) 500ms both;
  }

  .motion .ticks path {
    animation: fade 200ms var(--ease) both;
    animation-delay: calc(900ms + var(--i) * 60ms);
  }

  .motion .hero-house {
    animation: rise-in 360ms var(--ease) both;
    animation-delay: calc(1400ms + var(--i) * 80ms);
  }

  .motion .hero-house .window {
    animation: fade 240ms var(--ease) both;
    animation-delay: calc(1800ms + var(--i) * 120ms);
  }

  .motion .hero-copy > * {
    animation: rise-12 600ms var(--ease) both;
  }

  .motion .hero-copy > :nth-child(2) {
    animation-delay: 80ms;
  }

  .motion .hero-copy > :nth-child(3) {
    animation-delay: 160ms;
  }

  .motion .hero-copy > :nth-child(4) {
    animation-delay: 240ms;
  }

  .motion .hero-copy > :nth-child(5) {
    animation-delay: 320ms;
  }

  /* How it works: line draws, numerals pop */
  .motion .steps:not(.in) .step::before {
    transform: scale(0);
  }

  .motion .steps .step::before {
    transition: transform 800ms var(--ease);
    transition-delay: calc(var(--i) * 260ms);
  }

  .motion .steps .step-num {
    transition:
      transform 360ms var(--ease),
      opacity 360ms var(--ease);
    transition-delay: calc(var(--i) * 260ms);
  }

  .motion .steps:not(.in) .step-num {
    opacity: 0;
    transform: scale(0.6);
  }

  /* Bento tiles rise in */
  .motion .tile:not(.in) {
    opacity: 0;
    transform: translateY(16px);
  }

  .motion .tile.in {
    transition-delay: calc(var(--i) * 60ms), calc(var(--i) * 60ms), calc(var(--i) * 60ms);
  }

  .motion .tile.in:hover {
    transition-delay: 0ms;
  }

  /* App frame */
  .motion .browser {
    transition:
      opacity 360ms var(--ease),
      transform 360ms var(--ease);
  }

  .motion .browser:not(.in) {
    opacity: 0;
    transform: translateY(24px);
  }

  /* Builder card */
  .motion .listing-stage {
    transition:
      opacity 360ms var(--ease),
      transform 360ms var(--ease);
  }

  .motion .listing-stage:not(.in) {
    opacity: 0;
    transform: translateX(24px);
  }

  .motion .listing-stage.in .card-yours {
    animation: pop 240ms var(--ease) 300ms both;
  }

  /* Closing underline */
  .motion .closing-title .underline path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 900ms var(--ease) 200ms;
  }

  .motion .closing-title.in .underline path {
    stroke-dashoffset: 0;
  }

  /* Hero depth on scroll */
  @supports (animation-timeline: scroll()) {
    .layer {
      transform-box: view-box;
      animation: var(--drift-name, none) linear both;
      animation-timeline: scroll();
      animation-range: 0 100vh;
    }

    .layer-sun {
      --drift-name: drift-down;
    }

    .layer-2 {
      --drift-name: drift-15;
    }

    .layer-3 {
      --drift-name: drift-30;
    }

    .layer-4 {
      --drift-name: drift-45;
    }

    .layer-5 {
      --drift-name: drift-60;
    }
  }
}

/* Reduced motion: every element in its final state, nothing animates. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes rise-12 {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes pop {
  from {
    transform: scale(0.8);
  }
}

@keyframes drift-down {
  to {
    transform: translateY(30px);
  }
}

@keyframes drift-15 {
  to {
    transform: translateY(-15px);
  }
}

@keyframes drift-30 {
  to {
    transform: translateY(-30px);
  }
}

@keyframes drift-45 {
  to {
    transform: translateY(-45px);
  }
}

@keyframes drift-60 {
  to {
    transform: translateY(-60px);
  }
}
