/* The app's brand face. Licensed web fonts, ExtraBold only, since that is
   the one weight the app uses. */
@font-face {
  font-family: "National Forest";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/nationalforest-extrabold-webfont.woff2") format("woff2"),
       url("/assets/fonts/nationalforest-extrabold-webfont.woff") format("woff");
}

/* Palette lifted from the app's asset catalog: Moss on cream in light mode,
   cream on Moss in dark mode, with the same orange accent. */
:root {
  color-scheme: light dark;
  --bg: #f0ebe1;
  --ink: #18240a;
  --panel: #eef4e2;
  --accent: #f7950f;
  --topo-opacity: 0.25;
  --muted: color-mix(in srgb, var(--ink) 72%, var(--bg));
  --rule: color-mix(in srgb, var(--ink) 18%, var(--bg));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18240a;
    --ink: #f0ebe1;
    --panel: #283518;
    --topo-opacity: 0.15;
  }
}

* { box-sizing: border-box; }

/* The page colour lives on html only. A body background would paint over
   the fixed topo layer, which sits at the bottom of the stacking order. */
html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: transparent;
  position: relative;
  isolation: isolate;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* The app's TopoBackground: the same 34 contour paths, scaled to fill,
   stroked in the text colour at low opacity. */
.topo {
  position: fixed;
  inset: 0;
  z-index: 0;
  color: var(--ink);
  opacity: var(--topo-opacity);
  pointer-events: none;
}
.topo svg { width: 100%; height: 100%; display: block; }

.masthead, main, .colophon {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, 44rem);
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-size: 1.125rem;
}
.brand .logo { width: 36px; height: 36px; }

/* Inline so it takes the text colour and flips with the theme. */
.logo { display: inline-block; color: var(--ink); }
.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
}
.masthead nav a:hover { color: var(--ink); text-decoration: underline; }

a { color: var(--ink); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 0.5rem; }
h3 { font-size: 1.125rem; margin: 1.75rem 0 0.25rem; }
p, li { max-width: 62ch; }

/* Brand type: the app sets its titles in National Forest ExtraBold, as do
   page titles and the wordmark here. */
.display, h1 {
  font-family: "National Forest", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Landing page */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero .logo { width: 96px; height: 96px; }
.hero h1 { margin-top: 1rem; }
.hero .lede {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.25rem auto 1rem;
}
.hero p { margin-inline: auto; }
.hero .muted { color: var(--muted); }

.button {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: #18240a;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { filter: brightness(1.05); }

.sources {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 3rem;
  padding: 0;
  list-style: none;
}
.sources li {
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
}
.sources h3 { margin: 0 0 0.15rem; }
.sources .headline { font-weight: 600; margin: 0 0 0.4rem; }
.sources p { margin: 0; color: var(--muted); }
@media (min-width: 640px) {
  .sources { grid-template-columns: 1fr 1fr; }
}

.mac {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  margin-bottom: 3rem;
}

/* Long-form pages */
.prose { padding: 1rem 0 3rem; }
.prose .gist {
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0 2rem;
}
.prose .gist p:first-child { margin-top: 0; }
.prose .gist p:last-child { margin-bottom: 0; }
.prose .meta { color: var(--muted); font-size: 0.95rem; }

.colophon {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.colophon a { color: inherit; }
