/*
 * The site wears the app's Midnight theme in the dark, and its Daylight theme in the
 * light, so someone arriving from the paywall link recognises where they landed.
 * Both palettes are the ones in `ui/theme/Theme.kt` and `Core/Theme.swift`.
 */
:root {
  --bg: #f7faff;
  --surface: #eef5ff;
  --surface-2: #dfecff;
  --ink: #123052;
  --ink-dim: #4c6a8c;
  --line: #c9dcfa;
  --accent: #4a8dff;
  --accent-ink: #ffffff;
  --radius: 14px;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080b1c;
    --surface: #12162b;
    --surface-2: #1a1f3a;
    --ink: #f8f9ff;
    --ink-dim: #a7adcc;
    --line: #2c1e5a;
    --accent: #9a72f5;
    --accent-ink: #0b0714;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans",
        "Noto Sans Thai", "Noto Sans Arabic", "Noto Sans SC", "Noto Sans TC",
        "Noto Sans JP", "Noto Sans KR", "Noto Sans Devanagari", Helvetica, Arial, sans-serif;
}

/* Arabic reads right to left; only the direction changes, not the layout. */
[dir="rtl"] body { font-family: "Noto Sans Arabic", -apple-system, sans-serif; }

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

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

/* --- header --- */

header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  margin-inline-end: auto;
}

/* The app's own icon, at the size the store shows it: a reader arriving from the
   paywall link should recognise the same mark that is on their home screen. */
.brand .mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.42rem;
  flex: none;
  display: block;
}

/* The language shell has no header bar, so its icon sits in the heading itself. */
h1 .mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  vertical-align: -0.3rem;
  margin-inline-end: 0.6rem;
}

nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.95rem; }
nav a { color: var(--ink-dim); text-decoration: none; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* --- content --- */

main { padding: 2.5rem 0 3.5rem; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 2.2rem 0 0.5rem; letter-spacing: -0.005em; }
h3 { font-size: 1rem; margin: 1.6rem 0 0.3rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
main > .wrap > p:first-of-type { color: var(--ink-dim); font-size: 1.05rem; }

.updated {
  color: var(--ink-dim);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

/* Non-English pages say plainly which version governs. */
.translated {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  margin: 0 0 2rem;
  max-width: var(--measure);
}

/* --- home --- */

.hero { padding: 1rem 0 0.5rem; }
.hero h1 { font-size: 2.3rem; max-width: 18ch; }
.hero p { font-size: 1.1rem; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.features b { display: block; margin-bottom: 0.25rem; }
.features span { color: var(--ink-dim); font-size: 0.95rem; }

.notice {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 1.1rem 1.2rem;
  margin: 2rem 0;
}

.notice b { display: block; margin-bottom: 0.3rem; }
.notice p { margin: 0; color: var(--ink-dim); }

.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }

.store {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.store.pending {
  background: transparent;
  color: var(--ink-dim);
  border: 1px dashed var(--line);
  font-weight: 500;
}

/* --- faq --- */

.faq { margin: 2rem 0; }
.faq h2 { margin-top: 1.8rem; }

/* --- language switcher --- */

.languages {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 0;
  margin: 3rem 0 0;
}

.languages h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); margin: 0 0 0.75rem; }

.languages ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}

.languages a { color: var(--ink-dim); text-decoration: none; }
.languages a:hover { color: var(--ink); text-decoration: underline; }
.languages [aria-current="true"] { color: var(--ink); font-weight: 600; }

/* --- footer --- */

footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  margin-top: 3rem;
}

footer p { margin: 0 0 0.4rem; max-width: none; }
footer p:last-child { margin: 0; }
