/* ==========================================================================
   Design tokens — colours, type and shape, in light and dark.
   Shared by the app (src/styles.css) and the static pages (site/site.css),
   so the Growth Chart, the landing page and the online book stay one family.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* surfaces & ink */
  --bg: #f7f2e8;
  --surface: #fffdf8;
  --surface-2: #f1eadc;
  --ink: #1f2d33;
  --ink-2: #55666c;
  --ink-3: #7d8b8f;
  --line: #e5dccb;

  /* brand: the teal of the printed chart */
  --brand: #2f6b7a;
  --brand-strong: #235562;
  --brand-soft: #dcebed;
  --on-brand: #ffffff;
  --gold: #d9a441;
  --danger: #a8443c;

  /* the 1–10 score scale: soft red, through amber, to green */
  --rate-low: #d36b5e;
  --rate-mid: #e3ab5b;
  --rate-high: #57a970;

  /* principle accent — overridden on any [data-p] element */
  --pc: var(--brand);
  --on-pc: #ffffff;

  /* illustration */
  --sky-top: #f3d9ae;
  --sky-bottom: #fbf0dc;
  --sun: #f2b653;
  --ridge-far: #c9dcdb;
  --ridge-mid: #93b9bd;
  --ridge-near: #518996;
  --pine: #2f6b7a;
  --meadow: #a3b982;
  --trail: #f8ecd4;
  --bloom-a: #d97f74;
  --bloom-b: #f0c25e;
  --bloom-c: #9b8bd0;

  --font-display: 'Fraunces Variable', 'Iowan Old Style', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  --gutter: 20px;
  --shadow: 0 1px 2px rgb(60 45 20 / 0.04), 0 8px 24px -12px rgb(60 45 20 / 0.18);
  --tabbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a1d;
    --surface: #1b2529;
    --surface-2: #243136;
    --ink: #eef2f0;
    --ink-2: #aab8bb;
    --ink-3: #82939a;
    --line: #2e3d42;

    --brand: #6fb6c6;
    --brand-strong: #8fcbd8;
    --brand-soft: #21383e;
    --on-brand: #0e1a1e;
    --gold: #e0b45c;
    --danger: #e58c84;
    --on-pc: #0e1a1e;

    --sky-top: #15232a;
    --sky-bottom: #213239;
    --sun: #ecd9a6;
    --ridge-far: #2a4750;
    --ridge-mid: #223d45;
    --ridge-near: #1a3138;
    --pine: #10252b;
    --meadow: #263b31;
    --trail: #5d7068;
    --bloom-a: #b3695f;
    --bloom-b: #c9a14c;
    --bloom-c: #8072b0;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 8px 24px -12px rgb(0 0 0 / 0.5);
  }
}

/* fraunces-latin-ext-wght-normal */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/fraunces-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* fraunces-latin-wght-normal */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/fraunces-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}/* fraunces-latin-ext-wght-italic */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/fraunces-latin-ext-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* fraunces-latin-wght-italic */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/fraunces-latin-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
[data-p="communication"]{--pc:#1F7389}[data-p="compliments"]{--pc:#A36A00}[data-p="commitment"]{--pc:#437A34}[data-p="compromise"]{--pc:#7361B5}[data-p="compassion"]{--pc:#B34C46}[data-p="forgiveness"]{--pc:#2F76AD}@media (prefers-color-scheme: dark){[data-p="communication"]{--pc:#5FB4C8}[data-p="compliments"]{--pc:#E0AC4A}[data-p="commitment"]{--pc:#8CC079}[data-p="compromise"]{--pc:#A898E0}[data-p="compassion"]{--pc:#E38D85}[data-p="forgiveness"]{--pc:#7BB6E3}}
/* ==========================================================================
   The Five Cs — landing page and online book
   Colours, type and shape come from src/tokens.css (shared with the app).
   Two accents keep the pair in balance: gold for the book, teal for the chart.
   ========================================================================== */

:root {
  /* the book's gold, from its cover */
  --book: #8a6a1c;
  --book-rule: #c9ab63;
  --book-fill: #8a6a1c;
  --on-book: #ffffff;
  --book-strong: #6a500f;
  --book-soft: #f4e6c3;
  /* the paper the book's pictures are printed on, for dark mode */
  --paper: #efe7d6;

  --page: 1120px;
  --column: 680px;
  --pad: 20px;
  /* height of the bar at the top of every page */
  --head-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --book: #e0b45c;
    --book-rule: #8a7335;
    --book-fill: #e0b45c;
    --on-book: #1a1403;
    --book-strong: #f0cd85;
    --book-soft: #3a3120;
  }
}

