/* Fonts */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fraunces-600.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/fraunces-700.woff2") format("woff2");
}

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

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

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

/* Design tokens */
:root {
  --color-canvas: #161816;
  --color-canvas-deep: #0f110f;
  --color-canvas-ink: #f3efe6;
  --color-canvas-muted: #b9c0ba;
  --color-canvas-line: rgba(243, 239, 230, 0.14);
  --color-glow: #2fae6b;

  --color-page: #f9f6f0;
  --color-surface: #ffffff;
  --color-surface-warm: #f1ede4;
  --color-ink: #1c2b22;
  --color-muted: #57635b;
  --color-line: #e4dfd5;
  --color-line-strong: #cfc8ba;
  --color-accent: #1d7a47;
  --color-accent-dark: #145c35;
  --color-accent-tint: #e8f2eb;
  --color-error: #b42b20;

  --font-heading:
    "Fraunces", Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body:
    "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:
    ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --measure: 42rem;
  --page-width: 66rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --card-padding: clamp(1.5rem, 3.5vw, 2.5rem);

  --radius-card: 26px;
  --radius-inner: 16px;
  --radius-control: 12px;
  --radius-pill: 999px;

  --shadow-soft:
    0 12px 30px -8px rgba(28, 43, 34, 0.07),
    0 2px 6px -1px rgba(28, 43, 34, 0.04);
  --shadow-stage:
    0 24px 48px -12px rgba(20, 92, 53, 0.14),
    0 6px 16px -4px rgba(28, 43, 34, 0.06);
}

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

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

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background:
    radial-gradient(
      70rem 34rem at 20% -8rem,
      rgba(47, 174, 107, 0.32),
      transparent 70%
    ),
    radial-gradient(
      60rem 30rem at 85% -6rem,
      rgba(64, 160, 170, 0.22),
      transparent 70%
    ),
    var(--color-canvas);
  color: var(--color-canvas-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.375rem;
}

h4 {
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
}

p {
  margin: 0 0 var(--space-2);
}

a {
  color: var(--color-accent-dark);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--color-glow);
  outline-offset: 3px;
}

.card :focus-visible,
.story-card :focus-visible {
  outline-color: var(--color-accent);
}

.card,
.story-card {
  color: var(--color-ink);
}

/* Layout */
main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Header buttons */
.header-utilities {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.utility-button {
  flex: 0 0 auto;
  padding: 0.45rem 1.15rem;
  border: 1px solid var(--color-canvas-line);
  border-radius: var(--radius-pill);
  background: rgba(243, 239, 230, 0.08);
  color: var(--color-canvas-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  /* The share menu wrapper can shrink in the title row, which would wrap
     "Jaa sivu" onto two lines and turn the pill into a circle. */
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(28, 43, 34, 0.05);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.utility-button:hover {
  border-color: var(--color-glow);
  background: rgba(243, 239, 230, 0.14);
  transform: translateY(-1px);
}

/* Share menu */
.share-menu {
  position: relative;
}

.utility-button[aria-expanded="true"] {
  border-color: var(--color-glow);
  background: rgba(243, 239, 230, 0.14);
}

/* Out of the flow, so opening it never moves the title or the page. */
.share-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 10;
  width: max-content;
  min-width: 13rem;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 0.4rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-inner);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
}

.share-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.share-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.share-item:hover {
  background: var(--color-accent-tint);
  color: var(--color-accent-dark);
}

.share-panel :focus-visible {
  outline-color: var(--color-accent);
  outline-offset: -3px;
}

/* Two classes to outrank .hero p, which would set its colour and size. */
.share-panel .share-status {
  max-width: none;
  margin: 0.25rem 0.85rem 0.35rem;
  color: var(--color-accent-dark);
  font-size: 0.875rem;
  font-weight: 600;
}

.share-panel .share-status:empty {
  display: none;
}

.noscript {
  max-width: var(--measure);
  margin: var(--space-2) auto;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  background: var(--color-accent-tint);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.85rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px -4px rgba(29, 122, 71, 0.4);
  transition:
    background-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.button:hover:not(:disabled) {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -4px rgba(20, 92, 53, 0.5);
}

.button:disabled {
  background: var(--color-line);
  color: var(--color-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.button--full {
  width: 100%;
}

.button--secondary {
  background: transparent;
  color: var(--color-ink);
  border: 2px solid var(--color-line-strong);
  box-shadow: none;
}

/* The secondary button is dark-on-light; on the dark canvas it needs light
   text and a light outline instead. */
.button--ghost {
  background: transparent;
  color: var(--color-canvas-ink);
  border: 2px solid var(--color-canvas-line);
  box-shadow: none;
}

.button--ghost:hover:not(:disabled) {
  background: rgba(243, 239, 230, 0.08);
  border-color: var(--color-glow);
  transform: translateY(-1px);
}

.button--secondary:hover:not(:disabled) {
  background: var(--color-surface);
  color: var(--color-accent-dark);
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28, 43, 34, 0.05);
}

/* Hero */
.hero {
  display: grid;
  gap: 0 var(--space-4);
  align-items: center;
  padding: clamp(1rem, 3vw, 1.75rem) 0 clamp(2rem, 5vw, 3.25rem);
}

.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7.5vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.hero p {
  max-width: 36rem;
  margin-bottom: 1.5rem;
  color: var(--color-canvas-muted);
  font-size: clamp(1.1rem, 2vw, 1.225rem);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* The hero grid has no row gap (the desktop columns don't need one), so
   the stacked photo needs its own space below the buttons. */
.hero-media {
  margin: var(--space-3) 0 0;
}

/* Without an href the article button stays inert until the URL is known. */
a.button:not([href]) {
  cursor: default;
}

.hero-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-stage);
}

/* Story carousel */
.story {
  position: relative;
}

.story-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 1.25rem;
}

.story-tabs {
  grid-column: 2;
}

.story-arrows {
  display: none;
  grid-column: 3;
  justify-self: end;
  gap: 0.5rem;
}

.arrow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-canvas-line);
  border-radius: 50%;
  background: rgba(243, 239, 230, 0.08);
  color: var(--color-canvas-ink);
  font: inherit;
  font-size: 1.125rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(28, 43, 34, 0.05);
  transition: all 0.2s ease;
}

