/* Pantry & Plate launch site. Tokens from docs/site/BRIEF.md, extending the app's docs/DESIGN.md. */

:root {
  color-scheme: light dark;

  --paper: #f8f4ec;
  --sheet: #fffdf8;
  --sheet-sunken: #f1ebdf;
  --rule: #ddd3c1;
  --rule-strong: #b9ac95;
  --ink: #2b2620;
  --ink-muted: #6b6253;
  --herb: #3f7a3a;
  --herb-hover: #336530;
  --herb-soft: #e2eedb;
  --on-herb: #ffffff;
  --tomato: #c0392b;
  --tomato-soft: #f9e1dc;
  --butter: #f3e3b3;
  --focus: #2f6db5;
  --shadow-sheet: 0 1px 1px rgb(60 45 25 / 0.06), 0 6px 16px -6px rgb(60 45 25 / 0.14);
  --shadow-lift: 0 2px 4px rgb(60 45 25 / 0.08), 0 22px 44px -18px rgb(60 45 25 / 0.28);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Figtree", "Seravek", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-pad: clamp(4.5rem, 3rem + 6vw, 9rem);
  --radius: 16px;
  --margin-x: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1c18;
    --sheet: #29251f;
    --sheet-sunken: #191713;
    --rule: #3d372e;
    --rule-strong: #5b5244;
    --ink: #f1ebe0;
    --ink-muted: #b5ab9a;
    --herb: #8cc47f;
    --herb-hover: #a2d396;
    --herb-soft: #2f3b29;
    --on-herb: #16210f;
    --tomato: #f0806f;
    --tomato-soft: #45251f;
    --butter: #5a4f33;
    --focus: #8ab8f0;
    --shadow-sheet: 0 1px 1px rgb(0 0 0 / 0.3), 0 8px 18px -6px rgb(0 0 0 / 0.5);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 24px 48px -16px rgb(0 0 0 / 0.65);

    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  }
}

/* ---------- Base ---------- */

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

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

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

@media (min-width: 720px) {
  body {
    font-size: 1.0625rem;
  }
}

h1,
h2,
h3,
.wordmark,
.list-title,
.sheet-title,
.step-num,
.annot,
.margin-note,
.envelope,
.how-close-line,
.merge,
.note {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings:
    "SOFT" 50,
    "WONK" 0;
}

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

h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.15;
}

p {
  margin: 0;
}

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

a {
  color: var(--herb);
}

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

main:focus {
  outline: none;
}

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

.wrap {
  width: 100%;
  max-width: calc(72rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  padding-block: var(--section-pad);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 44px;
  padding: 0.6rem 1.35rem;
  border: 0;
  border-radius: 12px;
  background: var(--herb);
  color: var(--on-herb);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.08);
  transition: transform 120ms var(--ease);
}

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

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

.btn-small {
  min-height: 44px;
  padding: 0.45rem 1rem;
  font-size: 0.9375rem;
}

.btn-large {
  min-height: 56px;
  padding: 0.75rem 1.75rem;
  font-size: 1.0625rem;
}

.btn-quiet {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

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

.text-link,
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.25rem;
  border-radius: 6px;
  color: var(--herb);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: transform 120ms var(--ease);
}

.text-link:hover,
.nav-link:hover {
  color: var(--herb-hover);
  text-decoration-thickness: 2px;
}

.text-link:active,
.nav-link:active,
.brand:active {
  transform: scale(0.97);
}

.nav-link {
  color: var(--ink);
  font-weight: 500;
  text-decoration-color: transparent;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration-color: var(--herb);
}

.arrow {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Logo ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 120ms var(--ease);
}

a.brand:hover .wordmark {
  color: var(--herb);
}

.wordmark {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo {
  flex: none;
}

.logo-plate {
  fill: var(--herb-soft);
}

.logo-rim {
  fill: none;
  stroke: var(--herb);
  stroke-width: 1.5;
  opacity: 0.45;
}

.logo-leaf,
.logo-rib {
  stroke: var(--herb);
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.logo-leaf {
  fill: var(--sheet);
}

.logo-rib {
  fill: none;
}

/* ---------- Paper material ---------- */

.sheet {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sheet);
}

.margin-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--margin-x);
  width: 1px;
  background: var(--tomato);
  opacity: 0.7;
  pointer-events: none;
}

