/* VRUTA — text-only social app. Original design. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #141416; --bg2: #1c1c1f; --card: #1e1e22; --card2: #26262b;
  --line: #2c2c32; --text: #f4f4f2; --muted: #a1a1aa; --muted2: #71717a;
  --accent: #7c5cff; --accent2: #4f7cff; --teal: #22d3c5;
  --grad: linear-gradient(135deg, #7c5cff, #4f7cff 55%, #22d3c5);
  --danger: #ff5c6c; --amber: #f5b83d; --green: #34d399;
  --shadow: 0 10px 30px rgba(0,0,0,.45); --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
[data-theme="light"] {
  --bg: #fafaf7; --bg2: #ffffff; --card: #ffffff; --card2: #f2f2ee;
  --line: #e6e6df; --text: #17171a; --muted: #5b5b62; --muted2: #8a8a92;
  --shadow: 0 10px 28px rgba(20,20,40,.10);
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; transition: background .35s ease, color .35s ease;
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(124,92,255,.16), transparent 60%),
                    radial-gradient(700px 420px at -10% 30%, rgba(34,211,197,.10), transparent 60%);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(124,92,255,.12), transparent 60%),
                    radial-gradient(700px 420px at -10% 30%, rgba(34,211,197,.10), transparent 60%);
}
a { color: var(--accent2); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: var(--text); }
.hidden { display: none !important; }

/* ---------- Splash / loading ---------- */
#splash { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; background: var(--bg); transition: opacity .5s ease, visibility .5s; }
#splash.done { opacity: 0; visibility: hidden; }
.splash-word { font-family: var(--serif); font-size: 44px; letter-spacing: .14em; font-weight: 700; }
.splash-word span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-bar { width: 150px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--grad); animation: loadslide 1s ease-in-out infinite; }
@keyframes loadslide { 0% { transform: translateX(-110%);} 100% { transform: translateX(400%);} }
.splash-tag { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; user-select: none; }
.logo-mark { width: 38px; height: 38px; flex: none; animation: floaty 4.5s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(124,92,255,.45)); }
.logo-mark:hover { animation: wiggle .6s ease; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0deg);} 50% { transform: translateY(-4px) rotate(-2deg);} }
@keyframes wiggle { 0% { transform: rotate(0);} 25% { transform: rotate(-6deg) scale(1.06);} 60% { transform: rotate(5deg) scale(1.06);} 100% { transform: rotate(0);} }
.logo-mark.loading { animation: spinpulse 1s ease-in-out infinite; }
@keyframes spinpulse { 0% { transform: rotate(0) scale(1);} 50% { transform: rotate(180deg) scale(1.12);} 100% { transform: rotate(360deg) scale(1);} }
.logo-word { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: .16em; }
.logo-word b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.logo-sub { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: -3px; }

/* ---------- Auth ---------- */
#authView { min-height: 100vh; display: flex; flex-direction: column; }
.auth-hero { padding: 56px 22px 10px; max-width: 560px; margin: 0 auto; width: 100%; text-align: center; }
.auth-hero .logo { justify-content: center; }
.auth-hero .logo-mark { width: 72px; height: 72px; }
.auth-hero .logo-word { font-size: 40px; }
.auth-title { font-family: var(--serif); font-size: 30px; line-height: 1.2; margin: 26px 0 10px; }
.auth-sub { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 420px; margin: 0 auto; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; margin: 28px auto 20px; width: calc(100% - 40px); max-width: 440px; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none;} }
.auth-tabs { display: flex; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 10px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); transition: .25s; }
.auth-tabs button.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(124,92,255,.4); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 15px; outline: none; transition: border .2s, box-shadow .2s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.22); }
.field .hint { font-size: 12px; color: var(--muted2); margin-top: 5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 99px; font-weight: 700; font-size: 15px; background: var(--grad); color: #fff; transition: transform .15s ease, box-shadow .2s, opacity .2s; box-shadow: 0 6px 18px rgba(124,92,255,.35); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: var(--card2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: linear-gradient(135deg, #ff5c6c, #ff8a5c); box-shadow: 0 6px 18px rgba(255,92,108,.3); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.auth-foot { text-align: center; color: var(--muted2); font-size: 12px; padding: 0 24px 30px; line-height: 1.6; }
.auth-foot button { color: var(--accent2); font-size: 12px; text-decoration: underline; }
.demo-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); background: var(--card2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; line-height: 1.55; }
.demo-note b { color: var(--text); }

