/* M4B Converter: the page is a book. Cover + title page up top, the features read
   as a table of contents. Orange lives only on the cover (it's the app icon's). */

:root {
  --page: #ffffff;
  --ink: #1d1a17;
  --ink-soft: #5d5853;
  --rule: #e4e1dd;
  --leader: #b9b4ae;
  --cover-a: #f6a94b;
  --cover-b: #e4692a;
  --button: #1d1a17;
  --button-ink: #ffffff;
  --well: #f4f3f1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #191715;
    --ink: #f1ede8;
    --ink-soft: #b3aca4;
    --rule: #34302c;
    --leader: #5c5650;
    --button: #f1ede8;
    --button-ink: #191715;
    --well: #24211e;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Literata", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}
img { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--leader); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--cover-b); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }

.bar { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 0; font-size: 1rem; }
.bar nav { display: flex; gap: 1.5rem; }
.bar .by { color: var(--ink-soft); text-decoration: none; }

/* Cover + title page */
.opening { display: grid; gap: 2.5rem; padding: 2.5rem 0 3.5rem; align-items: center; }
.opening > * { min-width: 0; }
@media (min-width: 52rem) { .opening { grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 4rem; } }

.cover {
  aspect-ratio: 1;
  border-radius: 6px 14px 14px 6px;
  background: linear-gradient(160deg, var(--cover-a), var(--cover-b));
  color: #fff;
  padding: 2rem 1.75rem;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 10px 0 0 rgba(0,0,0,0.08), 0 30px 50px -28px rgba(120, 50, 10, 0.55);
  max-width: min(22rem, 68vw);
}
.cover .spines { display: flex; gap: 7%; align-items: flex-end; height: 38%; padding: 0 6%; border-bottom: 3px solid rgba(255,255,255,0.9); }
.cover .spines i { flex: 1; background: rgba(255,255,255,0.92); border-radius: 4px 4px 0 0; }
.cover .spines i:nth-child(1) { height: 70%; }
.cover .spines i:nth-child(2) { height: 100%; }
.cover .spines i:nth-child(3) { height: 86%; }
.cover .spines i:nth-child(4) { height: 80%; transform: rotate(9deg); transform-origin: bottom left; }
.cover .cover-title { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.01em; }
.cover .cover-by { font-size: 0.95rem; opacity: 0.9; }

.title-page h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.title-page .subtitle {
  margin: 1rem 0 0;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.35;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 28rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 2rem; align-items: center; }
.button {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 6px;
  background: var(--button);
  color: var(--button-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}
.button:hover { opacity: 0.88; }
.fineprint { margin: 1.25rem 0 0; font-size: 0.95rem; line-height: 1.55; color: var(--ink-soft); max-width: 30rem; }

.shot { margin: 0 0 5rem; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule), 0 30px 60px -36px rgba(0,0,0,0.5); }
.shot img { display: block; width: 100%; height: auto; }

/* Contents */
.contents { max-width: 44rem; margin: 0 auto 5rem; }
h2 { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 1.5rem; }
.contents h2 { text-align: center; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.toc li:last-child { border-bottom: 1px solid var(--rule); }
.toc .entry { display: flex; align-items: baseline; gap: 0.6rem; font-size: 1.3rem; font-weight: 600; }
.toc .entry::after { content: ""; order: 1; flex: 1; border-bottom: 2px dotted var(--leader); transform: translateY(-0.3em); }
.toc .entry time { order: 2; font-weight: 400; font-size: 1rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.toc p { margin: 0.35rem 0 0; color: var(--ink-soft); }

/* Getting started + questions */
.after { display: grid; gap: 3rem; margin-bottom: 4.5rem; }
.after > * { min-width: 0; }
@media (min-width: 52rem) { .after { grid-template-columns: 1fr 1fr; gap: 4.5rem; } }
.steps { margin: 0; padding-left: 1.5rem; }
.steps li { margin-bottom: 1rem; padding-left: 0.3rem; }
.steps li::marker { font-weight: 700; }
pre { background: var(--well); border-radius: 8px; padding: 0.9rem 1.1rem; margin: 0.6rem 0 0; overflow-x: auto; font-size: 0.92rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; }
.faq dt { font-weight: 600; margin-top: 1.25rem; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 0.25rem 0 0; color: var(--ink-soft); }

/* Tip + colophon */
.tip { text-align: center; padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.tip p { max-width: 30rem; margin: 0 auto 1.5rem; font-size: 1.35rem; line-height: 1.45; font-style: italic; }
footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-size: 0.95rem; color: var(--ink-soft); text-align: center; }
footer p { margin: 0.3rem 0; }
