/* The share page in the app's design language (docs/design/IOS-CLIENT-DESIGN.md §1.2): a near-black canvas,
   graphite layers, one neon action colour and an aurora that belongs to interactive works only. A shared post is the
   app's For you stage, which is always dark, so the page is too. */

:root {
  color-scheme: dark;
  --bg: #07070b;
  --stage: #050508;
  --surface: #111118;
  --raised: #1a1a23;
  --hairline: rgba(255, 255, 255, 0.09);
  --ink: #f4f4f8;
  --ink-2: #a2a2b3;
  --ink-3: #6c6c7c;
  --action: #c8ff3d;
  --on-action: #0a0a0f;
  --violet: #8b5cff;
  --cyan: #2fd4ff;
  --waiting: #ffb347;
  --danger: #ff6b7a;
  --aurora: linear-gradient(135deg, var(--violet), var(--cyan));
  --glass: rgba(10, 10, 15, 0.52);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --column: 460px;
}

@property --turn {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

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

.defs { position: absolute; width: 0; height: 0; }

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

/* ---- Glyphs ------------------------------------------------------------------------------------- */

.glyph { width: 20px; height: 20px; flex: none; fill: currentColor; }
.glyph-stroke { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Decorative aurora behind the page (wide screens only) -------------------------------------- */

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(110px); opacity: 0; }
.glow-violet { left: calc(50% - 640px); top: -120px; background: var(--violet); }
.glow-cyan { right: calc(50% - 640px); bottom: -160px; background: var(--cyan); }

@media (min-width: 760px) {
  .glow { opacity: 0.22; }
}

/* ---- Top bar and wordmark ----------------------------------------------------------------------- */

.topbar {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  min-height: 56px;
  padding: env(safe-area-inset-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Lower-case rounded black "sovvi"; the i has no dot of its own and the neon spark takes its place (D61). */
.wordmark {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font: 900 26px/1 var(--rounded);
  letter-spacing: -0.5px;
  color: var(--ink);
  padding: 6px 0;
}
.wordmark-i { position: relative; }
.wordmark-i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.1em;
  width: 0.25em;
  height: 0.25em;
  margin-left: -0.17em;
  border-radius: 50%;
  background: var(--action);
  box-shadow: 0 0 0.16em var(--action), 0 0 0.4em rgba(200, 255, 61, 0.55);
}
.wordmark.small { font-size: 17px; color: var(--ink-2); padding: 0; }

/* ---- Pills and buttons -------------------------------------------------------------------------- */

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s ease;
}
.glass-pill .glyph { width: 18px; height: 18px; }
.glass-pill.compact { min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.glass-pill:active, .secondary-pill:active, .rail-button:active, .join:active { transform: scale(0.96); }

.secondary-pill, .destructive-pill, .primary-pill {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s ease;
}
.destructive-pill { color: var(--danger); }
.primary-pill {
  min-height: 54px;
  border: 0;
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 0 24px rgba(200, 255, 61, 0.28);
}

.text-button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--action);
  font-weight: 700;
  font-size: 15px;
}

/* ---- Page column and stage ---------------------------------------------------------------------- */

.page {
  flex: 1;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 8px;
}

