/* ═══════════════════════════════════════════════════════════════════════════
   site.css — shared native dark theme (tokens, header, modals, footer).
   Pages opt in with <html class="native-dark"> and load this after claude.css.
   Every rule is scoped to html.native-dark so pages still on the inverted
   theme are untouched. Page-specific styles live in home.css, category.css.
   ═══════════════════════════════════════════════════════════════════════════ */

html.native-dark {
    --bg:        #0a0a0c;
    --surface:   #141418;
    --surface-2: #1b1b21;
    --surface-3: #25252c;
    --line:      rgba(255, 255, 255, 0.07);
    --line-2:    rgba(255, 255, 255, 0.13);
    --text:      #f4f4f6;
    --text-2:    #a9a9b4;
    --text-3:    #72727e;

    --c-anime:  #f472b6;
    --c-game:   #60a5fa;
    --c-movie:  #a78bfa;
    --c-tvshow: #fbbf24;

    --radius:    14px;
    --font:      'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
    --header-h:  64px;

    color-scheme: dark;
    background: var(--bg);
}

html.native-dark body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

html.native-dark button,
html.native-dark input {
    font-family: inherit;
}

html.native-dark ::selection { background: rgba(167, 139, 250, 0.35); }


/* ── Header ─────────────────────────────────────────────────────────────── */
html.native-dark header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 32px;
    background: rgba(10, 10, 12, 0.78);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--line);
}

html.native-dark .logo img { height: 40px; }

html.native-dark #page-tabs {
    padding: 0;
    border: 0;
    justify-content: flex-start;
    gap: 2px;
}

html.native-dark .page-tab {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    padding: 8px 14px;
    border-radius: 999px;
}

html.native-dark .page-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

html.native-dark .page-tab.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

html.native-dark .auth-buttons {
    margin-left: auto;
    align-items: center;
    gap: 8px;
}

html.native-dark .btn-login,
html.native-dark .btn-signup {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 999px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

html.native-dark .btn-login {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line-2);
}

html.native-dark .btn-login:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

html.native-dark .btn-signup {
    color: #0a0a0c;
    background: #fff;
    border: 1px solid #fff;
}

html.native-dark .btn-signup:hover {
    background: #e4e4e7;
    border-color: #e4e4e7;
}

/* Signed-in user menu */
html.native-dark .user-menu-trigger {
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    color: var(--text);
    box-shadow: none;
    padding: 7px 14px;
}

