/* Paper and ink, a bookcloth green and the ochre of a ribbon bookmark:
   the colors of the app (lib/shared/colors.dart in the app repo). */

@font-face {
  font-family: "Literata";
  src: url("/fonts/Literata-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f3ec;
  --surface: #fffdfa;
  --surface-low: #f2ede4;
  --text: #1e1b17;
  --muted: #5e564b;
  --border: #d8cfc1;
  --accent: #2d5a4a;
  --accent-soft: #d2e5da;
  --on-accent: #ffffff;
  --ribbon: #d9963a;
  --ochre: #9a6118;
  --ochre-soft: #f4dfbd;
  --line: #e0d8cb;
  --radius: 18px;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #221f1b;
    --surface-low: #1d1a17;
    --text: #ede6da;
    --muted: #b6ac9e;
    --border: #3f3933;
    --accent: #96c9b3;
    --accent-soft: #244a3c;
    --on-accent: #0f3326;
    --ribbon: #d9963a;
    --ochre: #e6b470;
    --ochre-soft: #5c3f14;
    --line: #35302a;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
}

a {
  color: var(--accent);
}

.wrap {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header and footer */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: url("/favicon.svg") center / cover;
}

.lang {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.lang:hover {
  color: var(--text);
}

.site-footer {
  margin-top: 72px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* Landing page */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
  padding: 48px 0 24px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero .lead {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
}

.store {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 28px;
}

.store-badge img {
  display: block;
  width: 150px;
  height: auto;
}

.store-note {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ochre-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

/* A note on a page, drawn from the theme colors instead of a screenshot */

.page {
  position: relative;
  margin: 0;
  padding: 28px 28px 32px;
  border: 1px solid var(--border);
  border-radius: 6px 18px 18px 6px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 18px),
    var(--surface);
  box-shadow: 0 18px 40px -24px rgba(30, 27, 23, 0.45);
  transform: rotate(1.2deg);
}

.page::after {
  content: "";
  position: absolute;
  top: -1px;
  right: 40px;
  width: 22px;
  height: 92px;
  background: var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
}

.page .chapter {
  margin: 0 0 4px;
  color: var(--ochre);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
}

.page p {
  margin: 0;
  background: repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 32px;
}

.page mark {
  padding: 0 2px;
  background: var(--ochre-soft);
  color: inherit;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 56px;
  padding: 0;
  list-style: none;
}

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature .icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature svg {
  width: 24px;
  height: 24px;
}

.feature h2 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.3;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.closing {
  margin: 56px auto 0;
  max-width: 620px;
  text-align: center;
}

.closing h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.2;
}

.closing p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 24px;
  }

  .page {
    transform: none;
  }
}

/* Legal pages, help and account deletion */

.legal {
  max-width: 760px;
  padding-top: 24px;
}

.legal h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.2;
}

.legal h2 {
  margin: 40px 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

.legal h3 {
  margin: 24px 0 4px;
  font-size: 17px;
}

.legal p,
.legal li {
  overflow-wrap: anywhere;
}

.updated {
  color: var(--muted);
  font-size: 14px;
}

.intro {
  font-size: 18px;
}

.summary,
.toc,
.notice {
  margin: 24px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
}

.summary {
  background: var(--accent-soft);
}

.summary h2,
.toc h2 {
  margin-top: 0;
  font-size: 18px;
}

.summary .note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toc {
  border: 1px solid var(--border);
  background: var(--surface);
}

.toc ol {
  margin: 0;
  padding-left: 22px;
}

.notice {
  border-left: 4px solid var(--ribbon);
  background: var(--surface);
}

.notice h3 {
  margin-top: 0;
}

.notice p:last-child {
  margin-bottom: 0;
}

.contact {
  margin: 12px 0;
  font-style: normal;
}

.contact-list dt {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.contact-list dd {
  margin: 0;
}

.faq {
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.faq summary {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
}

.faq[open] summary {
  border-bottom: 1px solid var(--border);
}

.faq p {
  margin: 12px 18px;
}

section {
  scroll-margin-top: 16px;
}
