/* Copybook launch site. Palette, type and logo follow docs/site/BRIEF.md. */

:root {
  --paper: #f6f1e7;
  --paper-raised: #fffcf5;
  --sheet: #fffefb;
  --rule: #e2d9c7;
  --rule-blue: #c9d5ee;
  --ink: #1f2430;
  --ink-soft: #5b606c;
  --accent: #2a4a96;
  --accent-hover: #213c7d;
  --accent-soft: #e4e9f6;
  --on-accent: #ffffff;
  --pen: #b8432a;
  --amber-bg: #fbeccc;
  --amber-text: #7a4300;
  --sky-bg: #dfedf9;
  --sky-text: #18496f;
  --green-bg: #dff0e2;
  --green-text: #1c5a2e;
  --shadow-sheet:
    0 1px 2px rgb(80 60 30 / 0.08), 0 18px 40px -16px rgb(80 60 30 / 0.28);

  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Public Sans", system-ui, sans-serif;
  --font-hand: "Kalam", "Comic Neue", cursive;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 4rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11141b;
    --paper-raised: #181c25;
    --sheet: #fffefb;
    --rule: #2e3441;
    --rule-blue: #2b3a5c;
    --ink: #ece8df;
    --ink-soft: #a4a9b6;
    --accent: #93b2f4;
    --accent-hover: #b0c7f8;
    --accent-soft: #1f2a44;
    --on-accent: #0e1527;
    --pen: #f08a6c;
    --amber-bg: #3a2b10;
    --amber-text: #f4c978;
    --sky-bg: #12304a;
    --sky-text: #9fcaf0;
    --green-bg: #15361f;
    --green-text: #97d6a8;
    --shadow-sheet:
      0 1px 2px rgb(0 0 0 / 0.5), 0 22px 48px -18px rgb(0 0 0 / 0.75);
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  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(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 50;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.6rem);
}

h2 {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.8rem);
}

h3 {
  font-family: var(--font-text);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

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

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

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

iframe {
  display: block;
}

section[id] {
  scroll-margin-top: var(--header-h);
}

.container {
  width: min(72rem, 100% - 2.5rem);
  margin-inline: auto;
}

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

.nowrap {
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
  color: var(--on-accent);
}

.skip-link:hover {
  color: var(--on-accent);
}

.skip-link:active {
  background: var(--accent-hover);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.08);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
  transform: translateY(-1px);
}

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

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

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.25em;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

.text-link:active {
  color: var(--ink);
}

.text-link__arrow {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms var(--ease-out);
}

.text-link:hover .text-link__arrow {
  transform: translateX(3px);
}

.small-print {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

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

.logo {
  flex: none;
  overflow: visible;
}

.logo path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo .logo__page {
  fill: var(--sheet);
  stroke: var(--accent);
  stroke-width: 1.75;
}

.logo .logo__spine {
  stroke: var(--accent);
  stroke-width: 1.75;
}

.logo .logo__rules {
  stroke: var(--rule-blue);
  stroke-width: 1.25;
}

.logo .logo__tick {
  stroke: var(--pen);
  stroke-width: 2.5;
}

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

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

.brand:hover .brand__word {
  color: var(--accent);
}

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

.brand__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 50;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

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

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

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

.site-nav__links {
  display: flex;
  gap: 1.5rem;
}

.site-nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left
    calc(50% + 0.8em) / 0 2px;
}

.site-nav__links a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

.site-nav__links a:active {
  color: var(--accent-hover);
}

.btn--compact {
  min-height: 2.75rem;
  padding: 0 1.1rem;
  font-size: 0.95rem;
}

@media (max-width: 719px) {
  .site-nav__links {
    display: none;
  }
}

/* ---------- Note replica (always light paper) ---------- */

.note {
  --ink: #1f2430;
  --ink-soft: #5b606c;
  --rule: #e2d9c7;
  --accent: #2a4a96;
  --accent-soft: #e4e9f6;
  --pen: #b8432a;
  --amber-bg: #fbeccc;
  --amber-text: #7a4300;
  --sky-bg: #dfedf9;
  --sky-text: #18496f;
  --green-bg: #dff0e2;
  --green-text: #1c5a2e;

  position: relative;
  aspect-ratio: 1 / 1.414;
  padding: 2.2em 2em;
  background: var(--sheet);
  color: var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-sheet);
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: left;
}