html.native-dark .user-menu-trigger:hover {
    background: var(--surface-3);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

html.native-dark .user-dropdown {
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

html.native-dark .user-dropdown-item { color: var(--text); }
html.native-dark .user-dropdown-item:hover { background: var(--surface-3); }
html.native-dark .user-dropdown-logout { border-top-color: var(--line); color: #f87171; }
html.native-dark .user-dropdown-logout:hover { background: rgba(248, 113, 113, 0.1); color: #fca5a5; }

/* ── Category tags (dark variants) ──────────────────────────────────────── */
html.native-dark .tag {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border: 1px solid transparent;
}

html.native-dark .tag.game   { background: rgba(96, 165, 250, 0.16);  color: #93c5fd; border-color: rgba(96, 165, 250, 0.3); }
html.native-dark .tag.anime  { background: rgba(244, 114, 182, 0.16); color: #f9a8d4; border-color: rgba(244, 114, 182, 0.3); }
html.native-dark .tag.movie  { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; border-color: rgba(167, 139, 250, 0.3); }
html.native-dark .tag.tvshow { background: rgba(251, 191, 36, 0.14);  color: #fcd34d; border-color: rgba(251, 191, 36, 0.3); }
html.native-dark .tag.oped   { background: rgba(255, 255, 255, 0.08); color: var(--text-2); border-color: var(--line-2); }

/* ── Modals ─────────────────────────────────────────────────────────────── */
html.native-dark .modal {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
}

html.native-dark .modal-box {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

html.native-dark .modal-box h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

html.native-dark .modal-box label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
}

html.native-dark .modal-box input {
    background: var(--bg);
    border: 1px solid var(--line-2);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    padding: 11px 14px;
}

html.native-dark .modal-box input:focus { border-color: rgba(255, 255, 255, 0.4); }
html.native-dark .modal-box input::placeholder { color: var(--text-3); }

html.native-dark .modal-submit {
    background: #fff;
    color: #0a0a0c;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
}

html.native-dark .modal-submit:hover { background: #e4e4e7; }
html.native-dark .modal-submit:disabled { opacity: 0.6; cursor: default; }
html.native-dark .modal-close { color: var(--text-3); }
html.native-dark .modal-close:hover { color: var(--text); }
html.native-dark .modal-switch { color: var(--text-3); font-size: 0.82rem; }
html.native-dark .modal-switch a { color: var(--text); font-weight: 600; }
html.native-dark .auth-error { color: #f87171; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
html.native-dark .site-footer {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    margin-top: 0;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 0.8rem;
    text-align: left;
}

html.native-dark .footer-logo { height: 28px; opacity: 0.7; }

html.native-dark .footer-links {
    display: flex;
    gap: 20px;
    padding: 0;
    border: 0;
    margin-right: auto;
}

html.native-dark .footer-links a {
    color: var(--text-2);
    text-decoration: none;
}

html.native-dark .footer-links a:hover { color: var(--text); }

/* ── Focus rings ────────────────────────────────────────────────────────── */
html.native-dark :is(a, button, input):focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* ── Composer cards (Composers tab, profile Following tabs) ────────────── */
html.native-dark .cd-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
}

html.native-dark .cd-dot[data-cat="anime"]  { background: var(--c-anime); }
html.native-dark .cd-dot[data-cat="game"]   { background: var(--c-game); }
html.native-dark .cd-dot[data-cat="movie"]  { background: var(--c-movie); }
html.native-dark .cd-dot[data-cat="tvshow"] { background: var(--c-tvshow); }

html.native-dark .cd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 28px 20px;
}

html.native-dark .cd-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 22px 16px;
}

html.native-dark .cd-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    padding: 18px 12px 16px;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}

html.native-dark .cd-card:hover { background: var(--surface); }

html.native-dark .cd-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 14px;
    background: var(--surface-2);
    box-shadow: 0 0 0 1px var(--line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html.native-dark .cd-grid-compact .cd-avatar { width: 92px; height: 92px; margin-bottom: 12px; }

/* Initial shown until a photo loads */
html.native-dark .cd-avatar::before {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-3);
}

html.native-dark .cd-avatar.has-img::before { content: none; }

html.native-dark .cd-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

html.native-dark .cd-card:hover .cd-avatar {
    transform: scale(1.04);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line-2);
}

html.native-dark .cd-name {
    max-width: 100%;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    overflow-wrap: break-word;
    hyphens: auto;
}

html.native-dark .cd-works {
    max-width: 100%;
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html.native-dark .cd-dots {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

html.native-dark .cd-card.is-skeleton .cd-avatar,
html.native-dark .cd-skel {
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: cdShimmer 1.3s ease-in-out infinite;
}

html.native-dark .cd-card.is-skeleton .cd-avatar::before { content: none; }
html.native-dark .cd-skel { width: 70%; height: 12px; border-radius: 6px; }

@keyframes cdShimmer {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    html.native-dark .cd-card { padding: 12px 6px; }
    html.native-dark .cd-grid-compact .cd-avatar { width: 72px; height: 72px; }
    html.native-dark .cd-avatar { width: 96px; height: 96px; }
    html.native-dark .cd-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    html.native-dark .cd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    html.native-dark { --header-h: auto; }

    html.native-dark header {
        position: static;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
        flex-wrap: wrap;
    }

    html.native-dark .logo img { height: 32px; }
    html.native-dark .auth-buttons { gap: 6px; }
    html.native-dark .btn-login,
    html.native-dark .btn-signup { padding: 7px 14px; font-size: 0.8rem; }
    html.native-dark .page-tab { padding: 7px 12px; font-size: 0.82rem; }

    html.native-dark .site-footer {
        flex-wrap: wrap;
        gap: 14px 20px;
        padding: 24px 16px;
    }
}
