/* Hallmark · macrostructure: Conversational FAQ · tone: warm editorial · anchor hue: ember
 * genre: editorial · theme: project tokens (packages/design-system) · nav: N6 masthead · footer: Ft1 line
 * enrichment: A · CSS-built CampFire Card specimen · type: Newsreader + Figtree (self-hosted, OFL)
 * Shared by the landing page, /privacy, /terms and the origin-down page. No scripts.
 */

@font-face {
  font-family: "Newsreader";
  src: url("/_edge/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/_edge/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* Design tokens copied from packages/design-system/src/index.ts (palette, radius, motion).
 * test/tokens.test.ts fails if they drift; update both together. */
:root {
  color-scheme: light dark;
  /* tokens:light */
  --cf-background: #fbf7f2;
  --cf-surface: #ffffff;
  --cf-surface-muted: #f3ece3;
  --cf-border: #e3d7c9;
  --cf-border-strong: #7d6d60;
  --cf-text: #1f1a17;
  --cf-text-muted: #5b5048;
  --cf-ember: #b83d0b;
  --cf-ember-text: #ffffff;
  --cf-ember-soft: #fce6d6;
  --cf-ember-soft-text: #7a2a08;
  --cf-glow: #f59e0b;
  --cf-success: #166534;
  --cf-danger: #b42318;
  --cf-focus: #1d4ed8;
  /* /tokens:light */

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 7rem;

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, ui-serif, serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --text-display: clamp(2.75rem, 1.5rem + 5.6vw, 6rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --measure: 38rem;
  --page: 70rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* tokens:dark */
    --cf-background: #15100d;
    --cf-surface: #211a16;
    --cf-surface-muted: #2b221d;
    --cf-border: #40342c;
    --cf-border-strong: #8a7868;
    --cf-text: #f7efe7;
    --cf-text-muted: #c2b4a7;
    --cf-ember: #fb7a36;
    --cf-ember-text: #1a0d05;
    --cf-ember-soft: #3a2014;
    --cf-ember-soft-text: #ffd2b8;
    --cf-glow: #fbbf24;
    --cf-success: #4ade80;
    --cf-danger: #f87171;
    --cf-focus: #93c5fd;
    /* /tokens:dark */
  }
}

/* ── Base ── */

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

html,
body {
  overflow-x: clip;
}

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

body {
  margin: 0;
  background: var(--cf-background);
  color: var(--cf-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: var(--space-md);
  top: -4rem;
  padding: var(--space-xs) var(--space-md);
  background: var(--cf-surface);
  color: var(--cf-text);
  border-radius: var(--radius-sm);
  z-index: 2;
}

.skip:focus-visible {
  top: var(--space-md);
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: clamp(var(--space-md), 4vw, var(--space-2xl));
}

.quiet {
  color: var(--cf-text-muted);
}

/* ── Buttons ── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 3rem;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius-sm);
  background: var(--cf-surface);
  color: var(--cf-text);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.button:hover {
  border-color: var(--cf-text-muted);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--cf-ember);
  border-color: var(--cf-ember);
  color: var(--cf-ember-text);
}

.button--primary:hover {
  border-color: var(--cf-text);
}

/* ── Masthead (N6): wordmark over a hairline, two quiet links ── */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
  padding-block: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--cf-border);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark svg {
  width: 1.5rem;
  height: 1.5rem;
  translate: 0 -0.08em;
}

.flame-outer {
  fill: var(--cf-ember);
}

.flame-inner {
  fill: var(--cf-glow);
}

.masthead__nav {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 600;
}

.masthead__nav a,
.masthead__link {
  white-space: nowrap;
  padding-block: var(--space-2xs);
  text-decoration: none;
}

.masthead__nav a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Opening: the tagline set large, beside a real card ── */

.opening {
  display: grid;
  gap: var(--space-3xl);
  padding-block: var(--space-3xl) var(--space-4xl);
}

.opening h1 {
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.028em;
  max-width: 12ch;
  font-variation-settings: "opsz" 72;
}

.opening__lede {
  margin-top: var(--space-xl);
  max-width: 30rem;
  font-size: var(--text-lg);
  color: var(--cf-text-muted);
}

.opening__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-xl);
  margin-top: var(--space-2xl);
}

