:root {
    --primary-color: #00A98F;
    --primary-color-dark: #008f79;
    --background-color: #FFFFFF;
    --section-highlight-bg: #F8F9FA;
    --text-color: #343A40;
    --text-color-light: #6C757D;
    --heading-color: #212529;
    --border-color: #DEE2E6;
    --code-bg: #1e1e1e;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: var(--heading-color);
    font-weight: 700;
}

p {
    color: var(--text-color-light);
}

/* --- Navigation Bar --- */
.main-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--heading-color);
    font-weight: 600;
    font-size: 1.2rem;
}
.logo-img {
    width: 32px;
    height: 32px;
}
.nav-links {
    display: flex;
    gap: 25px;
}
.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a svg { flex-shrink: 0; }
.nav-links a:hover {
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(150deg, #e6f9f7, #f0fdfa);
    padding: 80px 0;
    text-align: center;
}
h1 {
    font-size: 3rem;
    line-height: 1.2;
    max-width: 800px;
    margin: 0 auto 20px;
}
.hero-pills {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 28px;
    flex-wrap: wrap;
}
.hero-pill {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color-dark);
    background: rgba(0, 169, 143, 0.08);
    border: 1px solid rgba(0, 169, 143, 0.25);
    border-radius: 20px;
    letter-spacing: 0.01em;
}
.subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 12px;
}
.hero-tagline {
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 40px;
    color: var(--text-color-light);
    font-weight: 400;
}

