/* ============================================================
   alienverse — stylesheet
   Themes per "space": public (violet/cyan), us (rose), vault (acid green)
   ============================================================ */

:root {
  --bg: #07060f;
  --bg-2: #0d0b1a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ece9ff;
  --muted: #a39fbf;
  --faint: #6d6888;

  --accent: #a78bfa;
  --accent-2: #67e8f9;
  --accent-3: #f0abfc;
  --accent-rgb: 167, 139, 250;
  --glow: rgba(167, 139, 250, 0.45);

  --danger: #fb7185;
  --ok: #6ee7b7;

  --font-sans: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 180ms; --t: 360ms; --t-slow: 700ms;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
}

html[data-space="us"] {
  --accent: #fb7185; --accent-2: #fda4af; --accent-3: #f9a8d4;
  --accent-rgb: 251, 113, 133; --glow: rgba(251, 113, 133, 0.45);
  --bg: #0f0609; --bg-2: #1a0b12;
}
html[data-space="vault"] {
  --accent: #a3e635; --accent-2: #fde047; --accent-3: #86efac;
  --accent-rgb: 163, 230, 53; --glow: rgba(163, 230, 53, 0.4);
  --bg: #060a06; --bg-2: #0b140b;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--t-slow) var(--ease);
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(var(--accent-rgb), .35); color: #fff; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 10px 14px; background: var(--accent); color: #000; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- Backdrops ---------- */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .9; }
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(70px) saturate(140%); opacity: .55; }
.aurora i {
  position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), .55), transparent 60%);
  mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate;
  transition: background var(--t-slow);
}
.aurora i:nth-child(1) { top: -10%; left: -10%; }
.aurora i:nth-child(2) { bottom: -15%; right: -10%; animation-duration: 34s; animation-delay: -8s; background: radial-gradient(circle at 60% 60%, color-mix(in oklab, var(--accent-2) 55%, transparent), transparent 60%); }
.aurora i:nth-child(3) { top: 30%; left: 40%; width: 36vmax; height: 36vmax; animation-duration: 40s; animation-delay: -18s; background: radial-gradient(circle, color-mix(in oklab, var(--accent-3) 40%, transparent), transparent 60%); }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(12vw, -8vh, 0) scale(1.15) rotate(20deg); } }

.warp {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), .0) 0%, rgba(var(--accent-rgb), .25) 45%, var(--bg) 100%);
}
.warp.go { animation: warp 650ms var(--ease) forwards; }
@keyframes warp { 0% { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }

/* custom cursor (desktop only) */
.cursor { display: none; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor { display: block; position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
  .cursor-dot, .cursor-ring { position: absolute; top: 0; left: 0; border-radius: 50%; transform: translate(-50%, -50%); will-change: transform; }
  .cursor-dot { width: 6px; height: 6px; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
  .cursor-ring { width: 36px; height: 36px; border: 1.5px solid rgba(var(--accent-rgb), .6); transition: width var(--t) var(--ease-bounce), height var(--t) var(--ease-bounce), background var(--t), border-color var(--t); }
  body.cursor-hover .cursor-ring { width: 56px; height: 56px; background: rgba(var(--accent-rgb), .12); border-color: transparent; }
  body.cursor-down .cursor-ring { width: 24px; height: 24px; }
  body.cursor-text .cursor-ring { width: 3px; height: 28px; border-radius: 2px; background: var(--accent-2); border-color: transparent; }
}

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: linear-gradient(to bottom, rgba(7,6,15,.75), rgba(7,6,15,.35));
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.top.scrolled { border-color: var(--line); background: rgba(7,6,15,.8); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 1.15rem; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(from 90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent)); box-shadow: 0 0 18px var(--glow); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.glitch:hover::before { opacity: .8; color: var(--accent-2); animation: glitch-a 500ms steps(2) infinite; }
.glitch:hover::after { opacity: .8; color: var(--accent-3); animation: glitch-b 500ms steps(2) infinite reverse; }
@keyframes glitch-a { 0% { clip-path: inset(0 0 70% 0); transform: translate(-2px, -1px); } 50% { clip-path: inset(40% 0 30% 0); transform: translate(2px, 1px); } 100% { clip-path: inset(70% 0 0 0); transform: translate(-1px, 0); } }
@keyframes glitch-b { 0% { clip-path: inset(60% 0 0 0); transform: translate(2px, 1px); } 50% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, -1px); } 100% { clip-path: inset(0 0 80% 0); transform: translate(1px, 0); } }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { position: relative; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color var(--t-fast), background var(--t-fast); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); box-shadow: 0 0 10px var(--accent); }
.nav .nav-us { color: #fda4af; } .nav .nav-vault { color: #bef264; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.portal { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.portal-ring { position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid rgba(var(--accent-rgb), .6); border-top-color: transparent; border-bottom-color: transparent; transition: transform var(--t-slow) var(--ease); }
.portal:hover .portal-ring { transform: rotate(180deg) scale(1.1); }
.portal-core { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); transition: background var(--t), box-shadow var(--t), transform var(--t) var(--ease-bounce); }
.portal.on .portal-core { background: var(--accent); box-shadow: 0 0 16px var(--glow); }
.portal.on .portal-ring { animation: spin 4s linear infinite; }
.portal:active .portal-core { transform: scale(.7); }