/* ---------- App shell ---------- */
#appView { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 60; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; background: var(--card2); border: 1px solid var(--line); position: relative; transition: transform .15s, background .2s; }
.icon-btn:active { transform: scale(.9); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.search-wrap { display: none; flex: 1; max-width: 340px; }
.search-wrap input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 99px; border: 1px solid var(--line); background: var(--card2); font-size: 14px; outline: none; }
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.search-wrap .mag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box { position: relative; }
.layout { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 0; padding-bottom: 86px; }
.sidebar { display: none; }
.feed-col { min-width: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 80vh; }
.rail { display: none; }
.disclaimer { margin: 0; padding: 10px 16px; font-size: 12.5px; line-height: 1.55; color: var(--muted); background: color-mix(in srgb, var(--amber) 10%, transparent); border-bottom: 1px solid var(--line); }
.disclaimer b { color: var(--text); }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 61px; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
.tabs button { flex: 1; padding: 14px 6px; font-weight: 700; font-size: 14.5px; color: var(--muted); border-bottom: 3px solid transparent; transition: .2s; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { background: var(--card2); }

/* Composer */
.composer { padding: 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 17px; background: var(--grad); box-shadow: 0 4px 12px rgba(124,92,255,.35); }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.composer-body { flex: 1; min-width: 0; }
.composer textarea { width: 100%; border: none; background: transparent; resize: none; font-size: 17px; line-height: 1.5; outline: none; min-height: 64px; }
.composer textarea::placeholder { color: var(--muted2); }
.composer-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.composer-meta select, .composer-meta input { padding: 8px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card2); font-size: 13px; outline: none; max-width: 170px; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 99px; transition: .25s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 2.5px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: .25s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--grad); }
.switch input:checked + i::after { transform: translateX(18px); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.char-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.char-count.over { color: var(--danger); }
.char-ring { width: 26px; height: 26px; transform: rotate(-90deg); }
.char-ring circle { fill: none; stroke-width: 3; }
.char-ring .bg { stroke: var(--line); }
.char-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .2s; }