@media (min-width: 760px) {
  :root {
    --pad: 40px;
    --head-h: 68px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 40;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.eyebrow.gold {
  color: var(--book);
}

.fine {
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.5;
}

.lede {
  color: var(--ink-2);
  font-size: 1.08rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.tagline {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--book);
}

/* ---- buttons: equal weight for the book (gold) and the chart (teal) ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.12s ease,
    filter 0.15s ease,
    background-color 0.15s ease;
}

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

.btn-book {
  background: var(--book-fill);
  color: var(--on-book);
}

.btn-chart {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 600;
  text-underline-offset: 3px;
}

/* someone with a chart on this device is offered "Continue" instead of "Open" */
.when-returning,
.has-chart .when-new {
  display: none;
}

.has-chart .when-returning {
  display: inline;
}

/* ---- principle badge (as in the app) ---- */

.badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  color: var(--pc);
  background: color-mix(in srgb, var(--pc) 14%, var(--surface));
}

/* ==========================================================================
   Header and footer
   ========================================================================== */

/* A bar that stays at the top as the page scrolls: the page shows through it,
   softly blurred. Brand on the left; the site's two halves on the right. */
.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
}

/* Where the browser can, the line under the bar only appears once the page has scrolled. */
@supports (animation-timeline: scroll()) {
  .site-head {
    animation: head-line linear both;
    animation-timeline: scroll();
    animation-range: 0 48px;
  }

  @keyframes head-line {
    from {
      border-bottom-color: transparent;
    }
  }
}

/* On a phone, a chapter is for reading: there the bar scrolls away with the page. */
@media (max-width: 759px) {
  .reading .site-head {
    position: static;
    border-bottom-color: transparent;
    animation: none;
  }
}

.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--head-h);
  max-width: calc(var(--page) + 2 * var(--pad));
  margin: 0 auto;
  padding: 0 var(--pad);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-mark {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgb(60 45 20 / 0.08),
    0 3px 8px -3px rgb(60 45 20 / 0.35);
}

/* "Cs" in gold, as on the cover */
.wordmark b {
  color: var(--book);
  font-weight: inherit;
}

.site-head nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-head nav a {
  --accent: var(--book-strong);
  --soft: var(--book-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px 0 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.93rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition:
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.site-head nav svg {
  flex: none;
}

.site-head .nav-chart {
  --accent: var(--brand-strong);
  --soft: var(--brand-soft);
}

/* the section you are in is ringed in its colour */
.site-head nav a[aria-current='page'] {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}

.site-head nav a:active {
  transform: scale(0.96);
}

@media (min-width: 760px) {
  .wordmark {
    font-size: 1.4rem;
  }

  .wordmark-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .site-head nav a {
    min-height: 42px;
    padding: 0 18px 0 14px;
    font-size: 0.96rem;
  }
}

/* phones: "Book" and "Chart" */
@media (max-width: 479px) {
  .nav-long {
    display: none;
  }

  .nav-short {
    text-transform: capitalize;
  }
}

/* grid children may shrink below their content, so nothing pushes the page wider than the screen */
.hero-copy > *,
.after > *,
.pair-card > *,
.book-intro-text > *,
.companion > *,
.chart-end > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 359px) {
  .btn {
    padding: 0 16px;
    font-size: 0.96rem;
    white-space: normal;
    text-align: center;
  }

  /* the narrowest phones: the labels alone */
  .site-head-inner {
    gap: 8px;
    padding: 0 14px;
  }

  .site-head nav {
    gap: 6px;
  }

  .site-head nav a {
    padding: 0 13px;
  }

  .site-head nav svg {
    display: none;
  }
}

.site-foot {
  margin-top: 72px;
  border-top: 1px solid var(--line);
}

.site-foot-inner {
  display: grid;
  gap: 14px;
  max-width: calc(var(--page) + 2 * var(--pad));
  margin: 0 auto;
  padding: 32px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 40px);
}