.burger { display: none; width: 40px; height: 40px; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--t) var(--ease), opacity var(--t); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .burger { display: flex; }
  .nav {
    position: fixed; top: 68px; left: var(--gutter); right: var(--gutter);
    flex-direction: column; padding: 10px; gap: 2px;
    background: rgba(13, 11, 26, .92); border: 1px solid var(--line); border-radius: var(--r-lg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    transform: translateY(-12px) scale(.98); opacity: 0; pointer-events: none;
    transition: transform var(--t) var(--ease-bounce), opacity var(--t);
    box-shadow: 0 30px 60px rgba(0,0,0,.5);
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 14px 16px; font-size: 1.05rem; }
  .nav a.active::after { left: 6px; bottom: auto; top: 50%; transform: translateY(-50%); }
  .top-actions .btn span { display: none; }
}

/* ---------- Layout ---------- */
.view { position: relative; z-index: 1; width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto; padding: 32px 0 96px; min-height: 70dvh; }
.view.enter { animation: view-in var(--t-slow) var(--ease) both; }
.view.leave { animation: view-out 220ms var(--ease) forwards; }
@keyframes view-in { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes view-out { to { opacity: 0; transform: translateY(-10px); filter: blur(4px); } }

.foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); color: var(--faint); font-size: .85rem; border-top: 1px solid var(--line); }
.foot-dot { color: var(--accent); animation: twinkle 2.4s ease-in-out infinite; }
.foot-status { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
@keyframes twinkle { 0%, 100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* ---------- Typography ---------- */
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.025em; }
.display { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.8rem, 9vw, 7rem); line-height: .95; }
.display em { font-style: italic; }
.display em, .display em .w { background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 56ch; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(40px, 10vh, 120px) 0 clamp(40px, 8vh, 90px); display: grid; gap: 28px; }
.hero .display { max-width: 12ch; }
.hero .display .w { display: inline-block; animation: word-in 900ms var(--ease) both; }
@keyframes word-in { from { opacity: 0; transform: translateY(40px) rotate(3deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.typer { font-family: var(--font-mono); color: var(--muted); min-height: 1.6em; }
.typer::after { content: '▍'; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-orb { position: absolute; right: -6%; top: 10%; width: clamp(180px, 30vw, 380px); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.25), rgba(var(--accent-rgb), .55) 30%, rgba(var(--accent-rgb), .05) 70%);
  box-shadow: inset -30px -30px 80px rgba(0,0,0,.5), 0 0 120px var(--glow); animation: float 9s ease-in-out infinite; filter: saturate(130%); }
.hero-orb::after { content: ''; position: absolute; inset: -14%; border-radius: 50%; border: 1px solid rgba(var(--accent-rgb), .3); transform: rotateX(70deg); animation: spin 14s linear infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-22px) } }
@media (max-width: 760px) { .hero-orb { right: -25%; top: -5%; opacity: .7; } }

