/* Philosophy 101: the Question Deck.
   A cool grey table, white card stock for reading,
   one coloured stock per volume for its questions. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-400-italic-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-400-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-700-italic-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-700-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --table: #e3e6e8;
  --stock-white: #fdfdfc;
  --ink: #1d1d1b;
  --muted: #4a4f55;
  --rule: #cfd4d7;
  --tint: #eef0f1;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --margin: clamp(1rem, 4vw, 2.5rem);
  --gap-section: clamp(4.5rem, 10vw, 8rem);
  --card-radius: 22px;
  --card-shadow: 0 1px 2px rgb(24 30 36 / 0.1), 0 14px 32px -14px rgb(24 30 36 / 0.32);
  --card-shadow-lift: 0 2px 4px rgb(24 30 36 / 0.1), 0 22px 40px -16px rgb(24 30 36 / 0.38);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --stock: #2c4aa8;
  --stock-ink: #ffffff;
  scrollbar-color: #8a9197 var(--table);
}

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

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

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: clip;
  background: var(--table);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  caret-color: var(--ink);
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

::selection {
  background: var(--ink);
  color: var(--stock-white);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

.skip-link {
  position: absolute;
  left: var(--margin);
  top: 0.5rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--stock-white);
  font-family: var(--display);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Frame */

.site-header,
.site-main,
.site-footer {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--margin);
}

.site-main {
  outline: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.75rem;
}

.site-brand {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-brand__mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--display);
  font-weight: 600;
}

.site-nav a {
  text-decoration: none;
  padding: 0.5rem 0.2rem;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: var(--gap-section);
  padding-block: 1.75rem 2.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

/* Controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--stock-white);
  font: 700 1.05rem/1.2 var(--display);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(24 30 36 / 0.2), 0 8px 18px -10px rgb(24 30 36 / 0.5);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgb(24 30 36 / 0.2), 0 14px 24px -12px rgb(24 30 36 / 0.55);
}

.button:active {
  transform: translateY(0);
}

.button--quiet {
  background: var(--stock-white);
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

.button--quiet:hover {
  box-shadow: var(--card-shadow-lift);
}

.text-link {
  font-family: var(--display);
  font-weight: 700;
}

.section-title {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.section-title--large {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  letter-spacing: -0.03em;
}

/* Card anatomy: corner indices like a playing card */

.card-index {
  position: absolute;
  top: 1rem;
  left: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font: 800 0.95rem/1 var(--display);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

.card-index--flip {
  top: auto;
  left: auto;
  right: 1.15rem;
  bottom: 1rem;
  transform: rotate(180deg);
}

.card-index__pip {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--stock);
  transform: rotate(45deg);
}

/* The question card: the volume's own stock */

.qcard {
  position: relative;
  margin: 0;
  border-radius: var(--card-radius);
  background: var(--stock);
  color: var(--stock-ink);
  box-shadow: var(--card-shadow);
}

.qcard .card-index__pip {
  background: var(--stock-ink);
}

.qcard ::selection {
  background: var(--stock-ink);
  color: var(--stock);
}

.qcard :focus-visible {
  outline-color: var(--stock-ink);
}

.qcard__question {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Home */

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(2rem, 6vw, 4.5rem) 0;
}

.home-intro__text h1 {
  max-width: 11ch;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.home-intro__text h1 + p {
  max-width: 30ch;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.5;
}

.home-intro__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
}

.draw {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.draw__table {
  position: relative;
  width: min(100%, 25rem);
}

.draw__pile {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.07) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(-45deg, rgb(255 255 255 / 0.07) 0 2px, transparent 2px 11px),
    var(--ink);
  box-shadow: 0 0 0 7px var(--ink) inset, 0 0 0 8.5px rgb(255 255 255 / 0.35) inset, var(--card-shadow);
  transform: translate(1.4rem, 0.6rem) rotate(7deg);
}

.qcard--drawn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
  aspect-ratio: 5 / 7;
  padding: 3.5rem 2.25rem 3.25rem;
  transform: rotate(-2deg);
}

.qcard--drawn .qcard__question {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.15;
}

