/* countrypedia.dev — one stylesheet for the home page, privacy and terms.
   Colours and fonts come from the app (mobile/app/src/styles.css). Dark is the default;
   light follows the system, or the toggle (theme.js, saved in localStorage).
   Fonts: SIL Open Font License, see /fonts/OFL-*.txt. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/InstrumentSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/InstrumentSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/fonts/Newsreader-Italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- colour tokens ---------- */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0A0F17;
  --ground-2: #0D131D;
  --card: #131A25;
  --card-2: #18202D;
  --line: #263043;
  --line-2: #1D2533;
  --ink: #E8EDF5;
  --ink-2: #C2CBD9;
  --muted: #9CA8BB;
  --accent: #86A8FF;
  --on-accent: #0A1020;
  --accent-soft: #18233D;
  --accent-ink: #B3C8FF;
  --good-bg: #0F2A20; --good: #86DDB5;
  --warn-bg: #2D2210; --warn: #F2C27A;
  --bad-bg: #34181A;  --bad: #F6A898;
  --quote: #1A2230;
  --glow: rgba(70, 110, 220, 0.30);
  --frame: #1E2736;
  --frame-edge: #3A4760;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 10px 28px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, 0.9);
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #F2F4F8;
  --ground-2: #E9EDF4;
  --card: #FFFFFF;
  --card-2: #F7F8FB;
  --line: #DCE1EA;
  --line-2: #ECEFF4;
  --ink: #0F1828;
  --ink-2: #324057;
  --muted: #4D5A6E;
  --accent: #2350D8;
  --on-accent: #FFFFFF;
  --accent-soft: #E8EEFF;
  --accent-ink: #173A9E;
  --good-bg: #E2F4EB; --good: #0B5A40;
  --warn-bg: #FFF0D9; --warn: #7A4300;
  --bad-bg: #FCE6E0;  --bad: #9A2F14;
  --quote: #F3F5F9;
  --glow: rgba(35, 80, 216, 0.16);
  --frame: #13203A;
  --frame-edge: #2A3A5C;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 20px -12px rgba(16, 24, 40, 0.16);
  --shadow-lg: 0 30px 60px -28px rgba(16, 24, 40, 0.45);
}
/* No script, or before theme.js runs: follow the system. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --ground: #F2F4F8; --ground-2: #E9EDF4; --card: #FFFFFF; --card-2: #F7F8FB; --line: #DCE1EA; --line-2: #ECEFF4;
    --ink: #0F1828; --ink-2: #324057; --muted: #4D5A6E; --accent: #2350D8; --on-accent: #FFFFFF;
    --accent-soft: #E8EEFF; --accent-ink: #173A9E;
    --good-bg: #E2F4EB; --good: #0B5A40; --warn-bg: #FFF0D9; --warn: #7A4300; --bad-bg: #FCE6E0; --bad: #9A2F14;
    --quote: #F3F5F9; --glow: rgba(35, 80, 216, 0.16); --frame: #13203A; --frame-edge: #2A3A5C;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 20px -12px rgba(16, 24, 40, 0.16);
    --shadow-lg: 0 30px 60px -28px rgba(16, 24, 40, 0.45);
  }
}
:root {
  --sans: "Instrument Sans", "Helvetica Neue", Roboto, "Noto Sans", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Noto Serif", serif;
  --r-xl: 22px; --r-lg: 18px; --r-md: 14px; --r-sm: 10px;
  --wrap: 1160px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-wrap: break-word; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 10px 16px;
  border-radius: var(--r-sm); font-weight: 600; z-index: 50; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--ground); background: color-mix(in srgb, var(--ground) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-2); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em; margin-right: auto; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav { display: none; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 0 12px; min-height: 44px;
  display: inline-flex; align-items: center; border-radius: var(--r-sm); }
.nav a:hover { color: var(--ink); background: var(--card); }
@media (min-width: 860px) { .nav { display: flex; } }
.toggle { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; padding: 0; }
.toggle:hover { border-color: var(--accent); }
.toggle svg { width: 20px; height: 20px; }
.toggle .sun { display: none; }
:root[data-theme="light"] .toggle .sun { display: block; }
:root[data-theme="light"] .toggle .moon { display: none; }

/* ---------- buttons and pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid transparent;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -12px var(--glow); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { color: var(--ink); border-color: var(--line); background: var(--card); }
.btn.ghost:hover { border-color: var(--accent); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 6px 12px; border-radius: 999px; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

/* ---------- phone frame ---------- */
.phone { position: relative; width: 100%; max-width: 320px; aspect-ratio: 1080 / 2400; border-radius: 40px; padding: 9px;
  background: linear-gradient(160deg, var(--frame-edge), var(--frame) 40%); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 32px; background: #0A0F17; }
.phone.sm { max-width: none; border-radius: 30px; padding: 7px; }
.phone.sm img { border-radius: 24px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 40px 0 56px; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 900px; pointer-events: none;
  background: radial-gradient(50% 50% at 72% 38%, var(--glow), transparent 70%),
              radial-gradient(40% 40% at 10% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
.hero .wrap { position: relative; display: grid; gap: 40px; align-items: center; }
.hero-icon { display: none; width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 26px; }
@media (min-width: 900px) { .hero-icon { display: block; } }
.hero h1 { font-size: clamp(36px, 9.6vw, 60px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.hero h1 .serif { font-size: 1.06em; letter-spacing: -0.01em; color: var(--accent); }
.hero .lead { margin-top: 20px; font-size: clamp(17px, 2.2vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.hero .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero .status { margin-top: 26px; }
.trust { margin: 22px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 15px; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust svg { width: 18px; height: 18px; color: var(--good); flex-shrink: 0; }
.hero-shot { display: flex; justify-content: center; }
.hero-shot .phone { max-width: 300px; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 96px; }
  .hero .wrap { grid-template-columns: 1.25fr 1fr; gap: 56px; }
  .hero-shot .phone { max-width: 340px; transform: rotate(2deg); }
}

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--ground-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section h2 { font-size: clamp(30px, 6.4vw, 46px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; margin-top: 10px; max-width: 20ch; text-wrap: balance; }
.section .intro { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 40em; }

/* 1. sources */
.source { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .source { grid-template-columns: 1fr 1.15fr; gap: 72px; } .source .shot { order: -1; } }
.source .shot { display: flex; justify-content: center; }
.source .phone { max-width: 320px; }
.marks { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.marks li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.marks .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.marks .ic.warn { background: var(--warn-bg); color: var(--warn); }
.marks .ic svg { width: 20px; height: 20px; }
.marks strong { display: block; font-size: 17px; }
.marks span { color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.quote { margin: 28px 0 0; padding: 18px 20px 18px 22px; border-radius: var(--r-lg); background: var(--quote);
  border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.quote p { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.35; color: var(--ink); }
.quote small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }

/* 2. features */
.grid { margin-top: 40px; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px 22px 24px; box-shadow: var(--shadow);
  transition: border-color 200ms var(--ease), transform 200ms var(--ease); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
/* phones: icon beside the title, to keep nine cards short */
@media (max-width: 639px) {
  .card { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: center; padding: 18px 18px 20px; }
  .card .ic { margin-bottom: 0; }
  .card p { grid-column: 1 / -1; margin-top: 12px; }
}
.card .ic.good { background: var(--good-bg); color: var(--good); }
.card .ic.warn { background: var(--warn-bg); color: var(--warn); }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; }
.card p { margin-top: 8px; color: var(--ink-2); font-size: 16px; line-height: 1.55; }

/* 3. screenshot strip */
.strip-wrap { margin-top: 36px; }
.strip { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 16px 28px; margin: 0;
  list-style: none; scrollbar-width: thin; scrollbar-color: var(--line) transparent; scroll-padding: 0 16px; }
.strip:focus-visible { outline-offset: -3px; }
.strip li { flex: 0 0 216px; scroll-snap-align: start; }
.strip figure { margin: 0; }
.strip figcaption { margin-top: 14px; font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.strip figcaption b { display: block; color: var(--ink); font-size: 16px; }
@media (min-width: 720px) { .strip { padding: 8px 32px 28px; scroll-padding: 0 32px; } .strip li { flex-basis: 236px; } }
@media (min-width: 1240px) { .strip { padding-left: calc((100vw - var(--wrap)) / 2 + 32px); scroll-padding-left: calc((100vw - var(--wrap)) / 2 + 32px); } }
.hint { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* 4. research */
.steps { margin: 40px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; position: relative; padding: 22px; border-radius: var(--r-xl); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--serif); font-style: italic;
  font-size: 30px; line-height: 1; color: var(--accent); margin-bottom: 14px; }
.steps h3 { font-size: 18px; line-height: 1.3; }
.steps p { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }

/* 5. numbers */
.numbers { padding: 56px 0; background: linear-gradient(120deg, #13203A, #1F3A78); color: #FFFFFF; }
.numbers dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 16px; }
@media (min-width: 900px) { .numbers dl { grid-template-columns: repeat(4, 1fr); } .numbers { padding: 72px 0; } }
.numbers dl > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.numbers dd { margin: 0; font-size: clamp(36px, 9vw, 58px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.numbers dt { color: #D3DDF0; font-size: 16px; line-height: 1.4; max-width: 16em; }
.numbers .note { margin-top: 32px; color: #D3DDF0; font-size: 15px; }

/* 6. get the app */
.get { text-align: center; }
.get .box { max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  padding: 40px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.get .box::before { content: ""; position: absolute; inset: -40% -20% auto; height: 300px; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, var(--glow), transparent 70%); }
.get .box > * { position: relative; }
.get img.icon { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 18px; box-shadow: var(--shadow); }
.get h2 { margin: 12px auto 0; max-width: 18ch; }
.get p { margin: 14px auto 0; color: var(--ink-2); max-width: 34em; }
.get .actions { margin-top: 26px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.get .small { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line-2); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.foot a { color: var(--ink-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 8px; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot .brand-sm { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); font-weight: 700; padding-left: 0; }
.foot .brand-sm img { width: 24px; height: 24px; border-radius: 7px; }
.foot .copy { padding: 0 8px 0 0; }
@media (min-width: 640px) { .foot .copy { padding: 0 8px; } }

/* ---------- privacy and terms ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 48px 16px 72px; }
@media (min-width: 720px) { .doc { padding: 64px 32px 96px; } }
.doc h1 { font-size: clamp(34px, 7vw, 48px); line-height: 1.08; letter-spacing: -0.03em; }
.doc .meta { margin-top: 14px; color: var(--muted); font-size: 15px; }
.doc .short { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.doc .short h2 { margin-top: 0; }
.doc h2 { font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; margin-top: 36px; }
.doc p { margin-top: 10px; color: var(--ink-2); }
.doc .short p { color: var(--ink); }

/* ---------- motion: fade and rise on scroll; off for "reduce motion" ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 80ms; } .js .reveal.d2 { transition-delay: 160ms; } .js .reveal.d3 { transition-delay: 240ms; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
  .hero-shot .phone { transform: none !important; }
}
