/* -------------------------------------------------------------------------- */
/* GLOBAL RESET & TYPOGRAPHY */
/* -------------------------------------------------------------------------- */
:root {
    --bg-color: #ffffff;
    --text-color: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --primary-color: #2563eb;
    /* Blue 600 */
    --primary-hover: #1d4ed8;
    --secondary-bg: #f3f4f6;
    --secondary-hover: #e5e7eb;
    --border-color: #e2e8f0;
    --font-main: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------- */
/* MAIN PAGE LAYOUT (INDEX.HTML) */
/* -------------------------------------------------------------------------- */

/* Only apply these layout styles if we are NOT on the docs page (which has its own structure) */
/* However, since docs use specific classes, we can coexist. */

/* Main Container (Centered Split Layout) */
.container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    gap: 2rem;
    padding: 2rem;
    min-height: 100vh;
    /* Centered vertically */
    margin: 0 auto;
}

/* Left Content */
.left-content {
    flex: 1;
    max-width: 450px;
    animation: fadeIn 0.8s ease-out;
    z-index: 50;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.highlight {
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 400;
}

.actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-bg);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
}

/* Right Content - ASCII Section */
.right-content {
    flex: 1.2;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Ensure height fits the ASCII block (approx 58 lines * 9px = ~522px) */
    min-height: 550px;
    overflow: visible;
    /* Prevent clipping */
}

.ascii-container {
    position: relative;
    width: 950px;
    /* Spacious container */
    height: 950px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.ascii-art {
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 9px;
    /* Square cells */
    color: #111827;
    white-space: pre;
    user-select: none;
    pointer-events: none;
    font-weight: 700;
    /* Ensure it doesn't wrap */
    min-width: max-content;
    z-index: 10;
}

/* Floating Labels */
.floating-label {
    position: absolute;
    background: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 20;
    transition: transform 0.1s ease-out;
}

.label-automate {
    top: 25%;
    left: 10%;
}

.label-refactor {
    bottom: 20%;
    left: 35%;
}

.label-understand {
    top: 55%;
    right: 5%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Main Page */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .left-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .right-content {
        min-height: 400px;
        width: 100%;
        transform: scale(0.8);
    }
}


/* -------------------------------------------------------------------------- */
/* DOCUMENTATION PAGE STYLES */
/* -------------------------------------------------------------------------- */

.docs-body {
    display: block;
    /* Override flex centered body */
    padding: 0;
    overflow-x: hidden;
    background-color: #ffffff;
}

/* Loading Overlay */
.docs-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.docs-container {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    /* Hidden initially for fade-in */
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Sidebar */
.docs-sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.nav-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.925rem;
    padding: 0.4rem 0;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-color);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Content Area */
.docs-content {
    margin-left: 260px;
    padding: 4rem 10%;
    max-width: 960px;
    width: 100%;
}

.doc-section {
    margin-bottom: 6rem;
    scroll-margin-top: 4rem;
    animation: slideUpFade 0.6s ease-out backwards;
}

/* Stagger Animations */
.doc-section:nth-child(1) {
    animation-delay: 0.2s;
}

.doc-section:nth-child(2) {
    animation-delay: 0.4s;
}

.doc-section:nth-child(3) {
    animation-delay: 0.6s;
}

.doc-section:nth-child(4) {
    animation-delay: 0.8s;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2.5rem;
}

.content-block h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-block h3 {
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #334155;
}

.content-block p {
    margin-bottom: 1.25rem;
    color: #334155;
    line-height: 1.7;
}

/* Model Cards Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.model-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    background: #ffffff;
    transition: all 0.2s ease;
}

.model-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.model-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Tag Colors */
.tag-blue {
    background: #eff6ff;
    color: #2563eb;
}

.tag-green {
    background: #f0fdf4;
    color: #16a34a;
}

.tag-purple {
    background: #faf5ff;
    color: #9333ea;
}

.tag-orange {
    background: #fff7ed;
    color: #ea580c;
}

.tag-red {
    background: #fef2f2;
    color: #dc2626;
}

.tag-cyan {
    background: #ecfeff;
    color: #0891b2;
}

.tag-yellow {
    background: #fefce8;
    color: #ca8a04;
}

.model-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.model-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: var(--font-mono);
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.alert-box {
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.alert-box h3 {
    margin-top: 0;
    color: var(--text-color);
}

.region-list {
    display: grid;
    gap: 3rem;
}

.region-group {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 2rem;
}

.region-group:last-child {
    border-bottom: none;
}

.region-group h3 {
    font-size: 0.825rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.region-group ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.region-group li {
    font-size: 0.875rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #64748b;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Documentation Mobile Support */
@media (max-width: 900px) {
    .docs-sidebar {
        display: none;
    }

    .docs-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
        width: 100%;
    }
}

/* -------------------------------------------------------------------------- */
/* TOP NAVIGATION */
/* -------------------------------------------------------------------------- */
.top-nav {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #cbd5e1;
    /* Darker, visible line */
    background: #ffffff;
    width: 100%;
}

.nav-logo {
    height: 32px;
    width: auto;
    filter: brightness(0);
    /* Black color */
    margin-right: 0.75rem;
}

.nav-brand {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 700;
    /* Thick font */
    color: var(--text-color);
    letter-spacing: -0.02em;
}