/* mTagger site — the app's own theme, not a web palette.
 *
 * Every colour below is lifted verbatim from GREEN_LIGHT / GREEN_DARK in
 * app/src/main/java/ke/thande/mtagger/ui/theme/Accent.kt, which are themselves
 * transcribed from the Material 3 design kit's `m3/m3-schemes.css`. The site
 * therefore renders in exactly the colours the app ships with, in both tones,
 * and follows the visitor's system setting the same way the app follows the
 * phone's.
 *
 * Site tokens are named for the M3 role they hold, so a change in Accent.kt
 * can be carried across by reading the role name rather than guessing. */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
  /* — GREEN_LIGHT — */
  --primary: #376A3E;
  --on-primary: #FFFFFF;
  --primary-container: #B7F1B9;
  --on-primary-container: #2D4E30;
  --secondary: #526451;
  --surface: #F7FBF2;
  --on-surface: #181D18;
  --on-surface-variant: #424940;
  --outline: #717970;
  --outline-variant: #C1C9BE;
  --surface-container-lowest: #FFFFFF;
  --surface-container-low: #F1F5EC;
  --surface-container: #EBEFE7;
  --surface-container-high: #E5E9E1;

  /* The device frame stays dark in both tones — the screenshot inside it is a
     dark-mode capture, and a light frame around a dark screen reads as a bug. */
  --device-frame: #0B0F0B;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Material 3's own spacing rhythm — 4dp grid, as the app uses. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* M3 shape scale. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 28px;

  --page: 1080px;
  --gutter: var(--space-6);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* — GREEN_DARK — */
    --primary: #9CD49F;
    --on-primary: #003913;
    --primary-container: #1D5128;
    --on-primary-container: #B7F1B9;
    --secondary: #B8CCB5;
    --surface: #101510;
    --on-surface: #E0E4DB;
    --on-surface-variant: #C1C9BE;
    --outline: #919282;
    --outline-variant: #424940;
    --surface-container-lowest: #0B0F0B;
    --surface-container-low: #181D18;
    --surface-container: #1C211C;
    --surface-container-high: #272B26;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* M3 type scale, the same ramp the app draws with. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font); font-weight: 500;
  line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
p { margin: 0 0 var(--space-3); }
img { display: block; max-width: 100%; }

a { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: var(--primary-container); color: var(--on-primary-container); }

.overline {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--outline);
}

.rule { height: 1px; border: 0; background: var(--outline-variant); margin: 0; }

/* — the filled button, as Material draws it — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding-inline: var(--space-6);
  cursor: pointer; text-decoration: none;
  font-family: var(--font); font-weight: 500; font-size: 15px; letter-spacing: 0.01em;
  color: var(--on-primary); background: var(--primary);
  border: 0; border-radius: var(--radius-xl);
  transition: filter 120ms ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { filter: brightness(0.94); }

/* — the wordmark: neutral `m`, accented `Tagger`. Never all-caps. — */
.wordmark { font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.wordmark .m { color: var(--on-surface); }
.wordmark .tagger { color: var(--primary); }

.shell { max-width: var(--page); margin: 0 auto; padding-inline: var(--gutter); }

.nav { display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-6); }
.nav-brand { margin-right: auto; display: flex; align-items: center; gap: var(--space-2); }
.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links a { color: var(--on-surface-variant); font-size: 15px; }
.nav-links a:hover { color: var(--primary); }

/* — hero — */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-16); align-items: center;
  padding-block: var(--space-16) var(--space-16);
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 54px); font-weight: 500; line-height: 1.08;
  letter-spacing: -0.025em; margin: 0 0 var(--space-6); text-wrap: balance;
}
.hero p {
  font-size: 18px; line-height: 1.6; color: var(--on-surface-variant);
  margin: 0 0 var(--space-8); max-width: 46ch; text-wrap: pretty;
}
.device {
  width: 300px; margin-left: auto; padding: 12px;
  background: var(--device-frame); border-radius: 40px;
  border: 1px solid var(--outline-variant);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
}
.device img { border-radius: 30px; width: 100%; height: auto; }