.stats { display: flex; flex-wrap: wrap; gap: 28px; font-family: var(--font-mono); font-size: .8rem; color: var(--faint); }
.stats b { display: block; font-size: 1.6rem; color: var(--text); font-weight: 500; letter-spacing: -.02em; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; letter-spacing: -.01em;
  background: var(--accent); color: #0a0714; border: 1px solid transparent;
  transition: transform var(--t) var(--ease-bounce), box-shadow var(--t), background var(--t), color var(--t), filter var(--t);
  will-change: transform; overflow: hidden; isolation: isolate;
}
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); transition: transform 600ms var(--ease); }
.btn:hover { box-shadow: 0 10px 40px -8px var(--glow); transform: translateY(-2px); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(251,113,133,.35); }
.btn-danger:hover { background: rgba(251,113,133,.12); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ---------- Section head / tabs ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 28px; }
.section-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 6vw, 4rem); }
.tabs { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); gap: 2px; }
.tabs button { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: all var(--t-fast); }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--text); color: var(--bg); }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  transform-style: preserve-3d; transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease);
  overflow: hidden;
}
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--t);
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), .18), transparent 45%); }
.card:hover { border-color: rgba(var(--accent-rgb), .45); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(var(--accent-rgb), .15); }
.card:hover::before { opacity: 1; }
.card.pinned { border-color: rgba(var(--accent-rgb), .4); }
.card.pinned::after { content: '✦ pinned'; position: absolute; top: 14px; right: 16px; font-family: var(--font-mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.card h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: auto; font-family: var(--font-mono); font-size: .72rem; color: var(--faint); letter-spacing: .04em; }
.card .meta .by { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line); color: var(--muted); }
.chip.kind-build { color: var(--accent-2); border-color: color-mix(in oklab, var(--accent-2) 40%, transparent); }
.chip.kind-thought { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); }
.mood { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.mood-spark { background: #fde047; box-shadow: 0 0 10px #fde047; }
.mood-calm { background: #67e8f9; box-shadow: 0 0 10px #67e8f9; }
.mood-storm { background: #818cf8; box-shadow: 0 0 10px #818cf8; }
.mood-glow { background: #fb923c; box-shadow: 0 0 10px #fb923c; }
.mood-void { background: #1f1b2e; border: 1px solid var(--faint); }
.mood-love { background: #fb7185; box-shadow: 0 0 10px #fb7185; animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1) } 14% { transform: scale(1.35) } 28% { transform: scale(1) } 42% { transform: scale(1.25) } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.card.reveal { transition-delay: calc(var(--i, 0) * 60ms); }

.empty { text-align: center; padding: 72px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty .big { font-size: 3rem; margin-bottom: 8px; filter: drop-shadow(0 0 20px var(--glow)); }

/* ---------- Article ---------- */
.article { max-width: 72ch; margin: 0 auto; }
.article-head { display: grid; gap: 14px; margin-bottom: 36px; }
.article-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 6vw, 4.2rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-family: var(--font-mono); font-size: .75rem; color: var(--faint); }
.article-tools { display: flex; gap: 8px; margin-left: auto; }
.prose { font-size: 1.1rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.15em; }
.prose h1, .prose h2, .prose h3 { font-family: var(--font-serif); font-weight: 400; margin-top: 1.8em; letter-spacing: -.01em; }
.prose h1 { font-size: 2.2rem; } .prose h2 { font-size: 1.8rem; } .prose h3 { font-size: 1.4rem; }
.prose a { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(103,232,249,.35); text-underline-offset: 3px; transition: text-decoration-color var(--t-fast); }
.prose a:hover { text-decoration-color: currentColor; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent); color: var(--muted); font-family: var(--font-serif); font-size: 1.3em; font-style: italic; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
.prose pre { padding: 18px 20px; border-radius: var(--r); background: #05040b; border: 1px solid var(--line); overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { border-radius: var(--r); border: 1px solid var(--line); }
.prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); margin: 2.5em 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.prose input[type="checkbox"] { accent-color: var(--accent); margin-right: 6px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; padding: 14px 16px; border-radius: var(--r-sm);
  background: rgba(0,0,0,.25); border: 1px solid var(--line); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15); background: rgba(0,0,0,.4); }
.input::placeholder { color: var(--faint); }
textarea.input { min-height: 200px; resize: vertical; line-height: 1.6; font-family: var(--font-mono); font-size: .95rem; }
.input.title { font-family: var(--font-serif); font-size: clamp(1.6rem, 4vw, 2.4rem); padding: 10px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.input.title:focus { box-shadow: none; border-bottom-color: var(--accent); }
.input.code { font-family: var(--font-mono); letter-spacing: .5em; text-align: center; font-size: 1.5rem; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
select.input option { background: var(--bg-2); }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.4em; }
.hint { color: var(--faint); font-size: .85rem; }

.segment { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.segment label { position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 500; transition: all var(--t-fast); cursor: pointer; }
.segment input:checked + span { color: var(--text); border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .12); box-shadow: 0 0 20px -6px var(--glow); }
.segment input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.segment .sp-us span { --accent-rgb: 251,113,133; } .segment .sp-vault span { --accent-rgb: 163,230,53; }

.moods { display: flex; gap: 10px; flex-wrap: wrap; }
.moods label { position: relative; }
.moods input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.moods span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); transition: all var(--t) var(--ease-bounce); cursor: pointer; }
.moods span i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.moods input:checked + span { transform: scale(1.15); border-color: var(--text); background: var(--surface-2); }
.moods span:hover { transform: scale(1.08); }

/* ---------- Editor ---------- */
.editor { display: grid; gap: 24px; }
.editor-split { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .editor-split { grid-template-columns: 1fr 1fr; } }
.preview { padding: 22px; border-radius: var(--r); border: 1px dashed var(--line); min-height: 200px; }
.preview:empty::before { content: 'preview appears here as you type…'; color: var(--faint); font-style: italic; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; position: sticky; bottom: 16px; z-index: 5; padding: 12px 14px; border-radius: 999px; background: rgba(13,11,26,.85); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); }
.counter { font-family: var(--font-mono); font-size: .75rem; color: var(--faint); }

/* ---------- Login ---------- */
.login { display: grid; justify-items: center; padding-top: clamp(8px, 6vh, 60px); }
.login-card { position: relative; width: min(100%, 420px); padding: 40px 32px 32px; border-radius: var(--r-xl); border: 1px solid var(--line); background: linear-gradient(170deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 40px 100px -40px rgba(0,0,0,.9); display: grid; gap: 22px; animation: card-in var(--t-slow) var(--ease-bounce) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.login-card.shake { animation: shake 500ms var(--ease); }
@keyframes shake { 10%, 90% { transform: translateX(-2px) } 20%, 80% { transform: translateX(4px) } 30%, 50%, 70% { transform: translateX(-6px) } 40%, 60% { transform: translateX(6px) } }
.gate { position: relative; width: 84px; height: 84px; margin: 0 auto; }
.gate i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(var(--accent-rgb), .5); border-left-color: transparent; border-right-color: transparent; animation: spin 7s linear infinite; }
.gate i:nth-child(2) { inset: 12px; animation-duration: 4s; animation-direction: reverse; border-color: color-mix(in oklab, var(--accent-2) 60%, transparent); border-top-color: transparent; border-bottom-color: transparent; }
.gate i:nth-child(3) { inset: 24px; animation-duration: 2.5s; }
.gate b { position: absolute; inset: 34px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 30px var(--glow); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.3); opacity: .8; } }
.login-card.ok .gate b { animation: none; transform: scale(14); opacity: 0; transition: transform 700ms var(--ease), opacity 700ms var(--ease); }
.login-title { text-align: center; font-family: var(--font-serif); font-weight: 400; font-size: 2rem; }
.login-sub { text-align: center; color: var(--faint); font-size: .9rem; margin-top: -14px; }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 22px; max-width: 720px; }
.panel { padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 16px; }
.panel h2 { font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.panel h2 .status { margin-left: auto; }
.status { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.status.on { color: var(--ok); border-color: rgba(110,231,183,.4); background: rgba(110,231,183,.08); }
.status.off { color: var(--danger); border-color: rgba(251,113,133,.35); }
.qr { display: grid; justify-items: center; gap: 12px; padding: 16px; border-radius: var(--r); background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.qr img { border-radius: 12px; }
.secret { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em; word-break: break-all; text-align: center; color: var(--muted); user-select: all; }
.sessions { display: grid; gap: 8px; }
.session { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); font-size: .85rem; }
.session .cur { color: var(--ok); font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; }
.session .ua { color: var(--faint); font-family: var(--font-mono); font-size: .72rem; flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- About ---------- */
.about { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1.6fr; align-items: start; } }
.about-side { position: sticky; top: 90px; display: grid; gap: 18px; }
.avatar { width: 150px; aspect-ratio: 1; border-radius: 40% 60% 55% 45% / 55% 45% 55% 45%; background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent)); animation: morph 10s ease-in-out infinite, spin 30s linear infinite; box-shadow: 0 0 60px var(--glow); }
@keyframes morph { 0%, 100% { border-radius: 40% 60% 55% 45% / 55% 45% 55% 45%; } 50% { border-radius: 60% 40% 45% 55% / 45% 55% 45% 55%; } }

/* ---------- Private space banners ---------- */
.space-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r); border: 1px solid rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .08); font-size: .9rem; color: var(--muted); margin-bottom: 28px; }
.space-banner .lock { font-size: 1.3rem; filter: drop-shadow(0 0 12px var(--glow)); }
.space-banner .enc { margin-left: auto; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(100% - 32px, 420px); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(13,11,26,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: .92rem; display: flex; gap: 10px; align-items: center; animation: toast-in var(--t) var(--ease-bounce) both; box-shadow: 0 20px 50px -20px rgba(0,0,0,.9); }
.toast.out { animation: toast-out 250ms var(--ease) forwards; }
.toast.ok { border-color: rgba(110,231,183,.35); } .toast.err { border-color: rgba(251,113,133,.4); }
.toast::before { content: '✦'; color: var(--accent); } .toast.ok::before { content: '✓'; color: var(--ok); } .toast.err::before { content: '✕'; color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.95); } }

