:root {
  --ink: #15110d;
  --ink-raised: #201a14;
  --line: #40352a;
  --control: #948772;
  --parchment: #f0e6d2;
  --muted: #c4b79f;
  --brass: #cda45a;
  --brass-light: #e2c286;
  --page: #e9dcc0;
  --page-ink: #2b2118;
  --error: #f3a593;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
  interpolate-size: allow-keywords;
}

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

[hidden] {
  display: none !important;
}

html {
  --header-h: 4.5rem;
  --bar-h: 4.5rem;
  scroll-padding-top: var(--header-h);
  scrollbar-gutter: stable;
  background: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--parchment);
  font: 1.0625rem/1.65 var(--sans);
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
}

h1,
h2 {
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--brass-light);
}

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

/* Headings take focus after a screen change, so screen readers announce them. */
[tabindex="-1"]:focus {
  outline: none;
}

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

.narrow {
  max-width: 44rem;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: var(--brass);
  color: var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ink);
}

/* On the main page the header sits over the full-screen pages. */
.js .site-header {
  position: fixed;
  inset: 0 0 auto;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--parchment);
  font: 600 1.4rem var(--serif);
  text-decoration: none;
}

.menu-button {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--control);
  border-radius: 0.3rem;
  background: none;
  color: inherit;
  font: inherit;
}

.site-nav {
  display: none;
  width: 100%;
  padding-bottom: 1rem;
}

.site-nav.open {
  display: block;
}

.site-nav a {
  display: block;
  padding: 0.6rem 0;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--brass-light);
}

@media (min-width: 52rem) {
  .menu-button {
    display: none;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: auto;
    padding: 0;
  }

  .site-nav a {
    border-bottom: 2px solid transparent;
    padding: 0.3rem 0;
  }

  .site-nav a[aria-current] {
    border-color: var(--brass);
  }

  .site-nav .nav-join,
  .site-nav .nav-join[aria-current] {
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--brass);
    border-radius: 0.3rem;
    color: var(--brass-light);
  }
}

/* ---- Pages ----
   Each section is a full-screen page. Scrolling is the browser's own; CSS snaps it
   to whole pages, and each new page slides up over the last like a sheet of paper.

   How a page stays put: it's position: sticky, so once it reaches the top it pins
   there while the next page slides over it. A page taller than the screen (FAQ,
   the form) pins only once its bottom reaches the bottom of the screen, so all of it
   can be read first. --page-h (set by js/main.js) is the page's height.

   Snapping uses the empty .page-anchor before each page, because a pinned page's
   position on screen no longer matches its place in the document. The anchor is as
   tall as its page, so inside a tall page you can scroll freely. The anchors also
   carry the ids (#why, #pricing...) that links jump to.

   Without JavaScript none of this applies: the pages simply scroll. */

.view {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

/* Room for the fixed header (see .js .site-header). */
.js .view {
  padding-top: calc(var(--header-h) + clamp(2rem, 5vw, 4rem));
}

.js {
  scroll-padding-top: 0;
  scroll-snap-type: y mandatory;
}

.js .page-anchor {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: var(--page-h, 0px);
  margin-bottom: calc(-1 * var(--page-h, 0px));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* A second snap point at the page's end, so a flick through a tall page stops at
   its bottom before moving on to the next page. */
.js .page-anchor::after {
  content: "";
  height: 1px;
  scroll-snap-align: end;
  scroll-snap-stop: always;
}

.js .view {
  position: sticky;
  /* Until --page-h is known, a huge negative value keeps the page from pinning. */
  top: min(0px, calc(100svh - var(--page-h, 100000px)));
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding-bottom: calc(var(--bar-h) + clamp(2rem, 5vw, 4rem));
  background: var(--ink);
  /* Shrinks toward the middle of what's on screen, even for a tall page. */
  transform-origin: 50% calc(100% - 50svh);
}

/* The shadow along the top edge of each page after the first. */
.js .view:not(:first-of-type) {
  box-shadow: 0 -1.25rem 3rem -0.5rem rgb(0 0 0 / 0.7);
}

/* Dims the page as the next one covers it (animated below). */
.js .view::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
}

.js .step:not(.active) {
  display: none;
}

.js .site-footer {
  position: relative;
  padding-bottom: calc(var(--bar-h) + 1.75rem);
  background: var(--ink);
  scroll-snap-align: end;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem clamp(2.5rem, 6vw, 6rem);
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  }
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
}