/* The app's stage: 26 px continuous corners, a hairline, the height between the top bar and the line below. */
.stage {
  position: relative;
  isolation: isolate;
  height: calc(100dvh - 56px - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 540px;
  max-height: 900px;
  border-radius: 26px;
  overflow: hidden;
  background: var(--stage);
  border: 1px solid var(--hairline);
}

/* The text post's stage: deep indigo to near black under a soft aurora (§3.4). */
.stage.is-text {
  background:
    radial-gradient(120% 70% at 70% 0%, rgba(139, 92, 255, 0.42), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(47, 212, 255, 0.12), transparent 70%),
    linear-gradient(180deg, #17123a 0%, #0b0a1c 45%, var(--stage) 100%);
}

.preview, .post-body, .runtime { position: absolute; inset: 0; }

.cover { width: 100%; height: 100%; object-fit: cover; display: block; }

.cover-placeholder, .post-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 40px 140px;
  text-align: center;
  color: var(--ink-2);
  background: radial-gradient(60% 40% at 50% 42%, rgba(139, 92, 255, 0.2), transparent 70%);
}
.cover-placeholder p, .post-message p { margin: 0; font-size: 15px; }
.post-message { padding-bottom: 32px; }
.post-message .post-note { position: static; display: block; padding: 0; }
.post-message::before { margin-bottom: 8px; }
.post-message-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
/* A restricted post's one action (D80): open it in the app, where following is. */
.post-message-actions { display: flex; justify-content: center; }
.post-message-actions:empty { display: none; }
.post-message-actions .primary-pill { display: inline-flex; align-items: center; text-decoration: none; }

/* The empty state's mark: a line ring with a spark of light below it (§1.2 "空状态"). */
.empty-mark, .post-message::before {
  content: "";
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 244, 248, 0.5);
  box-shadow: 0 0 40px rgba(139, 92, 255, 0.45);
  position: relative;
}
.empty-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--action);
  box-shadow: 0 0 10px var(--action);
}

/* The bottom vignette that keeps the overlay readable; it never catches touches. */
.stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 300px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5) 42%, rgba(0, 0, 0, 0.86));
  pointer-events: none;
  z-index: 1;
}
.stage.is-running::after, .stage.is-unavailable::after { display: none; }

/* ---- Read-only posts ---------------------------------------------------------------------------- */

.post-read { position: absolute; inset: 0; }