.tape {
  position: absolute;
  width: 64px;
  height: 22px;
  background: var(--butter);
  opacity: 0.85;
  clip-path: polygon(
    0 6%,
    4% 0,
    96% 4%,
    100% 0,
    98% 30%,
    100% 58%,
    97% 100%,
    3% 96%,
    0 100%,
    2% 68%,
    0 38%
  );
  z-index: 2;
}

.eyebrow {
  display: block;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.list-title,
.sheet-title {
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: var(--herb-soft);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

/* A list sheet: ruled rows, the margin line, amounts in tabular figures. */
.list-sheet {
  padding: 1.1rem 1.25rem 1.25rem calc(var(--margin-x) + 0.9rem);
}

.list-sheet .eyebrow {
  margin-top: 1rem;
  margin-bottom: 0.15rem;
}

.rows {
  font-variant-numeric: tabular-nums;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 1rem;
  padding-block: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

.rows .row:last-child {
  border-bottom: 0;
}

.row .name {
  overflow-wrap: anywhere;
}

.row .amt {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.row .note {
  grid-column: 1 / -1;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  font-style: italic;
}

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

.merge,
.margin-note {
  margin-left: 0.35rem;
  color: var(--ink-muted);
  font-style: italic;
  font-weight: 400;
}

/* Strikes on corrected and subtracted amounts are drawn, so they can grow. */
s {
  position: relative;
  text-decoration: none;
  color: var(--ink-muted);
}

s::after {
  content: "";
  position: absolute;
  left: -0.1em;
  right: -0.1em;
  top: 55%;
  height: 2px;
  border-radius: 1px;
  background: var(--tomato);
  transform-origin: left center;
  transition: transform 300ms var(--ease);
}

.fig-final s {
  margin-right: 0.35rem;
}

/* ---------- 1. Header ---------- */

.site-header {
  position: relative;
  z-index: 20;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transition: opacity 200ms var(--ease);
  pointer-events: none;
}

.header-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

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

.header-nav .nav-link {
  display: none;
}

.wide-only {
  display: none;
}

@media (min-width: 720px) {
  .header-nav .nav-link {
    display: inline-flex;
  }
  .wide-only {
    display: inline;
  }
  .narrow-only {
    display: none;
  }
}

@media (min-width: 960px) {
  .site-header {
    position: sticky;
    top: 0;
  }
  .site-header.is-scrolled::before {
    opacity: 1;
  }
}

/* ---------- 2. Hero ---------- */

.hero {
  padding-block: clamp(2rem, 1rem + 4vw, 4rem) var(--section-pad);
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.kicker::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--herb);
}

.hero h1 {
  font-size: clamp(2.6rem, 1.4rem + 5.2vw, 5.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.hero h1 .wide {
  display: none;
}

.nowrap {
  white-space: nowrap;
}

.hero-sub {
  max-width: 34ch;
  margin-top: 1.5rem;
  font-size: 1.2rem;
  line-height: 1.55;
}

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

.fine {
  margin-top: 1rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

@media (min-width: 720px) {
  .hero h1 .wide {
    display: inline;
  }
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
    min-height: min(92svh, 860px);
  }
  .hero-copy {
    grid-column: 1 / 7;
  }
  .hero-art {
    grid-column: 7 / 13;
  }
}

/* The composition: three planes, sized in container units so it scales as one picture. */
.hero-art {
  position: relative;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  aspect-ratio: 100 / 108;
  container-type: inline-size;
}

.plane {
  position: absolute;
  inset: 0;
}

.plane-week {
  z-index: 1;
}
.plane-list {
  z-index: 2;
}
.plane-notes {
  z-index: 3;
  pointer-events: none;
}

.week-sheet {
  position: absolute;
  left: 1cqi;
  top: 4cqi;
  width: 86cqi;
  padding: 3cqi 3cqi 3.5cqi;
  border-radius: 2.6cqi;
  transform: rotate(-2.5deg);
}

.week-sheet .sheet-title {
  margin-bottom: 1.6cqi;
  font-size: 3.6cqi;
}

.hero .tape {
  width: 12cqi;
  height: 4.1cqi;
}

.tape-a {
  top: -1.6cqi;
  left: -3cqi;
  transform: rotate(-4deg);
}

.tape-b {
  top: -2cqi;
  right: 9cqi;
  transform: rotate(3deg);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.9cqi;
}

.wk-d {
  color: var(--ink-muted);
  font-size: 2.3cqi;
  font-weight: 600;
  text-align: center;
}

.wk-c {
  display: flex;
  min-height: 12.5cqi;
  border: 1px dashed var(--rule);
  border-radius: 1.2cqi;
}

.wk-c:has(.chip) {
  border-color: transparent;
}

.week .chip {
  flex: 1;
  padding: 0.9cqi;
  border-radius: 1.2cqi;
  font-size: 2.05cqi;
  line-height: 1.2;
  hyphens: auto;
  overflow-wrap: break-word;
}

.hero-list {
  position: absolute;
  left: 40cqi;
  top: 45cqi;
  width: 58cqi;
  padding: 3.2cqi 3.6cqi 3.6cqi 8.4cqi;
  border-radius: 2.6cqi;
  font-size: 2.65cqi;
  box-shadow: var(--shadow-lift);
  transform: rotate(1.5deg);
  --margin-x: 5.2cqi;
}

.hero-list .list-title {
  font-size: 4.4cqi;
}

.hero-list .eyebrow {
  margin-top: 2.2cqi;
  margin-bottom: 0.2cqi;
  font-size: 2.2cqi;
}

.hero-list .row {
  grid-template-columns: auto 1fr auto;
  column-gap: 1.6cqi;
  padding-block: 0.9cqi;
}

.hero-list .row .note {
  grid-column: 2 / -1;
  font-size: 2.4cqi;
}

.box {
  display: inline-grid;
  place-items: center;
  width: 2.9cqi;
  height: 2.9cqi;
  align-self: center;
  border: 1.5px solid var(--rule-strong);
  border-radius: 0.7cqi;
}

.box svg {
  width: 100%;
  height: 100%;
}

.row-done .box {
  background: var(--herb);
  border-color: var(--herb);
}

.tick {
  fill: none;
  stroke: var(--on-herb);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14;
  stroke-dashoffset: 0;
}

.row-done .name {
  position: relative;
  justify-self: start;
  color: var(--herb);
}

.row-done .name::after {
  content: "";
  position: absolute;
  left: -0.1em;
  right: -0.1em;
  top: 55%;
  height: 0.12em;
  min-height: 1px;
  background: var(--herb);
  transform-origin: left center;
}

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

.annot {
  position: absolute;
  color: var(--ink-muted);
  font-size: 3.3cqi;
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
}

.annot-a {
  left: 3cqi;
  top: 72cqi;
}

.annot-b {
  left: 3cqi;
  top: 90cqi;
  width: 30cqi;
}

.annot-arrow {
  position: absolute;
  overflow: visible;
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.annot-arrow path {
  vector-effect: non-scaling-stroke;
}

.arrow-a {
  left: 6cqi;
  top: 59cqi;
  width: 9cqi;
  height: 12cqi;
}

.arrow-b {
  left: 20cqi;
  top: 58cqi;
  width: 27cqi;
  height: 30cqi;
}

/* On a phone the picture shows Monday to Thursday, which hold all four meals, at legible sizes. */
@media (max-width: 719.98px) {
  /* Taller than the review's 100 / 132: the list starts below the meal rows so it hides no meal. */
  .hero-art {
    aspect-ratio: 100 / 154;
  }
  .week-sheet .sheet-title {
    font-size: 5cqi;
  }
  .week-sheet .week {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .week-sheet .week > :nth-child(7n + 5),
  .week-sheet .week > :nth-child(7n + 6),
  .week-sheet .week > :nth-child(7n + 7) {
    display: none;
  }
  .week .chip {
    font-size: 3.6cqi;
  }
  .wk-d {
    font-size: 3.6cqi;
  }
  .hero-list {
    left: 24cqi;
    top: 64cqi;
    width: 74cqi;
    font-size: 4cqi;
  }
  .hero-list .list-title {
    font-size: 6cqi;
  }
  .hero-list .eyebrow {
    font-size: 3.5cqi;
  }
  .hero-list .row .note {
    font-size: 3.6cqi;
  }
  .box {
    width: 4.2cqi;
    height: 4.2cqi;
  }
  .annot {
    font-size: 4.2cqi;
  }
  .annot-a {
    left: 1.5cqi;
    top: 85cqi;
  }
  .annot-b {
    left: 1.5cqi;
    top: 110cqi;
    width: 22cqi;
  }
  .arrow-a {
    left: 6.6cqi;
    top: 65.5cqi;
    width: 14cqi;
    height: 19cqi;
  }
  .arrow-b {
    left: 5.5cqi;
    top: 81cqi;
    width: 27cqi;
    height: 31cqi;
  }
}

/* ---------- 3. The problem ---------- */

.problem-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.problem-copy {
  max-width: 38rem;
}

.problem-copy p {
  margin-top: 1.25rem;
  font-size: 1.125rem;
}

.envelope {
  justify-self: start;
  max-width: 26rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--sheet-sunken);
  color: var(--ink);
  font-size: 1.25rem;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  line-height: 1.9;
  transform: rotate(1deg);
}

.envelope s {
  color: var(--ink-muted);
}

.envelope p:nth-child(2) s::after {
  transition-delay: 500ms;
}
.envelope p:nth-child(3) s::after {
  transition-delay: 1000ms;
}

.motion .envelope:not(.in-view) s::after {
  transform: scaleX(0);
}

@media (min-width: 960px) {
  .problem-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
  }
  .problem-copy {
    grid-column: 2 / 8;
  }
  .envelope {
    grid-column: 8 / 13;
    justify-self: center;
  }
}

/* ---------- 4. How the list is made ---------- */

.how-intro {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: 1.125rem;
}

.how-grid {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.steps {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
}

.step {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.step-num {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--herb);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
}

.step h3 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.step-text p {
  max-width: 34rem;
  margin-top: 0.75rem;
}

.fig {
  max-width: 30rem;
}

.fig-plan {
  padding: 1.1rem 1.25rem 1.25rem;
}

.plan-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.plan-rows li:last-child {
  border-bottom: 0;
}

.fig-scale .list-title,
.fig-merge .list-title,
.fig-final .list-title {
  margin-bottom: 0.5rem;
}

.fig-merge,
.fig-final {
  display: grid;
  gap: 1rem;
}

.inset {
  justify-self: start;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.pantry-card {
  justify-self: end;
  width: min(100%, 15rem);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  transform: rotate(1.5deg);
}

.pantry-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  color: var(--herb);
  font-weight: 600;
}

.pantry-rows {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.pantry-rows li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.2rem;
}

.pantry-rows .amt {
  color: var(--ink-muted);
}

.held-sheet {
  padding: 0.75rem 1.25rem 0.9rem;
  border-radius: var(--radius);
  background: var(--sheet-sunken);
}

.held-sheet .eyebrow {
  margin-bottom: 0.15rem;
}

.how-close {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  text-align: right;
}

.how-close-line {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.6rem);
  font-style: italic;
}

/* Without the live stage (no JS, reduced motion, below 960 px): each step shows its own figure. */
@media (min-width: 960px) {
  .how:not(.how--live) .step {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
  }
  .how:not(.how--live) .step-text {
    grid-column: 1 / 6;
  }
  .how:not(.how--live) .fig {
    grid-column: 7 / 13;
    width: 100%;
  }
}

/* The live stage: sticky, one sheet, state keyed off [data-step]. */
.stage-col {
  display: none;
}

.how--live .how-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 2rem;
}

.how--live .steps {
  grid-column: 1 / 6;
  gap: 0;
}

.how--live .stage-col {
  display: block;
  grid-column: 6 / 13;
}

.how--live .fig {
  display: none;
}

.how--live .step {
  display: flex;
  align-items: center;
  min-height: 70vh;
  opacity: 0.55;
  color: var(--ink-muted);
  transition: opacity 420ms var(--ease);
}

.how--live .step-num {
  color: var(--herb);
}

.how--live .step.is-active {
  opacity: 1;
  color: var(--ink);
}

.stage {
  position: sticky;
  top: 12vh;
  height: 76vh;
  min-height: 34rem;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr;
}

.st-inset,
.st-pantry {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: end;
  z-index: 3;
  margin-bottom: -2.5rem;
  margin-right: 1rem;
  opacity: 0;
  transform: translateX(1.5rem) rotate(2deg);
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

.st-inset {
  margin-bottom: -1.5rem;
}

.stage[data-step="3"] .st-inset,
.stage[data-step="4"] .st-pantry {
  opacity: 1;
  transform: rotate(1.5deg);
}

.st-sheet {
  grid-area: 2 / 1;
  align-self: start;
  display: grid;
  box-shadow: var(--shadow-lift);
  font-size: 0.875rem;
}

.layer {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

.stage[data-step="1"] .layer-plan,
.stage[data-step="2"] .layer-scale,
.stage[data-step="3"] .layer-list,
.stage[data-step="4"] .layer-list {
  opacity: 1;
  transform: none;
}

.st-sheet .list-title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.week-stage {
  gap: 0.4rem;
}

.week-stage .wk-d {
  font-size: 0.875rem;
}

.week-stage .wk-c {
  min-height: 5.5rem;
  border-radius: 8px;
}

.week-stage .chip {
  padding: 0.35rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(-0.5rem) scale(0.96);
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
  transition-delay: calc(var(--i) * 160ms + 150ms);
}

.stage[data-step="1"] .week-stage .chip {
  opacity: 1;
  transform: none;
}

.layer-scale .list-title .chip {
  font-size: 1rem;
}

.layer-scale .row {
  padding-block: 0.5rem;
}

.swap {
  display: inline-grid;
  justify-items: end;
}

.layer-scale .swap > * {
  grid-area: 1 / 1;
  transition: opacity 420ms var(--ease);
}

.layer-scale .to {
  opacity: 0;
}

.stage[data-step="2"] .layer-scale .from {
  opacity: 0;
  transition-delay: 450ms;
}

.stage[data-step="2"] .layer-scale .to {
  opacity: 1;
  transition-delay: 450ms;
}

.layer-scale .margin-note {
  opacity: 0;
  transition: opacity 420ms var(--ease) 700ms;
}

.stage[data-step="2"] .layer-scale .margin-note {
  opacity: 1;
}

/* Steps 3 and 4 share one grid of rows; order and column change, and main.js plays the move (FLIP). */
.st-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
  /* One track height for every row and label, so the two columns never stretch each other. */
  grid-auto-rows: 1.95rem;
  column-gap: 1.75rem;
  font-variant-numeric: tabular-nums;
}

.st-row {
  grid-column: 1;
  order: var(--o3);
  align-content: center;
  padding-block: 0;
  transition: transform 420ms var(--ease);
}

.stage[data-step="4"] .st-row:has(.note) {
  grid-row-end: span 2;
}

.st-eb {
  display: none;
  order: var(--o4);
  grid-column: var(--c4);
  align-self: end;
  padding-bottom: 0.1rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage[data-step="4"] .st-eb {
  display: block;
  animation: fade-in 420ms var(--ease) 200ms both;
}

.stage[data-step="4"] .st-row {
  grid-column: var(--c4);
  order: var(--o4);
}

.st-row .to,
.st-row .note {
  display: none;
}

.st-row .swap {
  display: inline-flex;
  gap: 0.35rem;
}

.st-row .was {
  color: inherit;
}

.st-row .was::after {
  transform: scaleX(0);
}

.stage[data-step="4"] .st-row .was {
  color: var(--ink-muted);
}

.stage[data-step="4"] .st-row .was::after {
  transform: none;
  transition-delay: 300ms;
}

.stage[data-step="4"] .st-row .to,
.stage[data-step="4"] .st-row .note {
  display: inline;
  animation: fade-in 420ms var(--ease) 500ms both;
}

.stage[data-step="4"] .st-row .note {
  display: block;
}

.st-row .merge {
  display: inline-block;
  animation: slide-in 420ms var(--ease) 250ms both;
}

.stage:not([data-step="3"]) .st-row .merge {
  display: none;
}

.stage[data-step="4"] .st-held,
.stage[data-step="4"] .st-eb-held {
  margin-inline: -0.5rem;
  padding-inline: 0.5rem;
  background: var(--sheet-sunken);
}

.stage[data-step="4"] .st-eb-held {
  margin-top: 0.6rem;
  border-radius: 10px 10px 0 0;
}

.stage[data-step="4"] .st-held:last-child {
  border-bottom: 0;
  border-radius: 0 0 10px 10px;
}

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

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(0.75rem);
  }
}

/* ---------- 5. What it does for you ---------- */

.features h2 {
  text-align: center;
}

.feature-sheet {
  max-width: 64rem;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding: 0.5rem 1.5rem;
  display: grid;
}

.feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-block: 1.25rem;
  border-top: 1px solid var(--rule);
  transition:
    opacity 420ms var(--ease),
    transform 420ms var(--ease);
}

.feature:first-child {
  border-top: 0;
}

.disc {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--herb-soft);
  color: var(--herb);
}

.feature h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

.feature p {
  margin-top: 0.25rem;
  color: var(--ink-muted);
}

.feature:nth-child(2) {
  transition-delay: 50ms;
}
.feature:nth-child(3) {
  transition-delay: 100ms;
}
.feature:nth-child(4) {
  transition-delay: 150ms;
}
.feature:nth-child(5) {
  transition-delay: 200ms;
}
.feature:nth-child(6) {
  transition-delay: 250ms;
}
.feature:nth-child(7) {
  transition-delay: 300ms;
}
.feature:nth-child(8) {
  transition-delay: 350ms;
}

.motion .feature-sheet:not(.in-view) .feature {
  opacity: 0;
  transform: translateY(8px);
}

@media (min-width: 720px) {
  .feature-sheet {
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    padding-inline: 2rem;
  }
  .feature:nth-child(2) {
    border-top: 0;
  }
}

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

.try-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.try-copy p {
  margin-top: 1.25rem;
}

.try-copy .small {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.try-copy .btn {
  margin-top: 1.75rem;
}

.embed {
  display: grid;
  gap: 0.75rem;
  transition:
    opacity 600ms var(--ease),
    transform 600ms var(--ease);
}

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

.frame {
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--sheet);
  box-shadow: var(--shadow-lift);
}

.frame-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 10px;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.frame-strip span:last-child {
  margin-left: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule-strong);
}

.frame-body {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
}

.frame-body iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
}

