@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/SpaceGrotesk-Variable.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #15131f;
    --panel: #1e1a2b;
    --panel-2: #262138;
    --line: rgba(241, 238, 250, 0.09);
    --paper: #f1eefa;
    --muted: #9b94b0;
    --mango: #ff7a3d;
    --citrus: #ffcb4d;
    --mint: #4fd8c4;
    --danger: #ff5c7c;
    --success: #4fd8c4;
    --radius-lg: 22px;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-hard: 4px 4px 0 rgba(21, 19, 31, 0.9);
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
    --ink: #faf8f5;
    --panel: #ffffff;
    --panel-2: #f2eee8;
    --line: rgba(21, 19, 31, 0.09);
    --paper: #17151f;
    --muted: #6b6580;
    --shadow-hard: 4px 4px 0 rgba(21, 19, 31, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
code { font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(21, 19, 31, 0.72);
    border-bottom: 1px solid var(--line);
}
[data-theme="light"] .navbar { background: rgba(250, 248, 245, 0.82); }

.navbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.brand span { color: var(--mango); }

.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--paper); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--paper);
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease;
}
.icon-btn:hover { transform: translateY(-2px); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    font-family: var(--font-body);
}
.btn-primary { background: var(--mango); color: #1a1420; box-shadow: var(--shadow-hard); }
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(21, 19, 31, 0.9); }
[data-theme="light"] .btn-primary:hover { box-shadow: 6px 6px 0 rgba(21, 19, 31, 0.16); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--paper); }
.btn-outline:hover { border-color: var(--mango); }
.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { color: var(--paper); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.avatar-lg { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--ink); margin-top: -60px; }

.inline-form { display: inline; }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 72px 0 90px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--mint);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
}
.hero-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin: 0 0 18px;
}
.hero .accent { color: var(--mango); }
.hero p.hero-lead { color: var(--muted); font-size: 17px; max-width: 480px; margin: 0 0 30px; line-height: 1.6; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-hint { color: var(--muted); font-size: 13px; margin-top: 16px; }

.mix-ring { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; margin: 0 auto; }
.mix-ring svg { width: 100%; height: 100%; }
.mix-ring .ring-rotate { transform-origin: 150px 150px; animation: mixspin 30s linear infinite; }
@keyframes mixspin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.hero-content { min-width: 0; }
.settings-card { min-width: 0; }
.section { padding: 64px 0; }
.section-eyebrow {
    display: inline-block;
    color: var(--mango);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-family: var(--font-mono);
}
.section-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin: 0 0 36px; }
.section-header { margin-bottom: 36px; }

.bento { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: 20px; }
.bento-main { grid-row: 1 / 3; }
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--mango); }
.card h3 { font-family: var(--font-display); margin: 0 0 10px; font-size: 20px; }
.card p { color: var(--muted); margin: 0; font-size: 14px; line-height: 1.65; }
.feature-card { display: flex; flex-direction: column; justify-content: flex-end; min-height: 160px; }
.bento-main.feature-card { min-height: 340px; justify-content: flex-end; }
.feature-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--mint);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.feature-icon { font-size: 30px; margin-bottom: 14px; }

/* Stat strip */
.stat-strip {
    display: flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stat-strip-item { flex: 1; padding: 28px; text-align: center; border-right: 1px solid var(--line); }
.stat-strip-item:last-child { border-right: none; }
.stat-strip-number { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--mango); }
.stat-strip-label { color: var(--muted); font-size: 13px; margin-top: 6px; font-family: var(--font-mono); }

/* CTA panel */
.cta-panel {
    background: var(--mango);
    border-radius: var(--radius-lg);
    padding: 56px 44px;
    color: #1a1420;
    clip-path: polygon(0 0, 100% 0, 100% 92%, 96% 100%, 0 100%);
}
.cta-panel h2 { font-family: var(--font-display); font-size: 30px; margin: 0 0 10px; }
.cta-panel p { opacity: 0.85; margin: 0 0 26px; max-width: 460px; }
.cta-panel .btn-primary { background: #1a1420; color: var(--citrus); box-shadow: 4px 4px 0 rgba(0,0,0,0.25); }
.cta-panel .btn-primary:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 rgba(0,0,0,0.25); }

/* Auth */
.auth-section { display: flex; justify-content: center; padding: 70px 0; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 38px;
}
.auth-card h1 { font-family: var(--font-display); margin: 0 0 6px; font-size: 24px; }
.auth-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-card-center { text-align: center; }
.auth-logo { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 18px; }
.auth-logo span { color: var(--mango); }
.onboarding-badge { font-size: 40px; margin-bottom: 6px; }
.btn-google-cta { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 26px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-hard); }
.google-icon { width: 18px; height: 18px; }
.auth-legal { font-size: 12px; color: var(--muted); margin-top: 22px; line-height: 1.6; }
.auth-legal a { color: var(--mint); }

.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 13px; color: var(--muted); margin-top: 12px; font-weight: 600; }
.form input, .form textarea {
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--paper);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color .15s;
}
.form input:focus, .form textarea:focus { border-color: var(--mango); }
.form input:focus-visible, .form textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--mango); outline-offset: 2px; }
.form button { margin-top: 22px; }
.link-muted { color: var(--muted); font-size: 13px; }
.form-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 24px 0; position: relative; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1px; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line); }
.divider::before { left: 0; }
.divider::after { right: 0; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-hard); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-footer a { color: var(--mango); font-weight: 700; }

