:root {
  --paper-ink: #1d1a16;
  --paper-bg: #f5efe3;
  --paper-sheet: #fbf7ee;
  --rust-accent: #8a3b2a;
  --rule-line: #cbbfa8;
  --muted-ink: #5e564b;
  --margin-shade: #ebe3d1;
  --cover-deep: #2b2a26;
  --cover-gilt: #c9a86a;
  --edge-radius: 2px;
  --shadow-soft: 0 18px 30px -18px rgba(29, 26, 22, 0.45);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body.ink-page {
  margin: 0;
  background: var(--paper-bg);
  color: var(--paper-ink);
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: clamp(1.125rem, 1.6vw, 1.4rem);
  line-height: 1.6;
  overflow-x: hidden;
}

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

h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
}

h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
}

p {
  margin: 0 0 1em;
  max-width: 38rem;
}

a {
  color: var(--rust-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--rust-accent);
  outline-offset: 3px;
}

/* ---------- Screen 1: opening ---------- */

.ink-opening {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2rem;
  padding: 4rem 1.25rem;
  border-bottom: 1px solid var(--rule-line);
}

.opening-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.opening-kicker,
.section-kicker {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust-accent);
  margin-bottom: 1rem;
}

.opening-title::first-letter {
  color: var(--rust-accent);
}

.opening-sub {
  font-size: clamp(1.125rem, 1.6vw, 1.4rem);
  color: var(--muted-ink);
  margin-bottom: 2rem;
}

.opening-cover-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.opening-cta {
  display: inline-block;
  padding: 1.1rem 2.4rem;
  background: var(--paper-ink);
  color: var(--paper-sheet);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  border: 1px solid var(--paper-ink);
  border-radius: var(--edge-radius);
  transition: background 0.2s ease, color 0.2s ease;
}

.opening-cta:hover {
  background: var(--rust-accent);
  border-color: var(--rust-accent);
}

.opening-photo {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--edge-radius);
  box-shadow: var(--shadow-soft);
}

.opening-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Book cover (pure CSS) ---------- */

.cover-plate {
  position: relative;
  width: min(72vw, 300px);
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.6rem 1.6rem 2.4rem;
  background: linear-gradient(160deg, var(--cover-deep) 0%, #1a1916 60%, #3a3426 100%);
  color: var(--paper-sheet);
  border-radius: var(--edge-radius);
  box-shadow: 14px 18px 28px -10px rgba(29, 26, 22, 0.6);
  text-align: left;
}

.cover-plate::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, #15140f, #3d3a30);
  border-radius: var(--edge-radius) 0 0 var(--edge-radius);
}

.cover-plate::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--cover-gilt);
  opacity: 0.6;
  pointer-events: none;
}

.cover-series {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cover-gilt);
}

.cover-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.cover-author {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--cover-gilt);
  padding-top: 0.6rem;
}

.cover-plate-small {
  width: min(56vw, 200px);
  margin-bottom: 1.5rem;
}

/* ---------- Screen 2: about ---------- */

.ink-about {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2.5rem;
  padding: 4rem 1.25rem;
  background: var(--paper-sheet);
  border-bottom: 1px solid var(--rule-line);
}

.about-photo,
.chapters-photo {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--edge-radius);
  box-shadow: var(--shadow-soft);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 6 / 5;
  object-fit: cover;
}

.about-text h3 {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule-line);
}

.reader-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 38rem;
}

.reader-list li {
  position: relative;
  padding: 0.7rem 0 0.7rem 2.2rem;
  border-bottom: 1px solid var(--rule-line);
}

.reader-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--rust-accent);
  font-weight: 700;
}

/* ---------- Screen 3: chapters ---------- */

.ink-chapters {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2.5rem;
  padding: 4rem 1.25rem;
  background: var(--paper-bg);
  border-bottom: 1px solid var(--rule-line);
}

.chapters-text h2::first-letter {
  color: var(--rust-accent);
}

.chapter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 2rem 0;
}