.stage.is-text .post-read { padding: 96px 76px 160px 24px; overflow-y: auto; }
.post-text {
  margin: 0;
  font-size: 23px;
  line-height: 1.38;
  font-weight: 800;
  color: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.quote { display: block; width: 40px; height: 40px; margin: 0 0 10px -4px; color: var(--action); }
/* A photo or video post's words show in the overlay instead (app.mjs). */
.stage:not(.is-text) .post-text { display: none; }
.post-cover { display: block; width: 100%; max-width: 280px; margin-top: 24px; border-radius: 16px; border: 1px solid var(--hairline); }

.post-note {
  margin: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px 120px;
  text-align: center;
  color: var(--ink-2);
  font-size: 15px;
}

/* A gallery pages sideways; each picture is shown whole over a blurred, dimmed fill of itself (§3.4). */
.post-gallery {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.post-gallery::-webkit-scrollbar { display: none; }
.post-gallery li { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; overflow: hidden; }
.post-gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.post-gallery img.fill { object-fit: cover; filter: blur(40px) brightness(0.45); transform: scale(1.2); z-index: -1; }

/* The video stops above the overlay, so its own controls never sit under the author and the title. */
.post-video { position: absolute; inset: 0 0 168px; width: 100%; height: calc(100% - 168px); object-fit: contain; background: #000; }

/* ---- Stage overlay: Join, author, title and the right-hand rail (§3.2) -------------------------- */

.overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 10px 18px 20px;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.overlay a, .overlay button, .overlay [role="button"] { pointer-events: auto; }

.overlay-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.byline {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-weight: 700;
  font-size: 15px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.byline:hover { text-decoration: underline; }

/* A remix's original, one line under its title (REMIX §8). */
.remix-source {
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.remix-source[href]:hover { text-decoration: underline; }
.remix-source[hidden] { display: none; }

.title, .description {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.description { font-size: 13px; color: var(--ink-2); cursor: pointer; }
.overlay-copy .glass-pill { white-space: nowrap; }
.join-note { margin: 0; max-width: 34ch; font-size: 12px; line-height: 1.4; color: var(--ink-2); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.description.is-expanded { display: block; max-height: 38vh; overflow-y: auto; white-space: pre-wrap; }
.stage.is-text .description { display: none; }

.rail { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 2px; }

.rail-avatar { display: grid; place-items: center; width: 52px; height: 52px; }
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a2a8c, #8b5cff);
  font: 700 17px/1 var(--rounded);
  color: #fff;
}
.avatar::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 1.5px;
  background: var(--aurora);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.rail-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: 700 11px/1.2 var(--rounded);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s ease;
}
.rail-button .glyph { width: 28px; height: 28px; }
.rail-button .glyph-stroke { stroke-width: 2; }

/* Join: dark glass, a slowly turning aurora ring with its glow, and the spark (§3.2 参与按钮). */
.join {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 4px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(rgba(10, 10, 15, 0.62), rgba(10, 10, 15, 0.62)) padding-box,
    conic-gradient(from var(--turn), var(--violet), var(--cyan), var(--violet)) border-box;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 22px rgba(139, 92, 255, 0.45), 0 0 34px rgba(47, 212, 255, 0.18);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  animation: turn 6s linear infinite;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.join:disabled { opacity: 0.55; animation-play-state: paused; }
.join .spark { width: 18px; height: 18px; fill: url(#aurora); color: var(--cyan); animation: spark 3s ease-in-out infinite; }

@keyframes turn { to { --turn: 360deg; } }
@keyframes spark {
  0%, 80%, 100% { transform: none; }
  88% { transform: scale(1.35) rotate(45deg); }
}

/* The shared work tag, at the stage's top left (§3.3). */
.shared-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  max-width: calc(100% - 24px);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-size: 12px;
  font-weight: 600;
}
.shared-tag .glyph { width: 15px; height: 15px; color: var(--cyan); }

/* The gallery's position, at the stage's top right in monospaced digits. */
.gallery-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  margin: 0;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.55);
  font: 600 12px/1.2 var(--mono);
  color: #fff;
}

/* Something the page is doing: a glass pill at the top of the stage, with a breathing light. */
.stage-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font: 500 12px/1.2 var(--mono);
  color: var(--ink-2);
  white-space: nowrap;
}
.stage-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--action);
  box-shadow: 0 0 8px var(--action);
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.25; } }

/* What went wrong, in the stage, with the one action that tries it again (§3.4, §11). */
.stage-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(300px, calc(100% - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px 20px 18px;
  border-radius: 22px;
  border: 1px solid var(--hairline);
  background: rgba(17, 17, 24, 0.86);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.stage-card p { margin: 0; font-size: 15px; line-height: 1.5; }

/* While a work runs it owns the stage; the frame keeps a 12 px inset at the top and the bottom (§1). */
.runtime { inset: 12px 0; }
.runtime iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--stage); }

/* ---- Below the stage ---------------------------------------------------------------------------- */

.dock { padding: 8px 12px 0; display: flex; flex-direction: column; gap: 8px; }
.dock:not(:has(> :not([hidden]):not(.visually-hidden))) { padding: 0; }

.participation-line { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.participation-line p { margin: 0; flex: 1; font: 500 13px/1.35 var(--mono); color: var(--ink-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--waiting); box-shadow: 0 0 8px var(--waiting); flex: none; }
.status-dot.is-live { background: var(--action); box-shadow: 0 0 8px var(--action); }

.notices { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.notice p { margin: 0; flex: 1; font-size: 13px; color: var(--ink-2); }
.notice button {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  font-size: 13px;
  font-weight: 700;
}

.toast {
  margin: 0;
  align-self: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  font-size: 13px;
  font-weight: 600;
}

.share-fallback { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--surface); }
.share-fallback label { font: 600 11px/1.2 var(--mono); letter-spacing: 0.8px; text-transform: uppercase; color: var(--ink-3); }
.share-fallback input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  font-family: var(--mono);
  font-size: 13px;
}
.share-fallback p { margin: 0; font-size: 12px; color: var(--ink-2); }

/* The app did not open from "Open in app" (SHARING.md §7.3): why, and where to get it when the service says. */
.app-fallback { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); }
.app-fallback p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.app-fallback .secondary-pill { display: inline-flex; align-items: center; }

/* ---- Development tools (?dev=1 only) ------------------------------------------------------------ */