.note__head {
  padding-bottom: 1em;
  margin-bottom: 1.1em;
  border-bottom: 1px solid var(--rule);
}

.note__centre {
  font-size: 0.85em;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.note__title {
  font-family: var(--font-display);
  font-size: 2em;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0.1em 0 0.35em;
}

.note__student {
  font-family: var(--font-display);
  font-size: 1.35em;
  font-weight: 600;
  line-height: 1.2;
}

.note__meta,
.note__period {
  color: var(--ink-soft);
}

.note__period {
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.35em;
}

.note__greeting {
  font-family: var(--font-display);
  font-size: 1.15em;
  margin-bottom: 1em;
}

.note__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1em 1.4em;
  margin-bottom: 1.1em;
}

.note__sec--wide {
  grid-column: 1 / -1;
}

.note__h {
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35em;
}

.note__stat {
  font-weight: 600;
}

.note__topics li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15em 0.5em;
  padding: 0.25em 0;
  border-bottom: 1px dashed var(--rule);
}

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

.note__hw {
  margin-top: 0.3em;
}

.note__hw li {
  position: relative;
  padding: 0.15em 0;
}

.note__mark {
  display: inline-block;
  width: 1.1em;
  color: var(--ink-soft);
}

.note__mark--done {
  color: var(--green-text);
  font-weight: 600;
}