.chapter-note {
  padding: 1.4rem 1.5rem;
  background: var(--paper-sheet);
  border-left: 3px solid var(--rust-accent);
  border-radius: var(--edge-radius);
}

.chapter-note h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: 0.4rem;
}

.chapter-note p {
  margin: 0;
  color: var(--muted-ink);
}

.pull-quote {
  margin: 2.5rem 0 0;
  padding: 1.5rem 0 0 1.5rem;
  border-left: 1px solid var(--rust-accent);
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

.pull-quote p {
  margin: 0 0 0.6rem;
}

.pull-quote cite {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-style: normal;
  font-size: 0.95rem;
  color: var(--muted-ink);
  letter-spacing: 0.05em;
}

.chapters-photo {
  aspect-ratio: 1 / 1;
}

.chapters-photo > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapters-photo-small {
  position: absolute !important;
  right: 8%;
  bottom: 8%;
  width: 42%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 6px solid var(--paper-sheet);
  border-radius: var(--edge-radius);
}

/* ---------- Screen 4: order ---------- */

.ink-order {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3rem;
  padding: 4rem 1.25rem;
  background: var(--paper-ink);
  color: var(--paper-sheet);
}

.ink-order .section-kicker {
  color: var(--cover-gilt);
}

.ink-order .order-note {
  color: #d9d0bd;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 2.2rem 1.6rem;
  background: var(--paper-sheet);
  color: var(--paper-ink);
  border: 1px solid var(--rule-line);
  border-radius: var(--edge-radius);
  max-width: 38rem;
  width: 100%;
}

.order-form label {
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: 0.6rem;
}

.order-form input {
  min-height: 3.5rem;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 1.125rem;
  color: var(--paper-ink);
  background: #fff;
  border: 1px solid var(--rule-line);
  border-radius: var(--edge-radius);
}

.order-form input::placeholder {
  color: #9a9080;
}

.order-form button {
  margin-top: 1.2rem;
  min-height: 3.8rem;
  padding: 0.8rem 1.5rem;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--paper-sheet);
  background: var(--rust-accent);
  border: 1px solid var(--rust-accent);
  border-radius: var(--edge-radius);
  cursor: pointer;
}

.order-form button:hover {
  background: var(--paper-ink);
  border-color: var(--paper-ink);
}

.consent-line {
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
  color: var(--muted-ink);
}

.consent-line a {
  color: var(--rust-accent);
}

/* ---------- Footer ---------- */

.ink-footer {
  padding: 2.5rem 1.25rem 3rem;
  background: #15140f;
  color: #cfc6b2;
  font-size: 0.95rem;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  margin-bottom: 1.2rem;
}

.footer-links a {
  color: var(--cover-gilt);
}

.ink-footer p {
  margin: 0.4rem auto;
  max-width: 40rem;
}

.footer-copy {
  color: #fff;
  font-weight: 600;
}

/* ---------- Wider screens ---------- */

@media (min-width: 900px) {
  .ink-opening {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    padding: 5rem 6vw;
  }

  .opening-photo {
    grid-row: 1;
    grid-column: 2;
  }

  .ink-about {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    padding: 5rem 6vw;
  }

  .about-text {
    order: 2;
  }

  .ink-chapters {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    padding: 5rem 6vw;
  }

  .chapters-photo {
    order: -1;
  }

  .chapter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ink-order {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    padding: 5rem 6vw;
  }
}

@media (min-width: 1400px) {
  .opening-photo {
    aspect-ratio: 3 / 4;
  }
}

/* ---------- Legal pages ---------- */

.legal-page {
  background: var(--paper-bg);
  color: var(--paper-ink);
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
}

.legal-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.legal-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule-line);
}

.legal-section h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  margin: 2.2rem 0 0.6rem;
}

.legal-section p,
.legal-section li {
  max-width: none;
}

.legal-section ul {
  padding-left: 1.4rem;
  margin: 0 0 1em;
}

.legal-back {
  display: inline-block;
  margin-top: 2.5rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--rust-accent);
  padding-bottom: 2px;
}

.legal-back:hover {
  color: var(--paper-ink);
  border-color: var(--paper-ink);
}