.site-foot-title strong,
.site-foot-title span {
  display: block;
}

.site-foot-title strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.site-foot-title span,
.site-foot-fine {
  color: var(--ink-2);
  font-size: 0.88rem;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.site-foot nav a {
  font-size: 0.94rem;
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ==========================================================================
   The book standing, and the app on a phone
   ========================================================================== */

.book {
  position: relative;
  aspect-ratio: 971 / 1619;
  border-radius: 2px 5px 5px 2px;
  box-shadow:
    4px 0 0 -0.5px #efe6d2,
    4.5px 0 0 -0.5px #cdbf9f,
    8px 0 0 -2px #efe6d2,
    8.5px 0 0 -2px #cdbf9f,
    0 26px 44px -16px rgb(24 44 52 / 0.55),
    0 8px 18px rgb(24 44 52 / 0.22);
}

.book img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.book::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgb(60 40 10 / 0.22) 0,
    rgb(255 255 255 / 0.28) 2.2%,
    rgb(60 40 10 / 0.1) 4%,
    rgb(255 255 255 / 0) 8%
  );
}

/* A phone in the hand: an even black bezel (4.5% of the width) all round, a
   slim metal rim, side buttons, and a screen with exactly the app's shape
   (390 × 844), so the screenshot is shown whole — nothing cropped at the edges.
   Height = width × 2.0593: the screen's height plus the bezel top and bottom. */
.phone {
  --phone-ring: 0 0 0 1.5px #434c52, inset 0 0 0 1px rgb(255 255 255 / 0.09);
  --phone-drop: 0 28px 46px -18px rgb(24 44 52 / 0.55), 0 8px 18px rgb(24 44 52 / 0.22);
  position: relative;
  flex: none;
  aspect-ratio: 1000 / 2059;
  /* corners: the screen's curve plus the bezel, so the two stay parallel */
  border-radius: 16.4% / 8%;
  background: #101315;
  box-shadow: var(--phone-ring), var(--phone-drop);
}

/* side buttons: volume on the left, power on the right */
.phone::before,
.phone::after {
  content: '';
  position: absolute;
  width: 1.4%;
  border-radius: 2px;
  background: #3a4247;
}

