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

:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --bg-muted: #171d24;
  --text: #e7ecf1;
  --text-muted: #9aa7b5;
  --accent: #f97316;
  --border: #2a3441;
  --max-width: 720px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --bg-muted: #eef2f7;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #dbe3ee;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.logo {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.section {
  padding: 3rem 0;
}

.subsection-title {
  margin-top: 2.5rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.app-list {
  margin: 0;
  padding: 0 0 0 1.25rem;
  list-style: disc;
}

.app-list ul {
  margin: 0.5rem 0 0;
  padding: 0 0 0 1.25rem;
  list-style: none;
}

.app-list li + li {
  margin-top: 0.75rem;
}

.app-list li ul li + li {
  margin-top: 0.4rem;
}

p {
  margin: 0;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Long-form pages generated from Markdown by js/build-pages.mjs. The global
   `p { margin: 0 }` above suits the link-list homepage but collapses prose. */
.prose h1 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  line-height: 1.25;
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.375rem;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose strong {
  color: var(--text);
}

/* Keep long URLs and emails from forcing a horizontal scroll on phones. */
.prose a {
  overflow-wrap: anywhere;
}

/*
 * Third-party embeds (`@embed` in the prose Markdown). Full width of the
 * column, tall enough for a form to breathe, and its own scroll on phones —
 * a Google Form is taller than any viewport, and letting it size itself
 * pushes the rest of the page below the fold.
 */
.prose .embed {
  display: block;

  /* Wider than the prose column, and centred by pulling the extra width evenly
     out of both margins. The column is measured for reading; a form is a
     working surface, and squeezing one into a 720px measure leaves it
     scrolling inside its own frame. */
  width: min(100vw - 2rem, 920px);
  margin: 2rem 50%;
  transform: translateX(-50%);

  /* Tall enough that the whole form is visible without a second scrollbar
     inside the page. An iframe cannot size itself to its content across
     origins, so this is a floor with room to spare rather than a fit. */
  height: clamp(900px, 85vh, 1300px);

  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
