/* ============================================================
   ALX FFF — Research / Publications (Open Library)
   Same design language as the whole platform.
   ============================================================ */
:root {
    --bg-dark: #050A14;
    --bg-card: #0C1015;
    --bg-alt: #0A0E16;
    --primary: #00D2FF;
    --secondary: #B026FF;
    --border: #2A3645;
    --text-light: #E8EEF5;
    --text-gray: #9AA7B8;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-dark);
    color: var(--text-gray);
    font-family: 'Outfit', sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
}

img { max-width: 100%; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== Minimal navbar ===== */
.j-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 20px;
    background: rgba(5, 10, 20, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.j-logo { color: var(--text-light); font-size: 1.4rem; font-weight: 800; white-space: nowrap; text-decoration: none; }
.j-logo span { color: var(--primary); }
.j-nav-actions { display: flex; align-items: center; gap: 14px; }
.j-nav-actions a { text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.j-back { color: var(--text-gray); transition: 0.3s; white-space: nowrap; }
.j-back:hover { color: var(--primary); }
.j-chat { color: var(--text-gray); transition: 0.3s; white-space: nowrap; }
.j-chat:hover { color: var(--primary); }
.j-login { background: var(--primary); color: #000; padding: 8px 16px; border-radius: 5px; font-weight: 600; transition: 0.3s; white-space: nowrap; }
.j-login:hover { box-shadow: 0 0 15px var(--primary); }

/* ===== Hero ===== */
.j-hero {
    min-height: 88vh;
    display: flex; align-items: center; justify-content: center; text-align: center;
    position: relative; overflow: hidden;
    padding: 120px 22px 80px;
}
.j-hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: url('../../assets/alxfff_cover.webp');
    background-size: cover; background-position: center;
    opacity: 0.14; filter: saturate(0.8);
}
.j-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-dark) 82%);
}
.hero-inner { position: relative; z-index: 2; max-width: 860px; }
.hero-eyebrow {
    color: var(--secondary); font-size: 0.85rem; font-weight: 600;
    letter-spacing: 3px; text-transform: uppercase; margin-bottom: 22px;
}
.j-hero h1 {
    color: var(--text-light); font-size: clamp(2.4rem, 6.5vw, 4.4rem);
    font-weight: 800; line-height: 1.12; margin-bottom: 24px;
}
.glow { color: var(--primary); text-shadow: 0 0 24px rgba(0, 210, 255, 0.55); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-gray); max-width: 680px; margin: 0 auto 34px; }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.stat-chip {
    border: 1px solid var(--border); background: rgba(12, 16, 21, 0.75);
    border-radius: 10px; padding: 8px 16px; font-size: 0.92rem; color: var(--text-gray);
}
.stat-chip b { color: var(--primary); font-weight: 800; margin-right: 4px; }

/* Scroll cue */
.j-cue {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid var(--border); background: rgba(12, 16, 21, 0.6);
    z-index: 2; transition: 0.3s;
}
.j-cue::after {
    content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary);
    animation: cue-float 2.2s ease-in-out infinite;
}
.j-cue:hover { box-shadow: 0 0 18px rgba(0, 210, 255, 0.4); border-color: var(--primary); }
@keyframes cue-float { 0%, 100% { transform: translate(-50%, 0) rotate(45deg); } 50% { transform: translate(-50%, 7px) rotate(45deg); } }

/* ===== Sections ===== */
.act { max-width: 1080px; margin: auto; padding: 96px 22px 30px; }
.act-head { margin-bottom: 30px; }
.act-no {
    display: inline-block; color: var(--secondary); font-size: 0.8rem; font-weight: 600;
    letter-spacing: 3px; text-transform: uppercase; margin-bottom: 10px;
}
.act-no::after { content: ""; display: block; width: 52px; height: 2px; margin-top: 8px; background: linear-gradient(90deg, var(--secondary), transparent); }
.act-head h2 { color: var(--text-light); font-size: clamp(1.65rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; }
.sec-intro { max-width: 780px; margin-bottom: 30px; }
.two-col { display: grid; grid-template-columns: 1.08fr 1fr; gap: 44px; align-items: center; }

/* ===== Toolbar: search + chips ===== */
.toolbar { margin: 10px 0 30px; }
#pub-search {
    width: 100%; max-width: 460px; display: block;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text-light); font-family: inherit; font-size: 1rem;
    padding: 12px 16px; outline: none; transition: 0.3s;
}
#pub-search:focus { border-color: var(--primary); box-shadow: 0 0 14px rgba(0, 210, 255, 0.15); }
#pub-search::placeholder { color: var(--text-gray); opacity: 0.7; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.chip {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
    color: var(--text-gray); font-family: inherit; font-size: 0.85rem; font-weight: 500;
    padding: 7px 15px; cursor: pointer; transition: 0.25s;
}
.chip:hover { border-color: var(--primary); color: var(--text-light); }
.chip.active {
    background: rgba(0, 210, 255, 0.12); border-color: var(--primary);
    color: var(--primary); font-weight: 600;
}
.pub-count { margin-top: 14px; font-size: 0.85rem; color: var(--text-gray); opacity: 0.85; }