.arrow-button:hover:not(:disabled) {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #ffffff;
  transform: scale(1.06);
}

.arrow-button:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}

.story-tabs,
.support-tabs {
  display: inline-flex;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.35rem;
  border: 1px solid var(--color-canvas-line);
  border-radius: var(--radius-pill);
  background: rgba(243, 239, 230, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}

.pill-tab {
  flex: 0 0 auto;
  padding: 0.5rem 1.15rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-canvas-muted);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.pill-tab:hover {
  color: var(--color-canvas-ink);
}

.pill-tab[aria-current="true"],
.pill-tab[aria-selected="true"] {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 122, 71, 0.28);
}

.story-track {
  position: relative;
  display: flex;
  gap: 1rem;
  margin-inline: calc(-1 * var(--gutter));
  padding: 0.75rem var(--gutter) 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  perspective: 1200px;
}

.story-track::-webkit-scrollbar,
.story-tabs::-webkit-scrollbar,
.support-tabs::-webkit-scrollbar {
  display: none;
}

.story-track > .story-card {
  flex: 0 0 85%;
  scroll-snap-align: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.45s ease,
    border-color 0.45s ease,
    opacity 0.45s ease;
}

.story-track > .story-card[data-current] {
  transform: translateY(-4px) scale(1);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-stage);
  z-index: 2;
}

.story-track > .story-card:not([data-current]) {
  cursor: pointer;
  transform: scale(0.94);
  opacity: 0.5;
}

/* Cards */
.story-card,
.card {
  padding: var(--card-padding);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.story-card > :last-child,
.card > :last-child {
  margin-bottom: 0;
}

.story-card p {
  color: var(--color-muted);
}

.story-card--status {
  background: linear-gradient(
    145deg,
    #ffffff 0%,
    var(--color-accent-tint) 100%
  );
}

.story-card .badge {
  display: inline-block;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.study-link {
  display: block;
  width: fit-content;
  margin-top: var(--space-2);
  font-weight: 600;
}

.cost-callout {
  margin-top: var(--space-3);
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-inner);
  background: var(--color-page);
}

.cost-callout h3 {
  margin-bottom: 0.35rem;
  font-size: 1.125rem;
}

.story-card .cost-callout p {
  margin: 0;
  color: var(--color-ink);
}

.badge {
  margin: 0;
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge span::after,
.updated span::after {
  content: " ";
}

/* Story photos */
.story-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: var(--space-3);
}

.story-photos--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-inner);
}

/* Support section */
.support {
  padding: var(--space-4) 0 var(--space-5);
}