/* ---------- Confetti / burst ---------- */
.burst { position: fixed; inset: 0; z-index: 150; pointer-events: none; }

/* ---------- Loader ---------- */
.loader { display: grid; place-items: center; padding: 80px 0; }
.loader i { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 800ms linear infinite; }
.skeleton { border-radius: var(--r-lg); border: 1px solid var(--line); min-height: 180px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ---------- Dialog ---------- */
.dialog-back { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 20px; background: rgba(3,2,8,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade var(--t) both; }
@keyframes fade { from { opacity: 0 } }
.dialog { width: min(100%, 400px); padding: 28px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-2); display: grid; gap: 16px; animation: card-in var(--t) var(--ease-bounce) both; }
.dialog h3 { font-size: 1.3rem; }

/* ============================================================
   v2: sections, media, uploads, comments, profile
   ============================================================ */
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.center { justify-content: center; margin-top: 28px; }
.strip { margin-top: 56px; }
.strip-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.9rem, 5vw, 3rem); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tabs a { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: all var(--t-fast); }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--text); color: var(--bg); }
.chip.kind-creative { color: var(--accent-3); border-color: color-mix(in oklab, var(--accent-3) 40%, transparent); }
.chip-apk { color: var(--ok); border-color: rgba(110,231,183,.4); }
.cmt-count { display: inline-flex; gap: 4px; align-items: center; }
.card-foot { gap: 8px; }

/* hero byline */
.hero-by { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); width: fit-content; color: var(--muted); font-size: .92rem; transition: border-color var(--t), background var(--t); }
.hero-by:hover { border-color: rgba(var(--accent-rgb), .5); background: var(--surface-2); }
.hero-by strong { color: var(--text); }

/* avatars */
.avatar.sm, .avatar-img.sm { width: 30px; height: 30px; animation: none; box-shadow: 0 0 14px var(--glow); }
.avatar.sm { border-radius: 50%; display: inline-block; }
.avatar-img { display: block; object-fit: cover; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .55); box-shadow: 0 0 40px var(--glow); }
.avatar-img.lg { width: 160px; height: 160px; border-radius: 42% 58% 55% 45% / 52% 45% 55% 48%; animation: morph 10s ease-in-out infinite; }
.avatar.lg { width: 160px; }

/* card covers */
.card.has-cover { padding-top: 0; }
.card-cover { position: relative; margin: 0 -22px 2px; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: #05040b; }
.card-cover img, .card-cover video { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease), filter var(--t); }
.card:hover .card-cover img, .card:hover .card-cover video { transform: scale(1.06); }
.cover-badge { position: absolute; top: 12px; left: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); color: #fff; pointer-events: none; }
.card.pinned.has-cover::after { top: 12px; right: 12px; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }

/* masonry (creative) */
.masonry { columns: 3 280px; column-gap: 18px; }
.masonry > * { break-inside: avoid; margin-bottom: 18px; width: 100%; }
.masonry .card-cover { aspect-ratio: auto; }
.masonry .card-cover img, .masonry .card-cover video { height: auto; max-height: 560px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--font-mono); font-size: .72rem; color: var(--accent-2); padding: 2px 8px; border-radius: 6px; background: color-mix(in oklab, var(--accent-2) 10%, transparent); }

