/* ============================================================
   ActSWM Project Page — Visual System
   Style direction: modern academic page (classic hero + modern tokens),
   inspired by world-model project pages (DreamDojo / DIAMOND / Web-WM).
   ============================================================ */

:root {
    /* Brand */
    --green: #2d7d46;
    --green-dark: #215c33;
    --green-soft: rgba(45, 125, 70, 0.10);
    --blue: #1a6b9c;
    --blue-soft: rgba(26, 107, 156, 0.10);

    /* Neutral text */
    --ink: #1a1a2e;
    --text: #2b2f36;
    --body: #3a3f47;
    --muted: #5f6778;
    --subtitle: #4a4f57;

    /* Surfaces */
    --bg: #ffffff;
    --bg-soft: #f7f9f8;
    --bg-light: #f4f7f5;
    --card-bg: #ffffff;

    /* Lines */
    --border: #e3e8e4;
    --border-strong: #cfdad2;

    /* Elevation */
    --shadow-sm: 0 4px 14px rgba(20, 40, 30, 0.06);
    --shadow: 0 14px 34px rgba(20, 40, 30, 0.09);

    /* Shape */
    --radius: 14px;
    --radius-sm: 9px;
    --radius-pill: 999px;

    /* Type */
    --font-serif: "Georgia", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
    --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", "Fira Code", "Roboto Mono", monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--body);
    background: var(--bg);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Anchor targets clear the sticky navbar */
[id] {
    scroll-margin-top: 78px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--ink);
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: -0.01em;
}

.hero-title {
    font-size: 3.05rem;
    font-weight: 600 !important;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.015em;
}

.hero-subtitle {
    color: var(--subtitle);
    font-size: 1.18rem;
    font-weight: 400;
    line-height: 1.55;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.hero-summary {
    color: var(--muted);
    font-size: 1.04rem;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.eyebrow {
    display: inline-block;
    color: var(--green);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--green-soft);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(45, 125, 70, 0.18);
}

.authors .list-inline-item {
    margin-right: 0.35rem;
    font-size: 1.03rem;
    font-weight: 500;
    color: var(--ink);
}
.authors .list-inline-item:not(:last-child)::after {
    content: "·";
    color: var(--muted);
    margin-left: 0.35rem;
    font-weight: 400;
}

.section-heading {
    font-family: var(--font-serif);
    padding-bottom: 0.55rem;
    border-bottom: 3px solid var(--green);
    display: inline-block;
    margin-top: 0.4rem;
}

/* ---------- Navbar ---------- */
.navbar {
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    background: rgba(255, 255, 255, 0.82) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 18px rgba(20, 40, 30, 0.04);
}

.navbar-brand {
    color: var(--green) !important;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.32rem;
    letter-spacing: 0.2px;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted) !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    color: var(--green) !important;
    background: var(--green-soft);
}

.nav-link.active {
    color: var(--green) !important;
    font-weight: 600;
    background: var(--green-soft);
}

/* ---------- Links bar (action buttons) ---------- */
.links-bar .col-md-2 a {
    display: inline-flex;
    min-width: 7.2rem;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.links-bar .col-md-2 a:hover {
    background: var(--bg-soft);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.links-bar .col-md-2 a img {
    transition: transform 0.25s ease;
}

.links-bar .col-md-2 a:hover img {
    transform: scale(1.08);
}

.links-bar .col-md-2 h5 {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--ink);
    font-size: 0.92rem;
}

/* ---------- Hero result / teaser ---------- */
.hero-result-row {
    margin-bottom: 1rem;
}

.hero-result-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.hero-result-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* Figures inside cards */
.hero-result-card img,
.card img.img-fluid {
    border-radius: var(--radius-sm);
}

/* ---------- Cards ---------- */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.card-header {
    font-family: var(--font-serif);
    font-weight: 600;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.card-body {
    color: var(--body);
}

/* ---------- Tables ---------- */
.table {
    color: var(--text);
}

.table thead th {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.88rem;
    background: var(--bg-light);
    color: var(--ink);
    border-bottom: 2px solid var(--border-strong);
}

.table td {
    font-size: 0.9rem;
    border-color: var(--border);
}

.table tbody tr:hover {
    background: var(--bg-soft);
}

.pipeline-overview-table th,
.pipeline-overview-table td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* ---------- Pipelines ---------- */
.pipeline-block {
    padding-top: 0.5rem;
}

.pipeline-gif {
    width: 100%;
    background: var(--bg-light);
    min-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ---------- Takeaway / callout ---------- */
.takeaway-box {
    font-family: var(--font-sans);
    background-color: var(--green-soft);
    border: 1px solid rgba(45, 125, 70, 0.22);
    color: var(--green-dark);
    border-left: 4px solid var(--green);
    border-radius: var(--radius-sm);
}

/* ---------- BibTeX ---------- */
#bibtexContent {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    line-height: 1.6;
}

#copyBibtex {
    z-index: 10;
}

/* ---------- Back to top ---------- */
#backToTop {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
    background-color: var(--green);
    border-color: var(--green);
    box-shadow: var(--shadow-sm);
}

#backToTop:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* ---------- Reveal / entrance ---------- */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

/* ---------- Links ---------- */
a {
    color: var(--blue);
}
a:hover {
    color: var(--green);
}

/* ---------- Selection & scrollbar ---------- */
::selection {
    background: var(--green-soft);
    color: var(--ink);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 1.08rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .authors .list-inline-item {
        display: block;
        margin-bottom: 0.3rem;
    }
    .authors .list-inline-item:not(:last-child)::after {
        content: none;
    }

    .hero-result-card {
        padding: 1rem;
    }

    .table {
        font-size: 0.78rem;
    }

    .navbar-nav {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .col-md-2.text-center h5 {
        font-size: 0.85rem;
    }
}
