/* ==========================================================================
Give us water with gas. — petition for a CO2 cartridge at UZH BIM Oerlikon
Quiet editorial layout: one narrow column on navy, lots of room, one apricot ask.
========================================================================== */

/* ---------- Fonts (self-hosted, latin subset, SIL OFL 1.1: see fonts/LICENSE.txt) ---------- */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/fraunces-latin.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap; src: url(fonts/fraunces-italic-latin.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/instrument-sans-latin.woff2) format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --bg: #07172b;
  --line: #1c3650;
  --line-strong: #34597a;
  --aqua: #5fe3ff;
  --aqua-soft: #a7f3ff;
  --apricot: #ffb37a;
  --apricot-hover: #ffc494;
  --text: #eaf6ff;
  --soft: #cfe3ef;
  --muted: #8fb0c4;
  --ok: #7ff0c0;
  --warn: #ffe08a;
  --error: #ff9bb0;
  --gutter: 1.25rem;
  --indent: 0rem;
  --space: 4.5rem;
  --wrap: 72rem;
  --col: 38rem;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 0.84, 0.3, 1);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 450;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
  text-wrap: balance;
}
h2 { font-size: clamp(1.75rem, 3vw + 0.9rem, 2.25rem); }

p { margin: 0; text-wrap: pretty; }
ul { list-style: none; margin: 0; padding: 0; }

a { color: var(--aqua-soft); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: #fff; }

:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* One container, one left edge, one narrow measure. */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding-inline-start: var(--indent);
}
.col { max-width: var(--col); }

.kicker, .note, .confirm-data dt {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header: just the language link, top right ---------- */
.site-header {
  display: flex;
  justify-content: flex-end;
  padding-block: 1.25rem;
}
.lang-switch { display: inline-block; padding-block: 0.6rem; font-size: 0.9375rem; color: var(--soft); text-decoration: underline; }

/* ---------- Bubbles: a few flat outlines drifting up behind the hero ---------- */
.hero-stage { position: relative; overflow: hidden; }
.hero-stage .hero { position: relative; z-index: 1; }
.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Each span is a full-height lane that rises by its own height; ::before is the bubble. */
.bubbles span {
  --s: 1rem; --d: 26s; --delay: -3s;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10%;
  width: var(--s);
  animation: rise var(--d) linear var(--delay) infinite;
}
.bubbles span::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: var(--s);
  height: var(--s);
  border: 1px solid var(--aqua);
  border-radius: 50%;
  opacity: 0.28;
}
.bubbles span:nth-child(1) { left: 22.9%; --s: 4.5rem; --d: 39s; --delay: -22s; }
.bubbles span:nth-child(2) { left: 77.1%; --s: 1rem; --d: 28s; --delay: -11s; }
.bubbles span:nth-child(3) { left: 93.8%; --s: 4.5rem; --d: 33s; --delay: -28s; }
.bubbles span:nth-child(4) { left: 64.6%; --s: 6rem; --d: 42s; --delay: -22s; }
.bubbles span:nth-child(5) { left: 31.2%; --s: 6rem; --d: 43s; --delay: -29s; }
.bubbles span:nth-child(6) { left: 60.4%; --s: 2rem; --d: 31s; --delay: -19s; }
.bubbles span:nth-child(7) { left: 98.0%; --s: 8rem; --d: 44s; --delay: -31s; }
.bubbles span:nth-child(8) { left: 89.7%; --s: 1rem; --d: 29s; --delay: -14s; }
.bubbles span:nth-child(9) { left: 27.0%; --s: 10rem; --d: 57s; --delay: -26s; }
.bubbles span:nth-child(10) { left: 81.3%; --s: 12rem; --d: 59s; --delay: -14s; }
.bubbles span:nth-child(11) { left: 56.3%; --s: 3rem; --d: 35s; --delay: -8s; }
.bubbles span:nth-child(12) { left: 68.8%; --s: 6rem; --d: 43s; --delay: -37s; }
.bubbles span:nth-child(13) { left: 35.4%; --s: 12rem; --d: 58s; --delay: -56s; }
.bubbles span:nth-child(14) { left: 2.0%; --s: 2rem; --d: 31s; --delay: -5s; }
.bubbles span:nth-child(15) { left: 39.6%; --s: 7rem; --d: 42s; --delay: -20s; }
.bubbles span:nth-child(16) { left: 47.9%; --s: 1rem; --d: 32s; --delay: -2s; }
.bubbles span:nth-child(17) { left: 14.5%; --s: 7rem; --d: 44s; --delay: -15s; }
.bubbles span:nth-child(18) { left: 73.0%; --s: 14rem; --d: 67s; --delay: -30s; }
.bubbles span:nth-child(19) { left: 10.3%; --s: 1.5rem; --d: 33s; --delay: -15s; }
.bubbles span:nth-child(20) { left: 6.2%; --s: 1.5rem; --d: 25s; --delay: -17s; }
.bubbles span:nth-child(21) { left: 85.5%; --s: 12rem; --d: 58s; --delay: -22s; }
.bubbles span:nth-child(22) { left: 52.1%; --s: 8rem; --d: 44s; --delay: -20s; }
.bubbles span:nth-child(23) { left: 18.7%; --s: 3rem; --d: 35s; --delay: -17s; }
.bubbles span:nth-child(24) { left: 43.7%; --s: 3.5rem; --d: 38s; --delay: -4s; }
/* Phones: every other bubble. */
.bubbles span:nth-child(odd) { display: none; }
@keyframes rise {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-100% - 4rem)); }
}

