:root {
  --paper: #f3ede3;
  --paper-deep: #e7ddd0;
  --linen: #faf7f2;
  --ink: #2a221c;
  --ink-soft: #4a4038;
  --muted: #7a6f64;
  --line: #d6cbbc;
  --sage: #4f6b58;
  --sage-deep: #3d5446;
  --sage-mist: #dce6de;
  --danger: #8f3d32;
  --font: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 1rem;
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.btn {
  font-family: inherit;
}

.kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
}

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

.wrap-narrow {
  width: min(720px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Mark */
.mark {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--sage);
  flex-shrink: 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.wordmark.is-light .mark,
.wordmark.is-light {
  color: var(--linen);
}

/* Nav */
.nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--linen);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--linen) 82%, transparent);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--linen);
}

.nav.is-paper {
  position: sticky;
  top: 0;
  background: color-mix(in oklab, var(--linen) 92%, transparent);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav.is-paper .wordmark,
.nav.is-paper .mark {
  color: var(--ink);
}

.nav.is-paper .nav-links a {
  color: var(--muted);
}

.nav.is-paper .nav-links a:hover,
.nav.is-paper .nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav.is-paper .btn-nav {
  background: var(--sage);
  color: var(--linen);
}

.btn-nav {
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--linen);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 52px;
  padding: 0 1.35rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms var(--ease);
}

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

.btn-linen {
  background: var(--linen);
  color: var(--ink);
}

.btn-sage {
  background: var(--sage);
  color: var(--linen);
}

.btn-ink {
  background: var(--ink);
  color: var(--linen);
}

.btn-ghost {
  background: transparent;
  border-color: color-mix(in oklab, var(--linen) 40%, transparent);
  color: var(--linen);
}

.btn-ghost-ink {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--ink);
  color: var(--linen);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, var(--ink) 8%, rgb(42 34 28 / 0.45) 48%, rgb(42 34 28 / 0.28));
}