/* Posts */
#feed { min-height: 300px; }
.post { padding: 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; animation: postin .4s ease both; cursor: pointer; transition: background .2s; }
.post:hover { background: color-mix(in srgb, var(--card) 55%, transparent); }
.post.fresh { animation: freshin .6s ease both; background: color-mix(in srgb, var(--accent) 9%, transparent); }
@keyframes postin { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }
@keyframes freshin { 0% { opacity: 0; transform: translateY(-14px) scale(.98); background: rgba(124,92,255,.22);} 100% { opacity: 1; transform: none; background: transparent;} }
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.post-name { font-weight: 800; font-size: 15px; }
.post-handle { color: var(--muted); font-size: 13.5px; }
.post-time { color: var(--muted2); font-size: 13px; }
.post-text { font-size: 15.5px; line-height: 1.6; margin: 6px 0 10px; white-space: pre-wrap; word-wrap: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent2); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
[data-theme="light"] .chip { color: #5b3df0; }
.chip.area { background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 30%, transparent); }
.chip.anon { background: var(--card2); color: var(--muted); border-color: var(--line); }
.post-actions { display: flex; justify-content: space-between; max-width: 460px; }
.act { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-radius: 99px; transition: .2s; }
.act:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent2); }
.act.on { color: #ff5c8a; }
.act.on.green { color: var(--green); }
.act.on.amber { color: var(--amber); }
.act svg { width: 19px; height: 19px; }
.act.liked svg { fill: #ff5c8a; }
.replies { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.reply { display: flex; gap: 10px; padding: 8px 0; }
.reply-text { font-size: 14.5px; line-height: 1.55; }
.reply-box { display: flex; gap: 8px; margin-top: 10px; }
.reply-box input { flex: 1; padding: 10px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); font-size: 14px; outline: none; min-width: 0; }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 10px; }
.empty h3 { color: var(--text); font-family: var(--serif); font-size: 21px; margin-bottom: 6px; }

/* Skeleton */
.skel { padding: 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.skel .av { width: 44px; height: 44px; border-radius: 50%; }
.skel .ln { height: 13px; border-radius: 6px; margin-bottom: 9px; }
.shimmer { background: linear-gradient(90deg, var(--card2) 25%, var(--line) 50%, var(--card2) 75%); background-size: 200% 100%; animation: shim 1.2s infinite; }
@keyframes shim { 0% { background-position: 200% 0;} 100% { background-position: -200% 0;} }

/* Bottom nav + FAB */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 10px; border-radius: 12px; transition: .2s; position: relative; }
.bottomnav button.active { color: var(--text); }
.bottomnav button svg { width: 24px; height: 24px; }
.bottomnav button.active svg { stroke: var(--accent); }
.fab { position: fixed; right: 18px; bottom: 84px; z-index: 65; width: 58px; height: 58px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 30px; font-weight: 300; box-shadow: 0 10px 26px rgba(124,92,255,.5); display: flex; align-items: center; justify-content: center; transition: transform .18s; }
.fab:active { transform: scale(.9) rotate(90deg); }

/* Modal */
.modal-back { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0;} to { opacity: 1;} }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 24px 24px 0 0; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: slideup .35s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes slideup { from { opacity: 0; transform: translateY(40px);} to { opacity: 1; transform: none;} }
.modal h2 { font-family: var(--serif); font-size: 23px; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.modal-close { float: right; width: 34px; height: 34px; border-radius: 50%; background: var(--card2); font-size: 17px; }

/* Profile */
.profile-hero { padding: 22px 16px 16px; border-bottom: 1px solid var(--line); }
.profile-hero .avatar { width: 72px; height: 72px; font-size: 28px; margin-bottom: 12px; }
.profile-hero h2 { font-size: 22px; font-family: var(--serif); }
.profile-hero .handle { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.profile-hero p { color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.stats { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; }
.stats b { font-weight: 800; }
.stats span { color: var(--muted); }
.section-title { padding: 16px 16px 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Explore */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; }
.topic-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; transition: transform .18s, border-color .2s; }
.topic-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.topic-card .tag { font-weight: 800; font-size: 15px; }
.topic-card .count { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.topic-card .follow { margin-top: 10px; }

/* Policy */
.policy-doc { padding: 20px 18px 30px; line-height: 1.7; font-size: 15px; }
.policy-doc h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 6px; }
.policy-doc h3 { font-size: 16px; margin: 20px 0 6px; }
.policy-doc p, .policy-doc li { color: var(--muted); }
.policy-doc p b, .policy-doc li b { color: var(--text); }
.policy-doc ul { padding-left: 20px; }
.policy-doc ul li { margin-bottom: 6px; }
.policy-nav { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px 0; }
.policy-nav button { padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card2); font-size: 13.5px; font-weight: 700; color: var(--muted); }
.policy-nav button.active { background: var(--grad); color: #fff; border-color: transparent; }
.rights-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 16px; }
.rights-card h3 { font-size: 16px; margin-bottom: 6px; }
.rights-card p { color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 12px; }
.griev-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; font-size: 14px; }
.griev-item .st { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.griev-item .st.done { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); z-index: 150; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; padding: 12px 20px; border-radius: 99px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .3s; max-width: calc(100vw - 40px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.posting-overlay { position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); }
.posting-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px 30px; text-align: center; box-shadow: var(--shadow); animation: rise .3s ease both; }
.posting-card .logo-mark { width: 54px; height: 54px; margin: 0 auto 12px; }

footer.app-foot { text-align: center; color: var(--muted2); font-size: 12px; padding: 22px 16px 12px; line-height: 1.7; }
footer.app-foot button { color: var(--accent2); text-decoration: underline; font-size: 12px; }

@media (min-width: 760px) {
  .search-wrap { display: block; }
  .layout { grid-template-columns: 220px 1fr; padding-bottom: 30px; }
  .sidebar { display: block; position: sticky; top: 61px; height: fit-content; padding: 18px 12px; }
  .side-link { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; font-size: 16px; font-weight: 700; color: var(--muted); transition: .2s; }
  .side-link:hover { background: var(--card2); color: var(--text); }
  .side-link.active { color: var(--text); background: var(--card2); }
  .side-link svg { width: 23px; height: 23px; }
  .bottomnav, .fab { display: none; }
  .modal-back { align-items: center; padding: 20px; }
  .modal { border-radius: 24px; }
}
@media (min-width: 1020px) {
  .layout { grid-template-columns: 220px 1fr 300px; }
  .rail { display: block; position: sticky; top: 61px; height: fit-content; padding: 18px 12px; }
  .rail-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
  .rail-card h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 10px; }
  .trend-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .trend-row:first-of-type { border-top: none; }
  .trend-row .c { color: var(--muted); font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