.lead + .grid {
  margin-top: 2rem;
}

/* Page dots: a column on the right edge. The current page's dot is long and
   gold; each dot jumps to its page, and its name shows on hover or focus. */

.page-dots {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 9;
  transform: translateY(-50%);
}

.page-dots ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-dots a {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.9rem;
  text-decoration: none;
}

@media (min-width: 64rem) {
  .page-dots {
    right: 0.75rem;
  }

  .page-dots a {
    width: 2.75rem;
    height: 2.25rem;
  }
}

.page-dots a::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 1rem;
  background: var(--control);
  transition: height 0.3s, background-color 0.2s;
}

@media (min-width: 64rem) {
  .page-dots a::before {
    width: 0.55rem;
    height: 0.55rem;
  }
}

.page-dots a:hover::before {
  background: var(--brass-light);
}

.page-dots a[aria-current]::before {
  height: 1.3rem;
  background: var(--brass);
}

.dot-label {
  position: absolute;
  right: 100%;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--control);
  border-radius: 0.3rem;
  background: var(--ink);
  color: var(--parchment);
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.page-dots a:not(:hover, :focus-visible) .dot-label {
  clip-path: inset(50%);
}

.page-dots a:hover .dot-label,
.page-dots a:focus-visible .dot-label {
  opacity: 1;
}

/* Page bar: previous, "2 of 7", next. Fixed to the bottom of the screen. */

.page-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 9;
  background: rgb(21 17 13 / 0.94);
  backdrop-filter: blur(6px);
}

.page-bar .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: var(--bar-h);
}
.turn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  color: var(--parchment);
  line-height: 1.25;
  text-decoration: none;
}

.turn.prev {
  grid-column: 1;
  justify-self: start;
}

.turn.next {
  grid-column: 3;
  justify-self: end;
  text-align: right;
}

.turn small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.turn-title {
  font: 1.15rem var(--serif);
}

.turn .arrow {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--control);
  border-radius: 50%;
  transition: background-color 0.2s, border-color 0.2s;
}

.turn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.turn.prev:hover .arrow {
  border-color: var(--brass);
}

.turn.next .arrow {
  border-color: var(--brass);
  background: var(--brass);
  color: var(--ink);
}

.turn.next:hover .arrow {
  background: var(--brass-light);
}

.turn:hover .turn-title {
  color: var(--brass-light);
}

/* On the first screen, the next arrow nudges a few times to show the way. */
.page-bar.first .next .arrow {
  animation: nudge 1.4s ease-in-out 1s 3;
}

@keyframes nudge {
  50% {
    transform: translateX(0.4rem);
  }
}