/* post page */
.build-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.post-hero { margin: 0 auto 40px; max-width: 980px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #05040b; box-shadow: 0 40px 100px -40px rgba(0,0,0,.9), 0 0 80px -40px var(--glow); animation: card-in var(--t-slow) var(--ease) both; }
.post-hero img, .post-hero video { width: 100%; max-height: 75vh; object-fit: contain; margin: 0 auto; }
.post-hero-btn { display: block; width: 100%; cursor: zoom-in; }
.article.kind-creative, .article.kind-build { max-width: 980px; }
.article.kind-creative .prose, .article.kind-build .prose { max-width: 72ch; margin: 0 auto; }
.post-section { margin-top: 48px; }
.section-label { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 16px; }
.prose img.zoomable { cursor: zoom-in; }

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.gallery.n1 { grid-template-columns: 1fr; }
.g-item { position: relative; display: block; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: #05040b; cursor: zoom-in; }
.gallery.n1 .g-item { aspect-ratio: auto; }
.g-item img, .g-item video { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.gallery.n1 .g-item img, .gallery.n1 .g-item video { object-fit: contain; max-height: 70vh; }
.g-item:hover img, .g-item:hover video { transform: scale(1.05); }

.downloads { display: grid; gap: 10px; }
.dl { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); transition: border-color var(--t), transform var(--t) var(--ease); }
.dl:hover { border-color: rgba(var(--accent-rgb), .45); transform: translateY(-2px); }
.dl-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.dl-ico.apk { color: var(--ok); background: rgba(110,231,183,.1); box-shadow: 0 0 24px -6px rgba(110,231,183,.5); }
.dl-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.dl-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-info .faint { font-size: .78rem; }
.dl-hash { justify-self: start; font-size: .68rem; color: var(--faint); padding: 0; transition: color var(--t-fast); }
.dl-hash:hover { color: var(--accent-2); }
@media (max-width: 520px) { .dl { flex-wrap: wrap; } .dl .btn { width: 100%; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; background: rgba(3,2,8,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: fade var(--t) both; touch-action: pan-y; }
.lightbox.out { animation: fade 220ms reverse forwards; }
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 16px 72px; }
.lb-media { max-width: min(100%, 1400px); max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.lb-media.zoom { animation: lb-zoom 420ms var(--ease-bounce) both; }
.lb-media.from-right { animation: lb-right 380ms var(--ease) both; }
.lb-media.from-left { animation: lb-left 380ms var(--ease) both; }
@keyframes lb-zoom { from { opacity: 0; transform: scale(.88); } }
@keyframes lb-right { from { opacity: 0; transform: translateX(60px); } }
@keyframes lb-left { from { opacity: 0; transform: translateX(-60px); } }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); transition: background var(--t-fast), transform var(--t) var(--ease-bounce); }
.lb-btn:hover { background: rgba(255,255,255,.18); transform: scale(1.08); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; translate: 0 -50%; }
.lb-next { right: 14px; top: 50%; translate: 0 -50%; }
.lb-foot { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 16px; color: var(--muted); font-size: .85rem; padding: 0 16px; }
.lb-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 10px; translate: none; } .lb-foot { bottom: 76px; } }

