:root {
  --bg: #fdf3d2;
  --surface: #fffaf0;
  --ink: #1f1a24;
  --muted: #6b5f58;
  --line: #ecd9a2;
  --accent: #2f8f6b;
  --accent-ink: #ffffff;
  --tile: #d9f1e4;
  --code-bg: #1f1a24;
  --code-ink: #f4efe6;
  --radius: 16px;
  --heading: ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151c;
    --surface: #211e29;
    --ink: #f1eef5;
    --muted: #a8a2b4;
    --line: #322e3c;
    --accent: #6fd3a5;
    --accent-ink: #12281f;
    --tile: #1f3a30;
    --code-bg: #0f0e13;
    --code-ink: #e9e4f0;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--heading);
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-size: clamp(26px, 4vw, 34px);
}

h3 {
  font-size: 19px;
}

p {
  margin: 0;
}

main > section,
.top,
footer {
  width: min(960px, 100% - 32px);
  margin-inline: auto;
}

main > section {
  padding-block: clamp(36px, 7vw, 72px);
}

/* header */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  image-rendering: pixelated;
  border-radius: 6px;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 15px;
}

.top nav a {
  text-decoration: none;
  color: var(--muted);
}
.top nav a:hover {
  color: var(--ink);
}

/* hero */
.hero {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
  }
}

h1 {
  font-size: clamp(38px, 7vw, 60px);
  letter-spacing: -0.01em;
}

.lede {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  max-width: 34em;
  font-size: 17px;
  color: var(--muted);
}

.lede-main {
  font-size: 21px;
  color: var(--ink);
}

.lede-main em {
  font-family: var(--heading);
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

.beats {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.beat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.beat canvas {
  padding: 4px;
  background: var(--tile);
  border-radius: 14px;
}

.beat .speech {
  max-width: none;
  flex: none;
  font-size: 16px;
}

.beat .speech::before {
  left: -9px;
  top: 50%;
  margin-top: -6px;
  transform: rotate(45deg);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.button.primary:hover {
  filter: brightness(1.07);
}

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

/* stage */
.stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 16px 22px;
  background: var(--tile);
  border-radius: calc(var(--radius) * 1.5);
}

canvas {
  display: block;
  image-rendering: pixelated;
}

.stage-pet {
  display: grid;
  place-items: center;
  min-height: 256px;
}

.caption {
  font-family: var(--heading);
  font-weight: 700;
}

.switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.switcher button {
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.switcher button:hover {
  border-color: var(--line);
}
.switcher button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-ink);
}

/* sections */
.sub {
  margin-top: 8px;
  color: var(--muted);
}

.how h2,
.features h2,
.moods h2,
.privacy h2,
.install h2 {
  margin-bottom: 4px;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

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

.steps > li {
  position: relative;
  padding: 18px 18px 18px 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--tile);
  color: var(--ink);
  font-family: var(--heading);
  font-weight: 700;
}

.steps h3 {
  margin-bottom: 6px;
}

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

.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.mood-grid li {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mood-grid canvas {
  padding: 8px;
  background: var(--tile);
  border-radius: 12px;
}

.mood-grid p {
  color: var(--muted);
  font-size: 15px;
}

.checks {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 30px;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.5em;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
}

code {
  padding: 1px 6px;
  background: var(--tile);
  border-radius: 6px;
  font: 0.9em ui-monospace, 'SF Mono', Menlo, monospace;
}

pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.compact > li {
  padding-left: 64px;
}

footer {
  display: grid;
  gap: 4px;
  padding-block: 40px 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

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

.group {
  margin: 36px 0 0;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.feature-grid li {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feature-grid h3 {
  font-size: 17px;
}

.feature-grid p {
  color: var(--muted);
  font-size: 15px;
}

.feature-grid.soon li {
  background: none;
  border-style: dashed;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  vertical-align: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--tile);
  border-radius: 999px;
}

.nudge-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 24px;
  background: var(--tile);
  border-radius: var(--radius);
}

.nudge-demo canvas {
  flex: none;
  image-rendering: pixelated;
}

.speech {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
  padding: 12px 16px;
  color: #1f1a24;
  background: #fffdf7;
  border: 2px solid #1f1a24;
  border-radius: 8px;
  box-shadow: 4px 4px 0 #1f1a24;
}

.speech::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background: #fffdf7;
  border: solid #1f1a24;
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
}

@media (max-width: 560px) {
  .speech::before {
    left: 24px;
    top: -8px;
    margin-top: 0;
    transform: rotate(135deg);
  }
}

.doc {
  max-width: 68ch;
}

.doc > * + * {
  margin-top: 16px;
}

.doc h2 {
  margin-top: 36px;
  font-size: 24px;
}

.doc h1 {
  font-size: clamp(32px, 6vw, 44px);
}
