/* Room by Room launch site. Palette, type and layout follow docs/site/BRIEF.md. */

:root {
  color-scheme: light dark;
  --bg: #f6f4ee;
  --bg-band: #eeebe2;
  --surface: #ffffff;
  --ink: #14201c;
  --ink-muted: #55625c;
  --line: #dcdcd2;
  --line-strong: #b8bdb3;
  --accent: #0e7a6b;
  --accent-strong: #0a5f53;
  --accent-soft: #dcf0ea;
  --fresh: #b9e8d8;
  --on-accent: #ffffff;
  --minor-bg: #fdf2d3;
  --minor-ink: #75510a;
  --moderate-bg: #fde3c7;
  --moderate-ink: #8a3b00;
  --urgent-bg: #fde2df;
  --urgent-ink: #a11d14;
  --shadow: 16 40 34;
  --a-rest: 0.06;
  --a-raised-1: 0.08;
  --a-raised-2: 0.12;

  --shadow-rest:
    0 1px 2px rgb(var(--shadow) / var(--a-rest)),
    0 2px 8px rgb(var(--shadow) / var(--a-rest));
  --shadow-raised:
    0 2px 4px rgb(var(--shadow) / var(--a-raised-1)),
    0 12px 32px rgb(var(--shadow) / var(--a-raised-2));

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: 20px;
  --space: clamp(80px, 12vw, 160px);
  --header: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1311;
    --bg-band: #111916;
    --surface: #161e1b;
    --ink: #e7ede9;
    --ink-muted: #9aa9a3;
    --line: #26322e;
    --line-strong: #3d4c46;
    --accent: #3cc3ac;
    --accent-strong: #63d4c0;
    --accent-soft: #123a33;
    --fresh: #1d5a4d;
    --on-accent: #04201b;
    --minor-bg: #382c0c;
    --minor-ink: #f2cd6b;
    --moderate-bg: #41260e;
    --moderate-ink: #f6aa62;
    --urgent-bg: #471916;
    --urgent-ink: #ff9e95;
    --shadow: 0 0 0;
    --a-rest: 0.3;
    --a-raised-1: 0.45;
    --a-raised-2: 0.45;
  }
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