/* comments */
.comments { max-width: 72ch; margin: 64px auto 0; padding-top: 32px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.comments-title { font-family: var(--font-serif); font-weight: 400; font-size: 1.9rem; }
.comment-list { display: grid; gap: 10px; }
.comment { padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); transition: opacity 300ms, transform 300ms var(--ease); }
.comment.fresh { animation: comment-in 600ms var(--ease-bounce) both; border-color: rgba(var(--accent-rgb), .45); }
.comment.gone { opacity: 0; transform: translateX(30px) scale(.97); }
.comment.by-owner { border-color: rgba(var(--accent-rgb), .3); background: rgba(var(--accent-rgb), .05); }
@keyframes comment-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; }
.comment-head .tbtn { margin-left: auto; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #0a0714; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.comment-body { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.badge { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .45); }
.badge-love { color: #fb7185; border-color: rgba(251,113,133,.45); }
.comment-form { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.comment-input { min-height: 96px; font-family: var(--font-sans); font-size: 1rem; }
.comment-as { margin: 0; font-size: .88rem; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* editor attachments */
.editor-hint { margin: -8px 0 0; }
.attach { display: grid; gap: 14px; }
.dropzone { position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; border-radius: var(--r-lg); border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color var(--t), background var(--t), transform var(--t) var(--ease-bounce); }
.dropzone:hover { border-color: rgba(var(--accent-rgb), .6); color: var(--text); }
.dropzone.over { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); transform: scale(1.01); box-shadow: 0 0 40px -10px var(--glow); }
.dropzone .ico { color: var(--accent); transition: transform var(--t) var(--ease-bounce); }
.dropzone:hover .ico, .dropzone.over .ico { transform: translateY(-4px); }
.dropzone .faint { font-size: .82rem; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tiles:empty { display: none; }
.tile { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); animation: card-in var(--t) var(--ease-bounce) both; }
.tile.is-cover { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 24px -8px var(--glow); }
.tile-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #05040b; display: grid; place-items: center; }
.tile-thumb img, .tile-thumb video { width: 100%; height: 100%; object-fit: cover; }
.tile-ico { color: var(--muted); }
.tile.is-uploading .tile-ico { color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.tile-cover-badge { position: absolute; top: 6px; left: 6px; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #0a0714; }
.tile-name { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { font-size: .7rem; }
.tile-actions { display: flex; gap: 4px; }
.tbtn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: transparent; transition: all var(--t-fast); }
.tbtn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.tbtn.on { color: #0a0714; background: var(--accent); border-color: var(--accent); }
.tbtn.danger:hover { color: var(--danger); border-color: rgba(251,113,133,.45); background: rgba(251,113,133,.1); }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 200ms linear; box-shadow: 0 0 10px var(--glow); }
.switches { display: flex; flex-wrap: wrap; gap: 18px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: background var(--t); flex: none; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform var(--t) var(--ease-bounce), background var(--t); }
.switch input:checked + .switch-track { background: rgba(var(--accent-rgb), .3); border-color: rgba(var(--accent-rgb), .7); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--accent); box-shadow: 0 0 10px var(--glow); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.switch input:checked ~ span:last-child { color: var(--text); }
@media (max-width: 600px) { .hide-sm { display: none; } }

/* about / socials */
.about-name { font-size: clamp(2.6rem, 8vw, 4.6rem); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.social-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 500; font-size: .9rem; transition: all var(--t) var(--ease); }
.social-link:hover { color: var(--text); transform: translateY(-2px); border-color: var(--line-strong); }
.s-github:hover { box-shadow: 0 10px 30px -10px rgba(255,255,255,.35); }
.s-leetcode:hover { color: #ffa116; border-color: rgba(255,161,22,.5); box-shadow: 0 10px 30px -10px rgba(255,161,22,.6); }
.s-instagram:hover { color: #f472b6; border-color: rgba(244,114,182,.5); box-shadow: 0 10px 30px -10px rgba(244,114,182,.6); }
.s-pinterest:hover { color: #f43f5e; border-color: rgba(244,63,94,.5); box-shadow: 0 10px 30px -10px rgba(244,63,94,.6); }
.s-linkedin:hover { color: #38bdf8; border-color: rgba(56,189,248,.5); box-shadow: 0 10px 30px -10px rgba(56,189,248,.6); }
.about-form .panel h2 { font-size: 1.05rem; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-host { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.avatar-edit { position: relative; border-radius: 50%; }
.avatar-edit-label { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; font-weight: 600; opacity: 0; transition: opacity var(--t); }
.avatar-edit:hover .avatar-edit-label, .avatar-edit:focus-visible .avatar-edit-label { opacity: 1; }
@media (hover: none) { .avatar-edit-label { opacity: 1; background: rgba(0,0,0,.4); } }

/* settings quick actions + storage */
.quick-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.quick-item { display: grid; gap: 2px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); transition: all var(--t) var(--ease); }
.quick-item:hover { border-color: rgba(var(--accent-rgb), .5); transform: translateY(-3px); box-shadow: 0 16px 40px -20px var(--glow); }
.quick-item .faint { font-size: .8rem; }
.q-emoji { font-size: 1.5rem; margin-bottom: 4px; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ok), var(--accent), var(--danger)); background-size: 300% 100%; transition: width var(--t-slow) var(--ease); }

/* floating write button (mobile) */
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60; width: 58px; height: 58px; border-radius: 50%; display: none; place-items: center; color: #0a0714; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 16px 40px -10px var(--glow); transition: transform var(--t) var(--ease-bounce); }
.fab:active { transform: scale(.9) rotate(90deg); }
@media (max-width: 760px) { .fab:not(.hidden) { display: grid; } .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); } }

/* ============================================================
   v3: visitor sign-in, moderation, warnings
   ============================================================ */
.warn-banner { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 14px 18px; margin-bottom: 22px; border-radius: var(--r); border: 1px solid rgba(251,191,36,.45); background: rgba(251,191,36,.08); color: #fde68a; font-size: .92rem; transition: background var(--t), transform var(--t) var(--ease); }
.warn-banner:hover { background: rgba(251,191,36,.14); transform: translateY(-1px); }
.warn-banner strong { color: #fef3c7; }

.oauth-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn-oauth { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 1px solid var(--line-strong); background: #fff; color: #1f1f1f; transition: transform var(--t) var(--ease-bounce), box-shadow var(--t); }
.btn-oauth:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(255,255,255,.35); }
.btn-oauth:active { transform: scale(.97); }
.btn-oauth.oauth-github { background: #24292f; color: #fff; border-color: #444c56; }
.btn-oauth.oauth-github:hover { box-shadow: 0 12px 30px -10px rgba(0,0,0,.8); }

.signin-card { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px 20px; border-radius: var(--r-lg); border: 1px solid rgba(var(--accent-rgb), .35); background: linear-gradient(160deg, rgba(var(--accent-rgb), .1), var(--surface)); }
.signin-card strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.6rem; }
.signin-card p { margin: 0 0 8px; }
.signin-glow { position: absolute; inset: -40% -20% auto; height: 160px; background: radial-gradient(closest-side, rgba(var(--accent-rgb), .35), transparent); filter: blur(30px); pointer-events: none; animation: float 7s ease-in-out infinite; }
.comment-entry { display: grid; gap: 14px; }
.or-signin { display: grid; justify-items: center; gap: 10px; padding-top: 4px; }

.member-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.member-bar strong { color: var(--text); }
.member-actions { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.linkish { padding: 0; color: var(--muted); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.linkish:hover { color: var(--text); }
.linkish.danger:hover { color: var(--danger); }
img.comment-avatar { object-fit: cover; background: var(--surface-2); }
.via { display: inline-flex; align-items: center; opacity: .85; }
.badge-ban { color: var(--danger); border-color: rgba(251,113,133,.45); }
.comment-tools { margin-left: auto; position: relative; display: inline-flex; gap: 4px; }
.comment-head { position: relative; }
.comment.by-member { border-color: var(--line); }

.mod-menu { position: absolute; top: 34px; right: 0; z-index: 20; min-width: 220px; display: grid; padding: 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(13,11,26,.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 24px 60px -20px rgba(0,0,0,.9); animation: card-in 220ms var(--ease-bounce) both; }
.mod-item { text-align: left; padding: 9px 12px; border-radius: 9px; font-size: .88rem; color: var(--text); transition: background var(--t-fast); }
.mod-item:hover { background: var(--surface-2); }
.mod-item.danger { color: var(--danger); }
.mod-item.danger:hover { background: rgba(251,113,133,.12); }

.providers { display: flex; flex-wrap: wrap; gap: 10px; }
.provider { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); opacity: .75; }
.provider.on { opacity: 1; border-color: rgba(110,231,183,.35); }
.member-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.member-list { display: grid; gap: 8px; }
.member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(0,0,0,.15); }
.member-row.is-banned { border-color: rgba(251,113,133,.3); background: rgba(251,113,133,.05); }
.member-row .comment-avatar { width: 38px; height: 38px; font-size: .95rem; }
.member-info { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.member-info .faint { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.member-row .member-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.suspend { display: inline-flex; gap: 4px; align-items: center; }
.input-sm { padding: 7px 10px; font-size: .85rem; border-radius: 9px; width: auto; }
select.input-sm { padding-right: 30px; background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; }
.blocks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px solid var(--line); }
.block-chip { display: inline-flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
@media (max-width: 560px) { .member-row .member-actions { margin-left: 0; width: 100%; } }

/* Grids must never grow wider than their container because of long unbreakable
   content (user-agent strings, emails, file names) — this used to push Settings off-screen. */
.hero, .about-side, .sealed-view, .moodmap, .now-editor, .reactions-wrap,
.settings, .editor, .panel, .comments, .attach, .about-form, .article-head, .login-card form,
.sessions, .member-list, .comment-list, .downloads, .comment-form, .comment-entry { grid-template-columns: minmax(0, 1fr); }
.session > *, .member-info, .dl-info, .tile { min-width: 0; }
.session .ua { min-width: 0; }

/* ============================================================
   v4: Signals — palette, reactions, capsules, now, Us, moods, galaxy
   ============================================================ */
/* header search + footer buttons */
.icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: all var(--t-fast); }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
kbd { font-family: var(--font-mono); font-size: .68rem; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--muted); background: var(--surface); }
.foot-btn { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 4px 8px; border-radius: 6px; transition: color var(--t-fast), background var(--t-fast); }
.foot-btn:hover { color: var(--text); background: var(--surface-2); }

/* command palette */
.palette-back { position: fixed; inset: 0; z-index: 185; display: grid; justify-items: center; align-items: start; padding: max(10vh, 16px) 16px 16px; background: rgba(3,2,8,.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade 160ms both; }
.palette-back.out { animation: fade 180ms reverse forwards; }
.palette { width: min(100%, 620px); max-height: min(70vh, 560px); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border-radius: 20px; border: 1px solid var(--line-strong); background: rgba(13,11,26,.96); box-shadow: 0 40px 120px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(var(--accent-rgb), .12), 0 0 80px -30px var(--glow); animation: palette-in 260ms var(--ease-bounce) both; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.palette-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 1.1rem; color: var(--text); }
.palette-input::placeholder { color: var(--faint); }
.palette-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.palette-group { padding: 10px 10px 4px; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; color: var(--text); transition: background 80ms; }
.palette-item.active { background: rgba(var(--accent-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.pi-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); flex: none; }
.pi-text { display: grid; min-width: 0; }
.pi-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-sub { font-size: .8rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 28px; text-align: center; color: var(--faint); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--faint); }
.palette-foot kbd { margin-right: 2px; }

/* reactions */
.reactions-wrap { max-width: 72ch; margin: 48px auto 0; display: grid; justify-items: center; gap: 10px; }
.reactions-wrap > .faint { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; }
.reactions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.react { display: inline-flex; align-items: center; gap: 6px; min-width: 54px; justify-content: center; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: transform var(--t) var(--ease-bounce), border-color var(--t), background var(--t), box-shadow var(--t); }
.react:hover { transform: translateY(-3px) scale(1.06); border-color: var(--line-strong); }
.react:active { transform: scale(.92); }
.react.on { border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .14); box-shadow: 0 0 24px -8px var(--glow); }
.react-emoji { font-size: 1.25rem; line-height: 1; transition: transform var(--t) var(--ease-bounce); }
.react.on .react-emoji { transform: scale(1.15); }
.react-n { font-size: .8rem; color: var(--muted); min-width: 0; }
.react.on .react-n { color: var(--text); }
.float-emoji { position: fixed; z-index: 160; pointer-events: none; font-size: 1.6rem; translate: -50% 0; animation: float-up 1.1s var(--ease) forwards; }
@keyframes float-up { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; transform: translateY(-14px) scale(1.15); } 100% { opacity: 0; transform: translateY(-110px) scale(.9) rotate(12deg); } }

/* scheduled / capsule */
.chip-sched { color: #fde68a; border-color: rgba(253,230,138,.4); }
.chip-capsule { color: var(--accent-3); border-color: color-mix(in oklab, var(--accent-3) 40%, transparent); }
.info-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); border: 1px solid rgba(253,230,138,.35); background: rgba(253,230,138,.07); color: #fef3c7; font-size: .92rem; }
.info-banner.capsule { border-color: rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .08); color: var(--text); }
.card.capsule { cursor: pointer; align-items: flex-start; border-style: dashed; border-color: rgba(var(--accent-rgb), .45); background: radial-gradient(120% 90% at 0% 0%, rgba(var(--accent-rgb), .16), transparent 60%), linear-gradient(160deg, var(--surface-2), var(--surface)); }
.card.capsule.shake { animation: shake 500ms var(--ease); }
.card.capsule.opening { animation: capsule-open 1.4s var(--ease) forwards; }
@keyframes capsule-open { 30% { transform: scale(1.04); box-shadow: 0 0 80px var(--glow); } 100% { transform: scale(.96); opacity: .4; filter: blur(2px) brightness(1.6); } }
.capsule-count { color: var(--accent); font-weight: 600; }
.capsule-orb { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.capsule-orb i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed rgba(var(--accent-rgb), .6); animation: spin 12s linear infinite; }
.capsule-orb i:nth-child(2) { inset: 9px; border-style: solid; border-color: rgba(var(--accent-rgb), .3); border-top-color: var(--accent); animation-duration: 3s; animation-direction: reverse; }
.capsule-orb i:nth-child(3) { inset: 22px; border: 0; background: radial-gradient(circle, rgba(var(--accent-rgb), .45), transparent 70%); animation: pulse 2.4s ease-in-out infinite; }
.capsule-orb span { position: relative; font-size: 1.3rem; filter: drop-shadow(0 0 10px var(--glow)); }
.capsule-orb.big { width: 180px; height: 180px; margin: 10px auto 6px; }
.capsule-orb.big span { font-size: 3rem; }
.sealed-view { display: grid; justify-items: center; text-align: center; gap: 18px; padding: 20px 0 60px; }
.sealed-view .eyebrow { justify-self: start; }
.sealed-title { font-size: clamp(2.6rem, 8vw, 5rem); }
.sealed-view .lede { margin: 0; }
.countdown { display: flex; gap: clamp(8px, 2.5vw, 18px); margin: 10px 0; }
.cd-part { display: grid; justify-items: center; gap: 6px; min-width: clamp(64px, 18vw, 104px); padding: 16px 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(170deg, var(--surface-2), var(--surface)); }
.cd-part b { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 600; line-height: 1; background: linear-gradient(180deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-part b.flip { animation: flip 420ms var(--ease-bounce); }
@keyframes flip { from { transform: translateY(-30%) rotateX(60deg); opacity: .2; } }
.cd-part span { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.sealed-view.opening .capsule-orb { animation: orb-burst 1.6s var(--ease) forwards; }
@keyframes orb-burst { 40% { transform: scale(1.25); filter: brightness(2); } 100% { transform: scale(3); opacity: 0; } }
.sched { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.when { color-scheme: dark; }
.sched-hint { flex-basis: 100%; }

/* now status */
.now-pill { display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 8px 16px 8px 12px; border-radius: 999px; border: 1px solid rgba(110,231,183,.3); background: rgba(110,231,183,.06); font-size: .92rem; transition: border-color var(--t), transform var(--t) var(--ease); }
.now-pill:hover { border-color: rgba(110,231,183,.6); transform: translateY(-1px); }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--ok); animation: live 1.8s ease-out infinite; }
@keyframes live { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.now-label { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ok); }
.now-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.now-ago { font-size: .78rem; white-space: nowrap; }
.now-editor { display: grid; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.now-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.now-emoji { text-align: center; font-size: 1.3rem; padding: 10px 6px; }
.emoji-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 1.1rem; transition: transform var(--t) var(--ease-bounce), border-color var(--t); }
.emoji-pick:hover { transform: scale(1.12); border-color: var(--line-strong); }

/* Us counter */
.us-counter { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 22px 24px; margin-bottom: 22px; border-radius: var(--r-lg); border: 1px solid rgba(251,113,133,.35); background: radial-gradient(120% 140% at 0% 0%, rgba(251,113,133,.18), transparent 55%), linear-gradient(160deg, var(--surface-2), var(--surface)); overflow: hidden; }
.us-heart { font-size: 2.4rem; filter: drop-shadow(0 0 18px rgba(251,113,133,.6)); }
.us-heart.beat { animation: heartbeat 1.8s ease-in-out infinite; }
.us-main { display: grid; gap: 2px; flex: 1 1 220px; }
.us-main p { margin: 0; }
.us-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.us-days { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1; background: linear-gradient(90deg, #fb7185, #f9a8d4, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.us-unit { font-size: 1.05rem; color: var(--muted); }
.us-next { display: flex; align-items: baseline; gap: 4px; padding: 10px 14px; border-radius: var(--r); background: rgba(0,0,0,.2); border: 1px solid var(--line); }
.us-next b { font-size: 1.4rem; color: #fda4af; }
.us-set { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.us-set input { color-scheme: dark; }
.us-edit { position: absolute; top: 12px; right: 12px; }

/* mood map */
.moodmap { display: grid; gap: 10px; padding: 18px 20px; margin-bottom: 26px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.mm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mm-head .faint { font-size: .8rem; }
.mm-scroll { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.mm-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); grid-auto-columns: 11px; gap: 3px; width: max-content; }
.mm-cell { width: 11px; height: 11px; border-radius: 3px; background: rgba(255,255,255,.05); transition: transform var(--t-fast); }
.mm-cell[class*="mood-"] { box-shadow: none; animation: none; }
.mm-cell:hover { transform: scale(1.5); }
.mm-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--faint); }
.mm-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* galaxy */
.galaxy-wrap { position: relative; height: min(72vh, 720px); min-height: 420px; border-radius: var(--r-xl); border: 1px solid var(--line); overflow: hidden; background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), .08), transparent 70%), #05040b; box-shadow: inset 0 0 120px rgba(0,0,0,.8); }
.galaxy-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.galaxy-canvas:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -4px; }
.galaxy-tip { position: absolute; z-index: 2; display: grid; gap: 4px; max-width: 260px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(13,11,26,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; box-shadow: 0 20px 50px -20px rgba(0,0,0,.9); animation: fade 120ms both; }
.galaxy-tip img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.galaxy-tip strong { font-size: .92rem; line-height: 1.3; }
.galaxy-tip span { font-size: .74rem; color: var(--faint); font-family: var(--font-mono); }
.galaxy-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--muted); }
.gl { display: inline-flex; align-items: center; gap: 8px; }
.gl i { width: 10px; height: 10px; border-radius: 50%; }
.gl-build i { background: #67e8f9; box-shadow: 0 0 12px #67e8f9; }
.gl-creative i { background: #f0abfc; box-shadow: 0 0 12px #f0abfc; }
.gl-thought i { background: #a78bfa; box-shadow: 0 0 12px #a78bfa; }
.galaxy-hint { text-align: center; margin-top: 14px; }

/* reading progress + related */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); box-shadow: 0 0 12px var(--glow); pointer-events: none; }
.related { max-width: 980px; margin-left: auto; margin-right: auto; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .aurora i { animation: none; }
  #stars { display: none; }
}
