/* Bloom / iroyin.app — design tokens mirror lib/core/theme/* in the Flutter
   app verbatim (AppColors, AppTypography, AppRadius, AppSpacing) so this
   site reads as the same product, not a re-skin. */

@font-face {
  font-family: 'CSGinva';
  src: url('../fonts/CSGinva/CSGinva-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'AlteHaasGrotesk';
  src: url('../fonts/AlteHaasGrotesk/AlteHaasGrotesk-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'AlteHaasGrotesk';
  src: url('../fonts/AlteHaasGrotesk/AlteHaasGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('../fonts/Barlow/Barlow-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('../fonts/Barlow/Barlow-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('../fonts/Barlow/Barlow-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('../fonts/Barlow/Barlow-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Liberation';
  src: url('../fonts/Liberation/LiberationSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Liberation';
  src: url('../fonts/Liberation/LiberationSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* AppColors — dark theme (this site is dark-only, matching the app's
     default surface for marketing/share contexts) */
  --bg: #0A0A0A;
  --surface: #161616;
  --text: #F5F5F5;
  --text-muted: #B0B0B0;
  --border: #3A3A3A;
  --primary: #F2F2F2;      /* AppColors.primaryLight — dark theme's button/accent */
  --primary-ink: #111111;  /* text drawn on top of --primary */
  --verified-gold: #D4A84B;
  --verified-org: #8B5CF6;

  /* AppTypography */
  --font-heading: 'AlteHaasGrotesk', sans-serif;
  --font-title: 'Barlow', sans-serif;
  --font-body: 'Liberation', sans-serif;
  /* Marketing-only display font (not part of the app's own theme) — used
     for the "Every format. One platform." tagline, matching the app-store
     screenshot artwork's headline typeface. */
  --font-tagline: 'CSGinva', serif;

  /* AppRadius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-xxl: 24px;
  --radius-full: 999px;

  /* AppSpacing (8px grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-xxxl: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0;
}

h4, h5, .title {
  font-family: var(--font-title);
  font-weight: 600;
  margin: 0;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

/* ─── Background: particles + gradient + bottom-left brand bleed ───────── */

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(to bottom, var(--bg), var(--surface));
}

#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* Mirrors onboarding_screen.dart's Positioned(left:-50, bottom:-15,
   Opacity(0.20, Image.asset(width:350))) — the same brand-mark bleed the
   app shows on first launch, anchored here to the viewport. */
.brand-bleed {
  position: fixed;
  left: -50px;
  bottom: -15px;
  width: 350px;
  opacity: 0.20;
  z-index: -1;
  pointer-events: none;
}
@media (min-width: 900px) {
  .brand-bleed { width: 520px; left: -70px; bottom: -30px; }
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Text wordmark — lowercase "bloom" + a gold full stop, matching the app's
   own marketing screenshots exactly (not an image, so it stays crisp and
   themeable). */
.wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.5px;
  color: var(--text);
}
.wordmark-dot { color: var(--verified-gold); }
.wordmark-sm { font-size: 22px; }
/* Sits inline inside a sentence (footer copyright) — same bold/lowercase/
   gold-dot treatment, but takes its size from the surrounding text instead
   of a fixed px value. */
.wordmark-inline { font-size: inherit; letter-spacing: normal; }

.hero-mark { height: 64px; width: auto; margin: 0 auto; }
@media (max-width: 480px) { .hero-mark { height: 48px; } }

.header-download-link {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}
.header-download-link:hover { background: rgba(255, 255, 255, 0.09); }

/* ─── Main / hero ────────────────────────────────────────────────────────── */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.15;
}
@media (max-width: 480px) {
  .hero h1 { font-size: 34px; }
}
.hero h1.hero-icon-heading { line-height: 0; }

.hero p.tagline {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  margin: var(--space-lg) auto 0;
  max-width: 480px;
}

/* CSGinva is exclusively for the marketing tagline on the home page — not
   the generic .tagline class shared with e.g. error.php's 404 message. */
.hero p.tagline.hero-tagline {
  font-family: var(--font-tagline);
  font-size: 22px;
  font-weight: 400;
}

/* ─── Glassmorphic panel — same recipe as _ReelBadge in the app:
   translucent black fill, subtle white border, backdrop blur ─────────────── */

.glass-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ─── Download buttons — styled after chromesque.com/download.php ──────── */

.download-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-xxl);
}

.store-btn { display: inline-flex; text-decoration: none; transition: transform 0.15s ease; }
.store-btn:hover { transform: translateY(-2px); }
.store-btn svg { width: 150px; height: 44px; }
@media (max-width: 400px) {
  .store-btn svg { width: 130px; height: 39px; }
}

/* OS detection toggles which buttons show — default (unknown OS / desktop)
   shows both; a detected OS shows only its own store button. Mirrors
   chromesque.com/download.php's os_Android / os_iOS class-on-<html> trick. */
html.os-ios .store-btn.android,
html.os-android .store-btn.ios { display: none; }

/* ─── Screenshot slider ──────────────────────────────────────────────────────
   Custom-built (no external package): several slides visible at once,
   snugly-fitted with no letterboxing — the slide's aspect-ratio is set from
   PHP to the ACTUAL active set's real dimensions (iOS shots are ~9:19.5,
   Android's are 9:16 — different, so a fixed guess always left an empty gap
   or a crop on one of them; matching the true ratio means object-fit:cover
   never needs to cut anything). Native horizontal scroll + snap does the
   "peek at the next, partially off-screen" effect for free; a small custom
   drag layer only kicks in for desktop mouse (touch already scrolls
   natively). */

.carousel-section { margin-top: var(--space-xxxl); }

.slider { position: relative; max-width: 1100px; margin: 0 auto; }

.slider-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--space-xl) var(--space-lg);
  cursor: grab;
  scrollbar-width: none;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-track.dragging { cursor: grabbing; scroll-snap-type: none; }

.slider-slide {
  flex: 0 0 auto;
  width: 148px;
  aspect-ratio: var(--shot-ratio, 0.4622);
  border-radius: var(--radius-md);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface);
}
.slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}
.slider-slide.placeholder { display: flex; align-items: center; justify-content: center; }
.slider-slide.placeholder img { opacity: 0.18; width: 40%; height: auto; object-fit: contain; }

