:root {
  /* palette */
  --blackberry: #3f1828;
  --meadow: #8a6576;
  --pediment: #d0c3bd;
  --kurobeni: #25171e;
  --copper: #bc9173;
  --midnight: #1f4047;

  --paper: #ece6e2;       /* Pediment, lightened for reading */
  --paper-edge: #ddd3ce;
  --ink: var(--kurobeni);
  --muted: #6b4c5a;       /* Meadow Flower, darkened to read on paper */
  --rule: var(--pediment);

  --serif: "Libre Bodoni", Georgia, serif;
  --hand: "Covered By Your Grace", "Bradley Hand", cursive;
  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --turn: .9s;
  --ease: cubic-bezier(.645, .045, .355, 1);
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* the book turns sideways; the site never scrolls */
}

body {
  font-family: var(--serif);
  font-variant-numeric: oldstyle-nums;
  color: var(--ink);
  background: var(--kurobeni);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.smallcaps,
.eyebrow {
  font-variant-caps: all-small-caps;
  letter-spacing: .06em;
}

/* ---------- Stage ---------- */

.stage {
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 48px);
  padding: 40px 24px 80px; /* breathing room, and space for "follow the journey" */
  touch-action: pan-y; /* swipes in the margins turn pages too */
}

.nav-btn {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(208, 195, 189, .35);
  background: none;
  color: var(--pediment);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .15s ease, color .15s ease;
}

.nav-btn:hover { border-color: var(--copper); color: var(--copper); }
.nav-btn:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.nav-btn[disabled] { visibility: hidden; }
.nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }


/* ---------- Book ---------- */

.book {
  position: relative;
  height: min(calc(100svh - 200px), 700px);
  aspect-ratio: 7 / 10;
  max-width: calc(100vw - 48px - 2 * (48px + clamp(16px, 3vw, 48px)));
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* the stack of pages showing at the edge */
.book::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px 4px 4px 2px;
  background: var(--paper-edge);
  box-shadow:
    2px 2px 0 -1px var(--paper-edge), 2px 2px 0 0 #c4b5ae,
    4px 4px 0 -1px var(--paper-edge), 4px 4px 0 0 #c4b5ae,
    6px 6px 0 -1px var(--paper-edge), 6px 6px 0 0 #b8a8a1,
    0 24px 40px -16px rgba(0, 0, 0, .6);
}

.page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px 4px 4px 2px;
  background: var(--paper);
  transform-origin: left center;
  transform: perspective(2400px) rotateY(0deg);
  transition: transform var(--dur, var(--turn)) var(--ease) var(--delay, 0s);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  container-type: size;
}

/* the fold along the spine */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(37, 23, 30, .14) 0%, rgba(37, 23, 30, .03) 3%, transparent 6%);
  z-index: 2;
}

/* shade that darkens a page as it lifts away */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(37, 23, 30, .25);
  opacity: 0;
  transition: opacity var(--dur, var(--turn)) var(--ease) var(--delay, 0s);
  z-index: 3;
}

.page.is-turned { transform: perspective(2400px) rotateY(-180deg); pointer-events: none; }
.page.is-turned::after { opacity: 1; }

.book.no-anim .page,
.book.no-anim .page::after { transition: none !important; }

.page-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 7cqi, 56px) clamp(22px, 7cqi, 56px) clamp(18px, 4cqi, 32px) clamp(28px, 9cqi, 68px);
}

.page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto; /* only kicks in if a page has more notes than fit */
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.folio {
  flex: none;
  margin: 1rem 0 0;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- Cover ---------- */

.page.cover {
  cursor: pointer;
  background: var(--blackberry);
  color: var(--copper);
}

/* the photo, faint and tinted by the cover colour. It's 30% larger than a
   plain "cover" fit and sits bottom-aligned, with its centre pushed toward
   the right edge so the title has the left side to itself. */
.cover-photo {
  --w: calc(1.3 * max(100cqw, 66.667cqh)); /* the photo is 2:3 */
  position: absolute;
  bottom: 0;
  left: max(calc(72cqw - var(--w) / 2), calc(100cqw - var(--w)));
  width: var(--w);
  aspect-ratio: 2 / 3;
  background: url("../assets/cover.jpg") center / 100% 100% no-repeat;
  mix-blend-mode: luminosity;
  opacity: .32;
  pointer-events: none;
  /* fade the photo's left edge into the cover instead of a hard line */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%);
}

