/* Manara — legal pages.
 *
 * Paper & Ink, lifted straight from lib/core/theme/app_palette.dart so the
 * site and the app are demonstrably the same object. Roles, not hues: `clay`
 * is "the one accent", which is terracotta on paper and lamp gold on ink —
 * the same trade the app makes, and the same trade the icon makes.
 *
 * Type is the app's own, self-hosted from /fonts: Literata (the reader's
 * face) for the documents, and the App Store screenshots' faces for the
 * landing page. Same origin, so opening a policy never phones a font
 * service, which is the privacy point the old "system fonts only" rule
 * was making.
 */

:root {
  --field: #FAF7F2;
  --surface: #FFFFFF;
  --text: #2F2219;
  --muted: #6E6055;
  --rule: rgba(47, 34, 25, 0.12);
  --clay: #B64F34;
  --gold: #A8722C;
  --slab: #241A14;
  --on-slab: #FDF6E9;
  --shadow: rgba(70, 44, 20, 0.07);
}

/* ── Landing page faces and night surfaces ───────────────────────────────
 * The App Store screenshots' type, self-hosted from /fonts (same origin, so
 * nothing is fetched from anyone else; the legal pages never ask for them,
 * so they never download there). The ink tokens are the app's night slab,
 * used for the sections that stay dark in both schemes, as the screenshots do.
 */
@font-face { font-family: Literata; src: url("/fonts/literata-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Literata; src: url("/fonts/literata-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Literata; src: url("/fonts/literata-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("/fonts/dm-serif-display-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("/fonts/libre-baskerville-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url("/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url("/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url("/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --face-display: "DM Serif Display", Georgia, serif;
  --face-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --face-quote: "Libre Baskerville", Georgia, serif;
  --ink: #17110D;
  --ink-raised: #241A14;
  --on-ink: #F4ECE2;
  --ink-muted: #B9A88F;
  --lamp: #E8B869;
  --ember: #EB7A4E;
  --terracotta: #B64F34;
  --warm-glow: rgba(235, 122, 78, 0.10);
}

/* One look everywhere: the site keeps Paper & Ink's day palette whatever the
   device's appearance setting, like the App Store screenshots. */
:root { color-scheme: light; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--field);
  color: var(--text);
  font-family: Literata, "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

header.masthead {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.lockup svg { height: 40px; width: 40px; display: block; filter: drop-shadow(0 4px 8px var(--shadow)); }
/* The icon's own light set: three diamonds and the star. */
.lockup .d1 { fill: #F7B596; } .lockup .d2 { fill: #C65634; } .lockup .d3 { fill: #8E3318; } .lockup .st { fill: #FFF3EA; }

.wordmark {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.dateline {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.standfirst {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 1.25rem 0 0;
}

/* ── Contents ─────────────────────────────────────────────────────────── */

nav.contents {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 3rem;
  box-shadow: 0 1px 3px var(--shadow);
}

nav.contents h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

nav.contents ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.95rem;
}

nav.contents li { margin: 0 0 0.35rem; break-inside: avoid; }

a { color: var(--clay); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ── Body ─────────────────────────────────────────────────────────────── */

section { margin: 0 0 2.75rem; scroll-margin-top: 1.5rem; }

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
  letter-spacing: -0.005em;
}

h2 .num {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-right: 0.5rem;
  font-weight: 500;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

p { margin: 0 0 1rem; }

ul { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin: 0 0 0.5rem; }

strong { font-weight: 600; }

/* The one high-contrast block per page, same as the app's slab. */
.slab {
  background: var(--slab);
  color: var(--on-slab);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.75rem;
}
.slab p:last-child { margin-bottom: 0; }
.slab a { color: var(--clay); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.93rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.9rem 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
}

.scroller { overflow-x: auto; }

/* Unfilled blanks. Loud on purpose — these must not survive to production. */
.todo {
  background: var(--clay);
  color: #FFF;
  padding: 0.05em 0.45em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
  font-weight: 600;
  white-space: nowrap;
}

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

@media (max-width: 34rem) {
  body { font-size: 16px; }
  nav.contents ol { columns: 1; }
  h1 { font-size: 1.7rem; }
  .wrap { padding: 0 1.15rem 4rem; }
}