/* User menu */
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
}
.user-chip:hover { border-color: var(--mango); }
.user-chip-name { font-size: 13px; font-weight: 700; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-admin { display: flex; align-items: center; gap: 8px; border-color: var(--mint); color: var(--mint); }
.admin-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }

/* Profile */
.profile-header { margin-top: 20px; }
.profile-banner { height: 220px; border-radius: var(--radius-lg); background-size: cover; background-position: center; background-color: var(--panel); }
.profile-info { padding: 0 24px; }
.profile-name { font-family: var(--font-display); font-size: 28px; margin: 14px 0 8px; }
.profile-bio { color: var(--muted); max-width: 600px; line-height: 1.6; }
.profile-stats { display: flex; gap: 32px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 600px; }
.profile-stats div { display: flex; flex-direction: column; }
.profile-stats strong { font-family: var(--font-display); font-size: 22px; }
.profile-stats span { color: var(--muted); font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }

.empty-state { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); }
.empty-state-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { margin: 0; font-size: 14px; }

.text-muted { color: var(--muted); }

/* Settings */
.settings-page { padding-top: 44px; }
.section-title-left { font-family: var(--font-display); text-align: left; font-size: 30px; margin: 4px 0 6px; }
.settings-intro { color: var(--muted); margin-bottom: 32px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; align-items: start; }
.settings-grid .auth-card { margin: 0; width: 100%; max-width: none; }
.settings-card-header { margin-bottom: 20px; }
.settings-card-header h2 { font-family: var(--font-display); margin: 0 0 6px; font-size: 18px; }
.settings-card-header p { margin: 0; color: var(--muted); font-size: 13px; }
.support-id-box {
    display: flex; align-items: center; gap: 10px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    flex-wrap: wrap;
}
.support-id-box span { color: var(--muted); font-family: var(--font-mono); }
.support-id-box code { color: var(--mango); word-break: break-all; }

/* Admin */
.admin-search { display: flex; gap: 10px; margin-bottom: 20px; }
.admin-search input:focus { outline: none; border-color: var(--mango); }
.admin-stats { margin-bottom: 32px; }
.admin-title { margin-top: 6px; margin-bottom: 32px; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.admin-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.admin-search input {
    flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--paper);
    padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px;
}
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { color: var(--muted); font-weight: 700; background: var(--panel-2); font-family: var(--font-mono); text-transform: uppercase; font-size: 11px; }
.admin-table tr:last-child td { border-bottom: none; }
.support-id { color: var(--muted); font-family: var(--font-mono); }
.admin-select { background: var(--panel-2); border: 1px solid var(--line); color: var(--paper); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12px; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-active { background: rgba(79, 216, 196, 0.15); color: var(--mint); }
.admin-pagination { display: flex; gap: 8px; margin-top: 20px; }
.admin-pagination a { padding: 8px 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.admin-pagination a.active { background: var(--mango); color: #1a1420; border-color: transparent; font-weight: 700; }

/* Feed */
.feed-page { padding-top: 40px; max-width: 640px; margin: 0 auto; }
.composer { margin-bottom: 28px; }
.composer textarea {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--paper);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    resize: vertical;
    outline: none;
}
.composer textarea:focus { border-color: var(--mango); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.composer-upload { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.composer-upload input { display: none; }

.feed-list { display: flex; flex-direction: column; gap: 18px; }
.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.post-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.post-author { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.post-time { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.post-content-link { display: block; }
.post-content { margin: 0 0 12px; line-height: 1.6; white-space: pre-wrap; }
.post-image { width: 100%; border-radius: var(--radius-sm); margin-bottom: 4px; }
.post-card-footer { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.post-action {
    background: transparent; border: none; color: var(--muted); font-size: 13px;
    display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm);
    font-family: var(--font-body); transition: background .15s, color .15s;
}
.post-action:hover { background: var(--panel-2); color: var(--paper); }
.post-action-active { color: var(--mango); }
.post-action-delete { margin-left: auto; }

.back-link { display: inline-block; margin-bottom: 20px; }

.comments-section { margin-top: 32px; }
.comments-title { font-family: var(--font-display); font-size: 18px; margin: 0 0 16px; }
.comment-form { margin-bottom: 24px; }
.comment-form textarea {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--paper);
    padding: 12px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px; resize: vertical; outline: none; width: 100%;
}
.comment-form textarea:focus { border-color: var(--mango); }
.comment-form .btn { margin-top: 10px; }

.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-author { font-weight: 700; font-size: 13px; }
.comment-meta time { color: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.comment-body p { margin: 0; font-size: 14px; line-height: 1.5; }

@media (max-width: 640px) {
    .feed-page { padding-left: 0; padding-right: 0; }
}

/* Toasts */
.toast {
    position: fixed; top: 20px; right: 20px; z-index: 100;
    padding: 14px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; box-shadow: var(--shadow-hard);
    animation: slideIn .3s ease, fadeOut .4s ease 3.6s forwards;
}
.toast-success { background: var(--mint); color: #06281c; }
.toast-error { background: var(--danger); color: #2a0510; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 24px; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }

.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 14px; text-align: center; padding: 24px; }
.error-code { font-family: var(--font-display); font-size: 96px; font-weight: 700; color: var(--mango); line-height: 1; }
.error-page h1 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.error-page p { color: var(--muted); margin: 0 0 12px; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero p.hero-lead { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .mix-ring { max-width: 260px; }
    .bento { grid-template-columns: 1fr; }
    .bento-main { grid-row: auto; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .stat-strip { flex-direction: column; }
    .stat-strip-item { border-right: none; border-bottom: 1px solid var(--line); }
    .stat-strip-item:last-child { border-bottom: none; }
}
