/*
 * Message in a Bottle, "the shore gallery" (visual redesign of 2026-12-01).
 *
 * Light, bright dawn-to-sea skies; the tint follows the state (dawn = ready,
 * lilac = drifting, gold = arrived, wall = viewing, night = camera). One coral
 * action per screen. Instrument Serif for moments, Inter for controls. The
 * artboards are in ../design/shore-gallery/; the fonts are self-hosted (see
 * README.md). No inline styles anywhere: the page's content security policy
 * forbids them, so everything the app draws is a class in this file.
 */

/* ---------- Fonts (self-hosted; never from a font service) ---------- */
@font-face {
  font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/InstrumentSerif-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/fonts/InstrumentSerif-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font-display: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-ui: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Text. Every pair is checked by test/design.test.mjs (4.5:1 for text). */
  --ink: #1f2430;
  --ink-2: #434958;
  --eyebrow: #6a584e;
  --white: #ffffff;
  --coral: #e2664a;          /* decoration only: rings, rays, the shutter */
  --coral-btn: #c24e33;      /* fill behind white text */
  --coral-btn-press: #a8432b;
  --coral-ink: #a83f27;      /* coral text on a light sky */
  --danger: #9c2a1e;
  --focus: #1f2430;

  /* Surfaces */
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .84);
  --glass-edge: rgba(255, 255, 255, .92);
  --hairline: rgba(31, 36, 48, .18);
  --shadow-card: 0 14px 34px -18px rgba(60, 45, 30, .3);

  --gutter: 24px;
  --app-width: 26.25rem;

  /* Glyphs, drawn as masks so a glyph takes the colour of its text */
  --i-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3C/svg%3E");
  --i-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  --i-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  --i-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E");
  --i-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16V11a6 6 0 1 1 12 0v5l2 2H4z'/%3E%3Cpath d='M10 20a2 2 0 0 0 4 0'/%3E%3C/svg%3E");
  --i-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E");
  --i-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4h11l-1.5 4L16 12H5'/%3E%3C/svg%3E");
  --i-waves: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14c3-3 6 3 9 0s6 3 9 0M3 19c3-3 6 3 9 0s6 3 9 0'/%3E%3C/svg%3E");
  --i-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 8a8 8 0 1 0 1 7m0-11v5h-5'/%3E%3C/svg%3E");
  --i-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
  --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 5-3 8-7 10-4-2-7-5-7-10V6z'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-retake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Cpath d='M9.5 13.5a2.5 2.5 0 0 0 4.5 1.5M14.5 12.5a2.5 2.5 0 0 0-4.5-1.5'/%3E%3C/svg%3E");
  --i-pass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19v-2a6 6 0 0 1 6-6h8M15 6l4 5-4 5'/%3E%3C/svg%3E");
  --i-museum: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9.5L12 4l9 5.5H3z'/%3E%3Cpath d='M5.5 12v6M10 12v6M14 12v6M18.5 12v6M3.5 20.5h17'/%3E%3C/svg%3E");
}
#screen[data-sky="lilac"] { --eyebrow: #565b70; }
#screen[data-sky="night"] { --ink: #ffffff; --ink-2: #c9ced8; --focus: #ffffff; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #fcefe3; color: var(--ink);
  font: 400 16px/1.45 var(--font-ui); font-synthesis: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