.phone::before {
  left: -1.4%;
  top: 19%;
  height: 14.5%;
  background: linear-gradient(#3a4247 0 44%, transparent 44% 56%, #3a4247 56% 100%);
}

.phone::after {
  right: -1.4%;
  top: 24%;
  height: 10%;
}

/* Placed rather than padded: padding percentages follow the surrounding box's
   width, not the phone's. 4.5% of the width at the sides is 4.5 / 2.0593 ≈
   2.185% of the height at top and bottom. */
.phone-screen {
  position: absolute;
  inset: 2.185% 4.5%;
  overflow: hidden;
  /* 12.8% of the width across, the same curve down (12.8 × 390 / 844 ≈ 5.9%) */
  border-radius: 12.8% / 5.9%;
  background: var(--bg);
  color: #0f1416;
}

.phone-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.phone-status {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  fill: currentColor;
  pointer-events: none;
}

.phone-status text {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.phone-island {
  fill: #000;
}

.phone-wifi path + path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.phone-battery {
  fill: none;
  stroke: currentColor;
  stroke-opacity: 0.4;
  stroke-width: 1;
}

.phone-home {
  position: absolute;
  left: 50%;
  bottom: 0.95%;
  width: 35%;
  height: 0.6%;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

@media (prefers-color-scheme: dark) {
  .phone-screen {
    color: #f3f5f6;
  }
}

/* ==========================================================================
   Landing page
   ========================================================================== */

.landing main {
  display: grid;
  gap: clamp(56px, 9vw, 104px);
}

.hero,
.band,
.closing {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--pad));
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero {
  display: grid;
  gap: 32px;
  padding-top: 12px;
}

.hero-copy {
  display: grid;
  gap: 16px;
  align-content: center;
  justify-items: start;
}

.hero h1,
.book-intro h1 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.3rem, 7.4vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.hero .lede {
  max-width: 34em;
}

.hero .cta-row {
  width: 100%;
  margin-top: 6px;
}

.hero .cta-row .btn,
.closing .cta-row .btn {
  flex: 1 1 220px;
  min-height: 58px;
  font-size: 1.04rem;
}

.hero-art {
  position: relative;
  aspect-ratio: 10 / 9;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-fade {
  display: none;
}

/* the book and the phone, centred together, each tilted slightly towards the other */
.hero-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10%;
}

.hero-book {
  flex: none;
  height: 60%;
  transform: rotate(-3deg);
}

.hero-phone {
  height: 72%;
  transform: rotate(3deg);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 56px;
    padding-top: 28px;
  }

  .hero .cta-row .btn {
    flex: 0 1 auto;
    min-width: 232px;
  }
}

.band {
  display: grid;
  gap: 24px;
}

.band-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.7rem, 4.6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.band-intro {
  margin-top: -14px;
  color: var(--ink-2);
  font-size: 1.05rem;
}

/* ---- the pair ---- */

.pair {
  display: grid;
  gap: 20px;
}

@media (min-width: 760px) {
  .pair {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

.pair-card {
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: start;
  padding: 28px 24px;
  border-radius: var(--radius);
  border-top: 5px solid var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pair-book {
  --accent: var(--book-rule);
}

.pair-chart {
  --accent: var(--brand);
}

.pair-book .eyebrow {
  color: var(--book);
}

.pair-chart .eyebrow {
  color: var(--brand);
}

.pair-card h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: -0.012em;
}

.pair-card > p:not(.eyebrow) {
  color: var(--ink-2);
  font-size: 1.02rem;
  text-wrap: pretty;
}

.ticks {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
  font-size: 0.96rem;
}

.ticks li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.ticks svg {
  flex: none;
  margin-top: 3px;
  color: var(--accent);
}

.pair-card .cta-row {
  margin-top: 6px;
}

@media (min-width: 760px) {
  .pair-card {
    padding: 34px 32px;
  }
}

/* ---- the five Cs ---- */

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

.c-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.c-icons {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.c-card strong {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.3rem;
  line-height: 1.2;
}

.c-card q {
  color: var(--ink-2);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.45;
  quotes: '“' '”';
  text-wrap: pretty;
}

.c-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--pc);
  font-size: 0.9rem;
  font-weight: 650;
}

/* ---- how they work together ---- */

.together {
  gap: 32px;
  justify-items: center;
}

.together-copy {
  display: grid;
  gap: 24px;
  width: 100%;
}

.steps {
  display: grid;
  gap: 22px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 16px;
}

.steps-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.steps li:first-child .steps-num {
  background: color-mix(in srgb, var(--book-rule) 30%, var(--surface));
  color: var(--book);
}

.steps h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.25rem;
  line-height: 1.5;
}

.steps p {
  color: var(--ink-2);
  text-wrap: pretty;
}

/* the phone peeks up from below, so the steps stay the main thing */
.together-shot {
  width: min(66vw, 250px);
  max-height: 340px;
  overflow: hidden;
  /* room for the side buttons and rim */
  padding: 3px 6px 0;
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}

.together-shot .phone {
  box-shadow: var(--phone-ring);
}

@media (min-width: 760px) {
  .together {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 64px;
  }

  .together-shot {
    width: 270px;
    max-height: 400px;
  }
}

/* ---- authors ---- */

.authors {
  gap: 28px;
  justify-items: center;
}

/* The wedding watercolour from the book, and in front of it the authors'
   portrait as a framed print: cream mount, a fine gold line, set at a slight tilt. */
.authors-art {
  position: relative;
  width: min(60vw, 260px);
}

.authors-art.has-portrait {
  width: min(78vw, 340px);
  /* room for the print to hang below and to the right of the painting */
  padding: 0 34% 14% 0;
  /* the tilted print's lower corner reaches a little past the box */
  margin-bottom: 14px;
}

.authors-painting {
  margin: 0;
}

.authors-painting .mat {
  width: 100%;
}

.authors-portrait {
  position: absolute;
  right: 2%;
  bottom: 0;
  width: 56%;
  margin: 0;
  padding: 7px 7px 0;
  border-radius: 3px;
  background: #fffdf8;
  box-shadow:
    inset 0 0 0 1px #e8dcc3,
    0 22px 36px -16px rgb(24 44 52 / 0.55),
    0 6px 14px rgb(24 44 52 / 0.2);
  transform: rotate(3deg);
}

.authors-portrait img {
  display: block;
  width: 100%;
  height: auto;
  /* a fine gold line round the photograph, as on the cover */
  outline: 1px solid var(--book-rule);
  outline-offset: 2px;
  border-radius: 1px;
}

.authors-portrait figcaption {
  padding: 10px 2px 9px;
  color: #3a3226;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.2;
  text-align: center;
  /* on the narrowest phones the names take two even lines */
  text-wrap: balance;
}

@media (prefers-color-scheme: dark) {
  .authors-portrait {
    background: var(--paper);
    box-shadow:
      inset 0 0 0 1px #d9cdb2,
      0 22px 36px -14px rgb(0 0 0 / 0.7);
  }
}

.authors > div {
  display: grid;
  gap: 20px;
  justify-items: start;
}

.pull {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  line-height: 1.35;
  text-wrap: balance;
}

.pull footer,
.closing blockquote footer {
  margin-top: 12px;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

@media (min-width: 760px) {
  .authors {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 56px;
  }

  .authors-art {
    width: 280px;
  }

  .authors-art.has-portrait {
    width: 380px;
  }

  .authors-portrait {
    padding: 9px 9px 0;
  }

  .authors-portrait figcaption {
    font-size: 0.95rem;
  }
}

/* ---- closing ---- */

.closing {
  display: grid;
  gap: 28px;
  justify-items: center;
  text-align: center;
}

.closing blockquote {
  max-width: 24em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 4.4vw, 2.1rem);
  line-height: 1.3;
  text-wrap: balance;
}

.closing .cta-row {
  justify-content: center;
  width: 100%;
  max-width: 560px;
}

/* ==========================================================================
   Pictures from the book
   They are painted on white. On the cream page the white is blended away; in
   dark mode each picture sits on a small sheet of paper instead.
   ========================================================================== */

.illus {
  --w: 100%;
  margin: 2.1em 0;
  text-align: center;
}

.illus.w86 { --w: 86%; }
.illus.w74 { --w: 74%; }
.illus.w66 { --w: 66%; }
.illus.w60 { --w: 60%; }
.illus.w54 { --w: 54%; }
.illus.w46 { --w: 46%; }
.illus.w30 { --w: 30%; }

.mat {
  display: inline-block;
  /* small pictures are shown a little larger on a phone than their share of the column */
  width: clamp(min(100%, 250px), var(--w), 100%);
  vertical-align: top;
}

.illus.rose .mat,
.illus.w30 .mat {
  width: clamp(110px, var(--w), 100%);
}

.mat img {
  display: block;
  width: 100%;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .mat {
    isolation: isolate;
    padding: 8px;
    border-radius: 12px;
    background: var(--paper);
  }

  .mat img {
    border-radius: 6px;
  }
}

/* ==========================================================================
   Reading pages
   ========================================================================== */

.reader,
.contents,
.not-found {
  padding: 8px var(--pad) 0;
}

.reader {
  display: grid;
  grid-template-columns: minmax(0, var(--column));
  justify-content: center;
}

.crumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--ink-3);
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.crumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--ink-2);
  font-weight: 650;
  text-decoration: none;
}

