/* Dunglee: the app's palette and type (Dunglee/Design/Theme.swift, Assets.xcassets). Paper and ink,
   green only where it means home. Light and dark follow the system, as the app does. */

:root {
  --paper: #FFFFFF;
  --ink: #141A17;
  --ink-muted: #5C6560;
  --rule: #E3E7E4;
  --home: #2E9D5B;
  --home-deep: #1D6B3C;
  --on-home: #141A17;
  --home-wash: rgba(46, 157, 91, 0.16);
  --wash: rgba(227, 231, 228, 0.5);
  --link: #1D6B3C;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1211;
    --ink: #E8ECE9;
    --ink-muted: #A2ABA6;
    --rule: #262C29;
    --home: #4FD58A;
    --home-deep: #1D6B3C;
    --on-home: #0F1211;
    --home-wash: rgba(79, 213, 138, 0.16);
    --wash: rgba(38, 44, 41, 0.5);
    --link: #4FD58A;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  /* The app is set in Apple's system font; elsewhere the platform's own. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* The app's spacing scale: 4, 8, 12, 16, 24, 40. */
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--home);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 10;
}
.skip:focus { left: 16px; }

/* Header: the mark, the name, two links. */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.site-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-muted); text-decoration: none; padding: 4px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 7vw, 2.75rem); margin: 24px 0 16px; }
h2 { font-size: 1.375rem; margin: 40px 0 12px; }
h3 { font-size: 1.0625rem; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 8px; }

.lede { font-size: 1.25rem; color: var(--ink); }
.muted { color: var(--ink-muted); }

/* "Coming soon to iPhone": a pill in the app's wash, as its chips are. */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--home-wash);
  color: var(--ink);
  font-weight: 600;
}
.soon::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--home);
}

/* A drawn map card, in the app's pin language: solid where someone lives, a ring where they're
   from, both for both. Decorative. */
.map-card {
  margin: 40px 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--wash);
}
.map-card svg { display: block; width: 100%; height: auto; }
/* The drawn map's land and pins. */
.land { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.pin-solid { fill: var(--home); stroke: var(--paper); stroke-width: 2; }
.pin-ring { fill: var(--paper); stroke: var(--home); stroke-width: 5; }
.pin-centre { fill: var(--home); }
.now-ring { fill: var(--paper); stroke: var(--home-deep); stroke-width: 3; }
.now-centre { fill: var(--home-deep); }
.label { fill: var(--ink); font: 600 14px -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.label-muted { fill: var(--ink-muted); font: 13px -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }

.map-card figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.features {
  list-style: none;
  padding: 0;
  margin: 24px 0 40px;
  display: grid;
  gap: 24px;
}
@media (min-width: 640px) {
  .features { grid-template-columns: 1fr 1fr; }
}
.features li { margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.features h2 { font-size: 1.125rem; margin: 0 0 8px; }
.features p { margin: 0; color: var(--ink-muted); }

.quote {
  margin: 0 0 40px;
  padding: 16px;
  border-left: 3px solid var(--home);
  background: var(--wash);
  border-radius: 0 8px 8px 0;
}

/* Long pages: the privacy policy and support. */
.doc h2 { padding-top: 16px; border-top: 1px solid var(--rule); }
.doc .updated { color: var(--ink-muted); margin-top: -8px; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 0.9375rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }
.doc th { font-weight: 600; }
.table-wrap { overflow-x: auto; }
.toc { padding-left: 20px; }

.site-footer {
  margin-top: 40px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer a { color: var(--ink-muted); }

@media (max-width: 360px) {
  body { font-size: 1rem; }
  .site-header { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