@media (min-width: 560px)  { .slider-slide { width: 180px; } }
@media (min-width: 860px)  { .slider-slide { width: 210px; } }
@media (min-width: 1180px) { .slider-slide { width: 240px; } }

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.slider-arrow:hover { background: rgba(0, 0, 0, 0.7); }
.slider-arrow-prev { left: 2px; }
.slider-arrow-next { right: 2px; }
.slider-arrow[disabled] { opacity: 0; pointer-events: none; }
.slider-arrow svg { width: 18px; height: 18px; }
@media (min-width: 1180px) {
  .slider-arrow-prev { left: -20px; }
  .slider-arrow-next { right: -20px; }
}

.slider-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-sm);
}
.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}
.slider-dot.active { width: 18px; background: var(--text); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: var(--space-xxl);
  border-top: 1px solid var(--border);
  padding: var(--space-xxl) var(--space-xl);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
}
.footer-links a {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); }

.footer-copyright {
  max-width: 1100px;
  margin: var(--space-xl) auto 0;
  padding: var(--space-md) var(--space-lg);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}
.footer-copyright a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
}

/* ─── Post / collection share page ──────────────────────────────────────── */

.share-page {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-xxxl);
}

.share-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.share-media img,
.share-media video { width: 100%; height: 100%; object-fit: cover; }

.share-media .play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.share-media .play-badge svg {
  width: 64px; height: 64px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.45));
}

.share-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--space-lg);
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
}

