/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0f;
  --surface:     #111118;
  --surface2:    #18181f;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --accent:      #6c63ff;
  --accent2:     #ff6b9d;
  --accent3:     #00d4aa;
  --text:        #f0eeff;
  --text2:       #8b89a8;
  --text3:       #4a4860;
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --font-ui:     'Syne', sans-serif;
  --font-body:   'Instrument Sans', sans-serif;
  --glow:        0 0 40px rgba(108,99,255,0.15);
  --glow-sm:     0 0 16px rgba(108,99,255,0.2);
}

html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Screens ─────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; }

/* ── ONBOARDING ──────────────────────────────────────────────── */
#onboarding {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-direction: column;
}

.ob-noise {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.ob-glow {
  position: absolute;
  top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(108,99,255,0.18) 0%, rgba(255,107,157,0.06) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.ob-inner {
  position: relative; z-index: 1;
  max-width: 560px; width: 100%;
  padding: 40px 24px;
  text-align: center;
}

.ob-wordmark {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 32px;
}
.ob-dot { color: var(--accent); }

.ob-headline {
  font-family: var(--font-ui);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}
.ob-headline em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ob-desc {
  color: var(--text2);
  font-size: 1rem;
  margin-bottom: 40px;
  font-weight: 400;
}

/* Topic chips */
.ob-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

.ob-chip {
  padding: 9px 18px;
  border: 1px solid var(--border2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.ob-chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.ob-chip.liked {
  background: linear-gradient(135deg, rgba(108,99,255,0.25), rgba(255,107,157,0.1));
  border-color: var(--accent);
  color: var(--text);
  box-shadow: var(--glow-sm);
}
.ob-chip.disliked { opacity: 0.3; border-color: transparent; }

/* UID + enter */
.ob-footer { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.ob-uid-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 10px 20px;
  width: 100%; max-width: 320px;
}
.ob-uid-label { color: var(--accent); font-family: var(--font-ui); font-weight: 700; font-size: 1rem; }
.ob-uid-wrap input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-ui); font-size: 0.9rem;
  font-weight: 600; flex: 1;
}
.ob-uid-wrap input::placeholder { color: var(--text3); }

.ob-enter {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent), #8b83ff);
  color: white; border: none; border-radius: 100px;
  font-family: var(--font-ui); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: 0 8px 32px rgba(108,99,255,0.35);
}
.ob-enter:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(108,99,255,0.5); }
.ob-enter:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── APP LAYOUT ──────────────────────────────────────────────── */
#app {
  width: 100%; min-height: 100vh;
  flex-direction: row;
}

/* ── SIDENAV ─────────────────────────────────────────────────── */
.sidenav {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky; top: 0; height: 100vh;
  background: var(--bg);
  flex-shrink: 0;
}

.nav-logo {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 0 12px;
  margin-bottom: 24px;
  color: var(--text);
}
.nav-logo span { color: var(--accent); }

.nav-links { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: none; background: transparent;
  color: var(--text2);
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  text-align: left; width: 100%;
}
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: rgba(108,99,255,0.15); color: var(--accent); }

.nav-user {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  word-break: break-all;
}
.nav-user::before { content: '@'; color: var(--accent); margin-right: 2px; }

/* ── FEED AREA ───────────────────────────────────────────────── */
.feed-area {
  flex: 1;
  max-width: 620px;
  padding: 0 0 80px;
  border-right: 1px solid var(--border);
  min-height: 100vh;
}

.feed-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.feed-title {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--accent); color: white; border-color: var(--accent); box-shadow: var(--glow-sm); }

/* Feed loader */
.feed-loader {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 80px 0;
  color: var(--text3);
  font-size: 0.875rem;
}
.feed-loader.hidden { display: none; }
.loader-dots { display: flex; gap: 6px; }
.loader-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: bounce 1s ease infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Feed list */
.feed-list { display: flex; flex-direction: column; }

/* ── POST CARD ───────────────────────────────────────────────── */
.post-card {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  animation: postIn 0.35s ease both;
  position: relative;
}
.post-card:hover { background: rgba(255,255,255,0.02); }
@keyframes postIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-header {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: 0.8rem; font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.avatar::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent2), var(--accent3), var(--accent));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s;
}
.post-card:hover .avatar::after { opacity: 1; }

.post-meta { flex: 1; min-width: 0; }
.post-author {
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700;
  color: var(--text); display: flex; align-items: center; gap: 6px;
}
.post-handle { color: var(--text3); font-weight: 400; font-size: 0.8rem; }
.post-time { color: var(--text3); font-size: 0.75rem; }

/* Score badge */
.score-badge {
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  font-family: var(--font-ui); font-size: 0.65rem; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

/* Post content */
.post-body {
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 14px;
  cursor: pointer;
}

/* Topic tag */
.post-topic {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-family: var(--font-ui); font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

/* Actions row */
.post-actions {
  display: flex; gap: 0; margin: 0 -6px;
}
.act-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none; background: transparent;
  color: var(--text3);
  font-family: var(--font-body); font-size: 0.8rem;
  cursor: pointer; transition: all 0.15s;
  flex: 1; justify-content: center;
}
.act-btn svg { width: 16px; height: 16px; }
.act-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.act-btn.lit-like  { color: #ff6b9d; }
.act-btn.lit-share { color: var(--accent3); }
.act-btn.lit-skip  { color: var(--text3); opacity: 0.4; }

/* Score bar under card */
.post-score-bar {
  height: 2px;
  background: var(--surface2);
  margin: 10px 0 0;
  border-radius: 100px;
  overflow: hidden;
}
.post-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 100px;
  transition: width 0.7s ease;
}

/* ── RIGHT PANEL ─────────────────────────────────────────────── */
.right-panel {
  width: 300px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.rp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.rp-title {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}

.rp-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-tag {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-family: var(--font-ui); font-weight: 600;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  color: var(--accent);
}
.rp-tag.disliked {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--text3);
  text-decoration: line-through;
}

.rp-trending { display: flex; flex-direction: column; gap: 8px; }
.trending-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; padding: 4px 0;
}
.trending-rank { font-family: var(--font-ui); font-weight: 700; color: var(--text3); width: 16px; }
.trending-topic { flex: 1; color: var(--text); font-weight: 500; }
.trending-count { font-family: var(--font-ui); font-size: 0.7rem; color: var(--text3); }

.rp-log {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
}
.log-entry {
  font-size: 0.72rem; font-family: var(--font-ui);
  color: var(--text3); padding: 3px 0;
  border-bottom: 1px solid var(--border);
  animation: logIn 0.25s ease;
  display: flex; align-items: center; gap: 6px;
}
.log-entry .le-type { color: var(--accent); font-weight: 700; }
.log-entry.type-like  .le-type { color: #ff6b9d; }
.log-entry.type-share .le-type { color: var(--accent3); }
.log-entry.type-skip  .le-type { color: var(--text3); }
@keyframes logIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1100px) { .right-panel { display: none; } }
@media (max-width: 720px) {
  .sidenav { width: 64px; padding: 16px 8px; }
  .nav-logo { font-size: 1rem; padding: 0 8px; }
  .nav-btn span, .nav-user { display: none; }
  .nav-btn { justify-content: center; padding: 12px; }
  .feed-area { max-width: 100%; }
}