/* wide covers (phones held sideways): centre on the upper body, not the feet */
@container (aspect-ratio > 1) {
  .cover-photo { bottom: auto; top: calc(50cqh - var(--w) * 1.5 * .42); }
}

.cover::before {
  background: linear-gradient(90deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .1) 3%, transparent 6%);
}

/* title set up the spine; --title-size is fitted to the cover height in main.js */
.cover-title {
  position: absolute;
  bottom: 4cqh;
  left: 7cqw;
  margin: 0;
  width: max-content;
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--title-size, 12cqh);
  line-height: .86;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
  transform-origin: left bottom;
  transform: rotate(-90deg) translateY(100%);
}

.cover-title { z-index: 1; color: var(--paper); }

/* magazine furniture: issue date and name top right, countdown and barcode along the bottom */
.cover {
  --title-w: calc(var(--title-size, 12cqh) * .86);
  --barcode-w: clamp(62px, 22cqw, 112px);
}

.cover-masthead {
  position: absolute;
  z-index: 1;
  top: 3cqh;
  right: 7cqw;
  max-width: 45cqw;
  text-align: right;
}

.cover-date {
  margin: 0;
  font-variant-caps: all-small-caps;
  letter-spacing: .22em;
  font-size: clamp(12px, 3.6cqw, 16px);
  color: rgba(236, 230, 226, .72);
}

.cover-author {
  margin: 0;
  font-variant-caps: all-small-caps;
  letter-spacing: .25em;
  font-size: clamp(16px, 5.5cqw, 26px);
  line-height: 1.15;
  color: var(--copper);
}

.cover-countdown {
  position: absolute;
  z-index: 1;
  bottom: 4cqh;
  left: calc(7cqw + var(--title-w) + 4cqw);
  width: calc(100cqw - 7cqw - var(--title-w) - 4cqw - var(--barcode-w) - 7cqw - 4cqw);
  max-width: 220px;
  margin: 0;
}

.countdown-text {
  display: block;
  font-size: clamp(13px, 4cqw, 18px);
  line-height: 1.25;
  color: var(--copper);
}

.cover-barcode {
  position: absolute;
  z-index: 1;
  bottom: 4cqh;
  right: 7cqw;
  width: var(--barcode-w);
  padding: 5px 5px 2px;
  background: var(--paper);
}

.cover-barcode svg { display: block; width: 100%; height: auto; fill: var(--kurobeni); }
.cover-barcode text { font-family: var(--ui); font-size: 9px; }

/* ---------- Contents ---------- */

.eyebrow {
  margin: 0 0 .2rem;
  font-size: 1rem;
  color: var(--muted);
}

.toc-head {
  flex: none;
  padding-bottom: .6rem;
  margin-bottom: .4rem;
  border-bottom: 1px solid var(--rule);
}

.toc-head h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(34px, 9cqi, 52px);
  line-height: 1;
}

/* the list scrolls inside the page; a ribbon shows where you are */
.toc-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.toc-body {
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding-right: 6px;
}

.toc-body::-webkit-scrollbar { display: none; }

/* scrolling areas only scroll up and down, so a sideways swipe still turns the page */
.page-body,
.toc-body { touch-action: pan-y; }

.toc {
  list-style: none;
  margin: 0;
  padding: .3rem 0 .6rem;
}

.toc button {
  width: 100%;
  display: grid;
  grid-template-columns: 2em 1fr auto;
  align-items: baseline;
  gap: .2em;
  padding: .32em 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: clamp(18px, 4.6cqi, 24px);
  line-height: 1.25;
}

.toc li + li button { border-top: 1px solid rgba(208, 195, 189, .55); }

.toc button:hover .t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.toc button:focus-visible { outline: 1px solid var(--midnight); outline-offset: -1px; }

.toc .n { color: var(--blackberry); font-size: .9em; }
.toc .tick { color: var(--midnight); padding-left: .3em; }
.toc .is-done .t { text-decoration: line-through; text-decoration-color: var(--meadow); color: var(--muted); }