.crumb span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- the text ---- */

.prose {
  font-family: var(--font-display);
  font-size: 1.14rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

@media (min-width: 760px) {
  .prose {
    font-size: 1.22rem;
    line-height: 1.72;
  }
}

.prose p {
  margin: 0 0 1.05em;
  text-wrap: pretty;
}

.prose p.center {
  text-align: center;
}

.prose p.label {
  margin: 1.5em 0 0.35em;
  font-weight: 700;
}

.prose a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose h2,
.prose h3 {
  scroll-margin-top: 24px;
  text-wrap: balance;
}

/* on wide screens the bar stays put, so a heading jumped to stops below it */
@media (min-width: 760px) {
  .prose h2,
  .prose h3 {
    scroll-margin-top: calc(var(--head-h) + 20px);
  }
}

.prose h2 {
  margin: 2.1em 0 0.6em;
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.prose h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.14em;
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
}

/* drop capital on the first paragraph of the Introduction and of each chapter */
.prose .dc {
  float: left;
  margin: 0.07em 0.09em 0 0;
  color: var(--book);
  font-size: 3.5em;
  font-weight: 500;
  line-height: 0.8;
}

/* section openers */
.chapter-head {
  margin: 0 0 2.2em;
  text-align: center;
}

.chapter-head .opener {
  margin: 0 0 1.5em;
}

.chapter-label,
.minor-title {
  margin: 0 0 0.7em;
  color: var(--book);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.chapter-title {
  font-size: 1em;
  font-weight: 400;
  line-height: 1.12;
}

.chapter-title .kicker {
  display: block;
  margin-bottom: 0.2em;
  font-size: 1.2em;
  font-style: italic;
}

.chapter-title .sep {
  display: none;
}

.chapter-title .title-main {
  display: block;
  font-size: clamp(2.1rem, 8vw, 3.1rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.chapter-subtitle {
  margin-top: 0.7em;
  font-style: italic;
  font-size: 1.1em;
}

.head-rule {
  width: 22%;
  height: 0;
  margin: 1.3em auto 0;
  border: 0;
  border-top: 1px solid var(--book-rule);
}

/* lists and displayed text */
.prose ul {
  margin: 0.9em 0 1.2em;
  padding: 0 0 0 1.4em;
}

.prose li {
  margin: 0.35em 0;
}

.prose .brighten {
  margin: 1.5em 0;
  padding: 0.9em 0.4em;
  border-top: 1px solid var(--book-rule);
  border-bottom: 1px solid var(--book-rule);
  list-style: none;
}

.prose .brighten li {
  padding-left: 1.3em;
  text-indent: -1.3em;
}

.prose .brighten .init {
  color: var(--book);
  font-size: 1.15em;
  font-weight: 700;
}

.fivecs {
  margin: 1.5em 0;
  text-align: center;
}

.fivecs p {
  margin: 0 0 0.3em;
  font-weight: 700;
}

.prose .fivecs ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fivecs li {
  margin: 0.15em 0;
  letter-spacing: 0.06em;
}

.dialogue {
  margin: 1em 0 1.3em 0.2em;
  padding-left: 1.1em;
  border-left: 3px solid var(--book-rule);
}

.prose .dialogue p {
  margin: 0.4em 0;
}

.callout {
  margin: 1.7em 5%;
  font-size: 1.16em;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

.prose .callout p {
  margin: 0.2em 0;
  text-wrap: balance;
}

.callout strong {
  font-style: normal;
  letter-spacing: 0.02em;
}

.lines {
  margin: 0.9em 0 1.2em 1.4em;
}

.prose .lines p {
  margin: 0.2em 0;
}

.prose .scale p {
  margin: 0.5em 0 0.5em 1.4em;
  text-indent: -1.4em;
}

/* dedication */
.prose.dedication {
  padding: 6vh 0 4vh;
  text-align: center;
}

.prose.dedication .crumb {
  text-align: left;
}

.minor-title {
  margin: 4vh 0 1.8em;
}

.prose.dedication p.center {
  max-width: 26em;
  margin: 0 auto;
  font-size: 1.22em;
  font-style: italic;
  line-height: 1.6;
  text-wrap: balance;
}

.byline {
  margin-top: 2.2em !important;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---- "In this chapter" ---- */

.outline,
.outline-rail {
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.4;
}

.outline {
  margin: 0 0 2em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.outline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.outline summary::-webkit-details-marker {
  display: none;
}

.outline summary::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.outline[open] summary::after {
  transform: rotate(-135deg);
}

.outline ol,
.outline-rail ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.outline ol {
  padding: 0 8px 10px;
}

.outline a,
.outline-rail a {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
}

.outline-rail {
  display: none;
}

@media (min-width: 1180px) {
  .reader.has-outline {
    grid-template-columns: minmax(0, var(--column)) 230px;
    column-gap: 64px;
  }

  .reader.has-outline .prose,
  .reader.has-outline .after {
    grid-column: 1;
  }

  .outline {
    display: none;
  }

  .outline-rail {
    display: block;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--head-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--head-h) - 48px);
    overflow-y: auto;
    padding-left: 18px;
    border-left: 1px solid var(--line);
  }

  .outline-rail p {
    margin: 0 0 8px 8px;
    color: var(--ink-3);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
  }
}

/* ---- after the text: the companion app, then previous / next ---- */

.after {
  display: grid;
  gap: 20px;
  margin-top: 56px;
  font-family: var(--font-body);
}

.companion {
  display: grid;
  gap: 16px;
  padding: 22px 20px;
  border-radius: var(--radius);
  border-left: 5px solid var(--pc);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.companion-icons {
  display: flex;
  gap: 8px;
}

.companion-text {
  display: grid;
  gap: 4px;
}

.companion-text strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 560;
  line-height: 1.25;
}

.companion-text > span:last-child {
  color: var(--ink-2);
  font-size: 0.96rem;
}

.companion .btn {
  justify-self: start;
}

@media (min-width: 620px) {
  .companion {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
    padding: 24px 26px;
  }

  .companion .btn {
    grid-column: 2;
  }
}

.chart-end {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 32px 24px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  text-align: center;
}

.chart-end-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
}

.chart-end h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 560;
  line-height: 1.15;
}

.chart-end-sub {
  margin-top: -6px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
}

.chart-end > p:not(.eyebrow):not(.chart-end-sub) {
  color: var(--ink-2);
}

.chart-end .cta-row {
  justify-content: center;
  margin-top: 8px;
}

.pager {
  display: grid;
  gap: 12px;
}

.pager-link {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
}

.pager-dir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pager-link strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 560;
  line-height: 1.3;
}

.pager-next {
  order: -1;
  border-color: color-mix(in srgb, var(--book-rule) 70%, var(--line));
}

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

  .pager-next {
    order: 0;
    justify-items: end;
    text-align: right;
  }
}

/* ==========================================================================
   The book's contents page
   ========================================================================== */

.contents {
  display: grid;
  gap: 56px;
  justify-items: center;
}

.contents > * {
  width: 100%;
  max-width: var(--column);
}

.book-intro {
  display: grid;
  gap: 32px;
  justify-items: center;
  max-width: 920px !important;
  padding-top: 12px;
}

.book-intro .book {
  width: min(58vw, 230px);
  transform: rotate(-2deg);
}

.book-intro-text {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.book-intro h1 {
  font-size: clamp(2rem, 6.4vw, 3rem);
}

.book-intro .cta-row {
  margin-top: 6px;
}

@media (min-width: 760px) {
  .book-intro {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 56px;
  }

  .book-intro .book {
    width: 270px;
  }
}

.toc-title {
  margin-bottom: 20px;
  text-align: center;
}

.toc-title .mat {
  width: min(100%, 560px);
}

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

.toc-list > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.toc-list > li > a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 560;
  line-height: 1.3;
  text-decoration: none;
}

.toc-list ol {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.toc-list ol a {
  display: block;
  padding: 5px 0 5px 18px;
  color: var(--ink-2);
  font-size: 0.98rem;
  text-decoration: none;
}

.toc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.toc-note {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.title-art {
  margin: 0;
}

.copyright {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.9rem;
  text-align: center;
}

.copyright p {
  max-width: 34em;
  margin: 0 auto 0.9em;
  text-wrap: balance;
}

.not-found {
  display: grid;
  gap: 18px;
  justify-items: start;
  max-width: calc(var(--column) + 2 * var(--pad));
  margin: 0 auto;
  padding-top: 8vh;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 560;
}

/* ==========================================================================
   Pointer feedback, motion, print
   ========================================================================== */

@media (hover: hover) {
  .btn-book:hover,
  .btn-chart:hover {
    filter: brightness(1.08);
  }

  .btn-quiet:hover,
  .pager-link:hover,
  .outline a:hover,
  .outline-rail a:hover {
    background: var(--surface-2);
  }

  .site-head nav a:hover {
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
  }

  .c-card:hover {
    transform: translateY(-3px);
  }

  .toc-list a:hover,
  .text-link:hover,
  .crumb a:hover {
    color: var(--brand);
  }
}

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

  * {
    transition: none !important;
  }
}

@media print {
  .site-head,
  .site-foot,
  .after,
  .outline,
  .outline-rail,
  .crumb,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