.embed-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}

.embed-cover[hidden],
.embed-done[hidden] {
  display: none;
}

.embed-done {
  justify-self: end;
}

@media (min-width: 720px) {
  .frame-body iframe {
    height: 680px;
  }
}

@media (min-width: 960px) {
  .try-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
  }
  .embed {
    grid-column: 1 / 9;
    grid-row: 1;
  }
  .try-copy {
    grid-column: 9 / 13;
    grid-row: 1;
  }
}

/* ---------- 7. What it leaves out ---------- */

.leaves {
  background: var(--sheet-sunken);
}

.leaves-copy p {
  margin-top: 1.25rem;
  font-size: 1.125rem;
}

@media (min-width: 960px) {
  .leaves-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
  }
  .leaves-copy {
    grid-column: 7 / 13;
  }
}

/* ---------- 8. Closing call to action ---------- */

.closing-card {
  max-width: 52rem;
  margin-inline: auto;
  padding-block: clamp(2.75rem, 2rem + 4vw, 4.5rem) clamp(2.5rem, 2rem + 3vw, 4rem);
  padding-inline: calc(var(--margin-x) + clamp(1rem, 4vw, 3rem));
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.tape-c {
  top: -11px;
  left: calc(50% - 32px);
  transform: rotate(-4deg);
}

.closing-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.closing h2 {
  font-size: clamp(2.2rem, 1.2rem + 4.2vw, 4.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.closing-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--herb);
}

.closing-box .tick {
  stroke-width: 2.5;
  stroke-dasharray: 22;
  transition: stroke-dashoffset 320ms var(--ease) 200ms;
}

.motion .closing-card:not(.in-view) .tick {
  stroke-dashoffset: 22;
}

.closing-card > p:first-of-type {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  font-size: 1.125rem;
}

.closing-card .btn {
  margin-top: 2rem;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding-block: 2rem 2.5rem;
}

.footer-brand {
  color: var(--ink);
}

.footer-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

@media (min-width: 720px) {
  .footer-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
  .footer-row > p:nth-child(2) {
    flex: 1;
    max-width: 30rem;
    text-align: center;
  }
}

/* ---------- Hero load sequence (only when main.js adds .motion) ---------- */

.motion .week-sheet {
  animation: settle-week 700ms var(--ease) both;
}

.motion .hero-list {
  animation: settle-list 700ms var(--ease) 120ms both;
}

.motion .hero-list .row {
  animation: rise 360ms var(--ease) both;
  animation-delay: calc(600ms + var(--i) * 60ms);
}

.motion .hero-list .tick {
  animation: draw 280ms var(--ease) 1050ms both;
}

.motion .row-done .name::after {
  animation: grow 240ms var(--ease) 1300ms both;
}

.motion .plane-notes {
  animation: fade-in 500ms var(--ease) 1500ms both;
}

@keyframes settle-week {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(-4deg);
  }
}

@keyframes settle-list {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(3deg);
  }
}

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

@keyframes draw {
  from {
    stroke-dashoffset: 14;
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

/* ---------- Reduced motion: everything in its final state, nothing moves ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .btn:active,
  .text-link:active,
  .nav-link:active,
  .brand:active {
    transform: none;
  }
}