/* bookmark ribbon in the right margin, with a notched tail */
.ribbon {
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(-.5 * clamp(22px, 7cqi, 56px));
  width: 12px;
  transform: translateX(50%);
}

.ribbon-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background: var(--blackberry);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 9px), 0 100%);
  cursor: grab;
  touch-action: none;
}

.ribbon.is-dragging .ribbon-thumb { cursor: grabbing; }

/* ---------- Dedication ---------- */

.dedication .page-inner { justify-content: center; align-items: center; }

.dedication-text {
  margin: 0 auto;
  max-width: min(16em, 90%); /* a narrow column, with room either side */
  text-align: center;
  font-style: italic;
  font-size: clamp(16px, 4.2cqi, 21px);
  line-height: 1.5;
  color: var(--ink);
  text-wrap: balance;
}

/* "follow the journey" with TikTok, Instagram and email underneath, fixed below the book */
.follow {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.follow-label {
  margin: 0;
  font-style: italic;
  font-size: .8rem;
  line-height: 1.2;
  color: rgba(208, 195, 189, .75);
}

.follow-links { display: flex; gap: .4rem; }

.follow-links a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--pediment);
  transition: color .15s ease;
}

.follow-links a:hover { color: var(--copper); }
.follow-links a:focus-visible { outline: 1px solid var(--copper); outline-offset: 2px; }
.follow-links svg { width: 18px; height: 18px; }

/* ---------- Goal pages ---------- */

.goal-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(20px, 6cqi, 40px);
}

/* the category, barely there, centred along the top of the page */
.goal-cat {
  position: absolute;
  /* the page's left margin is wider than its right (the spine), so nudge back to true centre */
  left: calc(50% + (clamp(22px, 7cqi, 56px) - clamp(28px, 9cqi, 68px)) / 2);
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  white-space: nowrap;
  font-variant-caps: all-small-caps;
  letter-spacing: .2em;
  font-size: .85rem;
  color: rgba(107, 76, 90, .2);
  pointer-events: none;
}

.menu-btn {
  width: 40px;
  height: 40px;
  margin: -8px 0 -8px -10px;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.menu-icon { display: grid; gap: 5px; width: 20px; }
.menu-icon span { display: block; height: 1.5px; background: currentColor; }

.menu-btn:hover { color: var(--midnight); }
.menu-btn:focus-visible { outline: 1px solid var(--midnight); outline-offset: 0; }

/* "No. 07 of 30" sits where a page number would */
.folio.goal-num { font-style: italic; font-size: 1rem; }

/* big and bold, like the cover; main.js shrinks it if a word won't fit */
.goal-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 13cqi, 88px);
  line-height: .9;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
  overflow-wrap: normal;
  hyphens: none;
}

/* leave room for the ribbon hanging at the top right */
.can-join .goal-title { margin-right: 52px; }

.goal-desc {
  margin: 0 0 1rem;
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--ink);
}

.goal-desc p { margin: 0; }
.goal-desc p + p { margin-top: .6rem; }

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .9rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.chip { font-style: italic; }
.chip.is-progress { color: var(--blackberry); }

/* "Completed", scribbled in blue ballpoint over the bottom of the title, off to the
   right, with the date underneath. The ink multiplies over the print like real pen. */
.done-note {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: calc(-.34em - 1rem) .4em .4rem auto;
  color: #2b4c9b;
  font-family: var(--hand);
  font-size: clamp(34px, 11cqi, 52px);
  line-height: 1;
  transform: rotate(-6deg);
  transform-origin: right center;
  mix-blend-mode: multiply;
}

.done-date { display: block; margin: .05rem .5em 0 0; font-size: .5em; text-align: right; }

.notes-label {
  margin: clamp(22px, 6cqi, 38px) 0 .5rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--rule);
  font-variant-caps: all-small-caps;
  letter-spacing: .06em;
  font-size: 1.05rem;
  color: var(--muted);
}

/* journal entries */
.notes {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--ink);
}

.notes li + li { margin-top: .9rem; }
.notes p { margin: 0; }
.notes p + p { text-indent: 1.4em; }
/* a link on an update, as a small preview card */
.note-link {
  display: flex;
  margin-top: .5rem;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .45);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.note-link:hover { border-color: var(--meadow); }