.qcard__source {
  display: grid;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1.5px solid color-mix(in srgb, var(--stock-ink) 35%, transparent);
}

.qcard__idea {
  font-size: 1rem;
  line-height: 1.45;
}

.qcard__from {
  font: 600 0.95rem/1.35 var(--display);
}

.qcard__from a {
  font-weight: 700;
}

.qcard--drawn.is-dealt {
  animation: deal 560ms var(--ease-out);
}

@keyframes deal {
  from {
    transform: translate(2.5rem, -0.75rem) rotate(8deg);
    opacity: 0.2;
  }
  to {
    transform: rotate(-2deg);
    opacity: 1;
  }
}

/* Decks: one stock per volume, stacked a few cards thick */

.volumes {
  margin-top: var(--gap-section);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr));
  gap: 2.75rem 2.25rem;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}

.deck-stack {
  position: relative;
  isolation: isolate;
  display: flex;
}

/* The cards underneath: the volume's stock, fanned slightly upward */
.deck-stack::before,
.deck-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--card-radius);
  background: var(--stock);
  box-shadow: 0 1px 2px rgb(24 30 36 / 0.12), 0 8px 18px -12px rgb(24 30 36 / 0.3);
  transform: translate(5px, -7px) rotate(2.2deg);
}

.deck-stack::after {
  z-index: -2;
  background: color-mix(in srgb, var(--stock) 62%, var(--stock-white));
  transform: translate(-4px, -11px) rotate(-1.8deg);
}