.page-count {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Phones: no room for the page titles, so show just "Previous" and "Next". */
@media (max-width: 40rem) {
  .turn-title {
    display: none;
  }

  .turn small {
    color: var(--parchment);
    font-size: 0.95rem;
  }
}

/* Home */

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

.hero .lead {
  max-width: 33rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

.manuscript {
  position: relative;
  margin: 0;
  padding: 2.25rem 2rem 2.75rem;
  border-radius: 0.2rem;
  background: linear-gradient(100deg, #d8c8a6, var(--page) 14%);
  color: var(--page-ink);
  font: 1.15rem/1.75 var(--serif);
  box-shadow: 0 1.5rem 3.5rem #0009;
  transform: rotate(1.2deg);
}

.manuscript p:last-of-type {
  margin: 0;
}

.manuscript .reply {
  font-style: italic;
}

.manuscript .ink-line {
  display: block;
  width: 60%;
  margin-top: 0.75rem;
}

.manuscript .ink-line path {
  stroke-dasharray: 220;
  animation: draw 1.8s 0.4s ease-out backwards;
}

.manuscript .quill {
  position: absolute;
  right: 1rem;
  bottom: -2rem;
  width: 6.5rem;
  height: 6.5rem;
}

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

.problems {
  display: grid;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.problem-block {
  margin-top: clamp(4rem, 7vw, 5.5rem);
}

.problem-block h2 {
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.problems li {
  padding-top: 1rem;
  border-top: 2px solid var(--brass);
}

.problems p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  .problems {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

/* Why Ironquill */

.reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 2.25rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reasons svg {
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reasons p {
  margin: 0;
  color: var(--muted);
}

/* Buttons and cards */

.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 1px solid var(--brass);
  border-radius: 0.3rem;
  background: var(--brass);
  color: var(--ink);
  font: 600 1.0625rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.button:hover {
  background: var(--brass-light);
}

.button.secondary {
  background: none;
  color: var(--brass-light);
}

.button.secondary:hover {
  background: var(--ink-raised);
}

.button:disabled {
  opacity: 0.7;
  cursor: default;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--ink-raised);
}

/* "Planned" sits above the name, so long model names get the full width. */
.model-head {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
}

.model-head h3 {
  margin-bottom: 0.75rem;
}

.tag {
  color: var(--brass-light);
  font-size: 0.95rem;
}

/* The helper model: one slimmer card under the roleplay models, with a dashed
   border so it reads as something different, not a fifth roleplay model. */
.helper-card {
  display: grid;
  gap: 0.75rem 2.5rem;
  margin-top: 1.25rem;
  padding: 1.25rem 1.75rem;
  border: 1px dashed var(--control);
  border-radius: 0.4rem;
}

.helper-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.helper-head h3 {
  margin: 0;
  color: var(--muted);
  font: 600 0.85rem var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.helper-who p {
  margin: 0;
}

.helper-name {
  font: 600 1.25rem var(--serif);
}

.helper-description {
  margin: 0;
}

@media (min-width: 56rem) {
  .helper-card {
    grid-template-columns: minmax(11rem, 1fr) minmax(0, 2.2fr) minmax(12rem, 1fr);
    grid-template-areas:
      "head head head"
      "who description specs";
    align-items: center;
  }

  .helper-head {
    grid-area: head;
  }

  .helper-who {
    grid-area: who;
  }

  .helper-description {
    grid-area: description;
  }

  .helper-card .specs {
    grid-area: specs;
  }
}

.notice {
  display: inline-block;
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--brass);
  border-radius: 0.3rem;
  color: var(--brass-light);
}

.specs {
  margin: 0;
}

.specs div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}

.specs dt {
  color: var(--muted);
}

.specs dd {
  margin: 0;
  text-align: right;
}

.price {
  color: var(--brass-light);
  font: 2.5rem/1.2 var(--serif);
}

.plain-list,
.app-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font: 1.15rem var(--serif);
}

pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  border-radius: 0.2rem;
  background: var(--page);
  color: var(--page-ink);
  font-size: 0.95rem;
  line-height: 2;
}

.settings-label {
  margin: 2.25rem 0 0.75rem;
}

/* FAQ */

details {
  border-bottom: 1px solid var(--line);
}

summary {
  padding: 1.1rem 0;
  font: 600 1.2rem var(--serif);
  cursor: pointer;
}

summary:hover {
  color: var(--brass-light);
}

summary::marker {
  color: var(--brass);
}

details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}

details[open]::details-content {
  block-size: auto;
}

/* Form */

.step-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.step-progress li {
  padding-top: 0.5rem;
  border-top: 3px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.step-progress li.done,
.step-progress li[aria-current] {
  border-color: var(--brass);
}

.step-progress li[aria-current] {
  color: var(--brass-light);
}

.step h3 {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

fieldset {
  min-width: 0;
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

legend,
.field > label {
  display: block;
  margin-bottom: 0.6rem;
  padding: 0;
  font-weight: 600;
}

.field {
  margin: 0 0 1.5rem;
}

.other-field {
  margin: 1rem 0 0;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--control);
  border-radius: 0.3rem;
  background: var(--ink-raised);
  color: var(--parchment);
  font: inherit;
}

input[aria-invalid="true"] {
  border-color: var(--error);
  outline-color: var(--error);
}

input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  accent-color: var(--brass);
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
  gap: 0.6rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
}

.choices .choice {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.choices .choice:hover {
  border-color: var(--control);
}

.choices .choice:has(input:checked) {
  border-color: var(--brass);
  background: var(--ink-raised);
}

.choices .choice:has(input:disabled) {
  color: var(--muted);
  cursor: default;
}

#model-status {
  margin: 0.75rem 0 0;
}

.error {
  margin: 0.4rem 0 0;
  color: var(--error);
}

.form-message {
  padding: 0.8rem 1rem;
  border: 1px solid var(--error);
  border-radius: 0.3rem;
  color: var(--error);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.turnstile-space {
  min-height: 65px;
  margin-bottom: 1rem;
}

/* Honeypot: out of sight for people, still present for bots. */
.hp {
  position: absolute;
  left: -9999px;
}

/* Text pages and footer */

.page {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.page h2 {
  margin-top: 2.5rem;
  font-size: 1.5rem;
}

.page h3 {
  margin-top: 1.75rem;
  font-size: 1.15rem;
}

.page li + li {
  margin-top: 0.4rem;
}

/* Policy pages: the list of sections near the top. */
.contents {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
}

.page .contents h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.contents ol {
  margin: 0;
  padding-left: 1.4rem;
  columns: 2 16rem;
  column-gap: 2rem;
}

.contents li {
  break-inside: avoid;
}

/* Draft policies: clauses for legal review, and details still to be filled in. */
.review {
  display: inline-block;
  padding: 0 0.35rem;
  border: 1px solid var(--brass);
  border-radius: 0.2rem;
  color: var(--brass-light);
  font: 600 0.75rem/1.5 var(--sans);
  letter-spacing: 0.04em;
  vertical-align: 0.1em;
}

.placeholder {
  color: var(--brass-light);
  font-style: italic;
}

.banner {
  margin-bottom: 2rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--brass);
  border-radius: 0.3rem;
  color: var(--brass-light);
  font-weight: 600;
}

.site-footer {
  padding: 1.75rem 0;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

/* Moving to another page of the site (such as Privacy) fades it in. Form step
   changes (js/transition.js) slide only the form; the rest stays still. */

@view-transition {
  navigation: auto;
}

.site-header {
  view-transition-name: header;
}

[data-transition="form"] #waitlist-panel {
  view-transition-name: form;
}

::view-transition-old(form) {
  animation: step-out 0.2s ease-in both;
}

::view-transition-new(form) {
  animation: step-in 0.35s 0.12s ease-out both;
}

[data-direction="back"] {
  --from: -3rem;
  --to: 3rem;
}

@keyframes step-out {
  to {
    opacity: 0;
    transform: translateX(var(--to, -3rem));
  }
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(var(--from, 3rem));
  }
}

/* ---- Page animations (none at all with reduced motion) ----
   As a page arrives, the one underneath shrinks to 94%, dims and blurs slightly,
   and the new page's content rises in, one part after another (--i, set by
   js/main.js). Both follow the scroll position: halfway scrolled is halfway
   animated, and scrolling back plays them in reverse. */

@keyframes sheet-under {
  to {
    transform: scale(0.94);
    filter: blur(2px);
  }
}

@keyframes sheet-dim {
  to {
    opacity: 0.55;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* Scroll-driven: each page's timeline (--p1, --p2...) runs as it slides into view. */
  @supports (animation-timeline: view()) {
    .js main {
      timeline-scope: --p1, --p2, --p3, --p4, --p5, --p6, --p7, --p8, --p9, --p10;
    }

    .js .view:nth-of-type(1) { view-timeline: --p1 block; }
    .js .view:nth-of-type(2) { view-timeline: --p2 block; }
    .js .view:nth-of-type(3) { view-timeline: --p3 block; }
    .js .view:nth-of-type(4) { view-timeline: --p4 block; }
    .js .view:nth-of-type(5) { view-timeline: --p5 block; }
    .js .view:nth-of-type(6) { view-timeline: --p6 block; }
    .js .view:nth-of-type(7) { view-timeline: --p7 block; }
    .js .view:nth-of-type(8) { view-timeline: --p8 block; }
    .js .view:nth-of-type(9) { view-timeline: --p9 block; }
    .js .view:nth-of-type(10) { view-timeline: --p10 block; }

    /* The page underneath follows the next page's arrival. */
    .js .view {
      animation: sheet-under linear both;
      animation-range: entry 0% entry 100%;
    }

    .js .view::after {
      animation: sheet-dim linear both;
      animation-range: entry 0% entry 100%;
    }

    .js .view:nth-of-type(1),
    .js .view:nth-of-type(1)::after { animation-timeline: --p2; }
    .js .view:nth-of-type(2),
    .js .view:nth-of-type(2)::after { animation-timeline: --p3; }
    .js .view:nth-of-type(3),
    .js .view:nth-of-type(3)::after { animation-timeline: --p4; }
    .js .view:nth-of-type(4),
    .js .view:nth-of-type(4)::after { animation-timeline: --p5; }
    .js .view:nth-of-type(5),
    .js .view:nth-of-type(5)::after { animation-timeline: --p6; }
    .js .view:nth-of-type(6),
    .js .view:nth-of-type(6)::after { animation-timeline: --p7; }
    .js .view:nth-of-type(7),
    .js .view:nth-of-type(7)::after { animation-timeline: --p8; }
    .js .view:nth-of-type(8),
    .js .view:nth-of-type(8)::after { animation-timeline: --p9; }
    .js .view:nth-of-type(9),
    .js .view:nth-of-type(9)::after { animation-timeline: --p10; }

    /* Nothing covers the last page. */
    .js .view:last-of-type,
    .js .view:last-of-type::after {
      animation: none;
    }

    /* The arriving page's content, staggered: each part starts a little later. */
    .js .reveal {
      animation: rise ease-out both;
      animation-range:
        entry calc(20% + var(--i, 0) * 6%)
        entry calc(60% + var(--i, 0) * 5%);
    }

    .js .view:nth-of-type(2) .reveal { animation-timeline: --p2; }
    .js .view:nth-of-type(3) .reveal { animation-timeline: --p3; }
    .js .view:nth-of-type(4) .reveal { animation-timeline: --p4; }
    .js .view:nth-of-type(5) .reveal { animation-timeline: --p5; }
    .js .view:nth-of-type(6) .reveal { animation-timeline: --p6; }
    .js .view:nth-of-type(7) .reveal { animation-timeline: --p7; }
    .js .view:nth-of-type(8) .reveal { animation-timeline: --p8; }
    .js .view:nth-of-type(9) .reveal { animation-timeline: --p9; }
    .js .view:nth-of-type(10) .reveal { animation-timeline: --p10; }

    /* The first page is already in place, so its content rises in once on load. */
    .js .view:first-of-type .reveal {
      animation: rise 0.7s ease-out both;
      animation-delay: calc(var(--i, 0) * 90ms);
      animation-timeline: auto;
    }
  }

  /* Older browsers: the same effect, played over time as each page arrives
     (js/main.js adds .arrived and .covered). */
  @supports not (animation-timeline: view()) {
    .js .view {
      transition: transform 0.6s ease-out, filter 0.6s ease-out;
    }

    .js .view::after {
      transition: opacity 0.6s ease-out;
    }

    .js .view.covered {
      transform: scale(0.94);
      filter: blur(2px);
    }

    .js .view.covered::after {
      opacity: 0.55;
    }

    .js .reveal {
      opacity: 0;
      transform: translateY(1.5rem);
      transition: opacity 0.6s ease-out, transform 0.6s ease-out;
      transition-delay: calc(var(--i, 0) * 80ms);
    }

    .js .arrived .reveal {
      opacity: 1;
      transform: none;
    }
  }
}

/* ---- Phones: plain scrolling ----
   On a phone most pages are taller than the screen, and the browser's address bar
   changes the screen height as you scroll, so snapping and stacked pages feel
   jumpy there. Phones get an ordinary scrolling page instead: no snapping, no
   pinning, each section as tall as its content, no page bar. The dots stay, and
   content fades in as it scrolls into view. */

@media (max-width: 52rem) {
  .js {
    scroll-snap-type: none;
  }

  .js .page-anchor {
    height: 0;
    margin: 0;
  }

  .js .page-anchor::after {
    display: none;
  }

  .js .view {
    position: relative;
    top: auto;
    display: block;
    min-height: 0;
    padding-bottom: clamp(2rem, 5vw, 4rem);
    box-shadow: none;
    transform: none;
    filter: none;
    animation: none;
  }

  .js .view::after {
    display: none;
  }

  .page-bar {
    display: none;
  }

  .js .site-footer {
    padding-bottom: 1.75rem;
  }
}

@media (max-width: 52rem) and (prefers-reduced-motion: no-preference) {
  /* Each part fades in as it scrolls into view (the first page's still plays on load). */
  @supports (animation-timeline: view()) {
    html.js .view:nth-of-type(n + 2) .reveal {
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*),
  details::details-content {
    animation: none !important;
    transition: none !important;
  }
}