.note-link:focus-visible { outline: 1px solid var(--midnight); outline-offset: 2px; }
.note-link img { flex: none; width: clamp(64px, 24cqi, 104px); aspect-ratio: 1; object-fit: cover; background: var(--rule); }
.note-link-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .45rem .7rem .5rem; }
.note-link-site {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
  color: var(--muted);
}
.note-link-title, .note-link-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.note-link-title { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.note-link-desc { font-size: .88rem; line-height: 1.35; color: var(--muted); }

/* photos on a goal page: a handwritten caption in black pen, then the Polaroids in a
   loose overlapping row. main.js shrinks the whole thing until the page fits. */
.polaroids {
  max-width: 460px;
  margin: .5rem 0 .3rem;
  container-type: inline-size; /* the caption and photos scale together */
}

.polaroid-caption {
  margin: 0 0 1.5cqi .5cqi;
  color: #1d1a1c;
  font-family: var(--hand);
  font-size: 6.2cqi;
  line-height: 1.1;
  transform: rotate(-2deg);
  transform-origin: left top;
}

.polaroid-row { position: relative; aspect-ratio: 1 / .64; }

.polaroid {
  position: absolute;
  display: block;
  width: 37%;
  padding: 5% 5% 16%;
  background: #fbf9f5;
  box-shadow: 0 1px 2px rgba(37, 23, 30, .18), 0 6px 14px -4px rgba(37, 23, 30, .32);
}
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--rule); }
.polaroid:focus-visible { outline: 2px solid var(--midnight); outline-offset: 3px; }
.polaroid-1 { z-index: 1; top: 20%; left: 0; transform: rotate(-6deg); }
.polaroid-2 { z-index: 3; top: 2%; left: 31%; transform: rotate(4deg); }
.polaroid-3 { z-index: 2; top: 22%; right: 0; transform: rotate(-3deg); }
.polaroid-1 img { object-position: 50% 62%; }
.polaroid-2 img { object-position: 50% 45%; }
.polaroid-3 img { object-position: 50% 55%; }

.notes .date {
  display: block;
  font-variant-caps: all-small-caps;
  letter-spacing: .05em;
  color: var(--blackberry);
}

/* ---------- Count me in ---------- */

/* a ribbon hanging from the top edge of the page, words running down it */
.join-ribbon {
  position: absolute;
  z-index: 2;
  top: 0;
  right: clamp(22px, 7cqi, 56px);
  width: 40px;
  padding: 18px 0 30px;
  border: 0;
  background: var(--midnight);
  color: var(--paper);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 11px), 0 100%);
  transition: padding-bottom .2s ease, background .15s ease;
}

.join-ribbon span { display: block; margin: 0 auto; writing-mode: vertical-rl; }

.join-ribbon:hover { background: #163035; padding-bottom: 38px; }
/* clip-path hides outlines, so focus shows as a colour change instead */
.join-ribbon:focus-visible { outline: none; background: var(--copper); color: var(--kurobeni); }

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1.3rem .6rem;
  border: 1px solid var(--midnight);
  border-radius: 2px;
  background: var(--midnight);
  color: var(--paper);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .15s ease;
}

.submit-btn:hover { background: #163035; }
.submit-btn:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.submit-btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Contact dialog ---------- */

.contact {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100svh - 24px);
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6);
  overflow: auto;
  overscroll-behavior: contain;
}

.contact::backdrop { background: rgba(37, 23, 30, .75); }

.contact-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.contact-close:hover { color: var(--ink); }
.contact-close:focus-visible { outline: 1px solid var(--midnight); }
.contact-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.contact-form,
.contact-thanks { padding: clamp(24px, 6vw, 40px); }

/* same voice as the goal pages: Anton headline, Bodoni everything else */
.contact h2 {
  margin: 0 3rem .6rem 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 8vw, 56px);
  line-height: .9;
  text-transform: uppercase;
  text-wrap: balance;
}