/* --- Buttons --- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}
.button-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 169, 143, 0.2);
}
.button-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 169, 143, 0.2);
}
.button-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.button-secondary:hover {
    border-color: var(--text-color);
    background-color: #f8f9fa;
}
.button-large { padding: 14px 28px; font-size: 1.1rem; }
.button-small { padding: 8px 16px; font-size: 0.9rem; }

/* --- Interactive Demo Section --- */
.interactive-demo { padding: 80px 0; }
.code-viewer-container {
    background: var(--code-bg);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    overflow: hidden;
}
.code-panes {
    display: flex;
    border-bottom: 1px solid #333;
}
.code-pane {
    position: relative;
    flex: 1;
    min-width: 0;
}
.code-pane:first-child {
    border-right: 1px solid #333;
}
/* Pane labels */
.pane-label {
    padding: 10px 15px 0;
    background: #2a2a2a;
}
.pane-label-title {
    display: block;
    color: #bbb;
    font-size: 1.0rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.pane-label-subtitle {
    display: block;
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 3px;
}

.tabs {
    padding: 10px 15px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
}
.tab-button {
    background: none;
    border: 1px solid transparent;
    color: #888;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-family);
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-button.active {
    color: white;
    background: #444;
}
.tab-button:hover:not(.active) {
    background: #383838;
    color: #ccc;
}
.code-content {
    padding: 15px;
    height: 350px;
    overflow: auto;
}
.console-header {
    background: #2d2d2d;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
    color: #888;
    font-size: 12px;
}
.console-body {
    background: var(--code-bg);
    padding: 15px;
    overflow: auto;
    flex-grow: 1;
}
.code-content pre, .code-content code {
    margin: 0;
    height: 100%;
    font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
    color: #d4d4d4;
}
.code-content pre code .comment {
    color: #858585;
    font-style: italic;
}
.preview-pane {
    background-color: #fff;
    overflow: hidden;
}
.preview-pane.collapsed {
    display: none;
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 15px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}
.preview-label {
    font-size: 0.78rem;
    color: #888;
    font-weight: 500;
}
.preview-expand-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-family: var(--font-family);
    transition: all 0.2s;
}
.preview-expand-btn:hover {
    border-color: #999;
    color: #333;
    background: #e8e8e8;
}
.preview-content {
    position: relative;
    height: 500px;
    overflow: hidden;
}
.preview-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.preview-spinner.active {
    display: flex;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner-text {
    font-size: 0.78rem;
    color: #999;
}
.preview-pane iframe {
    border: none;
    transform-origin: 0 0;
    opacity: 0;
    transition: opacity 0.3s;
    /* scale set dynamically per pipeline tab via JS */
}
.preview-pane iframe.loaded {
    opacity: 1;
}
/* Python Syntax Highlighting */
code .keyword { color: #C586C0; }
code .string { color: #CE9178; }
code .comment { color: #6A9955; }
code .function { color: #DCDCAA; }
code .class { color: #4EC9B0; }
code .number { color: #B5CEA8; }
code .decorator { color: #D7BA7D; }
code .operator { color: #d4d4d4; }

/* Typewriter cursor */
code.typing::after {
    content: '\258C';
    color: #d4d4d4;
    animation: blink-cursor 0.6s step-end infinite;
    font-weight: 100;
}
@keyframes blink-cursor {
    50% { opacity: 0; }
}

/* Fullscreen overlay */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.fullscreen-overlay.active {
    display: flex;
}
.fullscreen-content {
    width: 95vw;
    height: 92vh;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
}
.fullscreen-overlay iframe {
    border: none;
    background: white;
    transform-origin: 0 0;
}
.fullscreen-close {
    position: absolute;
    top: 10px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}
.fullscreen-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* --- General Sections --- */
.section { padding: 80px 0; }
.section-highlight { background-color: var(--section-highlight-bg); }
.section-header {
    text-align: center;
    margin-bottom: 60px;
}
.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.section-header p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* --- Modules Section --- */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}
.module-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.2s ease;
}
.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
    border-color: #ccc;
}
.module-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.module-header i {
    color: var(--primary-color);
}
.module-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.module-classes {
    margin-bottom: 15px;
    line-height: 2.2;
}
.module-classes code {
    background: var(--section-highlight-bg);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.85rem;
    color: var(--text-color);
    white-space: nowrap;
    margin-right: 8px;
}
.module-card p {
    font-size: 1rem;
    margin-bottom: 20px;
}
.module-card-more {
    grid-column: 1 / -1;
    border-style: dashed;
    border-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 25px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}
.module-card-more:hover {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border-color: var(--primary-color);
}
.module-more-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}
.module-more-content i {
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.module-more-content h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    white-space: nowrap;
}
.module-more-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    text-align: left;
}
.module-more-content .button {
    flex-shrink: 0;
}
.module-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.module-links a:not(.button) {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* --- Make It Yours / Architecture Section --- */
.arch-container {
    display: flex;
    gap: 30px;
    margin-bottom: 60px;
    align-items: stretch;
}
.arch-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.arch-layer {
    padding: 22px 28px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    border-left: 4px solid transparent;
    background: #fff;
    position: relative;
    transition: all 0.2s ease;
}
.arch-layer:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
    border-color: #ccc;
}
.arch-study {
    width: 84%;
    z-index: 3;
    border-left-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(0, 169, 143, 0.12);
}
.arch-platform {
    width: 92%;
    z-index: 2;
    margin-top: -10px;
    border-left-color: #7dd3c7;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.arch-core {
    width: 100%;
    z-index: 1;
    margin-top: -10px;
    border-left-color: #b2ece3;
    background: #f8fffe;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.arch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: var(--heading-color);
}
.arch-label i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}
.arch-layer p {
    font-size: 0.9rem;
    margin: 0 0 10px;
}
.arch-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.arch-badges code {
    background: var(--section-highlight-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 0.8rem;
    color: var(--text-color);
}

/* Vertical .fetch(flag) line */
.arch-api-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 130px;
}
.arch-api-label code {
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.arch-api-arrow {
    width: 2px;
    flex: 1;
    min-height: 40px;
    background: repeating-linear-gradient(
        to bottom,
        var(--primary-color) 0, var(--primary-color) 8px,
        transparent 8px, transparent 16px
    );
    margin: 10px 0;
}
.arch-api-sublabel {
    font-size: 0.75rem;
    color: var(--text-color-light);
    text-align: center;
    line-height: 1.4;
}

/* Building blocks icon — 2×2 colored grid */
.arch-blocks-icon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    width: 36px;
}
.arch-blocks-icon span {
    aspect-ratio: 1;
    border-radius: 3px;
}
.arch-blocks-icon span:nth-child(1) { background: var(--primary-color); }
.arch-blocks-icon span:nth-child(2) { background: #7dd3c7; }
.arch-blocks-icon span:nth-child(3) { background: #7dd3c7; }
.arch-blocks-icon span:nth-child(4) { background: #b2ece3; }

/* Framework scaffold icon — outlined rectangle with crosshair */
.arch-frame-icon {
    width: 40px;
    height: 32px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    position: relative;
}
.arch-frame-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5px;
    right: 5px;
    height: 1px;
    background: var(--primary-color);
    opacity: 0.4;
}
.arch-frame-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: var(--primary-color);
    opacity: 0.4;
}

/* Extension cards */
.extension-heading {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.3rem;
}
.extension-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}
.extension-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}
.extension-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
    border-color: #ccc;
}
.extension-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.extension-card-header i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}
.extension-card-header h4 {
    margin: 0;
    font-size: 1.1rem;
}
.extension-card > p {
    font-size: 0.9rem;
    margin: 0 0 15px;
    flex: 1;
}
.extension-code {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 14px;
    overflow-x: auto;
}
.extension-code pre,
.extension-code code {
    margin: 0;
    font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
    white-space: pre;
}

/* --- Example Studies Section --- */
.container-side-by-side {
    display: flex;
    align-items: center;
    gap: 50px;
}
.container-side-by-side .text-content { flex: 1; }
.container-side-by-side .text-content h3 { font-size: 2rem; margin-bottom: 1rem; }
.container-side-by-side .text-content p code {
    background: #e9ecef;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.95em;
}
.container-side-by-side .text-content .button { margin-top: 20px; }
.studies-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.study-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}
.study-card h4 { margin: 0 0 10px; }
.study-card a:not(.button) {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.study-card-links {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

/* --- Other Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}
.project-card {
    background: var(--section-highlight-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.project-card i {
    color: var(--primary-color);
    margin-bottom: 15px;
}
.project-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* --- Code Source Links (top-right of code pane) --- */
.code-source-links {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 1;
}
.code-source-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    text-decoration: none;
}
.code-source-icon:hover {
    color: #fff;
}

/* --- Footer --- */
footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-color-light);
    font-size: 0.9rem;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}
.footer-link {
    color: var(--text-color-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-link:hover {
    color: var(--primary-color);
}
.footer-icon-link {
    display: inline-flex;
    align-items: center;
}
.footer-icon-link svg {
    fill: var(--text-color-light);
    transition: fill 0.2s;
}
.footer-icon-link:hover svg {
    fill: var(--primary-color);
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .container-side-by-side { flex-direction: column; text-align: center; }
    .arch-container { flex-direction: column; }
    .arch-api-line {
        flex-direction: row-reverse;
        min-width: auto;
        padding: 5px 0;
    }
    .arch-api-arrow {
        height: 2px;
        width: auto;
        min-height: 0;
        flex: 1;
        background: repeating-linear-gradient(
            to right,
            var(--primary-color) 0, var(--primary-color) 8px,
            transparent 8px, transparent 16px
        );
        margin: 0 10px;
    }
    .arch-api-sublabel br { display: none; }
    .extension-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    .nav-links { display: none; } /* Basic responsive nav */
    .code-panes { flex-direction: column; }
    .code-pane:first-child { border-right: none; border-bottom: 1px solid #333; }
    .projects-grid { grid-template-columns: 1fr; }
}