.opening__more {
  font-weight: 600;
  white-space: nowrap;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
}

.stores[hidden] {
  display: none;
}

.stores a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--cf-text);
  color: var(--cf-background);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.stores a:hover {
  background: var(--cf-text-muted);
}

/* The specimen: a CampFire Card as it renders in the app, set down slightly askew on a
 * second card, like two badges swapped on a table. Built from tokens, no imagery. */
.specimen {
  margin: 0;
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  align-self: center;
}

.deck {
  display: grid;
  width: min(100%, 21rem);
}

/* The card underneath: its own grid cell, so it never paints over the front card. */
.deck::before {
  content: "";
  grid-area: 1 / 1;
  border: 1px solid var(--cf-border);
  border-radius: var(--radius-lg);
  background: var(--cf-surface-muted);
  rotate: 4deg;
  translate: 0.8rem 0.3rem;
}

.deck > .card {
  grid-area: 1 / 1;
}

.card {
  width: 100%;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius-lg);
  background: var(--cf-surface);
  rotate: -2.5deg;
  box-shadow:
    0 1px 0 var(--cf-border),
    0 18px 40px -24px var(--cf-border-strong);
}

.card p {
  margin: 0;
}

.card__met {
  display: inline-block;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--cf-ember-soft);
  color: var(--cf-ember-soft-text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.card .card__name {
  margin-top: var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.card .card__role {
  margin-top: var(--space-2xs);
  color: var(--cf-text-muted);
}

.card .card__ask {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--cf-border);
  font-size: var(--text-sm);
}

.card__ask span {
  display: block;
  color: var(--cf-text-muted);
}

.card .card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}

.card__connect,
.card__message {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--text-sm);
}

.card__connect {
  background: var(--cf-ember);
  color: var(--cf-ember-text);
}

.card__message {
  border: 1px solid var(--cf-border);
}

.specimen figcaption {
  max-width: 21rem;
  color: var(--cf-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

@media (min-width: 56rem) {
  .opening {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: center;
    padding-block: var(--space-4xl);
  }
}

/* ── Questions: plain questions set large, short answers ── */

.questions {
  display: grid;
  padding-block: var(--space-xl) var(--space-3xl);
}

.qa {
  display: grid;
  gap: var(--space-md);
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--cf-border);
  max-width: 44rem;
}

.qa h3 {
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 20ch;
}

.qa p {
  font-size: var(--text-lg);
  color: var(--cf-text-muted);
  max-width: var(--measure);
}

.qa p a:not(.button) {
  display: block;
  margin-top: var(--space-sm);
  color: var(--cf-text);
  font-weight: 600;
}

.qa--organisers {
  border-top: 3px solid var(--cf-ember);
}

.qa--organisers .button {
  margin-top: var(--space-xs);
}

@media (min-width: 56rem) {
  /* Answers step in from the page edge, alternately, so the page reads as a conversation. */
  .qa:nth-of-type(even) {
    margin-left: auto;
    margin-right: 0;
  }
}

/* ── Footer ── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-2xl);
  margin-top: var(--space-3xl);
  border-top: 1px solid var(--cf-border);
  color: var(--cf-text-muted);
  font-size: var(--text-sm);
}

.footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer a {
  display: inline-block;
  padding-block: var(--space-2xs);
  white-space: nowrap;
}

/* ── Plain pages: privacy, terms, origin-down ── */

.prose {
  max-width: var(--measure);
  padding-block: var(--space-xl) var(--space-3xl);
}

.prose h1 {
  font-size: var(--text-2xl);
}

.prose h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-2xl);
}

.prose p,
.prose ul {
  margin-top: var(--space-md);
}

.prose li + li {
  margin-top: var(--space-xs);
}

.moment {
  display: grid;
  gap: var(--space-md);
  justify-items: start;
  max-width: 34rem;
  margin-inline: auto;
  padding: var(--space-4xl) var(--space-lg);
}

.moment__mark {
  width: 3.5rem;
  height: 3.5rem;
}

.moment__mark .flame-outer {
  fill: var(--cf-ember);
}

.moment h1 {
  font-size: var(--text-2xl);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
  .button:active {
    transform: none;
  }
}

@media (forced-colors: active) {
  .button,
  .stores a {
    border: 1px solid ButtonText;
  }
}