.contact h2:focus { outline: none; }
.contact-form h2 { margin-bottom: 1.5rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.field {
  display: block;
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > span,
.field > legend {
  display: block;
  padding: 0;
  margin-bottom: .25rem;
  font-variant-caps: all-small-caps;
  letter-spacing: .05em;
  font-size: 1.05rem;
  color: var(--muted);
}

.field input:not([type=radio]),
.field select,
.field textarea {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid #bfaea7;
  border-radius: 2px;
  background: #f6f2f0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem; /* at least 16px stops iOS zooming into the field */
}

.field textarea { resize: vertical; min-height: 6.5rem; line-height: 1.5; }

.field input:not([type=radio]):focus,
.field select:focus,
.field textarea:focus {
  outline: 1px solid var(--midnight);
  outline-offset: 0;
  border-color: var(--midnight);
}

.was-validated .field :invalid { border-color: var(--blackberry); }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #bfaea7;
  border-radius: 2px;
}

.segmented label { position: relative; display: flex; }
.segmented label + label { border-left: 1px solid #bfaea7; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }

.segmented span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .4rem;
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
  background: #f6f2f0;
}

.segmented input:checked + span { background: var(--midnight); color: var(--paper); }
.segmented input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: -3px; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error {
  margin: 0 0 1rem;
  padding: .5rem 0 .5rem .8rem;
  border-left: 2px solid var(--blackberry);
  color: var(--blackberry);
  font-size: 1.05rem;
  line-height: 1.4;
}

.submit-btn {
  font-family: var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.contact-form .submit-btn { width: 100%; margin-top: .25rem; padding: .75rem; font-size: 1.15rem; }

.contact-thanks p { margin: 0 0 1rem; font-size: 1.15rem; line-height: 1.55; }
.contact-thanks a { color: var(--midnight); text-underline-offset: .15em; }
.contact-thanks .submit-btn { margin-top: .5rem; }

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .segmented span { font-size: .98rem; }
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
  .stage { position: relative; padding: 56px 40px 88px; }
  /* round arrows floating over the left and right edges of the book */
  .nav-btn {
    position: absolute;
    z-index: 100;
    top: calc(50% - 16px - 22px); /* middle of the book, which sits 16px above centre */
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(236, 230, 226, .86);
    color: var(--blackberry);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .38), 0 2px 5px rgba(0, 0, 0, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
  }
  .nav-btn:hover { color: var(--blackberry); }
  .nav-btn svg { stroke-width: 2; }
  .nav-prev { left: 18px; }
  .nav-next { right: 18px; }
  .stage.show-float-nav .nav-btn { opacity: 1; pointer-events: auto; }
  .book {
    height: auto;
    width: 100%;
    max-width: none;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .follow { bottom: 14px; }
}

/* ---------- Short screens (phones held sideways) ---------- */

/* a wider book so pages use the space they have */
@media (orientation: landscape) and (max-height: 540px) and (min-width: 701px) {
  .stage { padding: 14px 28px 62px; gap: 12px; }
  .nav-btn { width: 42px; height: 42px; }
  .book {
    height: calc(100svh - 76px);
    aspect-ratio: auto;
    width: min(calc(100vw - 2 * (42px + 12px) - 56px), 640px);
    max-width: none;
  }
  .follow { bottom: 6px; }
  .follow-links a { width: 28px; height: 28px; }
}

@container (max-height: 520px) {
  .done-note { font-size: 32px; }
  .can-join .done-note { margin-right: 52px; } /* clear the Join me? ribbon on short pages */
  .page-inner { padding-top: 18px; padding-bottom: 10px; }
  .folio { margin-top: .4rem; font-size: .8rem; }

  .toc-head { padding-bottom: .3rem; }
  .toc-head h2 { font-size: 28px; }

  .goal-top { margin-bottom: 10px; }
  .goal-title { font-size: clamp(28px, 11cqh, 54px); margin-bottom: .5rem; }
  .join-ribbon { width: 34px; padding: 12px 0 24px; font-size: 13px; }
  .can-join .goal-title { margin-right: 44px; }
  .notes-label { margin-top: 12px; margin-bottom: .3rem; }
  .notes { font-size: 1.02rem; line-height: 1.4; }
  .notes li + li { margin-top: .6rem; }

  .cover-author { font-size: 17px; }
  .cover-date { font-size: 12px; }
  .countdown-text { font-size: 13px; }
  .cover { --barcode-w: clamp(62px, 22cqh, 100px); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --turn: .01s; }
}