/* ===== Paper cards ===== */
.pub-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.pub-card {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 20px 20px 16px; transition: border-color 0.3s, transform 0.3s;
}
.pub-card:hover { border-color: rgba(0, 210, 255, 0.5); transform: translateY(-3px); }
.pub-card.live-card { border-style: dashed; }
.pub-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pub-cat {
    color: var(--secondary); font-size: 0.74rem; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
}
.oa-badge {
    flex-shrink: 0; color: #38E8A0; font-size: 0.72rem; font-weight: 600;
    border: 1px solid rgba(56, 232, 160, 0.45); border-radius: 999px; padding: 2px 10px;
    letter-spacing: 0.5px;
}
.pub-title { color: var(--text-light); font-size: 1.04rem; font-weight: 600; line-height: 1.4; }
.pub-authors { font-size: 0.87rem; }
.pub-meta { font-size: 0.8rem; color: var(--text-gray); opacity: 0.85; }
.pub-actions { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; }
.pub-link {
    color: var(--primary); text-decoration: none; font-size: 0.88rem; font-weight: 600;
    transition: 0.3s;
}
.pub-link:hover { text-shadow: 0 0 12px rgba(0, 210, 255, 0.6); }
.cite-btn {
    background: transparent; border: 1px solid var(--border); border-radius: 7px;
    color: var(--text-gray); font-family: inherit; font-size: 0.8rem; font-weight: 500;
    padding: 5px 12px; cursor: pointer; transition: 0.25s;
}
.cite-btn:hover { border-color: var(--secondary); color: var(--text-light); }
.live-date { color: var(--primary); font-size: 0.78rem; font-weight: 600; }
.live-loading { color: var(--text-gray); font-style: italic; }

/* Empty state + fallback */
.empty-state, .live-fallback { max-width: 640px; }
.live-fallback p { margin-bottom: 18px; }

/* ===== Lab card ===== */
.lab-card {
    background: linear-gradient(160deg, rgba(0, 210, 255, 0.07), rgba(176, 38, 255, 0.07)), var(--bg-card);
    border: 1px solid var(--border); border-radius: 16px; padding: 30px 26px;
}
.lab-card h4 { color: var(--text-light); font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.lab-card p { font-size: 0.9rem; margin-bottom: 20px; }

/* ===== Buttons ===== */
.btn-solid, .btn-outline {
    display: inline-block; padding: 11px 24px; border-radius: 8px;
    font-weight: 600; text-decoration: none; transition: 0.3s; font-size: 0.95rem;
}
.btn-solid { background: var(--primary); color: #000; }
.btn-solid:hover { box-shadow: 0 0 18px var(--primary); }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: transparent; font-family: inherit; cursor: pointer; }
.btn-outline:hover { background: rgba(0, 210, 255, 0.1); box-shadow: 0 0 14px rgba(0, 210, 255, 0.25); }

/* ===== Toast (citation copied) ===== */
.toast {
    position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
    background: var(--bg-card); color: var(--text-light);
    border: 1px solid var(--primary); border-radius: 10px;
    padding: 11px 22px; font-size: 0.9rem; font-weight: 500;
    opacity: 0; pointer-events: none; transition: 0.35s; z-index: 1300;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Footer ===== */
.j-footer {
    border-top: 1px solid var(--border); margin-top: 90px;
    padding: 30px 22px; text-align: center; font-size: 0.9rem;
    display: flex; flex-direction: column; gap: 10px;
}
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; }
.foot-links a { color: var(--text-gray); text-decoration: none; transition: 0.3s; }
.foot-links a:hover { color: var(--primary); }

/* ===== Reveal on scroll (same pattern as the whole platform) ===== */
.reveal-init { opacity: 0; transform: translateY(26px); }
.reveal-init.reveal-visible { opacity: 1; transform: translateY(0); transition: opacity 0.7s ease, transform 0.7s ease; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
    .two-col { grid-template-columns: 1fr; gap: 28px; }
    .pub-grid { grid-template-columns: 1fr; }
    .act { padding: 70px 18px 20px; }
    .j-hero { min-height: 78vh; }
}
@media (max-width: 560px) {
    .j-nav-actions { gap: 9px; }
    .j-nav-actions a { font-size: 0.82rem; }
    .j-login { padding: 7px 11px; }
    .j-back { display: none; }
    .hero-stats { gap: 8px; }
    .stat-chip { padding: 7px 12px; font-size: 0.84rem; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal-init { opacity: 1; transform: none; transition: none; }
    .j-cue::after { animation: none; }
    * { transition: none !important; }
}