img { max-width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.screen:focus { outline: none; }

/* ---------- The sky: one fixed backdrop whose tint follows the screen ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #fcefe3; }
.sky-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.sky-dawn {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .25) 0%, rgba(173, 208, 214, .6) 100%) bottom / 100% 38% no-repeat,
    linear-gradient(180deg, #fcefe3 0%, #f9e6da 36%, #e4eef0 62%, #cfe3e7 100%);
}
.sky-lilac {
  background:
    linear-gradient(rgba(255, 255, 255, .9) 0 0) 0 56% / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(180, 211, 219, .35) 0%, rgba(150, 192, 203, .6) 100%) bottom / 100% 44% no-repeat,
    linear-gradient(180deg, #f3eef4 0%, #e8e6f0 40%, #d6e4ea 70%, #c3d9e0 100%);
}
.sky-lilac::after {
  content: ""; position: absolute; left: 65%; top: 57.5%; width: 34px; height: 78px; margin: -39px 0 0 -17px;
  background: url('/art/bottle-adrift.svg') center / contain no-repeat; transform: rotate(-62deg);
  animation: bob-adrift 5s ease-in-out infinite;
}
@keyframes bob-adrift { 0%, 100% { transform: rotate(-62deg) translateY(0); } 50% { transform: rotate(-58deg) translateY(-3px); } }
@media (max-height: 720px) { .sky-lilac::after { display: none; } }
.sky-gold {
  background: linear-gradient(180deg, #ffefdf 0%, #fce3cf 34%, #f4e6d6 60%, #eadbc6 100%);
}
.sky-gold::after {
  content: ""; position: absolute; left: -10%; right: -10%; top: 71%; bottom: -5%;
  border-radius: 50% 50% 0 0 / 18% 18% 0 0;
  background: linear-gradient(180deg, #f3dfc4 0%, #e9d1b1 100%);
}
.sky-wall { background: radial-gradient(120% 60% at 50% 18%, #ffffff 0%, #f5f1ea 55%, #ece6dc 100%); }
/* The camera's dark appears and goes at once: text that turns light or dark with the screen must never sit on the wrong ground while a fade runs. */
.sky-night { background: #14181f; transition: none; }
body:has(#screen[data-sky="lilac"]) .sky-lilac,
body:has(#screen[data-sky="gold"]) .sky-gold,
body:has(#screen[data-sky="wall"]) .sky-wall,
body:has(#screen[data-sky="night"]) .sky-night { opacity: 1; }

/* ---------- The frame ---------- */
.app {
  position: relative; display: flex; flex-direction: column;
  width: min(100%, var(--app-width)); min-height: 100vh; min-height: 100dvh; margin-inline: auto;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 28px) max(var(--gutter), env(safe-area-inset-left));
}
.screen { display: flex; flex: 1; flex-direction: column; gap: 14px; min-width: 0; padding-top: 0; }
.screen > * { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 14px; }
.brand { margin: 0; font: 400 22px/1.1 var(--font-display); color: var(--ink); }

/* Offline: a small dark chip at the foot of the screen */
#connection {
  position: fixed; z-index: 40; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 8px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 12px; border-radius: 999px;
  background: rgba(31, 36, 48, .92); color: #ffffff; font: 500 12px/1.4 var(--font-ui); letter-spacing: .02em;
  pointer-events: none;
}
#connection:empty { display: none; }
#connection::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f2a48f; }

/* Notices (the Home Screen suggestion, a pushed update) sit in a sheet at the foot, over the sky */
#notices { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; pointer-events: none; }
#notices:not(:empty) { padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); }
#notices > * { pointer-events: auto; width: min(100%, 26rem); margin-inline: auto; }
#notices > * + * { margin-top: 10px; }
.banner.card { background: rgba(255, 255, 255, .94); box-shadow: 0 -10px 40px -14px rgba(60, 45, 30, .38); max-height: 60dvh; overflow: auto; }
.banner h2 { font-size: 22px; }
.banner p { font-size: 14px; }
.push-update { padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .94); border: 1px solid var(--glass-edge); }
.noscript { margin: 16px; }

/* ---------- Type ---------- */
.eyebrow { margin: 0; font: 500 12px/1.3 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--eyebrow); }
.display { margin: 6px 0 0; font: 400 36px/1.05 var(--font-display); letter-spacing: 0; text-wrap: balance; }
.display i { font-style: italic; }
.display.large { font-size: clamp(36px, 11.3vw, 44px); line-height: 1.02; }
.lede { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: balance; }
.title { font: 400 clamp(32px, 9.6vw, 38px)/1.05 var(--font-display); text-wrap: balance; }
.muted, .counts { color: var(--ink-2); }
.status-line { font-size: 14px; color: var(--ink-2); }
.status-line.error {
  padding: 10px 14px; border-radius: 14px; background: var(--glass-strong); border: 1px solid rgba(156, 42, 30, .22);
  color: var(--danger);
}

/* ---------- Glyphs ---------- */
[data-icon]::before {
  content: ""; flex: none; width: 1.3em; height: 1.3em; background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
}
[data-icon="settings"] { --glyph: var(--i-settings); }
[data-icon="close"] { --glyph: var(--i-close); }
[data-icon="lock"] { --glyph: var(--i-lock); }
[data-icon="camera"] { --glyph: var(--i-camera); }
[data-icon="bell"] { --glyph: var(--i-bell); }
[data-icon="download"] { --glyph: var(--i-download); }
[data-icon="flag"] { --glyph: var(--i-flag); }
[data-icon="waves"] { --glyph: var(--i-waves); }
[data-icon="refresh"] { --glyph: var(--i-refresh); }
[data-icon="back"] { --glyph: var(--i-back); }
[data-icon="shield"] { --glyph: var(--i-shield); }
[data-icon="check"] { --glyph: var(--i-check); }
[data-icon="retake"] { --glyph: var(--i-retake); }
[data-icon="museum"] { --glyph: var(--i-museum); }
[data-icon="pass"] { --glyph: var(--i-pass); }

/* ---------- Buttons: one coral action per screen ---------- */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 26px;
  border: 1px solid var(--hairline); background: rgba(255, 255, 255, .62); color: var(--ink);
  font: 500 15px/1.2 var(--font-ui); text-align: center; text-decoration: none;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
button.primary {
  border-color: var(--coral-btn); background: var(--coral-btn); color: #ffffff; font-weight: 600;
  box-shadow: 0 10px 24px rgba(194, 78, 51, .28);
}
button.primary:active:enabled { background: var(--coral-btn-press); }
button.danger { border-color: rgba(156, 42, 30, .38); background: rgba(255, 255, 255, .72); color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }
button:active:enabled, a.button:active { transform: scale(.98); }
.actions { display: flex; flex-direction: column; gap: 10px; }
.actions > * { min-width: 0; }
.link-button {
  min-height: 44px; padding: 8px 14px; border: 0; background: none; color: var(--ink-2);
  font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.icon-button {
  flex: none; width: 44px; min-height: 44px; height: 44px; padding: 0; border-radius: 22px;
  border-color: transparent; background: rgba(255, 255, 255, .6); color: var(--ink);
}
.icon-button::before { width: 20px; height: 20px; }
.pill-button { min-height: 44px; padding: 0 16px 0 10px; font-size: 14px; background: rgba(255, 255, 255, .6); border-color: transparent; }

/* ---------- Cards, lists, forms ---------- */
.card {
  padding: 20px; border: 1px solid var(--glass-edge); border-radius: 24px; background: var(--glass);
  box-shadow: var(--shadow-card); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  overflow-wrap: anywhere;
}
.card > * + *, .stack > * + * { margin-top: 12px; }
.card > h2 + p { margin-top: 6px; }
.card h2 { font: 400 26px/1.1 var(--font-display); }
.card p { color: var(--ink-2); }
.card .actions { margin-top: 16px; }
.card > button { display: flex; width: 100%; }
.list { padding: 0; list-style: none; display: grid; gap: 12px; }
.list li { margin: 0; }
.card ul.list { gap: 8px; margin-top: 10px; padding-left: 0; }
.card ul.list li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.card ul.list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
label { display: block; font-size: 14px; color: var(--ink-2); }
input[type="text"] {
  width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid rgba(31, 36, 48, .28); border-radius: 16px;
  background: rgba(255, 255, 255, .9); color: var(--ink); font: 400 16px/1.3 var(--font-ui);
}
input[type="text"]::placeholder { color: #5f6575; }
.photo { display: block; width: 100%; height: auto; border-radius: 14px; background: #f1ece3; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px; border-radius: 15px;
  background: var(--ink); color: #ffffff; font: 500 12px/1 var(--font-ui);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f2a48f; }
/* What every bottle from the museum archive says, sealed and in the viewer (card F10): a small museum tag. */
.pilot-tag {
  width: fit-content; max-width: min(318px, 100%); margin: 14px auto 0; padding: 8px 16px; border: 1px solid var(--glass-edge); border-radius: 18px;
  background: var(--glass-strong); font: 500 12.5px/1.4 var(--font-ui); color: var(--ink); text-align: center; text-wrap: balance;
}
/* The museum's mark stands in the line of the words, so it is read with them. */
.pilot-tag::before { display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; color: var(--coral-ink); }

/* ---------- Home: the shore (ready, drifting, arrived, returned, resting) ---------- */
.shore {
  position: relative; display: flex; flex: 1; flex-direction: column; isolation: isolate; overflow-x: clip;
  --stage: clamp(170px, calc(100vh - 440px), 300px);
  --stage: clamp(170px, calc(100dvh - 440px), 300px);
}
.shore[data-shore="arrived"] {
  --stage: clamp(170px, calc((100vh - 440px) / 1.27), 300px);
  --stage: clamp(170px, calc((100dvh - 440px) / 1.27), 300px);
}
/* A bottle from the museum archive has a notice to carry, so its stage is a little smaller, and a label of its own colour. */
.shore[data-source="archive"] {
  --stage: clamp(170px, calc((100vh - 510px) / 1.27), 300px);
  --stage: clamp(170px, calc((100dvh - 510px) / 1.27), 300px);
}
.topbar-end { display: flex; align-items: center; gap: 8px; }
.intro { padding: 40px 4px 0; text-align: center; }
.intro .lede { max-width: 30ch; margin-inline: auto; }
.notice {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: 100%;
  margin: 0 auto 14px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--glass-strong); font-size: 13px; line-height: 1.3; color: var(--ink);
}
.notice[data-icon]::before { width: 16px; height: 16px; color: var(--coral-ink); }
.moment { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding-block: 12px; }
.moment-drifting { justify-content: flex-end; padding-bottom: 20px; }
.scene { position: relative; flex: none; width: var(--stage); height: var(--stage); }
.scene-uncork { width: calc(var(--stage) * 1.0667); height: calc(var(--stage) * 1.2667); }
.scene-return { width: 150px; height: 150px; }
.sun {
  position: absolute; z-index: -1; left: 50%; bottom: 0; width: min(153.3%, 100vw); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 170, .8) 0%, rgba(255, 214, 170, 0) 62%); pointer-events: none;
}
.scene-return .sun { bottom: -53.3%; width: min(280%, 100vw); }

/* The stage is one button: the bottle to cast, the cork to pull, the circle to cast again. */
.stage {
  position: absolute; inset: 0; display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: none; box-shadow: none; color: inherit; cursor: pointer;
}
.stage:active:enabled { transform: none; }
.stage:focus-visible { outline-offset: 6px; }
.stage > span, .stage-art > span { position: absolute; }
.ripple { left: 50%; top: 76%; width: 40%; height: 11.33%; margin: -5.67% 0 0 -20%; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .95); animation: rip 3.2s ease-out infinite; }
.ripple.r2 { animation-delay: 1.06s; }
.ripple.r3 { animation-delay: 2.12s; }
@keyframes rip { 0% { transform: scale(.4); opacity: .95; } 100% { transform: scale(2.6); opacity: 0; } }
.halo { inset: 6%; border-radius: 50%; border: 2px dashed rgba(226, 102, 74, .55); animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.core {
  inset: 17.33%; border-radius: 50%; transition: background .9s;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #fff4ec 55%, #fbe1d2 100%);
  box-shadow: 0 26px 50px -20px rgba(226, 102, 74, .55), inset 0 0 0 1px rgba(255, 255, 255, .9);
}
.bottle {
  left: 38.33%; top: 23.33%; width: 23.33%; height: 50%; background: url('/art/bottle.svg') center / contain no-repeat;
  animation: bob 3.4s ease-in-out infinite; transition: transform .9s cubic-bezier(.2, .7, .2, 1), opacity .9s;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-5%) rotate(4deg); } }
