/* Base styles - Professional Academic Design */
:root {
    /* Color System - Orange theme */
    --accent-primary: #d97706;
    /* Amber/Orange - warm and professional */
    --accent-secondary: #b45309;
    /* Dark orange for emphasis */
    --accent-light: #f59e0b;
    /* Light orange for highlights */
    --text-primary: #1a1a1a;
    /* Rich black */
    --text-secondary: #4a4a4a;
    /* Medium gray */
    --text-muted: #6b6b6b;
    /* Light gray */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-accent: #fffbeb;
    /* Subtle orange tint */
    --border-subtle: #e0e0e0;
    --border-emphasis: #d0d0d0;
    --code-bg: #f8f8f8;
    /* VSCode-inspired */

    /* CKA-Agent Specific */
    --cka-primary: #786fa6;
    --cka-secondary: #786fa6;
    --cka-accent: #786fa6;
    --warning-red: #dc3545;
    --warning-bg: #fff3cd;
    --warning-border: #ffc107;

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 260px;
    --content-max-width: 1200px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

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

/* Typography - System fonts for professional look */
body {
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.7;
    color: var(--text-primary);
    background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
    height: 100vh;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings - Sans-serif for contrast */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    margin-top: 3rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

/* Code blocks - Monospace */
code,
pre {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    background: var(--code-bg);
    border-radius: 4px;
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease, border-bottom 0.2s ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: var(--accent-secondary);
    border-bottom: 1px solid var(--accent-secondary);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Site layout */
.site-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar styles - Clean academic look */
.sidebar-nav {
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, rgba(248, 248, 248, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0, 0, 0, 0.02) 40px, rgba(0, 0, 0, 0.02) 80px);
    backdrop-filter: blur(10px);
    padding: 24px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.logo a {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 48px;
    font-size: 1.1rem;
    font-family: ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -0.01em;
    border-bottom: none;
}

.logo a:hover {
    color: var(--accent-primary);
    border-bottom: none;
}

.logo svg {
    margin-right: 8px;
}

.side-nav {
    margin-bottom: 40px;
    flex-grow: 1;
}

.side-nav h3 {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.side-nav ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-nav a {
    font-size: 15px;
    font-weight: 500;
    font-family: ui-sans-serif, system-ui, sans-serif;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
    display: block;
    color: var(--text-secondary);
    border-bottom: none;
}

.side-nav a:hover {
    background-color: var(--bg-accent);
    color: var(--accent-primary);
    transform: translateX(4px);
    border-bottom: none;
}

.side-nav a.active {
    background-color: var(--bg-accent);
    color: var(--accent-primary);
    font-weight: 600;
    border-left: 3px solid var(--accent-primary);
    padding-left: 9px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-link {
    font-size: 14px;
    font-weight: 500;
    font-family: ui-sans-serif, system-ui, sans-serif;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    color: var(--accent-primary);
}

/* Main content area */

/* Main content styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* Hero section - Academic paper style */
.hero {
    padding: 96px 0 72px;
    text-align: center;
    background:
        radial-gradient(ellipse at top, rgba(200, 16, 46, 0.03) 0%, transparent 60%),
        linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

.hero .container {
    display: block;
    max-width: 900px;
}

.date-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 36px;
    opacity: 0;
    animation: fade-in 0.6s ease 0.2s forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date {
    font-size: 15px;
    color: var(--text-muted);
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.tag {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 600;
    font-family: ui-sans-serif, system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    background-color: var(--bg-accent);
    border-radius: 4px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 28px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.03em;
    opacity: 0;
    animation: fade-in 0.6s ease 0.4s forwards;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 48px;
    line-height: 1.6;
    opacity: 0;
    animation: fade-in 0.6s ease 0.6s forwards;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--accent-primary);
    color: white;
    font-weight: 600;
    font-family: ui-sans-serif, system-ui, sans-serif;
    padding: 14px 32px;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
    opacity: 0;
    animation: fade-in 0.6s ease 0.8s forwards;
}

.cta-button:hover {
    background-color: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.3);
    border-bottom: none;
}

/* Authors section */
.authors-section {
    margin: 28px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.authors-meta {
    max-width: 100%;
    margin: 0 auto;
}

.authors-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.authors-list {
    font-size: 1rem;
    margin-bottom: 12px;
    line-height: 2;
}

.author {
    font-weight: 500;
    color: var(--text-primary);
    display: inline-block;
    margin-right: 4px;
}

.author a {
    color: var(--text-primary);
    border-bottom: 1px dotted var(--border-emphasis);
    transition: all 0.2s ease;
}

.author a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.author-affiliation {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.equal-contribution {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
}

.corresponding-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

.author-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
}

/* Project links */
.project-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--border-emphasis);
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.project-link:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.project-link.github:hover {
    background-color: #24292e;
    border-color: #24292e;
}

.project-link.arxiv:hover {
    background-color: #b31b1b;
    border-color: #b31b1b;
}

.project-link.cite:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.project-link i {
    font-size: 1.1em;
}

/* Abstract styling */
.article-abstract {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 100%;
    margin: 0 auto;
    text-align: justify;
    padding: 0;
}

.article-abstract strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.cta-button:hover {
    background-color: #0c678b;
}

.cta-button span {
    margin-left: 8px;
}

/* Content section */
.content {
    padding: 40px 0 80px;
}

.content .container {

    /* Content sections - Professional academic layout */
    .content-section {
        padding: 72px 0;
        scroll-margin-top: 80px;
        opacity: 0;
        animation: fade-in 0.8s ease forwards;
        animation-delay: 0.2s;
    }

    .content-section:nth-child(even) {
        background:
            repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(0, 0, 0, 0.01) 80px, rgba(0, 0, 0, 0.01) 160px),
            linear-gradient(to bottom, #fafafa, #ffffff);
    }

    .text-content {
        font-size: 17px;
        max-width: 75ch;
        /* Optimal reading width */
        margin: 0 auto;
        line-height: 1.75;
    }

    .text-content p {
        margin-bottom: 1.5em;
        text-align: justify;
        hyphens: auto;
    }

    .text-content h2 {
        font-size: 2rem;
        font-weight: 700;
        margin: 3rem 0 1.5rem;
        scroll-margin-top: 80px;
        color: var(--accent-primary);
        border-bottom: 2px solid var(--border-subtle);
        padding-bottom: 0.5rem;
    }

    .text-content h3 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 2rem 0 1rem;
        color: var(--text-primary);
    }

    .note {
        font-style: italic;
        color: var(--text-muted);
        font-size: 15px;
        padding: 16px 20px;
        background-color: var(--bg-accent);
        border-left: 4px solid var(--accent-primary);
        border-radius: 4px;
        margin: 24px 0;
    }

    .feature-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin: 32px 0;
        scroll-margin-top: 80px;
    }

    .feature-button {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
        padding: 10px 20px;
        font-size: 15px;
        font-weight: 500;
        font-family: ui-sans-serif, system-ui, sans-serif;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .feature-button:hover {
        background-color: var(--bg-accent);
        border-color: var(--accent-primary);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .feature-button.active {
        background-color: var(--accent-primary);
        color: white;
        border-color: var(--accent-primary);
    }

    .demo-image {
        margin: 40px 0;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: var(--shadow-md);
        transition: box-shadow 0.3s ease;
    }

    .demo-image:hover {
        box-shadow: var(--shadow-lg);
    }

    .demo-caption {
        padding: 20px;
        background-color: var(--bg-secondary);
        border-top: 2px solid var(--border-subtle);
    }

    .demo-caption p {
        margin: 0;
        font-size: 15px;
        color: var(--text-secondary);
        font-family: ui-sans-serif, system-ui, sans-serif;
    }

    /* Highlights grid - Cards with subtle depth */
    .highlights-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
        margin: 48px 0;
    }

    .highlight-card {
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 248, 248, 0.9) 100%),
            repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.01) 10px, rgba(0, 0, 0, 0.01) 20px);
        border: 1px solid var(--border-subtle);
        border-radius: 8px;
        padding: 32px;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .highlight-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.3s ease;
    }

    .highlight-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
        border-color: var(--accent-primary);
    }

    .highlight-card:hover::before {
        transform: scaleX(1);
    }

    .highlight-icon {
        font-size: 2rem;
        margin-bottom: 16px;
        opacity: 0.9;
    }

    .highlight-card h3 {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 12px;
        color: var(--text-primary);
    }

    .highlight-card p {
        font-size: 15px;
        line-height: 1.6;
        color: var(--text-secondary);
        margin: 0;
    }

    /* Algorithm/Method boxes */
    .algorithm-box {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-subtle);
        border-left: 4px solid var(--accent-primary);
        border-radius: 6px;
        padding: 24px 28px;
        margin: 32px 0;
        transition: all 0.3s ease;
    }

    .algorithm-box:hover {
        background-color: var(--bg-accent);
        box-shadow: var(--shadow-sm);
        transform: translateX(4px);
    }

    .algorithm-box h3 {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 16px;
        color: var(--accent-primary);
    }

    .algorithm-box p {
        margin-bottom: 12px;
        line-height: 1.65;
    }

    .algorithm-box p:last-child {
        margin-bottom: 0;
    }

    .algorithm-box strong {
        color: var(--text-primary);
        font-weight: 600;
    }

    /* Sidebar */
    .sidebar {
        width: 28%;
        min-width: 240px;
    }

    .sidebar-links {
        position: sticky;
        top: 20px;
        background-color: var(--light-gray);
        padding: 20px;
        border-radius: 8px;
    }

    .sidebar-links h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 16px;
    }

    .sidebar-links ul {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .sidebar-links a {
        font-size: 15px;
        color: var(--secondary-text-color);
        transition: color 0.2s;
    }

    .sidebar-links a:hover {
        color: var(--primary-color);
    }

    /* Footer */
    footer {
        background-color: var(--light-gray);
        padding: 48px 0 24px;
    }

    .footer-content {
        display: flex;
        justify-content: space-between;
        margin-bottom: 24px;
    }

    .footer-links {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .footer-social {
        display: flex;
        gap: 20px;
    }

    .social-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--secondary-text-color);
        transition: color 0.2s;
        font-size: 24px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.03);
    }

    .social-icon:hover {
        color: var(--primary-color);
        background-color: rgba(0, 0, 0, 0.05);
    }

    .footer-link {
        font-size: 16px;
        font-weight: 500;
        color: var(--secondary-text-color);
        transition: color 0.2s;
    }

    .footer-link:hover {
        color: var(--primary-color);
    }

    .footer-bottom {
        padding-top: 24px;
        border-top: 1px solid var(--border-color);
        font-size: 14px;
        color: var(--secondary-text-color);
        text-align: center;
    }

    /* Responsive styles */
    @media (max-width: 1024px) {
        .content .container {
            flex-direction: column;
        }

        .text-content {
            max-width: 100%;
        }

        .sidebar {
            width: 100%;
            margin-top: 20px;
        }
    }

    @media (max-width: 768px) {
        .site-wrapper {
            flex-direction: column;
        }

        .sidebar-nav {
            width: 100%;
            height: auto;
            position: relative;
            padding: 15px;
        }

        .main-content {
            margin-left: 0;
            width: 100%;
        }

        .hero h1 {
            font-size: 36px;
        }

        .footer-content {
            flex-direction: column;
        }

        .footer-links {
            flex-direction: column;
            gap: 32px;
        }

        .footer-bottom {
            flex-direction: column;
            gap: 16px;
            align-items: flex-start;
        }
    }

    /* ========== Motivation Animation Styles ========== */
    .motiv-edge {
        stroke: #7b86a2;
        stroke-width: 2.2;
        opacity: 0.8;
        transition: opacity 0.5s ease, stroke 0.5s ease;
    }

    .motiv-edge.motiv-dim {
        opacity: 0.25;
    }

    .motiv-edge.motiv-glow {
        stroke: #ffd166;
        filter: drop-shadow(0 0 6px #ffd16666);
    }

    .motiv-pulse {
        animation: motiv-pulse-anim 1.8s ease-in-out infinite;
        transform-origin: center;
    }

    @keyframes motiv-pulse-anim {
        0% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.08);
        }

        100% {
            transform: scale(1);
        }
    }

    .motiv-flow {
        stroke: #ffd166;
        stroke-width: 3;
        fill: none;
        stroke-linecap: round;
        stroke-dasharray: 1 500;
        stroke-dashoffset: 500;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .motiv-flow.motiv-active {
        animation: motiv-dash 1.8s ease forwards;
        opacity: 1;
    }

    @keyframes motiv-dash {
        to {
            stroke-dashoffset: 0;
        }
    }

    .motiv-fade {
        opacity: 0;
        transition: opacity 0.6s ease;
    }

    .motiv-fade.motiv-show {
        opacity: 1;
    }

    .animation-container button:hover {
        background: #b45309 !important;
        transform: translateY(-1px);
        transition: all 0.2s ease;
    }

    /* Responsive Design */
    @media (max-width: 1024px) {
        .sidebar-nav {
            width: 220px;
        }

        .main-content {
            margin-left: 220px;
            width: calc(100% - 220px);
        }

        .hero h1 {
            font-size: 2.75rem;
        }
    }

    @media (max-width: 768px) {
        .sidebar-nav {
            display: none;
        }

        .main-content {
            margin-left: 0;
            width: 100%;
        }

        .hero {
            padding: 60px 0 48px;
        }

        .hero h1 {
            font-size: 2.25rem;
        }

        .subtitle {
            font-size: 1.1rem;
        }

        .highlights-grid {
            grid-template-columns: 1fr;
        }
    }

    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }

    /* Selection styles */
    ::selection {
        background-color: rgba(200, 16, 46, 0.2);
        color: var(--text-primary);
    }

    /* Focus styles for accessibility */
    *:focus-visible {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }

    /* Reduce motion for accessibility */
    @media (prefers-reduced-motion: reduce) {

        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}