.share-tutor {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-bottom: var(--space-sm);
}
.share-tutor img {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.share-tutor span {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.share-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 var(--space-xs);
}
.share-description {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin: 0 0 var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.share-stats {
  display: flex;
  gap: var(--space-sm);
}
.share-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.share-stat svg { width: 16px; height: 16px; }

/* Gist share card — mirrors GistContentCard and the gist feed card in the app:
   a rounded card on the app's dark surface, the text in Barlow SemiBold,
   centred vertically and left-aligned, shrinking as there is more to say; the
   app mark as a faint, oversized stamp bleeding off the bottom-left corner
   (behind the text); and, under it, the quiet row of counts. There is no 9:16
   media frame, since there's no image/video to fill it. */
.share-media.is-gist {
  aspect-ratio: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  /* The whole gist is one link: keep it from reading as underlined text. */
  text-decoration: none;
  color: var(--text);
}
/* Stated with !important too: a link's underline must never show on a gist,
   whatever else is styled around it (hover, focus, visited). */
.share-media.is-gist,
.share-media.is-gist:hover,
.share-media.is-gist:focus,
.share-media.is-gist:visited,
.share-media.is-gist * { text-decoration: none !important; }

/* Author: avatar, name, badge — no pill, like the feed card's header. */
.share-tutor.gist-tutor {
  gap: var(--space-sm);
  padding: 0;
  background: none;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin-bottom: var(--space-md);
}
.gist-tutor img { width: 32px; height: 32px; }
.gist-tutor span { font-size: 16px; font-weight: 600; color: var(--text); }
.share-tutor.gist-tutor .tier-badge { margin-left: -2px; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0.5px solid currentColor;
  position: relative;
}
.tier-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.15;
}
.tier-badge svg { position: relative; }
.ri { display: block; flex: none; fill: currentColor; }

/* Header row: the author on the left, the gist's QR on the right. */
.gist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.gist-head .share-tutor.gist-tutor { margin-bottom: 0; min-width: 0; }
.gist-head .gist-tutor > span:not(.tier-badge) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gist-qr-card {
  flex: none;
  display: block;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  line-height: 0;
}
/* Beats `.share-media img { width/height: 100% }`. */
.share-media .gist-qr {
  width: 40px;
  height: 40px;
  display: block;
  image-rendering: pixelated;
}
.tier-badge.tier-gold,
.share-tutor .tier-badge.tier-gold { color: var(--verified-gold); }
.tier-badge.tier-org,
.share-tutor .tier-badge.tier-org  { color: var(--verified-org); }

.gist-card {
  position: relative;
  overflow: hidden;            /* the stamp is cut off by the rounded corner */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.gist-thumb {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: var(--space-md);
  aspect-ratio: 16 / 10;
}
.gist-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gist-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-align: left;
  margin: 0;
  white-space: pre-wrap;       /* keeps the author's line breaks, once */
  overflow-wrap: anywhere;
}
.gist-text--xl { font-size: 28px; }
.gist-text--lg { font-size: 24px; }
.gist-text--md { font-size: 20px; }
.gist-text--sm { font-size: 17px; }
/* Beats `.share-media img { width/height: 100% }`, which would otherwise
   blow the stamp up to the size of the whole card. */
.share-media .gist-logo {
  position: absolute;
  left: -8px;
  bottom: -8px;
  width: 175px;
  height: 175px;
  object-fit: contain;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}

/* The counts under the card: muted, no pills — like the app. */
/* The counts under the card: the app's social badges (TmSocialBadge) — a pill
   in a faint white wash, a 14px muted icon and a bold small count. */
.gist-stats { margin-top: var(--space-md); gap: var(--space-sm); flex-wrap: wrap; }
.gist-stats .share-stat {
  min-width: 38px;
  height: 30px;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.gist-stats .share-stat .ri { width: 14px; height: 14px; fill: currentColor; }

.reply-context {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-md);
  border-left: 2px solid var(--border);
}
.reply-context .gist-card { margin-bottom: var(--space-md); }
.reply-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.reply-author img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}
.reply-date {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.share-cta { margin-top: var(--space-xl); text-align: center; }
.share-cta p { color: var(--text-muted); font-size: 14px; margin-bottom: var(--space-md); }

/* ─── Bottom sheet (fallback: unknown OS / desktop) ─────────────────────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 21;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border);
  padding: var(--space-lg) var(--space-xl) var(--space-xxl);
  transform: translateY(100%);
  transition: transform 0.25s ease;
  max-width: 480px;
  margin: 0 auto;
}
.sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.sheet h3 { font-size: 18px; margin-bottom: var(--space-sm); }
.sheet p { color: var(--text-muted); font-size: 14px; margin-bottom: var(--space-lg); }

.sheet-qr {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
}
.sheet-qr img { width: 96px; height: 96px; border-radius: var(--radius-sm); background: #fff; padding: 6px; }
.sheet-qr span { font-size: 13px; color: var(--text-muted); }

.sheet-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-xl);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* ─── Profile page (iroyin.app/{username}) ─────────────────────────────
   A person's public profile: identity card, the headline numbers the app
   shows anyone, then the open-in-app call to action. Same dark surface,
   radii and badge colours as the share pages. */
.profile-page {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-xxxl);
}
.profile-page .ri { fill: currentColor; flex: none; }

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xxl);
}