.dev-panel {
  margin: 8px 4px 20px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
}
.dev-panel h2 { margin: 4px 0 12px; font-size: 16px; color: var(--ink); }
.dev-panel label { display: block; margin-bottom: 6px; font-weight: 600; }
.dev-panel select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--raised);
}
.dev-panel ol { padding-left: 20px; }
.dev-panel .facts { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.kicker { margin: 0; font: 600 11px/1.2 var(--mono); letter-spacing: 0.8px; text-transform: uppercase; color: var(--ink-3); }

/* ---- Footer ------------------------------------------------------------------------------------- */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  color: var(--ink-3);
  font-size: 12px;
}
.footer p { margin: 0; letter-spacing: 0.2px; }

/* ---- The leave question (D20) ------------------------------------------------------------------- */

.alert {
  width: min(320px, calc(100% - 48px));
  padding: 0;
  border-radius: 24px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.alert::backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.alert form { padding: 24px 20px 18px; text-align: center; }
.alert h2 { margin: 0 0 8px; font-size: 18px; }
.alert p { margin: 0 0 20px; color: var(--ink-2); font-size: 14px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- Author page -------------------------------------------------------------------------------- */

.back-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.back-button .glyph { width: 22px; height: 22px; }
.topbar-title { display: flex; align-items: center; gap: 12px; }

.profile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 8px;
  text-align: center;
}
.profile::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 280px;
  height: 200px;
  margin-left: -140px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139, 92, 255, 0.35), rgba(47, 212, 255, 0.08), transparent);
  filter: blur(20px);
  z-index: -1;
}
.profile .avatar { width: 88px; height: 88px; font-size: 36px; }
.profile .avatar::before { inset: -5px; padding: 2px; }
.profile h1 { margin: 10px 0 0; font-size: 22px; font-weight: 800; }

.stats {
  width: 100%;
  margin: 10px 0 4px;
  padding: 14px 6px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  list-style: none;
}
.stats li { display: flex; flex-direction: column; gap: 3px; }
.stats strong { font: 800 18px/1.1 var(--rounded); }
.stats span { font: 500 11px/1.2 var(--mono); color: var(--ink-3); letter-spacing: 0.4px; }

.section-title { margin: 20px 4px 10px; }

/* Two balanced columns of cards, as in Explore and the app's author page (§5). */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.grid-column { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface);
  transition: transform 0.15s ease;
}
.card:active { transform: scale(0.98); }
.card-cover { position: relative; display: block; background: var(--raised); overflow: hidden; }
.card-spacer { display: block; width: 100%; height: auto; }
.card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover.kind-interactive, .card-cover.kind-unsupported { background: linear-gradient(160deg, #3a2a8c, #0e0b22 70%); }
.card-cover.kind-gallery { background: linear-gradient(160deg, #1f6feb, #0e0b22 75%); }
.card-cover.kind-video { background: linear-gradient(160deg, #e24ed8, #0e0b22 75%); }
.card-cover.kind-text { background: linear-gradient(160deg, #17123a, #0b0a1c); }
.card-excerpt {
  position: absolute;
  inset: 0;
  padding: 34px 12px 12px;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  overflow: hidden;
}
.card-excerpt::before { content: "\201C"; display: block; height: 22px; font: 900 34px/1 var(--rounded); color: var(--action); }
.card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 11px;
  font-weight: 700;
}
.card-tag .glyph { width: 12px; height: 12px; color: var(--cyan); }
.card-title {
  margin: 0;
  padding: 9px 10px 11px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author-status { margin: 24px 0; text-align: center; color: var(--ink-2); font-size: 14px; }
.author-more { display: block; margin: 16px auto 8px; }

/* ---- Wider screens and less motion -------------------------------------------------------------- */

@media (min-width: 760px) {
  .stage { height: min(calc(100dvh - 150px), 880px); }
}

@media (prefers-reduced-motion: reduce) {
  .join, .join .spark, .stage-pill::before { animation: none; }
  .glass-pill, .secondary-pill, .rail-button, .join, .card { transition: none; }
}
