/* PDF Viewer Platform — Public CSS */

:root {
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #0b0f19;
    
    --indigo-50:  #e0e7ff;
    --indigo-100: #c7d2fe;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --violet-600: #7c3aed;
    
    --accent: var(--indigo-600);
    --accent-hover: var(--indigo-700);
    --accent-gradient: linear-gradient(135deg, var(--indigo-600) 0%, var(--violet-600) 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--slate-800);
    background: #f8fafc;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Site header */
.site-header {
    background: var(--slate-900);
    color: #fff;
    padding: 1.1rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: -0.02em;
}

.site-header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-header nav a {
    color: var(--slate-300);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color .15s;
}

.site-header nav a:hover { color: #fff; }

/* Page header */
.page-header {
    padding: 3.5rem 0 2rem;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.03em;
}

.page-header p {
    color: var(--slate-500);
    margin-top: .4rem;
    font-size: 1.05rem;
}

/* Category filter navigation */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-bottom: 2rem;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: .45rem 1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--slate-200);
    color: var(--slate-600);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    transition: all .18s;
}

.category-pill:hover {
    border-color: var(--indigo-100);
    color: var(--accent);
    transform: translateY(-1px);
}

.category-pill.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
}

/* Doc grid */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding-bottom: 5rem;
}

.doc-category {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent);
    margin-bottom: .35rem;
}

.doc-category-sep {
    color: var(--slate-300);
    font-weight: 400;
}

.doc-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
}

.doc-card:hover {
    box-shadow: 0 12px 30px rgba(79,70,229,0.08), 0 2px 4px rgba(0,0,0,0.02);
    transform: translateY(-4px);
    border-color: var(--indigo-100);
}

.doc-icon {
    width: 54px;
    height: 54px;
    background: var(--indigo-50);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.doc-icon svg { width: 26px; height: 26px; }

.doc-card:hover .doc-icon {
    background: var(--accent-gradient);
    color: #fff;
}

.doc-info { overflow: hidden; }

.doc-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.doc-info p {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin-top: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.doc-views {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-400);
    background: var(--slate-50);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--slate-100);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 6rem 1rem;
    color: var(--slate-400);
    background: #fff;
    border-radius: 16px;
    border: 2px dashed var(--slate-200);
    margin-bottom: 5rem;
}

.empty-state svg { margin: 0 auto 1.25rem; display: block; color: var(--slate-300); }

.empty-state p { font-size: 1.1rem; font-weight: 500; }

/* Site footer */
.site-footer {
    background: var(--slate-900);
    color: var(--slate-400);
    padding: 2.2rem 0;
    font-size: 0.88rem;
    font-weight: 500;
    border-top: 1px solid var(--slate-800);
    margin-top: auto;
}

.site-footer a {
    color: var(--slate-300);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .page-header { padding: 2.5rem 0 1.5rem; }
    .page-header h1 { font-size: 1.8rem; }
    .doc-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 480px) {
    .page-header h1 { font-size: 1.5rem; }
    .doc-grid { grid-template-columns: 1fr; }
    .doc-card { padding: 1.25rem; }
}

/* ------------------------------------------------------------------ */
/* Motion — subtle micro-interactions                                 */
/* ------------------------------------------------------------------ */

:root {
    --ease-out:    cubic-bezier(.16,1,.3,1);
    --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.site-header {
    animation: fadeIn .5s var(--ease-out) both;
}

.logo svg, .logo { transition: opacity .15s; }
.logo:hover { opacity: .85; }

.site-header nav a {
    position: relative;
}
.site-header nav a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 2px;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s var(--ease-out);
}
.site-header nav a:hover::after { transform: scaleX(1); }

.page-header {
    animation: fadeSlideUp .55s var(--ease-out) both;
}

.doc-card {
    animation: fadeSlideUp .5s var(--ease-out) both;
}
.doc-grid .doc-card:nth-child(1) { animation-delay: .02s; }
.doc-grid .doc-card:nth-child(2) { animation-delay: .06s; }
.doc-grid .doc-card:nth-child(3) { animation-delay: .10s; }
.doc-grid .doc-card:nth-child(4) { animation-delay: .14s; }
.doc-grid .doc-card:nth-child(5) { animation-delay: .18s; }
.doc-grid .doc-card:nth-child(6) { animation-delay: .22s; }
.doc-grid .doc-card:nth-child(n+7) { animation-delay: .25s; }

.empty-state {
    animation: fadeSlideUp .6s var(--ease-out) both;
}

.empty-state svg {
    transition: transform .3s var(--ease-spring);
}
.empty-state:hover svg { transform: scale(1.05) rotate(-2deg); }

.site-footer { animation: fadeIn .6s var(--ease-out) both; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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