.film-grain {
  pointer-events: none;
  position: absolute;
  inset: -20%;
  z-index: 1;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(circle at 18% 32%, #fff 0 1px, transparent 1px 3px);
  animation: grain 8s steps(2) infinite;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7rem 0 4rem;
}

.hero-copy .kicker {
  color: color-mix(in oklab, var(--linen) 80%, transparent);
}

.hero-copy h1 {
  margin-top: 1rem;
  font-size: clamp(2.8rem, 9vw, 4.8rem);
}

.hero-copy .lede {
  margin-top: 1.4rem;
  max-width: 36rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: color-mix(in oklab, var(--linen) 90%, transparent);
}

/* Letter */
.letter {
  padding: 5rem 0;
}

.letter h2 {
  margin-top: 0.7rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
}

.letter .prose {
  margin-top: 2rem;
  display: grid;
  gap: 1.15rem;
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

em.display {
  font-family: var(--display);
  font-style: normal;
}

/* Chapters */
.chapter {
  background: var(--paper);
}

.chapter.is-alt {
  background: var(--linen);
}

.chapter-grid {
  display: grid;
}

.chapter-photo {
  min-height: 280px;
  overflow: hidden;
}

.chapter-photo img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.chapter-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.2rem 1.25rem;
}

.chapter-copy h2 {
  margin-top: 0.7rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.chapter-copy p.body {
  margin-top: 1.2rem;
  max-width: 28rem;
  color: var(--ink-soft);
}

/* Stats */
.stats {
  background: var(--ink);
  color: var(--linen);
  padding: 5rem 0;
}

.stats-grid {
  display: grid;
  gap: 2.4rem;
}

.stat-figure {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
}

.stat-label {
  margin-top: 0.7rem;
  color: color-mix(in oklab, var(--linen) 75%, transparent);
  font-size: 0.95rem;
}

.stats .source {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: color-mix(in oklab, var(--linen) 60%, transparent);
}

/* Steps / cards */
.section {
  padding: 5rem 0;
}

.section h2 {
  margin-top: 0.7rem;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.cards {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 {
  margin-top: 0.7rem;
  font-size: 1.45rem;
}

.card p {
  margin-top: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.panel-ink {
  margin-top: 2.5rem;
  background: var(--ink);
  color: var(--linen);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
}

.panel-ink .kicker {
  color: color-mix(in oklab, var(--linen) 70%, transparent);
}

.panel-ink h3 {
  margin-top: 0.7rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.panel-ink p {
  margin-top: 1rem;
  max-width: 36rem;
  color: color-mix(in oklab, var(--linen) 80%, transparent);
}

/* Families */
.families {
  background: var(--linen);
}

.family-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.family-grid {
  display: grid;
  gap: 1.2rem;
  margin-top: 2.4rem;
}

.family {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
}

.family img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.family-copy {
  padding: 1rem 1.1rem 1.2rem;
}

.family-copy .who {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.family-copy h3 {
  margin-top: 0.4rem;
  font-size: 1.3rem;
}

.family-copy p {
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Close */
.close {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: var(--linen);
  text-align: center;
}

.close img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.close-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgb(42 34 28 / 0.55);
}

.close-copy {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 6.5rem 0;
}

.close-copy .mark {
  margin: 0 auto;
  color: var(--linen);
  width: 2.5rem;
  height: 2.5rem;
}

.close-copy h2 {
  margin-top: 1.4rem;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
}

.close-copy p {
  margin: 1.2rem auto 0;
  max-width: 28rem;
  font-size: 1.1rem;
  color: color-mix(in oklab, var(--linen) 85%, transparent);
}

.close-copy .actions {
  justify-content: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.4rem 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer p {
  margin: 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Interior pages */
.page-hero {
  background: var(--ink);
  color: var(--linen);
  padding: 7.5rem 0 3.5rem;
}

.page-hero h1 {
  margin-top: 0.8rem;
  font-size: clamp(2.4rem, 7vw, 4rem);
}

.page-hero p {
  margin-top: 1rem;
  max-width: 34rem;
  color: color-mix(in oklab, var(--linen) 85%, transparent);
  font-size: 1.08rem;
}

.split-hero {
  display: grid;
}

.split-hero img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}

/* Forms */
form.letter-form {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

label span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--linen);
  color: var(--ink);
  border-radius: 0.7rem;
  padding: 0.85rem 0.95rem;
  font: inherit;
  min-height: 48px;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.form-note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Sitting kit */
.kit-list {
  counter-reset: q;
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.kit-list li {
  background: var(--linen);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.5rem;
  border: 1px solid var(--line);
}

.kit-list li::before {
  counter-increment: q;
  content: counter(q, decimal-leading-zero);
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}

.kit-list h3 {
  margin-top: 0.45rem;
  font-size: 1.35rem;
}

.kit-list .hint {
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.write-lines {
  margin-top: 1rem;
  height: 4.2rem;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(1.4rem - 1px),
    var(--line) calc(1.4rem - 1px),
    var(--line) 1.4rem
  );
}

.rules {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.rule h3 {
  font-size: 1.25rem;
}

.rule p {
  margin-top: 0.4rem;
  color: var(--ink-soft);
}

/* Animations */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes ken {
  from {
    transform: scale(1.04);
  }
  to {
    transform: scale(1.12) translate(-1%, -1%);
  }
}

@keyframes grain {
  to {
    transform: translate3d(-2%, -3%, 0);
  }
}

.rise {
  animation: rise-in 700ms var(--ease) both;
}
.d1 {
  animation-delay: 80ms;
}
.d2 {
  animation-delay: 160ms;
}
.d3 {
  animation-delay: 240ms;
}

.ken img,
.ken video {
  animation: ken 22s var(--ease) alternate infinite;
}

@media (min-width: 800px) {
  .chapter-grid {
    grid-template-columns: 1fr 1fr;
    min-height: 28rem;
  }
  .chapter.is-flip .chapter-photo {
    order: 2;
  }
  .chapter-copy {
    padding: 3.5rem 3rem;
  }
  .chapter-photo img {
    min-height: 100%;
  }
  .stats-grid,
  .cards,
  .family-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .split-hero {
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 22rem;
  }
  .rules {
    grid-template-columns: repeat(3, 1fr);
  }
  .panel-ink {
    padding: 2.4rem 2.4rem;
  }
}

@media (max-width: 720px) {
  .nav {
    flex-wrap: wrap;
  }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 0.15rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-media video {
    display: none;
  }
}

@media print {
  .nav,
  .actions,
  .site-footer,
  .hero-media,
  .btn,
  .film-grain {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .page-hero {
    background: white;
    color: black;
    padding: 0 0 1rem;
  }
  .kit-list li {
    break-inside: avoid;
  }
  .write-lines {
    height: 3.6rem;
  }
}