.stage.thrown .bottle { animation: none; transform: translate(171%, -173%) rotate(220deg) scale(.4); opacity: 0; }
.stage.thrown .core { background: radial-gradient(circle, #ffe2d4 0%, #f9b9a2 100%); }

/* The welcome and the wait: the same bottle, with nothing to tap */
.welcome { position: relative; display: flex; flex: 1; flex-direction: column; isolation: isolate; overflow-x: clip; }
.welcome-scene { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 150px; padding-block: 12px; }
.scene-welcome { --stage: clamp(130px, 24dvh, 210px); }
.stage-art { position: absolute; inset: 0; }
.welcome-cards { display: grid; gap: 12px; padding-bottom: 4px; }
.loading { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow-x: clip; }

/* Arrived: the bottle on the sand, and its cork */
.stage-uncork { border-radius: 28px; }
.glow {
  left: 0; top: 7.9%; width: 100%; height: 84.2%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 140, .95) 0%, rgba(255, 196, 140, 0) 64%); animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
.rays {
  left: 9.375%; top: -12.2%; width: 81.25%; aspect-ratio: 1; background: url('/art/rays.svg') center / contain no-repeat;
  opacity: 0; transform: scale(.6); transition: opacity .5s, transform .8s;
}
/*
 * The bottle on the sand is one box to the shape of its art (34 x 70, the `viewBox` of both washed bottles: 65% of the stage's height is
 * 37.5% of its width times 70 / 34), tilted as a whole. The cork is a child of that box, placed in the art's own units: the neck's mouth
 * is the middle of its top edge (x 13 to 21 of 34, y 0), and the cork is as wide as the neck is, seated 2 units into the mouth. It is
 * tilted with the bottle, so it sits on the neck at every size of the stage and in every picture of the bottle (a member's, the
 * archive's), and it pops out of the neck along the bottle's own axis. (Before, it was drawn beside the bottle and tilted by itself: the
 * tilt moved the neck to the left and left the cork where it was.)
 */
.washed {
  left: 31.25%; top: 26.7%; width: 37.5%; height: 65%; background: url('/art/bottle-washed.svg') center / 100% 100% no-repeat;
  transform: rotate(-14deg);
}
.shore[data-source="archive"] .washed { background-image: url('/art/bottle-washed-archive.svg'); }
.washed > .cork {
  position: absolute; left: 27%; top: -19.5%; width: 46%; height: 26.3%; background: url('/art/cork.svg') center / contain no-repeat;
  transform-origin: 50% 85%; transition: transform .7s cubic-bezier(.2, 1.4, .3, 1);
}
.pull {
  left: 50%; top: 1.6%; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .8); white-space: nowrap;
  font: 600 12px/1.3 var(--font-ui); color: var(--coral-ink); transform: translateX(-50%);
  animation: nudge 1.4s ease-in-out infinite; transition: opacity .3s;
}
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
.stage-uncork.open .cork { transform: translate(60%, -190%) rotate(160deg); }
.stage-uncork.open .rays { opacity: 1; transform: scale(1.1); }
.stage-uncork.open .pull { opacity: 0; }