/* — sections — */
.section { padding-block: var(--space-16); }
.section > .overline { display: block; margin-bottom: var(--space-8); }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-12); max-width: 860px; }
.item h3 { font-size: 20px; margin: 0 0 var(--space-2); }
.item p { font-size: 15px; line-height: 1.6; color: var(--on-surface-variant); margin: 0; text-wrap: pretty; }

/* — the privacy card, in the app's own primaryContainer — */
.pledge {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-12); align-items: start;
  padding: var(--space-12); border-radius: var(--radius-lg);
  background: var(--primary-container); color: var(--on-primary-container);
}
.pledge h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 var(--space-4); text-wrap: balance; }
.pledge p { font-size: 16px; line-height: 1.6; margin: 0; max-width: 44ch; text-wrap: pretty; }
.pledge ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.pledge li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 1.55; }
.pledge li svg { flex: none; margin-top: 2px; }

footer { border-top: 1px solid var(--outline-variant); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6); flex-wrap: wrap; padding-block: var(--space-8);
}
.footer-inner a, .footer-inner span { font-size: 14px; }
.footer-links { display: flex; align-items: center; gap: var(--space-6); }

/* ── legal documents ──────────────────────────────────────────────────────
   The Markdown from the app repo is the source of truth; this only decides
   how it looks. */

.doc { max-width: 720px; margin: 0 auto; padding: var(--space-12) var(--gutter) var(--space-16); }
.doc-kicker {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--primary); margin-bottom: var(--space-4);
}
.doc h1 { font-size: clamp(30px, 4.6vw, 40px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 var(--space-8); }
.doc > p:first-of-type { font-size: 18px; line-height: 1.6; color: var(--on-surface); margin: 0 0 var(--space-12); }
.doc h2 { font-size: 22px; margin: var(--space-12) 0 var(--space-4); }
.doc h3 { font-size: 17px; margin: var(--space-8) 0 var(--space-3); }
.doc p, .doc li { font-size: 16px; line-height: 1.65; color: var(--on-surface-variant); text-wrap: pretty; }
.doc p { margin: 0 0 var(--space-4); }
.doc ul, .doc ol { margin: 0 0 var(--space-4); padding-left: var(--space-6); }
.doc li { margin-bottom: var(--space-2); }
.doc li::marker { color: var(--primary); }
.doc strong { color: var(--on-surface); font-weight: 500; }
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em;
  padding: 2px 6px; border-radius: var(--radius-sm);
  background: var(--surface-container-high); color: var(--on-surface);
}
.doc hr { height: 1px; border: 0; background: var(--outline-variant); margin: var(--space-12) 0; }
.doc blockquote {
  margin: 0 0 var(--space-4); padding-left: var(--space-4);
  border-left: 2px solid var(--outline-variant); color: var(--outline);
}

/* The permission matrix is the one thing that will not fit a phone, so the
   table scrolls inside its own box rather than the page going wide. */
.doc .table-wrap {
  overflow-x: auto; margin: 0 0 var(--space-6);
  border-radius: var(--radius-md); background: var(--surface-container-low);
}
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.doc th {
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--outline);
  padding: var(--space-4) var(--space-3); vertical-align: bottom;
  border-bottom: 1px solid var(--outline-variant);
}
.doc td {
  padding: var(--space-4) var(--space-3); vertical-align: top;
  color: var(--on-surface-variant);
  border-bottom: 1px solid var(--outline-variant);
}
.doc tr:last-child td { border-bottom: 0; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-12); padding-block: var(--space-12); }
  .device { margin-left: 0; }
  .cols-3, .cols-2, .pledge { grid-template-columns: minmax(0, 1fr); }
  .pledge { gap: var(--space-8); padding: var(--space-8); }
  .section { padding-block: var(--space-12); }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  .footer-inner { justify-content: flex-start; }
}
