/* Cairn's own colours, taken from the app rather than invented.
   Amber is `Palette.unknown` — the colour of a trail we hold and a report
   nobody has confirmed. Paper is the map's background. Blue appears exactly
   once, for water, and is not used for anything else here either. */
:root {
  --bg: #14161a;
  --bg-elev: #1b1e24;
  --bg-card: #21252c;
  --border: #2f343d;
  --text: #eceef2;
  --text-dim: #99a1ae;
  --accent: #d99e21;
  --accent-soft: rgba(217, 158, 33, 0.12);
  --link: #f0c46a;
  --water: #3a6bad;
  --max: 900px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(20, 22, 26, 0.9);
  backdrop-filter: saturate(160%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand:hover { text-decoration: none; }
.brand .stack { color: var(--accent); font-size: 20px; line-height: 1; }
.nav .spacer { flex: 1; }
.nav a:not(.brand) { color: var(--text-dim); font-size: 15px; }
.nav a:not(.brand):hover { color: var(--text); text-decoration: none; }

section { border-top: 1px solid var(--border); padding: 56px 0; }
section:first-of-type { border-top: 0; }

h1 {
  font-size: clamp(30px, 5.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

h3 { font-size: 17px; margin: 0 0 6px; }

p { margin: 0 0 16px; max-width: 62ch; }
.lead { font-size: 19px; color: var(--text-dim); }
.dim { color: var(--text-dim); }
.small { font-size: 15px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* A claim with its number attached. Every figure on this site is measured,
   and showing it next to the sentence is the point. */
.figure {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 650;
  font-size: 22px;
  display: block;
  margin-bottom: 2px;
}

.note {
  background: var(--accent-soft);
  border: 1px solid rgba(217, 158, 33, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0 0;
}

.note p { margin: 0; font-size: 15px; }

table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0 0; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 550; }
td.num { font-variant-numeric: tabular-nums; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--text-dim);
  font-size: 14px;
}

.site-footer a { color: var(--text-dim); }
.footer-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }

ul { max-width: 62ch; }
li { margin-bottom: 8px; }

@media (max-width: 620px) {
  section { padding: 40px 0; }
  .nav { gap: 14px; }
  .nav a:not(.brand) { font-size: 14px; }
}

/* A card that is a link. Same box, but it says so on hover — a card that does
   something and looks identical to one that does not is a small lie. */
.link-card {
  display: block;
  color: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}

.link-card:hover {
  border-color: var(--accent);
  background: var(--bg-elev);
  text-decoration: none;
}

.link-card h3 { color: var(--link); }

/* Screenshots. Three across on a wide screen, scrolling on a narrow one —
   never shrunk to where the text in them is unreadable, which defeats the
   point of showing an app that is mostly text on a map. */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.shots figure { margin: 0; }

.shots img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  background: var(--bg-elev);
}

.shots figcaption {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 10px;
}

@media (max-width: 720px) {
  .shots {
    grid-template-columns: repeat(3, 78%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .shots figure { scroll-snap-align: start; }
}
