:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6b6b70;
  --line: #e3e3e8;
  --ink: #16171b;
  --on-ink: #ffffff;
  --evergreen: #163e35;
  --sage: #bccbb6;
  --sage-soft: #f0f3ee;
  --known: #2c7449;
  --known-soft: #e6f2ea;
  --estimated: #8a5500;
  --estimated-soft: #fbf1e6;
  --unknown: #626865;
  --unknown-soft: #f2f2f4;
  --font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, 'Segoe UI',
    Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --rhythm: clamp(72px, 10vw, 140px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #111113;
    --card: #1c1c1e;
    --text: #ffffff;
    --text-2: #a1a1a6;
    --line: #38383a;
    --ink: #f2f3f5;
    --on-ink: #16171b;
    --evergreen: #bccbb6;
    --sage: #3e5a4f;
    --sage-soft: #1b2b25;
    --known: #6fcf8f;
    --known-soft: #183323;
    --estimated: #f0b35a;
    --estimated-soft: #33260f;
    --unknown: #a5aaa7;
    --unknown-soft: #2c2c2e;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--sage);
  color: var(--text);
}

a {
  color: var(--evergreen);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--evergreen);
  outline-offset: 3px;
  border-radius: 6px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* Header and footer */

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

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

.brand img {
  width: 96px;
  height: auto;
}

header.site nav a,
footer.site nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  margin-left: 24px;
}

header.site nav {
  white-space: nowrap;
}

@media (max-width: 420px) {
  header.site nav a[href='#remembers'] {
    display: none;
  }
}

header.site nav a:hover,
footer.site nav a:hover,
header.site nav a[aria-current='page'] {
  color: var(--text);
}

footer.site {
  border-top: 1px solid var(--line);
  margin-top: var(--rhythm);
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 40px;
  color: var(--text-2);
  font-size: 15px;
}

footer.site p {
  margin: 0;
}

footer.site nav a:first-child {
  margin-left: 0;
}

/* The one action */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 23, 27, 0.18);
}

.button:active {
  transform: translateY(0);
}

/* Until the App Store link exists: the same pill, plainly not a control. */
.button--soon {
  margin: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 500;
  cursor: default;
}

.button--soon:hover {
  transform: none;
  box-shadow: none;
}

/* Home: the plinth */

.home header.site {
  background: var(--surface);
}

.plinth {
  background: var(--surface);
  padding: 8px var(--gutter) clamp(56px, 7vw, 88px);
  text-align: center;
}

.stage {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
}

.render img {
  width: min(560px, 74%);
  margin: 0 auto;
}

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag {
  position: absolute;
  text-align: left;
  animation: settle 900ms var(--ease) both;
}

.tag a {
  display: grid;
  gap: 1px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px 11px;
  font-size: 14px;
  line-height: 1.35;
  box-shadow:
    0 8px 24px rgba(22, 23, 27, 0.07),
    0 1px 2px rgba(22, 23, 27, 0.05);
  transition:
    box-shadow 200ms var(--ease),
    transform 200ms var(--ease);
}

.tag a:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px rgba(22, 23, 27, 0.12),
    0 1px 2px rgba(22, 23, 27, 0.05);
}

.tag b {
  font-size: 15px;
}

.tag span:not(.pin) {
  color: var(--text-2);
}

.tag em {
  font-style: normal;
  color: var(--evergreen);
  font-size: 13px;
  font-weight: 600;
}

.pin {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--evergreen);
  box-shadow: 0 0 0 4px var(--bg);
}

/* Each tag sits beside the appliance it names; the pin marks the appliance. */
.tag--fridge {
  left: 0;
  top: 30%;
  animation-delay: 150ms;
}
.tag--fridge .pin {
  right: -36px;
  top: 30px;
}
.tag--ac {
  right: 0;
  top: 14%;
  animation-delay: 300ms;
}
.tag--ac .pin {
  left: -118px;
  top: 40px;
}
.tag--washer {
  right: 4%;
  top: 60%;
  animation-delay: 450ms;
}
.tag--washer .pin {
  left: -150px;
  top: -4px;
}

.example {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

/* The records are always visible; they only settle onto their pins. */
@keyframes settle {
  from {
    transform: translateY(8px) scale(0.98);
    box-shadow: 0 0 0 rgba(22, 23, 27, 0);
  }
  to {
    transform: none;
  }
}

.hero-words h1 {
  margin-top: clamp(18px, 3vw, 32px);
  font-size: clamp(42px, 6.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero-words p {
  margin: 14px auto 28px;
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--text-2);
}

/* Chapters: each opens on one real screen */

.chapter {
  padding: var(--rhythm) 0 0;
}

.chapter--quiet {
  background: var(--surface);
  padding-bottom: var(--rhythm);
  margin-top: var(--rhythm);
}

.chapter--quiet + .chapter {
  padding-top: var(--rhythm);
}

.chapter-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}

.chapter-grid--flip .phone {
  order: 2;
}

.phone {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 320px);
  padding: 10px;
  border-radius: 48px;
  background: #16171b;
  outline: 1px solid var(--line);
  outline-offset: -1px;
  box-shadow:
    0 30px 60px rgba(22, 23, 27, 0.16),
    0 4px 10px rgba(22, 23, 27, 0.08);
}

.phone img {
  border-radius: 38px;
  background: var(--card);
}

/* The record that led here, pinned to the row of the screen it comes from. */
.echo {
  position: absolute;
  z-index: 1;
  margin: 0;
  display: grid;
  gap: 1px;
  width: max-content;
  max-width: 230px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px 11px;
  font-size: 14px;
  line-height: 1.35;
  box-shadow:
    0 12px 28px rgba(22, 23, 27, 0.12),
    0 1px 2px rgba(22, 23, 27, 0.05);
}