/* Returned: the circle that casts again, over still rings */
.ring { position: absolute; left: 50%; top: calc(50% + 14px); border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .95); transform: translate(-50%, -50%); pointer-events: none; }
.ring-1 { width: 60px; height: 18px; }
.ring-2 { width: 130px; height: 34px; opacity: .7; }
.ring-3 { width: 220px; height: 54px; opacity: .45; }
.stage-return { border: 2px dashed rgba(226, 102, 74, .55); background: rgba(255, 255, 255, .35); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.castcore {
  inset: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 26px; color: #ffffff;
  background: var(--coral); box-shadow: 0 18px 36px -12px rgba(226, 102, 74, .6); transition: transform .45s ease, opacity .45s ease;
}
.stage-return.thrown .castcore { transform: scale(.4); opacity: 0; }

/* What it says under the stage */
.cue { margin-top: 10px; min-height: 58px; text-align: center; }
.cue-title { font: 400 30px/1.1 var(--font-display); color: var(--coral-ink); }
.cue-sub { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.cue-title.small { font-size: 28px; }

/* Drifting: a bottle on the horizon and a line that says it is on its way */
.progress { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
/* The wait timer ("Adrift for 3 min"): digits of one width, so the words do not shift when they change. No animation: it is replaced, not counted. */
.progress-labels .wait { font-variant-numeric: tabular-nums; }
.track { height: 4px; overflow: hidden; border-radius: 2px; background: rgba(31, 36, 48, .14); }
.track span { display: block; width: 38%; height: 100%; border-radius: 2px; background: #565b70; animation: drift 3.6s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(163%); } }

/* The foot: one quiet line of numbers, and what else the state allows */
.foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; }
.foot > * { max-width: 100%; }
.foot .notifications { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.foot .notifications:empty { display: none; }
.foot .card { width: 100%; padding: 14px 16px; border-radius: 20px; }
.foot .card h2 { font-size: 21px; }
.foot .card p { font-size: 13px; line-height: 1.45; }
.foot .actions { width: 100%; }
.ghost { width: 100%; min-height: 56px; border-radius: 28px; background: rgba(255, 255, 255, .55); }
.fine { font-size: 12px; line-height: 1.4; color: var(--ink-2); text-align: center; }
.fine[data-icon] { display: flex; align-items: center; justify-content: center; gap: 6px; }
.fine[data-icon]::before { width: 14px; height: 14px; }
.tally-row { display: grid; grid-template-columns: 44px auto 44px; align-items: center; justify-content: center; gap: 4px; }
.tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 28px; font-size: 13px; color: var(--ink-2); }
.tally b { font-weight: 600; color: var(--ink); }
.refresh { background: transparent; color: var(--ink-2); }
.refresh::before { width: 16px; height: 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px;
  background: rgba(255, 255, 255, .7); font: 500 12px/1 var(--font-ui); color: var(--coral-ink);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (max-height: 700px) {
  .intro { padding-top: 22px; }
  .display.large { font-size: 38px; }
}
@media (max-height: 620px) {
  .topbar { margin-top: 8px; }
  .intro { padding-top: 10px; }
  .display { font-size: 30px; }
  .display.large { font-size: 32px; }
  .lede { margin-top: 6px; font-size: 14px; }
  .notice { margin-bottom: 8px; }
  .moment { padding-block: 2px; }
  .cue { min-height: 0; margin-top: 4px; }
  .cue-title { font-size: 24px; }
  .foot { padding-top: 2px; }
  .frame { margin-top: 14px; padding: 12px; }
  .wall-label { margin-top: 14px; }
  .acts { padding-top: 14px; }
}

/* ---------- The viewer and the review: a photograph on a white mat, on the gallery wall ---------- */
.viewer { display: flex; flex: 1; flex-direction: column; color: var(--ink); --wall-ink: #6b6459; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 14px; }
.viewer-top .icon-button { background: rgba(31, 36, 48, .06); }
.frame {
  width: min(318px, 100%); margin: 28px auto 0; padding: 18px; border: 1px solid #e2dbce; background: #ffffff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .03), 0 24px 40px -18px rgba(60, 45, 30, .35);
}
.frame .photo { width: 100%; max-height: min(376px, 46dvh); border-radius: 0; object-fit: contain; background: #ffffff; }
.frame-empty { min-height: 240px; }
.wall-label { width: min(246px, 100%); margin: 24px auto 0; padding-top: 14px; border-top: 1px solid #d9d1c3; }
.label-title { font: italic 400 26px/1.1 var(--font-display); color: var(--ink); }
.label-meta { margin-top: 4px; font-size: 12.5px; line-height: 1.55; color: var(--wall-ink); }
.viewer > .status-line { margin-top: 14px; }
.viewer > .card { margin-top: 18px; }
/* A work from the museum archive (card F10): the owner's notice under the chip, and the museum's own label, wider than a member's. */
.viewer .pilot-tag { margin-top: 12px; border-color: #e2dbce; background: #ffffff; }
.viewer .pilot-tag + .frame { margin-top: 18px; }
.wall-label-archive { width: min(318px, 100%); }
.wall-label-archive .label-title { overflow-wrap: anywhere; }
.label-by { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.label-credit { margin-top: 8px; }
.label-url { margin-top: 8px; font-size: 11px; overflow-wrap: anywhere; }
.label-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 2px; color: var(--coral-ink);
  font: 500 13px/1.3 var(--font-ui); text-decoration: underline; text-underline-offset: 3px;
}
/* The moderator's review of a work from the archive: the same label, in a card. */
.card .label-title { font-style: italic; }
.archive-report > .pilot-tag { width: auto; max-width: none; margin: 0; text-align: left; }
.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: auto; padding-top: 24px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 72px; padding: 0 6px; border: 1px solid #e2dbce; border-radius: 20px; background: #ffffff; color: var(--ink);
  font: 500 12.5px/1.2 var(--font-ui); text-align: center; text-decoration: none;
}
.act::before { width: 20px; height: 20px; }
.act.go { border-color: var(--coral-btn); background: var(--coral-btn); color: #ffffff; }
/* The viewer has four actions (card F13: Keep a copy, Report, Pass it on, Return to sea): four narrower columns, the words in two lines where they must be. */
.viewer[data-viewer="open"] .acts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.viewer[data-viewer="open"] .act { padding: 0 3px; font-size: 12px; }

/* ---------- The choice at the review of a cast (card F13): the notice, and a box that is a target a thumb can hit ---------- */
.pass-choice { width: min(318px, 100%); margin: 16px auto 0; }
.pass-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--wall-ink); text-align: center; text-wrap: balance; }
.check { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; margin-top: 8px; color: var(--ink); font: 500 14px/1.3 var(--font-ui); cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: 0;
  border: 1px solid #e2dbce; border-radius: 14px; background: #ffffff; color: var(--coral-ink); cursor: pointer;
}
.check input::before {
  content: ""; width: 22px; height: 22px; background: currentColor; visibility: hidden;
  -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat;
}
.check input:checked { border-color: var(--coral-btn); }
.check input:checked::before { visibility: visible; }
.check input:disabled { cursor: default; opacity: .6; }

/* ---------- The camera: a dark viewfinder, one shutter ---------- */
.app:has(.camera-screen) { width: min(100%, var(--app-width)); padding: 0 0 env(safe-area-inset-bottom); }
/* Its own dark ground, the night sky's: its white text must not depend on `body:has(...)` having turned the page behind it dark. */
.camera-screen { display: flex; flex: 1; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: #14181f; color: #ffffff; }
.viewfinder {
  position: relative; flex: 1; min-height: 260px; overflow: hidden; background: #1b2029; border-radius: 0 0 34px 34px;
}
.camera { position: absolute; inset: 0; background: #1b2029; }
.camera > video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.vf-top {
  position: absolute; z-index: 2; left: 20px; right: 20px; top: calc(env(safe-area-inset-top) + 16px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.vf-top.plain { position: relative; left: auto; right: auto; top: auto; margin: calc(env(safe-area-inset-top) + 16px) 20px 0; }
.vf-bottom { position: absolute; z-index: 2; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 17px;
  background: rgba(20, 24, 31, .62); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font: 400 13px/1.2 var(--font-ui); color: #ffffff;
}
.pill[data-icon]::before { width: 14px; height: 14px; }
.icon-button.dark { background: rgba(20, 24, 31, .62); color: #ffffff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.vf-message { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 36px; text-align: center; }
.vf-message:empty { display: none; }
.vf-message p, .app-panel p { max-width: 28ch; font-size: 15px; line-height: 1.5; color: #c9ced8; }
.vf-title { font: 400 clamp(30px, 8.6vw, 36px)/1.08 var(--font-display); color: #ffffff; }
.capture-controls { display: flex; align-items: center; justify-content: space-around; padding: 22px 30px 8px; }
.controls-spacer { display: block; width: 44px; height: 44px; }
.shutter {
  display: flex; align-items: center; justify-content: center; flex: none; width: 84px; height: 84px; min-height: 84px; padding: 0;
  border: 4px solid #ffffff; border-radius: 50%; background: transparent;
}
.shutter::before { content: ""; width: 66px; height: 66px; border-radius: 50%; background: var(--coral); transition: transform .12s ease; }
.shutter:active:enabled::before { transform: scale(.92); }
.shutter.waiting { opacity: .35; }
.camera-note { padding: 0 24px 22px; text-align: center; font-size: 12px; line-height: 1.4; color: #c9ced8; }
.camera-screen-plain { align-items: stretch; }
.app-panel { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 36px; text-align: center; }
.app-panel .primary { margin-top: 10px; min-width: 220px; }

/* ---------- Titles and cards: Settings, moderation, the warning and the deletion screens ---------- */
.screen > .title { margin-top: 12px; }
.screen > .title + .card, .screen > .title + .frame { margin-top: 2px; }
.screen > .frame { margin-top: 2px; margin-bottom: 4px; }
.screen .list > li > .card > .actions { margin-top: 12px; }
.screen > .actions { margin-top: 4px; }

/* ---------- Forced colours: glyphs and cards keep their edges ---------- */
@media (forced-colors: active) {
  [data-icon]::before { background: CanvasText; forced-color-adjust: none; }
  .card, .push-update { border: 1px solid CanvasText; }
  button.primary { border: 2px solid ButtonText; }
}

/* ---------- Reduced motion: no movement, only fades ---------- */
@media (prefers-reduced-motion: reduce) {
  .sky-layer { transition-duration: .2s; }
  button, a.button { transition: none; }
  button:active:enabled, a.button:active { transform: none; }
  .ripple, .halo, .bottle, .glow, .pull, .stage-return, .badge .dot, .track span, .sky-lilac::after { animation: none; }
  /* Still: three rings, a calm glow, the label where it rests. */
  .ripple { transform: scale(1.2); opacity: .8; }
  .ripple.r2 { transform: scale(1.8); opacity: .55; }
  .ripple.r3 { transform: scale(2.4); opacity: .3; }
  .glow { opacity: .9; }
  .pull { transform: translateX(-50%); }
  .track span { width: 50%; }
  .sky-lilac::after { transform: rotate(-62deg); }
  /* The throw and the pop become fades. The cork's own rule is `.washed > .cork`, which a plain `.cork` here cannot beat (it would keep its pop's transition and vanish at once). */
  .bottle, .cork, .washed > .cork, .rays, .core, .castcore, .pull { transition: opacity .25s ease; }
  .stage.thrown .bottle { transform: none; opacity: 0; }
  .stage.thrown .core { background: radial-gradient(circle at 50% 40%, #ffffff 0%, #fff4ec 55%, #fbe1d2 100%); }
  .stage-return.thrown .castcore { transform: none; opacity: 0; }
  .stage-uncork.open .cork { transform: none; opacity: 0; }
  .stage-uncork.open .rays { transform: none; }
  .rays { transform: none; }
  .shutter::before { transition: none; }
}