.note__focus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.note__focus li {
  padding: 0.15em 0.7em;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.note__comment span {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
}

.note__print {
  position: absolute;
  top: 1.4em;
  right: 1.4em;
  padding: 0.35em 1em;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* Rating pills: always show their words */
.pill {
  display: inline-block;
  padding: 0.1em 0.65em;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

/* The brief's floor: note text never goes below 0.75rem. */
.note .note__h,
.note .note__centre {
  font-size: max(0.75rem, 0.82em);
}

.note .pill {
  font-size: max(0.75rem, 0.85em);
}

.pill--amber {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.pill--sky {
  background: var(--sky-bg);
  color: var(--sky-text);
}

.pill--green {
  background: var(--green-bg);
  color: var(--green-text);
}

/* ---------- Hand annotations ---------- */

.annot {
  font-family: var(--font-hand);
  color: var(--pen);
  font-size: 1.35rem;
  line-height: 1.1;
  white-space: nowrap;
}

.annot path,
.annot__arrow path,
.pen-underline path,
.pen-tick path,
.corner-tick path {
  fill: none;
  stroke: var(--pen);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* ---------- Act 1: Hero ---------- */

.hero__inner {
  display: grid;
  gap: 3rem;
  padding-block: 3rem 4.5rem;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.hero__title > span {
  display: inline;
}

.pen-underline {
  position: relative;
  display: inline-block;
}

.pen-underline svg {
  position: absolute;
  left: -0.04em;
  right: 0.12em;
  bottom: -0.12em;
  width: calc(100% - 0.08em);
  height: 0.24em;
  overflow: visible;
}

.pen-underline path {
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.hero__sub {
  max-width: 34rem;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 2.5rem 1rem 1.5rem;
}

.stack {
  position: relative;
  width: min(22rem, 100%);
}

.plane {
  will-change: transform;
}

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

.plane--note {
  position: relative;
  z-index: 1;
}

.plane--annot {
  position: absolute;
  z-index: 2;
  top: -1.6rem;
  right: -0.5rem;
}

.back-page {
  height: 100%;
  border-radius: 6px;
  background:
    linear-gradient(
      to right,
      transparent 47px,
      color-mix(in srgb, var(--pen) 18%, transparent) 47px 49px,
      transparent 49px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 27px,
      var(--rule-blue) 27px 28px
    ),
    var(--paper-raised);
  background-position:
    0 0,
    0 40px,
    0 0;
  box-shadow: 0 1px 2px rgb(80 60 30 / 0.1);
  transform: translate(-5%, -4%) rotate(-4deg);
}

.hero-note-wrap {
  position: relative;
}

.hero-note {
  transform: rotate(1.5deg);
}

.paper-clip {
  position: absolute;
  z-index: 2;
  top: -1.6rem;
  left: 1.6rem;
  transform: rotate(-8deg);
}

.paper-clip path {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.annot--hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transform: rotate(-6deg);
}

/* The arrow ends just right of the comma in "Dear Priya Patel,". Below
   960px the note's header can wrap, so the arrow hangs off the greeting. */
.annot__arrow {
  height: auto;
}

.annot__arrow--wide {
  display: none;
  margin-top: -0.1rem;
  margin-right: 2.5rem;
}

.hero-greeting {
  position: relative;
}

.annot__arrow--narrow {
  position: absolute;
  left: calc(100% - 0.6rem);
  bottom: -0.35rem;
  width: 9.375rem;
  overflow: visible;
  pointer-events: none;
}

.annot__arrow path {
  stroke-width: 2;
}

@media (min-width: 960px) {
  .hero__inner {
    grid-template-columns: 5fr 7fr;
    align-items: center;
    min-height: min(52rem, 100svh - var(--header-h));
    padding-block: 3rem;
  }

  .hero__copy {
    container-type: inline-size;
  }

  /* One sentence per line: keep the longest line inside the copy column. */
  .hero__title {
    font-size: min(clamp(2.4rem, 1.4rem + 4.2vw, 4.6rem), 10.6cqi);
  }

  .hero__title > span {
    display: block;
    white-space: nowrap;
  }

  .stack {
    width: 26rem;
  }

  .hero-note {
    font-size: 0.8rem;
  }

  .back-page {
    transform: translate(-9%, -6%) rotate(-4deg);
  }

  .plane--annot {
    top: -1.4rem;
    right: -3.5rem;
  }

  .annot--hero .annot__text {
    font-size: 1.55rem;
  }

  .annot__arrow--narrow {
    display: none;
  }

  .annot__arrow--wide {
    display: block;
    width: 17.5rem;
    margin-top: -0.75rem;
    margin-right: 4.7rem;
  }
}

@media (max-width: 599px) {
  .hero-note {
    font-size: 0.75rem;
    padding: 1.9em 1.6em;
  }
}

/* ---------- Act 2: At the door ---------- */

.door {
  background: var(--paper-raised);
  border-block: 1px solid var(--rule);
  padding-block: 4rem;
}

.door__inner {
  display: grid;
  gap: 3rem;
}

.door__copy {
  max-width: 40rem;
  display: grid;
  gap: 1.25rem;
}

.door__answer {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.45;
  font-variation-settings: "SOFT" 50;
}

.scraps {
  position: relative;
  height: 17rem;
  max-width: 26rem;
  width: 100%;
  margin-inline: auto;
}

.scrap {
  position: absolute;
  transition: transform 900ms var(--ease-out);
}

.scrap--diary {
  top: 0;
  left: 0;
  width: 13.5rem;
  padding: 1rem 1.1rem 1.6rem;
  background: var(--sheet);
  color: #1f2430;
  box-shadow: var(--shadow-sheet);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 72%,
    94% 78%,
    97% 86%,
    90% 92%,
    93% 100%,
    0 100%
  );
  transform: rotate(-3deg);
}

.scrap__day {
  display: block;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2d9c7;
  font-size: 0.875rem;
  font-weight: 600;
  color: #5b606c;
}

.scrap__hand {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 1.3;
}

.scrap--sheet {
  top: 6.5rem;
  right: 0;
  display: grid;
  grid-template-columns: 3.5rem 5.5rem 4.5rem;
  background: var(--sheet);
  color: #1f2430;
  border: 1px solid #e2d9c7;
  box-shadow: var(--shadow-sheet);
  font-size: 0.875rem;
  transform: rotate(2deg);
}

.scrap--sheet span {
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  border-right: 1px solid #e2d9c7;
  border-bottom: 1px solid #e2d9c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrap--sheet span:nth-child(3n) {
  border-right: 0;
}

.scrap--sheet span:nth-child(n + 7) {
  border-bottom: 0;
}

.scrap--sticky {
  bottom: 0;
  left: 18%;
  display: grid;
  place-items: center;
  width: 7.5rem;
  aspect-ratio: 1;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.45);
  transform: rotate(-5deg);
}

.motion .scraps.is-in .scrap--diary {
  transform: translate(-14px, -8px) rotate(-5deg);
}

.motion .scraps.is-in .scrap--sheet {
  transform: translate(12px, 6px) rotate(3.5deg);
}

.motion .scraps.is-in .scrap--sticky {
  transform: translate(-8px, 14px) rotate(-3deg);
}

@media (min-width: 960px) {
  .door {
    padding-block: 7rem;
  }

  .door__inner {
    grid-template-columns: minmax(0, 40rem) 1fr;
    align-items: center;
    gap: 4rem;
  }

  .door__answer {
    font-size: 1.5rem;
  }
}

/* ---------- Reveals (only when motion is welcome and JS runs) ---------- */

.motion .reveal {
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
}

.motion .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(12px);
}

.motion .reveal--late {
  transition-delay: 500ms;
}

/* ---------- Act 3: How it works ---------- */

.how {
  padding-block: 5rem 4rem;
}

.how__intro {
  max-width: 40rem;
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.how__steps {
  display: grid;
  gap: 3.5rem;
}

.step {
  display: grid;
  gap: 0.75rem;
  align-content: center;
}

.step h3 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  margin-left: 0;
}

.step p {
  max-width: 34rem;
}

.step__mini {
  margin-top: 1.5rem;
  padding-inline: 0.75rem;
}

.sheet {
  position: relative;
}

.sheet--mini {
  width: min(20rem, 100%);
  margin-inline: auto;
}

.sheet--mini .note {
  font-size: 0.75rem;
  padding: 2em 1.6em;
}

.how__sheet {
  display: none;
}

/* Staged note: each piece shows from its stage on */
.slot {
  display: grid;
}

.slot > * {
  grid-area: 1 / 1;
}

.ph {
  display: grid;
  align-content: start;
  gap: 0.55em;
  margin-bottom: 1.1em;
  opacity: 0;
}

.ph i {
  display: block;
  width: var(--w);
  height: 0.75em;
  border-radius: 999px;
  background: var(--rule);
  opacity: 0.7;
}

[data-stage="1"] .ph[data-for="2"],
[data-stage="1"] .ph[data-for="3"],
[data-stage="2"] .ph[data-for="3"] {
  opacity: 1;
}

[data-stage="1"] [data-from="2"],
[data-stage="1"] [data-from="3"],
[data-stage="2"] [data-from="3"] {
  opacity: 0;
}

[data-stage="1"] .pill,
[data-stage="1"] [data-from="2"] .note__hw li {
  opacity: 0;
  transform: scale(0.85);
}

[data-stage="1"] .pen-tick path,
[data-stage="1"] .corner-tick path,
[data-stage="2"] .corner-tick path {
  stroke-dashoffset: 1;
}

[data-stage="1"] .note__comment span,
[data-stage="2"] .note__comment span {
  clip-path: inset(0 100% 0 0);
}

.note__comment span {
  clip-path: inset(0 0 0 0);
}

.pen-tick {
  position: absolute;
  left: -1.6em;
  top: 0.05em;
  width: 1.5em;
  height: auto;
}

.pen-tick path {
  stroke-width: 2.5;
}

.slip {
  position: absolute;
  top: 34%;
  left: -0.6rem;
  width: 72%;
  padding: 0.7em 0.8em;
  background: #fffcf5;
  border: 1px solid #e2d9c7;
  border-radius: 6px;
  box-shadow: 0 10px 22px -12px rgb(80 60 30 / 0.4);
  transform: rotate(-2deg);
  display: grid;
  gap: 0.45em;
}

.slip li {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.95em;
}

.slip b {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9em;
}

[data-stage="2"] .slip,
[data-stage="3"] .slip {
  opacity: 0;
  transform: translateX(-2rem) rotate(-6deg);
  pointer-events: none;
}

[data-stage="3"] .note__print {
  opacity: 0;
  transform: scale(0.97);
}

.sheet .note::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 30px 60px -24px rgb(40 30 10 / 0.45);
  opacity: 0;
  pointer-events: none;
}

[data-stage="3"] .note::after {
  opacity: 1;
}

.annot--how {
  position: absolute;
  bottom: 9%;
  right: -1.5rem;
  transform: rotate(-6deg);
  opacity: 0;
}

[data-stage="3"] .annot--how {
  opacity: 1;
}

/* Stage transitions, only when motion is welcome */
.motion .how__sheet .note,
.motion .how__sheet .slip,
.motion .how__sheet .note__print,
.motion .how__sheet .annot--how {
  transition:
    transform 500ms var(--ease-out),
    opacity 400ms ease;
}

.motion .how__sheet .ph,
.motion .how__sheet [data-from],
.motion .how__sheet .note::after {
  transition: opacity 450ms ease;
}

.motion .how__sheet .pill,
.motion .how__sheet .note__hw li {
  transition:
    transform 260ms cubic-bezier(0.3, 1.5, 0.5, 1),
    opacity 200ms ease;
}

.motion .how__sheet [data-stage="2"] .pill:nth-child(1) {
  transition-delay: 0ms;
}

.motion .how__sheet [data-stage="2"] li:nth-child(2) .pill {
  transition-delay: 140ms;
}

.motion .how__sheet [data-stage="2"] li:nth-child(3) .pill {
  transition-delay: 280ms;
}

.motion .how__sheet [data-stage="2"] .note__hw li {
  transition-delay: 420ms;
}

.motion .how__sheet [data-stage="2"] .note__hw li + li {
  transition-delay: 520ms;
}

.motion .how__sheet .pen-tick path {
  transition: stroke-dashoffset 450ms ease 700ms;
}

.motion .how__sheet .note__comment span {
  transition: clip-path 900ms steps(28, end) 400ms;
}

.motion .how__sheet .note__comment span + span {
  transition-delay: 1350ms;
}

.motion .how__sheet [data-stage="3"] [data-from="3"]:not(.note__greeting) {
  transition-delay: 300ms;
}

.motion .how__sheet [data-stage="3"] .slot:last-of-type [data-from="3"] {
  transition-delay: 2300ms;
}

.motion .how__sheet [data-stage="3"] .note__print {
  transition:
    transform 120ms ease 2500ms,
    opacity 260ms ease 2650ms;
}

.motion .how__sheet [data-stage="3"] .note,
.motion .how__sheet [data-stage="3"] .note::after {
  transition-delay: 2800ms;
}

.motion .how__sheet [data-stage="3"] .annot--how {
  transition-delay: 3100ms;
}

@media (min-width: 960px) {
  .how {
    padding-block: 7rem 6rem;
  }

  .how__grid {
    display: grid;
    /* The A4 sheet fits the viewport height under the sticky offset. */
    grid-template-columns: minmax(0, 1fr) min(30rem, (100svh - 7rem) / 1.414);
    gap: 4rem;
  }

  .how__steps {
    gap: 0;
  }

  .step {
    min-height: 80vh;
  }

  .step h3 {
    padding-left: 1rem;
    margin-left: -1rem;
  }

  .step__mini {
    display: none;
  }

  .js .step:not(.is-active) h3 {
    border-left-color: transparent;
  }

  .js .step:not(.is-active) {
    color: var(--ink-soft);
  }

  .how__sheet {
    display: block;
    position: sticky;
    top: 6rem;
    align-self: start;
    margin-top: 6vh;
    container-type: inline-size;
  }

  /* 0.82rem at a 30rem column, scaling down with it. */
  .sheet--sticky .note {
    font-size: 2.73cqi;
    transform: rotate(-1.2deg);
  }

  .sheet--sticky[data-stage="3"] .note {
    transform: rotate(0deg);
  }

  .sheet--sticky .slip {
    left: -2.5rem;
  }
}

@media (min-width: 960px) and (max-height: 820px) {
  .how__sheet {
    top: 5rem;
  }
}

/* ---------- Act 4: Features ---------- */

.features {
  padding-block: 4.5rem;
}

.features h2 {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.cards {
  display: grid;
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
}

.card p {
  color: var(--ink-soft);
}

.icon {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.motion .cards .card {
  transition:
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out),
    box-shadow 180ms ease;
}

.motion .cards:not(.is-in) .card {
  opacity: 0;
  transform: translateY(12px);
}

.motion .cards .card:nth-child(2) {
  transition-delay: 80ms, 80ms, 0ms;
}
.motion .cards .card:nth-child(3) {
  transition-delay: 160ms, 160ms, 0ms;
}
.motion .cards .card:nth-child(4) {
  transition-delay: 240ms, 240ms, 0ms;
}
.motion .cards .card:nth-child(5) {
  transition-delay: 320ms, 320ms, 0ms;
}
.motion .cards .card:nth-child(6) {
  transition-delay: 400ms, 400ms, 0ms;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .motion .cards.is-in .card {
    transition-delay: 0ms;
    transition-duration: 180ms;
  }

  .motion .cards.is-in .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sheet);
  }
}

.mini-schedule {
  display: grid;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.875rem;
}

.mini-schedule__label {
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--ink);
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.mini-row--due {
  border-left: 4px solid var(--amber-text);
  background: var(--amber-bg);
  color: var(--amber-text);
}

.mini-btn {
  flex: none;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.mini-topics {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.875rem;
}

.mini-topic {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
}

.mini-topic__n {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.mini-topic__t {
  flex: 1;
  min-width: 0;
}

.status {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.status--covered {
  background: var(--green-bg);
  color: var(--green-text);
}

.status--planned {
  background: var(--accent-soft);
  color: var(--accent);
}

.mini-ratings {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.875rem;
}

.mini-ratings__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mini-ratings__row .pill {
  font-size: 0.875rem;
}

.mini-ratings__row--grey {
  filter: grayscale(1);
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .card--large {
    grid-column: 1 / -1;
  }
}

@media (min-width: 960px) {
  .features {
    padding-block: 7rem;
  }

  .cards {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .card--large {
    grid-column: 1 / span 7;
    grid-row: 1 / span 2;
    padding: 2.25rem;
  }

  .card:nth-child(2),
  .card:nth-child(3) {
    grid-column: 8 / span 5;
  }

  .card:nth-child(n + 4) {
    grid-column: span 4;
  }

  .card--large .mini-schedule {
    font-size: 0.9375rem;
  }
}

/* ---------- Act 5: Try the real thing ---------- */

.try {
  padding-block: 4.5rem;
}

.try__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.try__head {
  max-width: 40rem;
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.browser {
  width: min(64rem, 100%);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sheet);
}

.browser__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  border-bottom: 1px solid var(--rule);
}

.browser__dots {
  position: absolute;
  left: 0.9rem;
  display: flex;
  gap: 0.4rem;
}

.browser__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--ink-soft);
  opacity: 0.6;
}

.browser__pill {
  padding: 0.1rem 1.6rem;
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.browser iframe {
  width: 100%;
  height: 600px;
  border: none;
  background: var(--paper);
}

.try__full {
  margin-top: 1rem;
}

.facts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem 1.75rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

@media (min-width: 768px) {
  .browser iframe {
    height: 640px;
  }

  .facts {
    flex-direction: row;
  }
}

@media (min-width: 960px) {
  .try {
    padding-block: 7rem;
  }
}

/* ---------- Close ---------- */

.close {
  background: var(--accent-soft);
  padding-block: 4.5rem;
}

.close__inner {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.close__copy {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  max-width: 34rem;
}

.close__copy .btn {
  margin-top: 0.5rem;
}

.close__visual {
  display: none;
}

.sheet--close {
  width: 18rem;
  margin-inline: auto;
}

.sheet--close .note {
  font-size: 0.75rem;
  padding: 2em 1.6em;
}

.sheet--close .note__print {
  display: none;
}

.corner-tick {
  position: absolute;
  z-index: 2;
  top: -0.6rem;
  right: -0.9rem;
  width: 3rem;
  height: auto;
}

.corner-tick path {
  stroke-width: 4;
}

.annot--close {
  position: absolute;
  z-index: 2;
  top: 2.2rem;
  right: -6.5rem;
  transform: rotate(-6deg);
}

.motion .close .corner-tick path {
  transition: stroke-dashoffset 600ms ease 300ms;
}

.motion .close:not(.is-in) .corner-tick path {
  stroke-dashoffset: 1;
}

@media (min-width: 600px) {
  .close__visual {
    display: block;
  }
}

@media (min-width: 960px) {
  .close {
    padding-block: 7rem;
  }

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

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

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

  .site-footer__credit {
    margin-left: auto;
  }
}

/* ---------- Hero entry, only when motion is welcome ---------- */

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

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

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

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

.motion .back-page {
  animation: fade-in 300ms ease both;
}

.motion .hero-note-wrap {
  animation: lift-in 500ms var(--ease-out) 150ms both;
}

.motion .hero-note .pill {
  animation: pop-in 260ms cubic-bezier(0.3, 1.5, 0.5, 1) both;
  animation-delay: 700ms;
}

.motion .hero-note li:nth-child(2) .pill {
  animation-delay: 820ms;
}

.motion .hero-note li:nth-child(3) .pill {
  animation-delay: 940ms;
}

.motion .pen-underline path {
  animation: draw-on 700ms ease-out 600ms both;
}

.motion .annot--hero .annot__text {
  animation: fade-in 500ms ease 1200ms both;
}

.motion .hero .annot__arrow path {
  animation: draw-on 500ms ease-out 1400ms both;
}

.motion .hero .annot__arrow path + path {
  animation-delay: 1800ms;
  animation-duration: 250ms;
}

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