:root {
  --bg: #090a0f;
  --surface: #12141d;
  --surface-elevated: #191c28;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --fg: #f8fafc;
  --muted: #94a3b8;
  --primary: #be123c;
  --primary-hover: #9f1239;
  --primary-fg: #ffffff;
  --success: #34d399;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top center, rgba(190, 18, 60, 0.14), transparent 48%), var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.container { max-width: 1152px; width: 100%; margin: 0 auto; padding: 0 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f43f5e, #d946ef);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title-group { display: flex; align-items: center; gap: 8px; }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: #fda4af;
  border: 1px solid var(--border);
}

.nav-pills {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
}

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

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  border: none;
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 6px 18px rgba(190, 18, 60, 0.35);
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

.main-content { padding: 20px 16px 80px; }

.feed-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto 18px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--primary);
  color: #fff;
}

.feed-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 400px;
  margin: 0 auto;
}

.story-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, rgba(190, 18, 60, 0.25), transparent 60%), #07080c;
  border: 1px solid var(--border);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.story-card.sponsored-card {
  border-color: rgba(251, 191, 36, 0.45);
}

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

.story-open-btn {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  border: none;
  cursor: pointer;
}

.scrim-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  padding: 14px 14px 36px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.scrim-bottom {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 52px 14px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.62) 60%, transparent);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.author-block { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar-orb {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.grad-0 { background: linear-gradient(135deg, #f43f5e, #f59e0b); }
.grad-1 { background: linear-gradient(135deg, #06b6d4, #4f46e5); }
.grad-2 { background: linear-gradient(135deg, #d946ef, #7c3aed); }

.author-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.live-badge-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
  display: inline-block;
}
.pulse-dot.red { background: #f43f5e; }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11px;
}

.card-caption, .lb-caption {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

.card-actions-row { display: flex; gap: 8px; }
.lb-main-cta { width: 100%; }

.glass-util-btn {
  flex: 1;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.promo-backdrop { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.promo-orb { position: absolute; width: 200px; height: 200px; border-radius: 999px; filter: blur(42px); opacity: 0.45; }
.promo-orb.orb-a { top: 18%; left: -40px; background: #be123c; }
.promo-orb.orb-b { bottom: 22%; right: -40px; background: #d946ef; }

.promo-center {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  pointer-events: none;
}

.promo-center h3 { margin: 0; font-size: 20px; color: #fff; }
.promo-center p { margin: 0; font-size: 13px; color: rgba(248, 250, 252, 0.8); }

.doc-card {
  max-width: 780px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 26px;
}

.doc-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 18px; }
.doc-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #fda4af; }
.doc-header h1 { margin: 6px 0; font-size: 24px; }
.doc-lead { margin: 0; font-size: 13px; color: var(--muted); }
.doc-body { display: flex; flex-direction: column; gap: 16px; }
.doc-body h2 { margin: 0 0 6px; font-size: 15px; }
.doc-body p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.consent-backdrop { z-index: 80; background: rgba(5, 6, 10, 0.94); }

.studio-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.studio-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.studio-header h2 { margin: 0; font-size: 16px; }
.studio-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.studio-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.consent-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.consent-list strong { color: var(--fg); }
.consent-note { margin: 0; font-size: 12px; color: var(--muted); }
.consent-actions { display: flex; justify-content: flex-end; gap: 10px; }
.inline-link { color: #fda4af; font-weight: 600; }
.inline-link-btn { background: none; border: none; padding: 0; color: #fda4af; text-decoration: underline; cursor: pointer; font: inherit; }

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav {
  width: 44px;
  height: 44px;
  margin: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-frame {
  position: relative;
  width: min(520px, calc(100vw - 120px), calc(94dvh * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: 94dvh;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lb-media, .lb-embed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  display: block;
}

@media (max-width: 640px) {
  .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 15; margin: 0; }
  .lb-nav-prev { left: 8px; }
  .lb-nav-next { right: 8px; }
  .lb-frame { width: 100%; max-width: 100%; max-height: calc(100dvh - 48px); }
}
