/* tokens.css — CSS custom properties + universal motion utilities.
   Loaded BEFORE style.css so cascade order stays unchanged. */

:root {
    /* core palette */
    --bg-color:#121212;
    --surface-color:rgba(20,20,20,0.95);
    --surface-border:#333;
    --text-primary:#e0e0e0;
    --text-secondary:#888;
    --primary-color:#00ff9d;
    --accent-color:#00ff9d;
    /* file list: leading [line-count] prefix (not green — tweak here) */
    --file-title-line-count-color:#8ec8ff;
    --file-title-line-count-color-hover:#b8dcff;
    --file-title-line-count-color-read:#6f9ec8;
    --error-color:#ff4757;
    --radius:6px;

    /* typography */
    --font-main:'Inter',sans-serif;
    --font-mono:'JetBrains Mono',monospace;

    /* glow / corner accents */
    --glow:0 0 10px rgba(0,255,157,0.2);
    --corner-line-color:rgba(0,255,157,0.72);

    /* layout / spacing */
    --content-max-width:85vw;
    --page-content-top-offset:.45rem;
    --page-toolbar-row-gap:1.5rem;
    --page-toolbar-band-min-height:2.75rem;
    --list-card-row-gap:.35rem;
    --filter-chip-height:40px;

    /* header glass / hover / press */
    --header-hover-fill:rgba(255,255,255,0.08);
    --header-hover-text:rgba(248,255,252,0.96);
    --header-hover-ms:.16s;
    --header-press-fill:rgba(255,255,255,0.11);
    --header-press-text:rgba(248,255,252,0.96);
    --header-logo-hover-fill:linear-gradient(118deg,rgba(0,255,161,0.2) 0%,rgba(44,232,255,0.14) 46%,rgba(125,247,255,0.11) 100%);
    --header-logo-press-fill:linear-gradient(118deg,rgba(0,255,161,0.26) 0%,rgba(44,232,255,0.19) 46%,rgba(125,247,255,0.14) 100%);
    --header-glass-bg:rgba(10,11,14,0.38);
    --header-glass-blur:blur(18px) saturate(1.12);
    --header-glass-edge:inset 0 0 0 1px rgba(255,255,255,0.06);
    --header-glass-drop:0 6px 28px rgba(0,0,0,0.38);

    /* press motion — buttons/chips/nav share one depth; large card hits use --ulp-press-transform-soft */
    --ulp-press-transform:scale(0.982);
    --ulp-press-transform-soft:scale(0.985);
    --ulp-press-ms:125ms;
    --ulp-press-ease:cubic-bezier(0.33,1,0.68,1);
    --ulp-press-surface-bg:rgba(255,255,255,0.07);
    --ulp-press-inset-shadow:inset 0 1px 0 rgba(255,255,255,0.1),inset 0 2px 5px rgba(0,0,0,0.2);
    --ulp-hover-lift-badge:scale(1.12);
    --ulp-hover-lift-badge-pile:scale(1.18);

    /* toolbar inset */
    --toolbar-chip-inset-top:max(0,calc((var(--page-toolbar-band-min-height) - var(--filter-chip-height)) / 2));

    /* detail card geometry */
    --detail-inner-section-gap:.75rem;
    --detail-card-pad-x:1rem;
    --detail-card-pad-top:.6rem;
    --detail-card-pad-bottom:1.1rem;
    --detail-likers-rail-gap:.5rem;
    --panel-content-inset-top:.7rem;
    --sticky-header-offset:calc(64px + 0.45rem);

    /* corner stack / toasts */
    --ulp-corner-stack-bottom:max(0.5rem,env(safe-area-inset-bottom,0));
    --ulp-corner-toast-radius:16px;
    --ulp-corner-stack-gap:.65rem;
    --ulp-corner-stack-max:min(340px,calc(100vw - 2.5rem));
    --ulp-corner-toast-max:min(340px,calc(100vw - 2.5rem));

    /* detail meta rail (24px height + border colors) */
    --detail-meta-rail-h:24px;
    --detail-meta-rail-border:rgba(255,255,255,0.05);
    --detail-meta-rail-border-hover:rgba(255,255,255,0.08);

    /* Surface fills — semantic aliases for the top repeats found across style.css.
       Use these instead of hardcoding rgba(255,255,255,0.04/0.08) and rgba(0,255,157,0.1).
       Existing :hover behaviors stay identical (values match the historical literals). */
    --surface-soft:rgba(255,255,255,0.04);
    --surface-strong:rgba(255,255,255,0.08);
    --accent-soft:rgba(0,255,157,0.1);

    /* Corner scale — prefer these over hardcoded 6–14px (see style/overrides media blocks) */
    --modern-rounded-xl:14px;
    --modern-rounded-lg:12px;
    --modern-rounded-md:10px;
    --modern-rounded-sm:8px;
    --modern-rounded-inset:calc(var(--modern-rounded-md) - 2px);
    /* List rows (.file-item / .resource-item) and file/resource detail shell share one radius */
    --list-card-radius:var(--modern-rounded-md);
    /* Meta rail chips on list cards: Admin, stats group, time, category, #tags */
    --meta-chip-radius:var(--modern-rounded-sm);
    --shell-radius:var(--modern-rounded-lg);
    --unified-shell-radius:var(--modern-rounded-lg);

    /* VIP: rich gold / amber (gem gradient, chips, captions) */
    --vip-icon-grad:linear-gradient(128deg,#fffbeb 0%,#fef3c7 12%,#fde68a 28%,#f5c542 48%,#eab308 68%,#d97706 86%,#fbbf24 100%);
    --vip-caption-color:#fff1c9;
    --vip-caption-color-strong:#fffbeb;
    --vip-caption-border:rgba(251,191,36,0.5);
    --vip-caption-glow:rgba(245,197,66,0.42);
    --vip-caption-glow-aqua:rgba(252,211,77,0.22);
    --vip-caption-surface:linear-gradient(135deg,rgba(255,236,180,0.2) 0%,rgba(245,197,66,0.12) 45%,rgba(146,64,14,0.14) 100%)
}

/* Universal press motion — JS adds .press-feedback; :is() covers native :active gaps */
.press-feedback {
    transition:transform var(--ulp-press-ms) var(--ulp-press-ease) !important;
    transform:var(--ulp-press-transform) !important
}

:is(.mobile-toggle,.mobile-nav-item,.nav-item,.nav-btn,.nav-btn-icon,.filter-chip,.site-page-btn,.ulp-online-dot-btn,.chat-btn,.chat-header-btn,.chat-composer-btn,.clear-all-btn,.header-search-clear,.action-btn,.action-icon-btn,.reply-btn,.edit-btn,.like-btn-container,.ulp-like-likers__heart-hit,.discussion-like-toggle,.forum-post-like-toggle,.crypto-currency-btn,.modal-close-btn,.adm-btn,.adm-btn-icon,.adm-nav-item,.adm-page-btn,a.forum-category-card,.list-card-hit,.forum-topic-list-card-hit,.forum-modern-cat-link,.profile-quick-btn,.profile-bg-action-btn,.profile-avatar-delete-btn,.profile-avatar-overlay,.profile-showcase-tile,.group-badge,.chat-msg-act-btn,.file-upload-preview-remove-btn,.notification-view-all-link,.data-item,.vip-plan-btn,.forum-cat-back,.detail-seg-btn,.file-custom-btn,.forum-topic-mod-apply,.forum-topic-cat-flydown-link,.discussion-composer-cancel-btn,.forum-new-topic-prefix-chip,.forum-prefix-filter-banner__clear,.rich-editor-send-btn,.forum-topic-reply-btn,.bulk-bar-forum-btn,.btn,.btn.btn-toolbar,.edit-content-staff-toggle,.ulp-press-soft):active:not(:disabled):not([disabled]):not(.disabled) {
    transition:transform var(--ulp-press-ms) var(--ulp-press-ease);
    transform:var(--ulp-press-transform)
}

/* Same depth when JS adds .press-feedback (pointer/touch); cancels local hover-scale jumps. */
:is(.action-icon-btn,.group-badge,.profile-bg-action-btn,.profile-avatar-delete-btn,.profile-avatar-overlay,.profile-showcase-tile,.btn,.btn.btn-toolbar,.edit-content-staff-toggle,.filter-chip).press-feedback:not(:disabled):not([disabled]):not(.disabled) {
    transition:transform var(--ulp-press-ms) var(--ulp-press-ease) !important;
    transform:var(--ulp-press-transform) !important
}
