:root {
  --bg-base: #07090E;
  --bg-surface: #0E131F;
  --bg-card: #131A29;
  --bg-card-hover: #182235;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  --primary: #6366F1;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-rose: #F43F5E;
  --accent-amber: #F59E0B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --shadow-card: 0 12px 35px -10px rgba(0, 0, 0, 0.65);
  --radius-card: 20px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 90px;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(99, 102, 241, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Header */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: 640px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #4338CA, #6366F1, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #FFF;
  font-size: 19px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #FFF;
}

.brand-subtitle {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 700;
}

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

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34D399;
  font-size: 11.5px;
  font-weight: 600;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #FFF;
  border-color: var(--primary);
}

/* Search Box */
.search-container {
  width: 100%;
  max-width: 640px;
  padding: 0 16px 10px;
}

.search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  color: #FFF;
  outline: none;
  transition: border-color 0.2s;
}
#searchInput:focus {
  border-color: var(--primary);
}
#searchInput::placeholder {
  color: var(--text-muted);
}

/* Filter Bar */
.filter-bar {
  width: 100%;
  max-width: 640px;
  padding: 0 16px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-pill:hover, .filter-pill.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: var(--primary);
  color: #FFF;
}

/* Feed Container */
.feed-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 20px 14px;
}

/* Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Post Header */
.post-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.creator-info {
  display: flex;
  align-items: center;
  gap: 11px;
}

.creator-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EC4899, #8B5CF6, #3B82F6);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #FFF;
}

.creator-names {
  display: flex;
  flex-direction: column;
}

.creator-handle-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.creator-handle {
  font-weight: 700;
  font-size: 13.5px;
  color: #FFF;
}

.post-time {
  font-size: 12px;
  color: var(--text-muted);
}

.pub-source-badge {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.category-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.28);
}

/* Poster Canvas (Instagram 4:5 Ratio) */
.poster-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.8;
  background: #0B0E17;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.post-card:hover .poster-img {
  transform: scale(1.02);
}

/* High-contrast Infographic Canvas */
.infographic-banner {
  width: 100%;
  height: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: linear-gradient(165deg, #111827 0%, #0F172A 50%, #080C14 100%);
}

.banner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
}

.audience-pill {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.style-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.banner-center {
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: auto 0;
}

.metric-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 8px 14px;
  border-radius: 12px;
  max-width: fit-content;
}

.metric-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #FFF;
  line-height: 1;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #A5B4FC;
}

.canvas-headline {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.canvas-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  border-left: 2px solid var(--accent-cyan);
  padding-left: 10px;
}

.banner-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.mood-text {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Action Bar */
.action-bar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.action-group-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
}
.action-btn.liked {
  color: var(--accent-rose);
}
.action-btn.liked svg {
  fill: var(--accent-rose);
  stroke: var(--accent-rose);
}

.tag-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #E2E8F0;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tag-action-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #FFF;
}

/* Post Content */
.post-content {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-headline {
  font-size: 16.5px;
  font-weight: 800;
  color: #FFF;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.post-hook {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 14px;
  color: #CBD5E1;
  line-height: 1.45;
}

.post-summary-snippet {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: 2px;
}

.read-more-btn {
  color: var(--primary);
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
}
.read-more-btn:hover {
  text-decoration: underline;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #FFF;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-audience-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #A5B4FC;
  font-size: 12px;
  font-weight: 700;
  max-width: fit-content;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  color: #FFF;
}

.modal-why-box {
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 16px;
  border-radius: 4px 12px 12px 4px;
  font-size: 13.5px;
  color: #E2E8F0;
  line-height: 1.5;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.modal-takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-takeaways-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #CBD5E1;
  line-height: 1.5;
}
.modal-takeaways-list li span.bullet-icon {
  color: var(--accent-emerald);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}

.modal-full-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
}

.modal-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-pub-source {
  font-size: 12px;
  color: var(--text-muted);
}

/* Paper Cut Lightbox */
.lightbox-img-wrap {
  width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
}
.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