/* ---------- 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(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  text-wrap: balance;
}

p {
  margin: 0;
  max-width: 62ch;
}

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

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

section {
  scroll-margin-top: var(--header);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4vw + 0.5rem, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.lead {
  margin-top: 20px;
  color: var(--ink-muted);
  font-size: 1.1875rem;
}

.sr-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

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

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

.btn--primary:hover {
  background: var(--accent-strong);
}

.btn--outline {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

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

.btn--large {
  min-height: 54px;
  padding: 0 28px;
  font-size: 1.0625rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 700;
  text-underline-offset: 4px;
}

/* ---------- Header ---------- */

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

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.wordmark span {
  color: var(--ink-muted);
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__link {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-nav__link:hover {
  color: var(--accent-strong);
}

@media (min-width: 768px) {
  .site-nav__link {
    display: inline-flex;
  }

  .site-nav .btn {
    margin-left: 12px;
  }
}

/* ---------- Floor plan ---------- */

.plan {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.plan rect {
  fill: color-mix(in srgb, var(--surface) 70%, transparent);
  stroke: var(--line);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.plan__room.is-done rect,
.plan__room.is-filled rect {
  fill: var(--fresh);
  transition: fill 0.45s var(--ease);
}

.plan text {
  fill: var(--ink);
  font-family: var(--body);
  font-size: 11px;
  text-anchor: middle;
}

.plan__tick {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.plan__room.is-done .plan__tick {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s var(--ease);
}

/* ---------- Phone and app mocks ---------- */

.phone {
  --w: 300px;
  position: relative;
  display: block;
  width: var(--w);
  aspect-ratio: 300 / 610;
  overflow: hidden;
  border: 10px solid color-mix(in srgb, var(--ink) 92%, transparent);
  border-radius: 44px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  font-size: calc(var(--w) * 0.05);
}

.phone--sm {
  --w: 236px;
  border-radius: 36px;
  border-width: 8px;
}

.screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.35;
  text-align: left;
}

.m-bar {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 2em 1em 0.75em;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 1.05em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.m-bar svg {
  width: 1.4em;
  height: 1.4em;
}

.m-body {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  padding: 0.9em;
}

.m-pill {
  display: block;
  padding: 0.7em 0.8em;
  border-radius: 0.9em;
  background: var(--bg);
}

.m-pill__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5em;
  color: var(--ink-muted);
  font-size: 0.85em;
}

.m-pill__top b {
  color: var(--ink);
}

.m-track {
  display: block;
  height: 0.45em;
  margin-top: 0.45em;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.m-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(var(--v, 0));
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.m-card {
  display: block;
  padding: 0.7em 0.8em;
  border: 1px solid var(--line);
  border-radius: 0.9em;
  background: var(--surface);
}

.m-card--new {
  border: 1.5px solid var(--accent);
}

.m-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
}

.m-card__head b {
  font-family: var(--display);
  font-weight: 600;
}

.m-card__head > span {
  color: var(--ink-muted);
  font-size: 0.85em;
}

.m-rows {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  margin: 0.4em 0 0;
  padding: 0;
  list-style: none;
}

.m-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 2em;
  font-size: 0.9em;
  transition: color 0.3s var(--ease);
}

.m-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.3em;
  height: 1.3em;
  border: 1.5px solid var(--line-strong);
  border-radius: 0.35em;
}

.m-box svg {
  width: 0.95em;
  height: 0.95em;
}

.m-box path {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.m-row.is-done {
  color: var(--ink-muted);
}

.m-row.is-done .m-box {
  border-color: var(--accent);
  background: var(--accent);
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.m-row.is-done .m-box path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.3s var(--ease);
}

.m-row.is-skipped {
  color: var(--ink-muted);
}

.m-ghost {
  margin-left: auto;
  padding: 0.1em 0.6em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 0.8em;
  font-style: normal;
}

.m-badge {
  display: inline-block;
  margin-left: 0.3em;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85em;
  font-weight: 700;
}

.m-title {
  font-family: var(--display);
  font-size: 1.25em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.m-title small {
  display: block;
  color: var(--ink-muted);
  font-family: var(--body);
  font-size: 0.65em;
  font-weight: 400;
  letter-spacing: 0;
}

.m-callout {
  padding: 0.6em 0.7em;
  border-radius: 0.7em;
  background: var(--accent-soft);
  font-size: 0.82em;
}

.m-label {
  color: var(--ink-muted);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
}

.m-chips span {
  padding: 0.25em 0.65em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.75em;
  white-space: nowrap;
}

.m-chips .is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.m-chips .is-ghost {
  border-style: dashed;
  color: var(--ink-muted);
}

.m-field {
  padding: 0.55em 0.7em;
  border: 1px solid var(--line-strong);
  border-radius: 0.5em;
  font-size: 0.82em;
}

.m-field--select::after {
  content: "▾";
  float: right;
  color: var(--ink-muted);
}

.m-seg {
  display: flex;
  gap: 0.35em;
}

.m-seg span {
  flex: 1;
  padding: 0.3em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.75em;
  text-align: center;
}

.m-seg .is-on {
  border-color: var(--urgent-ink);
  background: var(--urgent-bg);
  color: var(--urgent-ink);
  font-weight: 700;
}

.m-button {
  padding: 0.55em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.85em;
  font-weight: 700;
  text-align: center;
}

.m-issue {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  padding: 0.55em 0.7em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--surface);
  font-size: 0.82em;
}

.m-note {
  margin-top: 0.5em;
  padding: 0.5em 0.7em;
  border-radius: 0.6em;
  background: var(--bg);
  font-size: 0.85em;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 0.15em 0.65em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 700;
  white-space: nowrap;
}

.chip--urgent {
  background: var(--urgent-bg);
  color: var(--urgent-ink);
}

.chip--moderate {
  background: var(--moderate-bg);
  color: var(--moderate-ink);
}

.chip--minor {
  background: var(--minor-bg);
  color: var(--minor-ink);
}

/* ---------- 1. Hero ---------- */

.hero {
  padding: 32px 0 0;
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: 40px;
}

.hero__title {
  font-size: clamp(2.6rem, 7vw + 0.5rem, 5.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.hero__break {
  display: none;
}

.swash {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.swash svg {
  position: absolute;
  left: -4%;
  bottom: 0.02em;
  z-index: -1;
  width: 108%;
  height: 0.48em;
  overflow: visible;
}

.swash path {
  fill: none;
  stroke: var(--fresh);
  stroke-width: 18;
  stroke-linecap: round;
}

@media (prefers-reduced-motion: no-preference) {
  .swash path {
    stroke-dasharray: 1;
    animation: draw 600ms ease-out 400ms both;
  }
}

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

.hero__lead {
  margin-top: 24px;
  color: var(--ink-muted);
  font-size: 1.1875rem;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

.hero__reassure {
  margin-top: 18px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.hero__visual {
  position: relative;
  height: 520px;
}

.plane {
  position: absolute;
  transform: translate3d(
    calc(var(--mx, 0) * var(--px)),
    calc(var(--my, 0) * var(--px)),
    0
  );
  transition: transform 0.4s var(--ease);
}

.plane--back {
  --px: 4px;
  top: -24px;
  left: -22%;
  width: 115%;
}

.plane--back .plan {
  rotate: -4deg;
}

.plane--mid {
  --px: 8px;
  top: 0;
  left: calc(50% - 118px);
}

.hero .phone {
  --w: 236px;
}

.plane--front {
  --px: 14px;
  inset: 0;
  pointer-events: none;
}

.slip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 250px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.slip--issue {
  top: 360px;
  left: 0;
  rotate: -3deg;
}

.slip--report {
  top: 430px;
  right: 0;
  rotate: 2.5deg;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.hero:not(.is-start) .slip {
  transition:
    opacity 0.5s var(--ease),
    translate 0.5s var(--ease);
}

.hero.is-start .slip {
  opacity: 0;
  translate: 0 12px;
}

/* The hero's "before" state, painted from the first frame so the finished
   HTML never flashes. main.js adds .is-played and the rows take over. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero:not(.is-played) .m-row.is-done {
    color: var(--ink);
  }

  .js .hero:not(.is-played) .m-row.is-done .m-box {
    border-color: var(--line-strong);
    background: none;
  }

  .js .hero:not(.is-played) .m-row.is-done .m-box path,
  .js .hero:not(.is-played) .plan__room.is-done .plan__tick {
    stroke-dashoffset: 1;
  }

  .js .hero:not(.is-played) .plan__room.is-done rect {
    fill: color-mix(in srgb, var(--surface) 70%, transparent);
  }

  .js .hero:not(.is-played) .m-fill {
    --v: 0 !important;
  }

  .js .hero:not(.is-played) :is([data-pct], [data-count]) {
    visibility: hidden;
  }

  .js .hero:not(.is-played) .slip {
    opacity: 0;
    translate: 0 12px;
  }
}

@media (min-width: 640px) {
  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 960px) {
  .hero {
    padding-top: 0;
  }

  .hero__grid {
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    min-height: min(88vh, 860px);
  }

  .hero__copy {
    grid-column: 1 / span 5;
  }

  .hero__break {
    display: inline;
  }

  .hero__visual {
    grid-column: 6 / span 7;
    height: 680px;
  }

  .plane--back {
    top: 50%;
    left: 8%;
    width: 104%;
    margin-top: -230px;
  }

  .plane--mid {
    top: 30px;
    left: 24%;
  }

  .hero .phone {
    --w: 300px;
  }

  .slip--issue {
    top: 520px;
    left: 6%;
  }

  .slip--report {
    top: 588px;
    right: auto;
    left: 44%;
  }
}

/* ---------- 2. The question ---------- */

.band {
  background: var(--bg-band);
}

.question {
  padding-block: var(--space);
  text-align: center;
}

.question__line {
  max-width: 16ch;
  margin-inline: auto;
  font-size: clamp(2.25rem, 5vw + 1rem, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.question__answer {
  max-width: 46ch;
  margin: 32px auto 0;
  font-size: 1.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .question__line {
      view-timeline: --question block;
    }

    .question__line span {
      animation: ink linear both;
      animation-timeline: --question;
      animation-range: cover calc(30% + var(--i) * 4%) cover
        calc(36% + var(--i) * 4%);
    }
  }
}

@keyframes ink {
  from {
    color: var(--line-strong);
  }
  to {
    color: var(--ink);
  }
}

.js .question__line.is-fallback span {
  color: color-mix(
    in srgb,
    var(--ink) calc(clamp(0, var(--p, 0) * 8 - var(--i), 1) * 100%),
    var(--line-strong)
  );
}

/* ---------- Reveal on enter (main.js adds .is-in) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal:not(.is-in) {
    opacity: 0;
    translate: 0 16px;
  }
}

.reveal.is-in {
  transition:
    opacity 0.6s var(--ease) calc(var(--i, 0) * 60ms),
    translate 0.6s var(--ease) calc(var(--i, 0) * 60ms);
}

/* ---------- 3. How it works ---------- */

.how {
  padding-block: var(--space);
}

.stepper {
  display: grid;
  gap: 72px;
  margin-top: 48px;
}

.stepper__line,
.stepper__frame {
  display: none;
}

.step__text h3 {
  margin-top: 8px;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.step__text p {
  margin-top: 12px;
  color: var(--ink-muted);
}

.step__num {
  display: block;
  color: var(--accent);
  font-family: var(--display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}

.step__screen {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

@media (min-width: 960px) {
  .stepper {
    grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px;
    row-gap: 0;
    margin-top: 24px;
  }

  .step {
    display: contents;
  }

  .step__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    grid-column: 2;
    grid-row: var(--n);
    min-height: 70vh;
  }

  .step__num {
    color: transparent;
    font-size: 5.5rem;
    -webkit-text-stroke: 1.5px var(--line-strong);
    transition:
      color 0.32s var(--ease),
      -webkit-text-stroke-color 0.32s var(--ease);
  }

  .step.is-active .step__num {
    color: var(--accent);
    -webkit-text-stroke-color: var(--accent);
  }

  .stepper__line {
    position: relative;
    display: block;
    grid-column: 1;
    grid-row: 1 / 4;
    justify-self: center;
    width: 2px;
    margin-block: 20vh;
    background: var(--line);
  }

  .stepper__line i {
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleY(var(--fill));
    transform-origin: top;
    transition: transform 0.5s var(--ease);
  }

  .stepper__frame,
  .step__screen {
    position: sticky;
    top: 15vh;
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: start;
    justify-self: center;
    margin-top: 0;
  }

  .stepper__frame {
    display: block;
    width: 300px;
    aspect-ratio: 300 / 610;
    border: 10px solid color-mix(in srgb, var(--ink) 92%, transparent);
    border-radius: 44px;
    background: var(--surface);
    box-shadow: var(--shadow-raised);
  }

  .step__screen .phone {
    --w: 300px;
    border-width: 10px;
    border-color: transparent;
    border-radius: 44px;
    background: transparent;
    box-shadow: none;
  }

  .stepper .step__screen {
    opacity: 0;
    translate: 0 12px;
    transition:
      opacity 0.32s var(--ease),
      translate 0.32s var(--ease);
  }

  .stepper .step.is-active .step__screen {
    opacity: 1;
    translate: 0 0;
  }
}

/* ---------- 4. The report writes itself ---------- */

.peak {
  --p: 1;
  padding-top: var(--space);
}

.peak__intro .lead {
  max-width: 62ch;
}

.peak__stage {
  display: grid;
  gap: 20px;
  max-width: 640px;
  margin-top: 40px;
}

.peak__source {
  display: none;
}

.peak__strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
}

.m-chip-src {
  padding: 0.15em 0.75em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8em;
  font-weight: 700;
}

.peak__arrow {
  flex-basis: 100%;
  height: 36px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report {
  position: relative;
  margin: 0;
  padding: 28px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.report::before {
  content: "";
  position: absolute;
  inset: 10px 14px auto;
  border-top: 1px dashed var(--line-strong);
}

.report__head {
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report__text {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ln {
  --t: clamp(0, (var(--p) - var(--s)) / 0.12, 1);
  opacity: clamp(0, (var(--t) - 0.7) * 3.4, 1);
}

.peak__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 16px;
}

.copy-btn {
  --t: clamp(0, (var(--p) - 0.86) / 0.1, 1);
  position: relative;
  display: inline-grid;
  min-height: 44px;
  padding: 0 22px;
  place-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  font-weight: 700;
}

.copy-btn::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  background: var(--accent);
  opacity: var(--t);
}

.copy-btn > span {
  position: relative;
  display: inline-flex;
  grid-area: 1 / 1;
  align-items: center;
  gap: 6px;
}

.copy-btn__a {
  color: var(--accent-strong);
  opacity: calc(1 - var(--t));
}

.copy-btn__b {
  color: var(--on-accent);
  opacity: var(--t);
}

.copy-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bubble {
  --t: clamp(0, (var(--p) - 0.9) / 0.08, 1);
  max-width: 240px;
  padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.9375rem;
  opacity: var(--t);
  translate: 0 calc((1 - var(--t)) * 12px);
}

.bubble small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

@media (min-width: 960px) {
  .peak__stage {
    margin-inline: auto;
  }
}

/* The pinned, scroll-driven version: desktop, motion allowed, JS running. */
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .js .peak__track {
    height: 220vh;
  }

  .js .peak__stage {
    position: sticky;
    top: var(--header);
    grid-template-columns: minmax(0, 400px) minmax(0, 460px);
    justify-content: space-between;
    align-items: center;
    max-width: none;
    height: calc(100vh - var(--header));
    margin-top: 0;
  }

  .js .peak__strip {
    display: none;
  }

  .js .peak__source {
    --k: clamp(0, var(--p) / 0.08, 1);
    --r: clamp(0, (var(--p) - 0.08) / 0.07, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 15px;
  }

  .js .peak__source > :not(.flow, .peak__finish) {
    opacity: calc(1 - var(--r) * 0.25);
  }

  .js .peak__issues {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .js .peak__finish {
    transform: scale(calc(1 - var(--k) * 0.03 + var(--r) * 0.03));
    opacity: calc(1 - var(--r) * 0.4);
  }

  .js .flow {
    --t: clamp(0, (var(--p) - var(--s)) / 0.12, 1);
    position: relative;
    z-index: 2;
    transform: translate(
        calc(var(--dx, 0px) * var(--t)),
        calc(var(--dy, 0px) * var(--t))
      )
      rotate(calc(var(--t) * (1 - var(--t)) * 24deg))
      scale(calc(1 - var(--t) * 0.35));
    transform-origin: left center;
    opacity: clamp(0, (1 - var(--t)) * 3.3, 1);
  }

  .js .ln {
    display: inline-block;
  }

  .js .peak__result {
    position: relative;
  }

  .js .report__text {
    font-size: 0.875rem;
  }

  .js .peak__done {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- 5. Features ---------- */

.features {
  padding-block: var(--space) 0;
}

.bento {
  display: grid;
  gap: 16px;
  margin-top: 48px;
}

.tile {
  position: relative;
  padding: 20px 20px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-rest);
}

.tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

.tile h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.tile p {
  margin-top: 8px;
  color: var(--ink-muted);
}

.tile.reveal.is-in {
  transition:
    opacity 0.6s var(--ease) calc(var(--i, 0) * 60ms),
    translate 0.6s var(--ease) calc(var(--i, 0) * 60ms),
    transform 0.2s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .tile {
    transition: transform 0.2s var(--ease);
  }

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

  .tile:hover::after {
    opacity: 1;
  }
}

.tile__art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 132px;
  margin-bottom: 20px;
  padding: 16px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg);
  font-size: 0.9375rem;
}

.art-presets .m-chips span {
  font-size: 0.8125rem;
}

.art-presets__tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  list-style: none;
}

.art-presets__tasks li::before {
  content: "✓ ";
  color: var(--accent-strong);
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .art-presets__tasks {
    opacity: 0.45;
    translate: 0 0;
    transition: opacity 0.2s var(--ease);
  }

  .tile:hover .art-presets__tasks {
    opacity: 1;
  }

  .art-presets .m-chips span:first-child {
    transition:
      translate 0.2s var(--ease),
      box-shadow 0.2s var(--ease);
  }

  .tile:hover .art-presets .m-chips span:first-child {
    translate: 0 -2px;
    box-shadow: var(--shadow-raised);
  }
}

.art-skip .m-pill__top {
  font-size: 0.875rem;
}

.art-skip .m-track {
  height: 8px;
}

.art-sev {
  align-items: flex-start;
  gap: 8px;
}

.art-sev .chip {
  font-size: 0.875rem;
}

.art-sev .chip:nth-child(2) {
  margin-left: 14px;
}

.art-sev .chip:nth-child(3) {
  margin-left: 28px;
}

.art-battery {
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
}

.battery {
  position: relative;
  display: flex;
  align-items: center;
  width: 54px;
  height: 26px;
  padding: 3px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
}

.battery::after {
  content: "";
  position: absolute;
  right: -6px;
  width: 4px;
  height: 10px;
  border-radius: 0 2px 2px 0;
  background: var(--line-strong);
}

.battery i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--urgent-ink);
}

.battery small {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  text-align: center;
}

.art-battery .m-row {
  font-size: 0.9375rem;
}

.art-history {
  gap: 0;
  font-size: 0.8125rem;
}

.art-history span {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.art-history span:last-child {
  border-bottom: 0;
}

.art-theme {
  padding: 0;
}

.art-theme__half {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.art-theme__half .m-row {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.9375rem;
}

.art-theme__half--light {
  background: #f6f4ee;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.art-theme__half--light .m-row {
  background: #ffffff;
  color: #55625c;
}

.art-theme__half--light .m-box {
  border-color: #0e7a6b;
  background: #0e7a6b;
}

.art-theme__half--light .m-box path {
  stroke: #ffffff;
}

.art-theme__half--dark {
  background: #0d1311;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.art-theme__half--dark .m-row {
  background: #161e1b;
  color: #9aa9a3;
}

.art-theme__half--dark .m-box {
  border-color: #3cc3ac;
  background: #3cc3ac;
}

.art-theme__half--dark .m-box path {
  stroke: #04201b;
}

.art-private {
  align-items: center;
}

.art-private .shield {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile--4 {
    grid-column: span 2;
  }
}

@media (min-width: 960px) {
  .bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tile--4 {
    grid-column: span 4;
  }

  .tile--2 {
    grid-column: span 2;
  }

  .tile--3 {
    grid-column: span 3;
  }
}

/* ---------- 6. Try it ---------- */

.try {
  padding-block: var(--space);
}

.try__grid {
  display: grid;
  gap: 40px;
}

.try__copy p {
  margin-top: 20px;
}

.try__steps {
  margin: 20px 0 16px;
  padding-left: 1.4em;
  color: var(--ink-muted);
}

.try__live {
  display: none;
}

.try__poster {
  position: relative;
  display: block;
  justify-self: center;
  border-radius: 36px;
  color: inherit;
  text-decoration: none;
}

.try__poster-btn {
  position: absolute;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  box-shadow: var(--shadow-raised);
}

@media (min-width: 960px) {
  .try__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
  }

  .try__copy {
    grid-column: 1 / span 4;
  }

  .try__live {
    display: grid;
    grid-column: 6 / span 7;
    place-items: center;
  }

  .try__live::before {
    content: "";
    grid-area: 1 / 1;
    width: 72%;
    height: 82%;
    border-radius: 48px;
    background: var(--accent-soft);
    translate: 32px 32px;
  }

  .phone--live {
    grid-area: 1 / 1;
    width: auto;
    height: min(800px, 80vh);
    aspect-ratio: 410 / 800;
    font-size: 1rem;
  }

  .phone--live iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
  }

  .try__poster {
    display: none;
  }
}

/* ---------- 7. Good to know ---------- */

.know {
  padding-block: var(--space);
}

.faq {
  display: grid;
  margin: 40px 0 0;
}

.faq > div {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.faq dt {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.faq dd {
  max-width: 52ch;
  margin: 6px 0 0;
}

@media (min-width: 768px) {
  .faq {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 56px;
  }
}

/* ---------- 8. Close ---------- */

.closing {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: var(--space);
  overflow: clip;
  text-align: center;
}

.plan--closing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1100px, 150%);
  opacity: 0.18;
  translate: -50% -50%;
}

.closing__copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.closing__copy p {
  margin: 18px 0 32px;
  color: var(--ink-muted);
  font-size: 1.1875rem;
}

@media (min-width: 960px) {
  .closing {
    min-height: 70vh;
  }
}

/* ---------- 9. Footer ---------- */

.site-footer {
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .site-footer__inner > :last-child {
    margin-left: auto;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