.echo b {
  font-size: 15px;
}

.echo em {
  font-style: normal;
  color: var(--evergreen);
  font-size: 13px;
  font-weight: 600;
}

/* The card sits just under the phone, never over the screen. */
.echo {
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
}

.chapter .phone {
  margin-bottom: 26px;
}

/* A dot on the exact row of the screen the record refers to. */
.spot {
  position: absolute;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--evergreen);
  box-shadow:
    0 0 0 3px #ffffff,
    0 2px 6px rgba(22, 23, 27, 0.25);
}

.spot--warranty {
  left: 92%;
  top: 33.5%;
}

.spot--next {
  left: 5%;
  top: 52.4%;
}

.chapter {
  overflow-x: clip;
}

.chapter-words h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.chapter-words > p {
  max-width: 54ch;
  font-size: 19px;
  color: var(--text-2);
  margin: 20px 0 0;
}

.chapter-words .aside {
  font-size: 16px;
  color: var(--text);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  max-width: 48ch;
}

.facts {
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
  max-width: 520px;
}

.facts div {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.facts dt {
  color: var(--text-2);
}

.facts dd {
  margin: 0;
}

.sum {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  margin: 28px 0 36px;
  font-size: clamp(20px, 2vw, 26px);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.sum span:first-child,
.sum strong {
  color: var(--evergreen);
  font-weight: 700;
}

.chapter-words h3 {
  font-size: 20px;
}

.certainty {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
  font-size: 16px;
}

.certainty li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.mark {
  flex: none;
  min-width: 6.5em;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
}

.mark--known {
  background: var(--known-soft);
  color: var(--known);
}
.mark--estimated {
  background: var(--estimated-soft);
  color: var(--estimated);
}
.mark--unknown {
  background: var(--unknown-soft);
  color: var(--unknown);
}

/* Plans */

.plans {
  padding-top: var(--rhythm);
}

.plans h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.08;
  max-width: 18ch;
}

.plan-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 40px;
  border-top: 2px solid var(--text);
}

.plan {
  padding: 28px 32px 8px 0;
}

.plan + .plan {
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

.plan h3 {
  font-size: 22px;
}

.plan--plus h3 {
  color: var(--evergreen);
}

.plan ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--text-2);
}

.plan li {
  padding-left: 22px;
  position: relative;
}

.plan li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

.plan--plus li::before {
  background: var(--evergreen);
}

.price-note {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 18px;
}

/* Close */

.close {
  padding-top: var(--rhythm);
  text-align: center;
}

.close h2 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.close p {
  color: var(--text-2);
  font-size: 19px;
  margin: 14px 0 28px;
}

/* Reading pages: privacy, terms, support */

main > .wrap {
  max-width: 760px;
  padding-top: clamp(32px, 6vw, 72px);
}

main > .wrap h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

main > .wrap h2 {
  font-size: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

main > .wrap h3 {
  font-size: 19px;
  margin-top: 28px;
}

main > .wrap p,
main > .wrap li {
  max-width: 68ch;
}

main > .wrap .meta {
  color: var(--text-2);
  font-size: 15px;
  margin-top: 12px;
}

main > .wrap .lead {
  font-size: 20px;
  line-height: 1.5;
  margin-top: 28px;
}

main > .wrap .note {
  background: var(--sage-soft);
  border-radius: 14px;
  padding: 16px 20px;
}

main > .wrap ul,
main > .wrap ol {
  padding-left: 1.2em;
}

main > .wrap li + li {
  margin-top: 6px;
}

/* Small screens: the records stay pinned to the render as compact chips */

@media (max-width: 760px) {
  header.site nav a {
    margin-left: 16px;
    font-size: 14px;
  }

  .render img {
    width: min(420px, 92%);
  }

  .tag a {
    padding: 6px 10px 7px;
    border-radius: 12px;
  }

  .tag b {
    font-size: 13px;
  }

  .tag span:not(.pin) {
    display: none;
  }

  .tag em {
    font-size: 12px;
  }

  .chapter .phone {
    margin-bottom: 76px;
  }

  .tag--fridge {
    left: 0;
    top: 60%;
  }
  .tag--fridge .pin {
    right: auto;
    left: 46px;
    top: -16px;
  }
  .tag--ac {
    right: 0;
    top: 0;
  }
  .tag--ac .pin {
    left: 34px;
    top: auto;
    bottom: -16px;
  }
  .tag--washer {
    right: 0;
    top: 72%;
  }
  .tag--washer .pin {
    left: -16px;
    top: 12px;
  }

  /* On a phone the card hangs fully below the frame, never over the screen. */
  .echo {
    top: calc(100% + 12px);
    bottom: auto;
    max-width: none;
    white-space: nowrap;
    padding: 7px 11px 8px;
    font-size: 13px;
  }

  .echo b {
    font-size: 13px;
  }

  .echo em {
    font-size: 12px;
  }

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

  .chapter-grid--flip .phone {
    order: 0;
  }

  .phone {
    width: min(82%, 300px);
  }

  .plan-pair {
    grid-template-columns: 1fr;
  }

  .plan,
  .plan + .plan {
    padding: 24px 0 8px;
    border-left: 0;
  }

  .plan + .plan {
    border-top: 1px solid var(--line);
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tag {
    animation: none;
  }
  .button,
  .tag a {
    transition: none;
  }
}