.profile-avatar {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: #262626;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar.tier-subscribed   { border-color: var(--verified-gold); }
.profile-avatar.tier-organization { border-color: var(--verified-org); }
.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-initial {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 42px;
  color: var(--text-muted);
}

.profile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-lg) 0 var(--space-sm);
  max-width: 100%;
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.profile-name .tier-badge { flex: none; position: relative; top: 2px; } /* sits on the name's baseline */

/* The handle chip: link icon + username, like the app's profile chip. */
.profile-handle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.profile-handle:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.profile-handle.copied { color: var(--verified-gold); border-color: var(--verified-gold); }

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
}
.profile-meta li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.profile-bio {
  margin: var(--space-md) 0 0;
  max-width: 36ch;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Impact | Followers | Following — the app's ProfileStatsStrip. */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-lg) var(--space-sm);
  min-width: 0;
}
.profile-stat + .profile-stat { border-left: 1px solid var(--border); }
.profile-stat strong {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.profile-stat span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-month { margin-top: var(--space-lg); text-align: center; }
.profile-month h2 {
  margin: 0 0 var(--space-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.profile-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }
.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-private {
  margin-top: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}
.profile-private-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-sm);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.profile-private h2 { margin: 0 0 var(--space-xs); font-size: 17px; }
.profile-private p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }

.profile-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--primary-ink);
  font: 700 16px/1 var(--font-body);
  text-decoration: none;
}
.profile-open:hover { opacity: .92; }

@media (max-width: 360px) {
  .profile-name { font-size: 22px; }
  .profile-stat strong { font-size: 20px; }
}
@media (min-width: 720px) {
  .profile-page { max-width: 540px; padding-top: var(--space-xxl); }
  .profile-avatar { width: 124px; height: 124px; }
}

/* A shared story (public accounts): the 9:16 frame it was made in — the
   picture whole over a blurred copy of itself, a video's cover with its text,
   emoji and drawing laid over the whole frame. */
.story-wrap { max-width: 340px; margin: var(--space-xl) auto 0; }
.story-stage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: #0c0c0e;
  border: 1px solid var(--border);
  text-decoration: none;
  color: #fff;
}
.story-stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.story-stage .story-bg { object-fit: cover; filter: blur(28px) brightness(0.6); transform: scale(1.25); }
.story-stage .story-photo { object-fit: contain; }
.story-stage .story-overlay { object-fit: fill; pointer-events: none; }
.story-stage .story-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.story-stage .story-play svg { width: 64px; height: 64px; filter: drop-shadow(0 2px 12px rgba(0,0,0,0.45)); }
.story-caption {
  margin: var(--space-md) 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}