/* ---------- Hero ---------- */
.hero { padding-top: calc(var(--space) * 0.5); }
.hero h1 {
  margin: 0 0 1.75rem;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.hero h1 em { font-style: italic; font-weight: 400; }
.lead { max-width: 34rem; font-size: 1.125rem; line-height: 1.65; color: var(--soft); }

.counter {
  margin-top: 3rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.35;
  font-variation-settings: "opsz" 36;
}
.counter strong { font-weight: 500; font-variant-numeric: lining-nums; color: var(--aqua); }
.hero-cta { margin-top: 1.75rem; }

/* ---------- The one apricot action ---------- */
.cta, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border: 0;
  border-radius: 3px;
  background: var(--apricot);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.cta:hover, button[type="submit"]:hover { color: var(--bg); background: var(--apricot-hover); }

button[type="submit"].is-busy { cursor: progress; opacity: 0.8; }
button[type="submit"].is-busy::after {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections: a hairline, then room ---------- */
.section { margin-top: var(--space); }
.section > .col, .site-footer > .col { padding-top: 2.25rem; border-top: 1px solid var(--line); }

.why-list { margin-top: 2rem; }
.why-list li {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.45;
  font-variation-settings: "opsz" 36;
}
.why-list li + li { margin-top: 1.5rem; }

.intro { margin: 0.75rem 0 2.5rem; color: var(--soft); }

/* ---------- Form: fields straight on the page ---------- */
.sign-form { scroll-margin-top: 2rem; }
#sign-section { scroll-margin-top: 1rem; }
.row { display: grid; gap: 0 1.25rem; }
.field { display: grid; gap: 0.4rem; margin-bottom: 1.5rem; }
.field label { font-size: 0.9375rem; font-weight: 500; color: var(--soft); }

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: max(16px, 1rem);
  line-height: 1.3;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:hover { border-color: var(--muted); }
.field input[type="text"]:focus,
.field input[type="email"]:focus { outline: 1px solid var(--aqua); outline-offset: 0; border-color: var(--aqua); }

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

.hint { font-size: 0.9rem; line-height: 1.4; }
.hint:empty { display: none; }
.hint.is-ok { color: var(--ok); }
.hint.is-bad { color: var(--warn); }

.field .error { font-size: 0.9rem; line-height: 1.45; color: var(--error); }
.field.has-error input { border-color: var(--error); }

.field.checkbox { grid-template-columns: auto 1fr; align-items: start; gap: 0.75rem; }
.field.checkbox input { width: 1.375rem; height: 1.375rem; margin: 0.55rem 0 0; accent-color: var(--aqua); cursor: pointer; }
.field.checkbox label { padding-block: 0.45rem; line-height: 1.5; cursor: pointer; }

.submit-row { margin-top: 1rem; }
.submit-row button { width: 100%; }
.hp { display: none; }

/* ---------- Signers: set like the signatories of an open letter ---------- */
.note { margin-top: 0.75rem; }
.signers {
  margin-top: 2.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.75;
  font-variation-settings: "opsz" 24;
  overflow-wrap: anywhere;
}
.signers li { display: inline; }
.signers li:not(:last-child)::after { content: "\00a0·  "; content: "\00a0· " / ""; color: var(--muted); }
.signers .affiliation { font-family: var(--font-body); font-size: 0.875rem; color: var(--muted); }
.signers-empty { margin-top: 2.25rem; font-family: var(--font-display); font-size: 1.25rem; color: var(--muted); }

/* ---------- Footer: a few small plain lines ---------- */
.site-footer { margin-top: var(--space); padding-bottom: 4rem; font-size: 0.875rem; line-height: 1.65; color: var(--muted); }
.site-footer p + p, .site-footer nav { margin-top: 0.75rem; }
.site-footer a { color: var(--soft); }
.site-footer a:hover { color: #fff; }
.footer-links li { display: inline; line-height: 2.4; }
.footer-links a { white-space: nowrap; }
.footer-links li:not(:last-child)::after { content: "  ·  "; content: "  ·  " / ""; white-space: pre; }

/* ---------- Message pages (pending / verified / confirm / error) ---------- */
.message-stage { min-height: 55vh; padding-top: calc(var(--space) * 0.75); }
.message h1 { margin-bottom: 1.5rem; font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.05; }
.message > p { color: var(--soft); }
.message > p + p { margin-top: 1rem; }
.message .counter { margin-top: 2.5rem; color: var(--text); }
.message .share, .message .back { margin-top: 1.25rem; }
.message > p.fix { margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.message form { margin-top: 2rem; }
.confirm-data { margin: 2.25rem 0 0; }
.confirm-data dd {
  margin: 0.15rem 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.confirm-data dd:last-child { margin-bottom: 0; }

/* ---------- Load reveal (hero only, subtle) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .col > * { animation: reveal 0.7s var(--ease-out) both; }
  .hero .col > :nth-child(2) { animation-delay: 0.08s; }
  .hero .col > :nth-child(3) { animation-delay: 0.16s; }
  .hero .col > :nth-child(n + 4) { animation-delay: 0.26s; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bubbles { display: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  button[type="submit"].is-busy::after { animation: none; }
}

/* ---------- Larger screens: more margin, more air ---------- */
@media (min-width: 40em) {
  :root { --gutter: 2rem; --space: 7rem; }
  .row { grid-template-columns: 1fr 1fr; }
  .submit-row button { width: auto; }
  .signers .name { white-space: nowrap; }
}

@media (min-width: 900px) {
  :root { --gutter: 3rem; --indent: clamp(0rem, 12vw - 3.5rem, 10rem); --space: 9.5rem; }
  .site-header { padding-block: 2rem; }
  /* Desktop: the whole hero is a bubble field. */
  .bubbles { left: 0; }
  .bubbles span:nth-child(n) { display: block; }
}