.support-options {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.support-tabs {
  justify-self: center;
  margin-bottom: 0;
}

.support-header {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}

.support-intro {
  color: var(--color-canvas-muted);
  font-size: 1.125rem;
}

.support-period {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-pill);
  background: rgba(243, 239, 230, 0.08);
  color: var(--color-canvas-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.card--access {
  border: 1.5px solid var(--color-accent);
  box-shadow: var(--shadow-stage);
}

/* Payment details */
.details {
  display: grid;
  gap: 0.625rem;
  margin: var(--space-3) 0;
}

.detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-page);
}

.details dt {
  color: var(--color-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  flex-shrink: 0;
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.mono-value {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

.amount {
  color: var(--color-accent-dark);
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.copyable {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.copy-button {
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-accent-dark);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-button:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #ffffff;
}

.small {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* Access card: steps and QR */
.steps-box {
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-inner);
  background: var(--color-page);
}

.steps {
  margin: 0;
  padding-left: 1.25rem;
}

.steps li + li {
  margin-top: 0.5rem;
}

.steps li::marker {
  color: var(--color-accent);
  font-weight: 700;
}

.access-grid {
  display: grid;
  gap: var(--space-4);
}

.donation-text {
  max-width: var(--measure);
}

.donation-text > :last-child {
  margin-bottom: 0;
}

.access-info > :last-child {
  margin-bottom: 0;
}

/* Last in the card, so on phones it follows the message builder: build
   the message, pay, then follow. */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-inner);
  background: var(--color-accent-tint);
  text-align: center;
}

.qr-box p {
  margin-bottom: 0.25rem;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.qr-box .qr-handle {
  margin-bottom: var(--space-2);
  color: var(--color-accent-dark);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* In a column flex container the image would otherwise stretch to the
   container's height; a fixed width with the intrinsic ratio prevents it. */
.qr-image {
  display: block;
  flex-shrink: 0;
  width: 180px;
  height: auto;
  aspect-ratio: 235 / 270;
  margin-bottom: 1.5rem;
  border-radius: 12px;
}

/* Thank-you note: stacked under the QR on narrow screens, in its own column
   beside it on desktop. */
.thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  order: 2;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-line);
}

.thanks img {
  display: block;
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

.thanks h4 {
  margin-bottom: 0.35rem;
}

.thanks p {
  margin: 0;
}

/* Payment message builder */
.message-builder {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-inner);
  background: var(--color-surface-warm);
}

.field {
  margin-bottom: var(--space-2);
}

.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}

.field input:hover {
  border-color: var(--color-muted);
}

.field input[aria-invalid="true"] {
  border-color: var(--color-error);
  box-shadow: 0 0 0 1px var(--color-error);
}

.hint {
  margin: 0.3rem 0 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.field-error {
  color: var(--color-error);
  font-size: 0.9375rem;
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

.message-label {
  margin: var(--space-3) 0 0.35rem;
  font-weight: 600;
}

.message-output {
  margin-bottom: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1.5px dashed var(--color-accent);
  border-radius: var(--radius-control);
  background: var(--color-accent-tint);
  color: var(--color-accent-dark);
  overflow-wrap: anywhere;
}

.message-output:not([lang]) {
  border-color: var(--color-line-strong);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.message-output[lang] {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
}

.notice {
  margin: var(--space-3) 0 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-canvas-line);
  background: var(--color-canvas-deep);
  color: var(--color-canvas-muted);
  font-size: 0.9375rem;
}

.footer-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--space-5) var(--gutter);
}

.footer-grid {
  display: grid;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-grid section {
  max-width: var(--measure);
}

.site-footer a {
  color: var(--color-canvas-ink);
}

.site-footer h2 {
  margin-bottom: 0.5rem;
  color: var(--color-canvas-ink);
  font-size: 1.125rem;
}

.updated {
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-canvas-line);
  font-size: 0.875rem;
}

.credit {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}

/* Muted like the rest of the line, so the credit doesn't compete with the
   page's own links. */
.site-footer .credit a {
  color: inherit;
}

.footer-organizer h2 {
  font-size: 1.25rem;
}

.footer-organizer p {
  font-size: 1.0625rem;
  color: var(--color-canvas-ink);
}

/* Privacy accordion */
.privacy-accordion summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.privacy-accordion summary::-webkit-details-marker {
  display: none;
}

.privacy-accordion summary h2 {
  margin: 0;
  color: var(--color-canvas-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-glow);
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.privacy-accordion summary:hover h2 {
  color: var(--color-glow);
}

.privacy-accordion summary::after {
  content: "↓" / "";
  color: var(--color-glow);
  font-weight: bold;
  transition: transform 0.2s ease;
}

.privacy-accordion[open] summary::after {
  transform: rotate(180deg);
}

.privacy-accordion p {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Phones */
@media (max-width: 30rem) {
  /* Three photos side by side would be about 75 px wide, so the first one
     takes a row of its own. */
  .story-photos--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-photos--three img:first-child {
    grid-column: 1 / -1;
  }

  /* Two buttons don't fit beside the title on a phone, so they sit on
     their own row above it. */
  .hero-title-row {
    flex-wrap: wrap;
  }

  .hero-title-row {
    justify-content: center;
    text-align: center;
  }

  .header-utilities {
    order: -1;
    flex-basis: 100%;
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .donation-text h3,
  .access-info h3 {
    text-align: center;
  }

  .footer-organizer {
    text-align: center;
  }

  .privacy-accordion {
    text-align: center;
  }

  .privacy-accordion p {
    text-align: left;
  }

  /* A single column keeps the tab row inside the screen, where it can
     scroll, instead of letting the centring grid widen the page. */
  .story-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .story-tabs {
    grid-column: 1;
    justify-self: center;
  }

  .detail-row dt {
    flex-basis: 100%;
  }

  .copyable {
    justify-content: space-between;
  }

  .mono-value {
    font-size: 0.875rem;
  }

  .pill-tab {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
  }

  /* A phone can't scan its own screen, so the button comes first and the
     code, for showing to someone else, is smaller. */
  .qr-image {
    order: 1;
    width: 140px;
    margin: 1.25rem 0 0;
  }
}

/* Desktop */
@media (min-width: 54rem) {
  .hero:has(.hero-media:not([hidden])) {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .hero-title-row {
    grid-column: 1 / -1;
  }

  .hero-media {
    margin-top: 0;
  }

  .story-arrows {
    display: flex;
  }

  .story-track {
    gap: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 2.25rem;
  }

  .story-track > .story-card {
    flex-basis: min(38rem, 64%);
  }

  .story-track > .story-card:not([data-current]) {
    transform: scale(0.92) translateY(6px);
    opacity: 0.5;
  }

  .story-track > .story-card:not([data-current]):hover {
    opacity: 0.8;
    transform: scale(0.95) translateY(2px);
    border-color: var(--color-accent);
  }

  .details--inline .detail-row {
    flex-wrap: nowrap;
  }

  .details--inline {
    grid-template-columns: 1fr 1fr;
  }

  .access-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }

  /* Full width but only as tall as the code: the text sits beside the
     QR instead of in a narrow centred column. */
  .qr-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 0.8fr) minmax(0, 1.4fr);
    grid-template-areas:
      "qr heading thanks"
      "qr text thanks"
      "qr handle thanks"
      "qr button thanks";
    align-content: center;
    column-gap: var(--space-4);
    padding: 1.5rem 2rem;
    text-align: left;
  }

  .qr-box h4 {
    grid-area: heading;
    margin-bottom: 0.35rem;
  }

  .qr-box p {
    grid-area: text;
  }

  .qr-box .qr-handle {
    grid-area: handle;
  }

  .qr-image {
    grid-area: qr;
    width: 150px;
    margin-bottom: 0;
  }

  .qr-box .button {
    grid-area: button;
    justify-self: start;
  }

  .thanks {
    grid-area: thanks;
    flex-direction: row;
    gap: var(--space-2);
    margin-top: 0;
    padding-top: 0;
    padding-left: var(--space-4);
    border-top: 0;
    border-left: 1px solid var(--color-line);
  }

  .thanks img {
    width: 110px;
    height: 110px;
  }

  .footer-grid {
    grid-template-columns: 1fr 2fr;
  }
}

/* Print: the dark canvas would print as light text on white paper, and
   controls are useless on paper. */
@media print {
  body,
  .site-footer {
    background: none;
    color: #000000;
  }

  .hero p,
  .support-intro,
  .support-period,
  .site-footer h2,
  .footer-organizer p,
  .privacy-accordion summary h2 {
    color: #000000;
  }

  .header-utilities,
  .hero-actions,
  .story-nav,
  .support-tabs,
  .copy-button,
  .message-builder,
  .qr-box .button {
    display: none !important;
  }

  .story-track {
    display: block;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .story-track > .story-card,
  .story-track > .story-card:not([data-current]) {
    margin-bottom: var(--space-3);
    opacity: 1;
    transform: none;
    box-shadow: none;
    break-inside: avoid;
  }

  /* Both support options belong on paper, whichever tab is selected. */
  .support-options > .card[hidden] {
    display: block !important;
  }

  .card {
    box-shadow: none;
    break-inside: avoid;
  }

  .story-card .badge {
    padding: 0;
    background: none;
    color: #000000;
  }
}