/* Bonfire — see content/video-agent/systems/bonfire/design-system.md
   Ground is near-black, not black. There is no accent colour: emphasis is the
   face change from Space Grotesk to Fraunces Italic, never a hue. */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/SpaceGrotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Permanent Marker";
  src: url("../fonts/PermanentMarker-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Bonfire";
  src: url("../fonts/Fraunces-Italic-bonfire.woff2") format("woff2");
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0a0a0d;
  --surface: #131319;
  --surface-alt: #1c1c24;
  --fg: #ededf0;
  --muted: #8a8a96;
  --bone: #ececE7;
  --negative: #d6453f;

  --font-argument: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-emphasis: "Fraunces Bonfire", Georgia, serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-argument);
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The emphasis face is a size step up because Fraunces and Space Grotesk share
   a cap height; 1.042 is the measured ratio, not a guess. */
em, i, .emphasis {
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: 600;
  font-size: 1.042em;
}

a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); }

.wrap { max-width: 68rem; margin: 0 auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; }

.site-head { display: flex; align-items: baseline; gap: 1.5rem; padding-block: 2rem; }
.site-head__name { font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.site-head__line { color: var(--muted); font-size: 0.9rem; }
.site-foot { color: var(--muted); font-size: 0.85rem; padding-block: 4rem 3rem; }

.post-list { display: grid; gap: 2.5rem; padding: 0; margin: 3rem 0; list-style: none; }
.post-card__title { margin: 0 0 0.25rem; font-size: 1.35rem; }
.post-card__title a { text-decoration: none; }
.post-card__title a:hover { text-decoration: underline; }
.post-card__meta { color: var(--muted); font-size: 0.85rem; }

/* Subscribe form. Posts to the attribution worker, never straight to Ghost —
   the worker is what carries the video id into PostHog. */
.subscribe { background: var(--surface); padding: 1.75rem; margin: 3rem 0; max-width: var(--measure); }
.subscribe__row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.subscribe input[type="email"] {
  flex: 1 1 16rem; min-width: 0; padding: 0.7rem 0.85rem;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--surface-alt); font: inherit;
}
.subscribe button {
  padding: 0.7rem 1.25rem; background: var(--bone); color: var(--bg);
  border: 0; font: inherit; font-weight: 700; cursor: pointer;
}
.subscribe button[disabled] { opacity: 0.5; cursor: default; }
.subscribe__msg { margin-top: 0.75rem; min-height: 1.4em; font-size: 0.9rem; color: var(--muted); }
.subscribe__msg--error { color: var(--negative); }
.subscribe__hp { position: absolute; left: -9999px; }

@media (prefers-reduced-motion: no-preference) {
  a, button { transition: opacity 120ms ease; }
}

/* Koenig editor card widths — required by gscan, and the reason a wide image
   in the editor is actually wide on the page. */
.kg-width-wide { max-width: 52rem; margin-inline: auto; }
.kg-width-full { max-width: 100vw; margin-inline: calc(50% - 50vw); }
.kg-width-full img { width: 100%; }

/* Ghost's font settings write these classes onto <html>; honour them so the
   admin font picker is not silently dead. */
html.gh-font-heading-space-grotesk h1,
html.gh-font-heading-space-grotesk h2,
html.gh-font-heading-space-grotesk h3 { font-family: var(--font-argument); }
html.gh-font-body-space-grotesk body { font-family: var(--font-argument); }