.deck {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 1.6rem 1.5rem 1.5rem;
  border-radius: var(--card-radius);
  background: var(--stock-white);
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

.deck__number {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  min-width: 2.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 10px;
  background: var(--stock);
  color: var(--stock-ink);
  font: 800 1.35rem/1 var(--display);
  letter-spacing: -0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.deck__title {
  padding-right: 3rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.deck__title a {
  text-decoration: none;
}

.deck__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
}

.deck__description {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.deck__chapters {
  margin: 1.25rem 0 0;
  padding: 0.5rem 0 0;
  list-style: none;
  border-top: 1.5px solid var(--rule);
}

.deck__chapters li {
  border-bottom: 1px solid var(--tint);
}

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

.deck__chapters a {
  display: block;
  padding: 0.5rem 0;
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
}

.deck__chapters a:hover {
  text-decoration: underline;
}

.statement {
  max-width: 40rem;
  margin-top: var(--gap-section);
}

.statement p {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 1.2rem;
}

/* Volume page */

.volume-page,
.chapter {
  max-width: 48rem;
  margin-inline: auto;
  padding-top: clamp(1rem, 3vw, 2rem);
}

.volume-page {
  padding-top: clamp(1.75rem, 4vw, 2.5rem);
}

.breadcrumb {
  margin-bottom: 1.25rem;
  font-family: var(--display);
  font-weight: 700;
}

.deck-stack--hero::before {
  transform: translate(4px, -6px) rotate(0.7deg);
}

.deck-stack--hero::after {
  transform: translate(-3px, -10px) rotate(-0.6deg);
}

.deck--hero {
  background: var(--stock);
  color: var(--stock-ink);
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.5rem, 6vw, 3.25rem) clamp(1.75rem, 5vw, 2.75rem);
}

.deck--hero h1 {
  max-width: 12ch;
  font-size: clamp(2.5rem, 8vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.deck--hero .deck__number {
  top: clamp(1.25rem, 4vw, 2rem);
  right: clamp(1.25rem, 4vw, 2.25rem);
  padding: 0;
  background: none;
  color: inherit;
  font-size: clamp(3.5rem, 11vw, 6rem);
  letter-spacing: -0.04em;
}

.deck--hero .deck__description {
  color: inherit;
}

.deck--hero ::selection {
  background: var(--stock-ink);
  color: var(--stock);
}

.deck--hero :focus-visible {
  outline-color: var(--stock-ink);
}

.deck--hero .deck__description {
  max-width: 30ch;
  margin-top: 1rem;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
}

.deck__count {
  margin-top: 2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
}

.card-run {
  margin-top: clamp(3.5rem, 8vw, 5rem);
}

.card-list {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.chapter-card {
  display: grid;
  gap: 0.5rem;
  padding: 1.35rem 1.5rem 1.5rem;
  border-radius: 18px;
  background: var(--stock-white);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
}

.chapter-card:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: var(--card-shadow-lift);
}

.chapter-card__index {
  justify-self: start;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: var(--stock);
  color: var(--stock-ink);
  font: 800 0.9rem/1.3 var(--display);
  font-variant-numeric: tabular-nums;
}

.chapter-card__title {
  font: 700 clamp(1.25rem, 2.6vw, 1.5rem)/1.2 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.chapter-card:hover .chapter-card__title {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
}

.chapter-card__question {
  color: var(--muted);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
}

/* Chapter page */

.deck-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.95rem 0.3rem 0.3rem;
  border-radius: 999px;
  background: var(--stock);
  color: var(--stock-ink);
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(24 30 36 / 0.15);
}

.deck-chip:hover {
  text-decoration: underline;
}

.deck-chip__number {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--stock-ink);
  color: var(--stock);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.read-card {
  position: relative;
  padding: clamp(3.25rem, 7vw, 4.75rem) clamp(1.35rem, 7vw, 4.5rem) clamp(3.5rem, 7vw, 4.75rem);
  border-radius: var(--card-radius);
  background: var(--stock-white);
  box-shadow: var(--card-shadow);
}

.read-card h1 {
  max-width: 20ch;
  font-size: clamp(1.75rem, 4.4vw, 2.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.prose {
  max-width: 36rem;
  margin-top: 1.75rem;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin-top: 2em;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}

.prose strong {
  font-weight: 700;
}

.prose a {
  text-decoration-color: color-mix(in srgb, var(--stock) 80%, var(--ink));
  text-decoration-thickness: 0.12em;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: 0.55em;
}

.prose li::marker {
  font-family: var(--display);
  font-weight: 700;
}

.prose blockquote {
  margin: 0.75em 0 0;
  padding: 0.85em 1.1em;
  border-radius: 12px;
  background: var(--tint);
}

.prose blockquote > * + * {
  margin-top: 0.6em;
}

.prose hr {
  height: 1px;
  margin-block: 2.5em;
  border: 0;
  background: var(--rule);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--tint);
  font-size: 0.92em;
}

/* The dealt question: the biggest type on the page */

.qcard--dealt {
  z-index: 1;
  margin-top: -1.5rem;
  margin-inline: clamp(0.5rem, 3vw, 2.25rem) clamp(-0.5rem, -1vw, 0rem);
  padding: clamp(3.25rem, 7vw, 4.5rem) clamp(1.5rem, 6vw, 3.75rem) clamp(3.5rem, 7vw, 4.75rem);
  transform: rotate(-1.4deg);
}

.qcard--dealt .qcard__question {
  font-size: clamp(2.25rem, 6.2vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.next-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: clamp(2.75rem, 6vw, 3.75rem);
}

.next-card {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1.15rem 1.35rem 1.3rem;
  border-radius: 16px;
  background: var(--stock-white);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
}

.next-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-lift);
}

.next-card--forward {
  text-align: right;
}

.next-card__label {
  color: var(--muted);
  font: 600 0.95rem/1.3 var(--display);
}

.next-card__title {
  font: 700 1.15rem/1.25 var(--display);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.next-card:hover .next-card__title {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
}

/* Plain pages (404) */

.page-plain {
  max-width: 40rem;
  margin: clamp(2rem, 6vw, 4rem) auto 0;
}

.page-plain .read-card > * + * {
  margin-top: 1rem;
}

.page-plain h1 {
  font-size: clamp(2rem, 5vw, 2.85rem);
}

/* Responsive */

@media (max-width: 56rem) {
  .home-intro {
    grid-template-columns: 1fr;
  }

  .draw__table {
    width: min(88%, 23rem);
  }
}

@media (max-width: 38rem) {
  body {
    font-size: 1.0625rem;
  }

  .site-header {
    min-height: 4rem;
  }

  .next-cards {
    grid-template-columns: 1fr;
  }

  .next-card--forward {
    order: -1;
  }

  .qcard--dealt {
    margin-inline: 0.35rem 0;
    transform: rotate(-1deg);
  }

  .qcard--drawn {
    padding: 3rem 1.75rem;
  }

  .deck-grid {
    gap: 2.25rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .site-footer,
  .next-cards,
  .breadcrumb {
    display: none;
  }

  .read-card,
  .qcard {
    box-shadow: none;
    transform: none;
  }
}

/* Reading progress */

.deck__progress {
  margin-top: 0.75rem;
  color: var(--muted);
  font: 700 0.9rem/1.3 var(--display);
}

[data-track].is-read::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.4em;
  vertical-align: -0.15em;
  background: currentColor;
  -webkit-mask: var(--tick) center / contain no-repeat;
  mask: var(--tick) center / contain no-repeat;
}

:root {
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5l4.8 4.8L19.5 7' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.chapter-card {
  position: relative;
}

.chapter-card.is-read::before {
  position: absolute;
  top: 1.35rem;
  right: 1.4rem;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  color: var(--muted);
}

.card-run__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.card-run__head .deck__progress {
  margin: 0;
}

.continue {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.continue a {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
}

/* Search */

.search-page {
  max-width: 48rem;
  margin-inline: auto;
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.search-page h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  letter-spacing: -0.035em;
}

.search-form {
  margin-top: 1.5rem;
}

.search-form__label {
  display: block;
  margin-bottom: 0.6rem;
  font: 600 1rem/1.3 var(--display);
}

.search-form__row {
  position: relative;
}

.search-form__icon {
  position: absolute;
  top: 50%;
  left: 1.1rem;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-form__input {
  width: 100%;
  min-height: 3.75rem;
  padding: 0.75rem 1.25rem 0.75rem 3.25rem;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--stock-white);
  color: var(--ink);
  font: 400 1.2rem/1.3 var(--text);
  box-shadow: var(--card-shadow);
  -webkit-appearance: none;
  appearance: none;
}

.search-form__input::placeholder {
  color: #6b7178;
}

.search-form__input:focus {
  outline: none;
  border-color: var(--ink);
}

.search-status {
  margin-top: 1.25rem;
  color: var(--muted);
  font: 600 0.95rem/1.3 var(--display);
}

.search-results {
  margin-top: 0.75rem;
}

.search-result[hidden] {
  display: none;
}

.chapter-card__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font: 600 0.9rem/1.3 var(--display);
}

.chapter-card__meta .chapter-card__index {
  justify-self: auto;
}

.chapter-card__idea {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

.search-empty {
  margin-top: 1.5rem;
  color: var(--muted);
}

@media (max-width: 38rem) {
  .site-nav {
    gap: 0.7rem;
    font-size: 0.9rem;
  }

  .site-nav a {
    padding-inline: 0;
  }

  .site-brand {
    font-size: 1.02rem;
    gap: 0.45rem;
  }

  .site-brand__mark {
    width: 1.6rem;
    height: 1.6rem;
  }
}

@media (max-width: 23rem) {
  .site-brand {
    font-size: 0;
    gap: 0;
  }
}

/* Chapter helpers */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}

.breadcrumb__position {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.qcard__actions {
  margin-top: 1.75rem;
}

.qcard__share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid color-mix(in srgb, var(--stock-ink) 55%, transparent);
  border-radius: 12px;
  background: transparent;
  color: var(--stock-ink);
  font: 700 1rem/1.2 var(--display);
  cursor: pointer;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.qcard__share:hover {
  border-color: var(--stock-ink);
  background: color-mix(in srgb, var(--stock-ink) 12%, transparent);
}

.qcard__share svg {
  width: 1.15rem;
  height: 1.15rem;
}

.deck__more {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.9rem;
  font: 700 0.98rem/1.3 var(--display);
  text-decoration-color: var(--stock);
  text-decoration-thickness: 0.14em;
}

.read-card .search-form__input {
  border-color: var(--rule);
  box-shadow: none;
}

.read-card .search-form__input:focus {
  border-color: var(--ink);
}
