/* Project Page Styles */

:root {
    --accent-color: #355070;
    --text-primary: #2d2d2d;
    --text-secondary: #666;
    --background: #ffffff;
    --background-subtle: #fafafa;
    --border-color: #e0e0e0;
    --highlight-bg: rgba(53, 80, 112, 0.08);
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #4a6a8a;
}

/* Cascade Title */
.project-title.cascade-title {
    font-family: 'Outfit', sans-serif;
    font-size: 52px;
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    color: #355070;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.cascade-logo {
    flex-shrink: 0;
    width: 48px;
    height: auto;
}

/* Cascade inline mention */
.cascade-name {
    font-style: italic;
}

.project-subtitle-paper {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Hero Figure Composite */
.hero-figure-composite {
    margin-top: 16px;
    margin-bottom: 48px;
}

/* Break out of container margins for pipeline figures */
.project-section .hero-figure-composite {
    max-width: 1050px;
    width: calc(100vw - 120px);
    margin-left: auto;
    margin-right: auto;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* Pipeline Row */
.hero-pipeline-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 16px;
    row-gap: 8px;
    align-items: center;
    justify-items: center;
    padding: 24px 0;
}

.pipeline-stage-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    align-self: end;
}

.pipeline-grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.pipeline-stage-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.pipeline-grid-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrow-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.arrow-symbol {
    font-size: 24px;
    color: rgba(0,0,0,0.3);
}

.pipeline-decoder-box {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(53, 80, 112, 0.3);
    border-radius: 8px;
    font-size: 14px;
    color: rgba(53, 80, 112, 0.6);
    text-align: center;
    line-height: 1.5;
}

/* Decoder Detail Strip */
.hero-decoder-detail {
    background: rgba(53, 80, 112, 0.03);
    border: 1px solid rgba(53, 80, 112, 0.1);
    border-radius: 8px;
    padding: 28px 20px 24px;
    margin: 12px 10px 24px;
}

.decoder-detail-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.cascade-logo-sm {
    width: 28px;
    height: auto;
    flex-shrink: 0;
}

.cascade-detail-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 600;
    font-variant: small-caps;
    font-style: normal;
    letter-spacing: 0.05em;
    color: #355070;
}

.decoder-detail-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto auto;
    grid-template-rows: auto 1fr;
    column-gap: 16px;
    row-gap: 8px;
    align-items: center;
    justify-items: center;
}

.detail-step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    align-self: end;
}

.detail-grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.detail-grid-cell .detail-step-img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.detail-grid-arrow {
    font-size: 24px;
    color: rgba(0,0,0,0.3);
}

.decoder-detail-strip {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto auto;
    align-items: center;
    justify-items: center;
    gap: 16px;
}

.detail-step-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.detail-step-conv-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.detail-step-conv-container .detail-step-img {
    width: 100%;
}

.detail-step-torus-inset {
    position: absolute;
    bottom: 2px;
    right: -24px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(53, 80, 112, 0.15);
    border-radius: 4px;
    padding: 4px;
    text-align: center;
}

.torus-inset-label {
    font-size: 9px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.torus-inset-img {
    width: 120px;
    height: auto;
}

.detail-step-arrow {
    font-size: 24px;
    color: rgba(0,0,0,0.3);
    flex-shrink: 0;
    padding-top: 16px;
}


.detail-step-mlp {
    width: 145px;
    height: auto;
}

/* Hero Results Row */
.hero-results-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.hero-results-single {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-result-panel {
    margin: 0;
}

.hero-result-img {
    width: 100%;
    height: auto;
}

.hero-figure-caption {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-secondary);
    text-align: left;
}


/* Impact Callout */
.impact-callout {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 24px 0;
    padding: 24px 32px;
    background: var(--highlight-bg);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
}

.impact-callout-stat {
    font-size: 48px;
    font-weight: 600;
    color: var(--accent-color);
    flex-shrink: 0;
    line-height: 1;
}

.impact-callout-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Responsive: Hero */
@media (max-width: 900px) {
    .hero-pipeline {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hero-pipeline-stage {
        flex: 0 1 140px;
    }

    .hero-pipeline-arrow {
        padding: 16px 2px 0;
    }

    .decoder-detail-strip {
        flex-wrap: wrap;
        gap: 12px;
    }

    .hero-results-row {
        grid-template-columns: 1fr;
    }

    .cascade-title {
        font-size: 40px;
    }
}

@media (max-width: 600px) {
    .hero-pipeline {
        flex-direction: column;
        gap: 4px;
    }

    .hero-pipeline-arrow {
        flex-direction: row;
        gap: 6px;
        padding: 0;
    }

    .arrow-symbol {
        transform: rotate(90deg);
    }

    .impact-callout {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .decoder-detail-strip {
        flex-direction: column;
    }

    .detail-step-arrow {
        transform: rotate(90deg);
        padding: 0;
    }
}

/* Navigation */
.project-nav {
    margin-bottom: 48px;
    padding-top: 24px;
}

.project-nav a {
    margin-right: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.project-nav a:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    margin-bottom: 80px;
    text-align: center;
}

.hero-split {
    display: grid;
    grid-template-columns: 11fr 13fr;
    gap: 48px;
    align-items: center;
    text-align: left;
    max-width: 1200px;
    width: calc(100vw - 80px);
    margin-left: calc(50% - min(560px, 50vw - 40px));
    padding: 40px 0;
    box-sizing: border-box;
}

.hero-left .project-title.cascade-title {
    justify-content: flex-start;
}

.hero-left .project-subtitle {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-left .project-links {
    justify-content: flex-start;
}

.hero-left .project-meta {
    text-align: left;
}

.hero-right .hero-figure-composite {
    max-width: none;
    margin: 0;
}

.hero-right .hero-result-img {
    width: 100%;
}

.hero-right .hero-figure-caption {
    margin-top: 12px;
}

@media (max-width: 768px) {
    .hero-split {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-left .project-title.cascade-title {
        justify-content: center;
    }

    .hero-left .project-links {
        justify-content: center;
    }

    .hero-left .project-meta {
        text-align: center;
    }
}

.project-title {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.project-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.project-meta {
    margin-bottom: 32px;
}

.authors {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.affiliation {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--background-subtle);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.project-link:hover {
    background: var(--highlight-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

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

.project-link.primary:hover {
    background: #c49363;
    color: white;
}

.link-icon {
    font-size: 18px;
}

/* Hero Visualization */
.hero-visual {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.hero-blurb {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.hero-image-wide {
    max-width: 1200px;
}

.decoder-context-figure {
    margin: 28px auto 0;
    max-width: 1240px;
    padding: 14px;
    background: var(--background-subtle);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.decoder-context-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #fff;
}

.decoder-context-figure figcaption {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-secondary);
    text-align: left;
}

.decoding-intro-text {
    margin: 0 auto 16px;
    max-width: 980px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
}

/* Scroll fade-in */
.project-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.project-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Also fade the highlight section */
.highlight-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.highlight-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Sections */
.project-section {
    margin-bottom: 80px;
}

.project-section h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.project-section h2 a {
    color: inherit;
    text-decoration: none;
}

.project-section h2 a:hover {
    color: inherit;
}

.project-section h2 a::after {
    content: ' #';
    color: transparent;
    transition: color 0.2s ease;
    font-weight: 400;
}

.project-section h2 a:hover::after {
    color: var(--accent-color);
}

.project-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.project-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.section-content p {
    margin-bottom: 16px;
}

.section-content p + p {
    text-indent: 1.5em;
}

.section-content p.paragraph-heading,
.section-content p.continuation {
    text-indent: 0;
}

/* Highlight Section */
.highlight-section {
    background: var(--highlight-bg);
    border-left: 3px solid var(--accent-color);
    padding: 32px;
    border-radius: 4px;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

.insight-column {
    background: var(--background);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.insight-content {
    margin-bottom: 24px;
}

.property-list {
    list-style: none;
    padding-left: 0;
    margin: 12px 0;
}

.property-list li {
    margin-bottom: 8px;
}

.insight-figure {
    margin-top: 24px;
}

/* BB Code Connectivity Visualization */
.bb-figure {
    margin-top: 32px;
    margin-bottom: 32px;
}

#bb-viz {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    cursor: grab;
}

#bb-viz:active {
    cursor: grabbing;
}

#bb-viz canvas {
    border-radius: 8px;
}

.bb-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.bb-controls-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.bb-mode-btn {
    padding: 6px 12px;
    background: var(--background-subtle);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bb-mode-btn:hover {
    background: var(--highlight-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.bb-mode-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Key Insight Box */
.key-insight-box {
    margin-top: 20px;
    padding: 24px;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    font-size: 16px;
    line-height: 1.6;
}

/* Challenge List */
.challenge-list {
    list-style: none;
    padding: 0;
}

.challenge-list li {
    margin-bottom: 24px;
    padding-left: 24px;
    position: relative;
}

.challenge-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 600;
}

/* Problem Statement */
.problem-statement p {
    margin-bottom: 16px;
}

.problem-statement p:last-child {
    margin-bottom: 0;
}

/* Pipeline Figure */
.pipeline-svg {
    width: 100%;
    height: auto;
    font-family: 'JetBrains Mono', monospace;
}

#problem-figure {
    width: 100%;
    padding: 16px 0;
}

/* Figures */
.section-figure,
.insight-figure,
.result-figure {
    margin: 32px 0;
}

.figure-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.section-figure figcaption,
.insight-figure figcaption,
.result-figure figcaption,
.interactive-figure figcaption {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    color: var(--text-secondary);
    text-align: left;
    line-height: 1.65;
}

.fig-label {
    display: block;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Interactive Elements */
.interactive-section {
    background: var(--background-subtle);
    padding: 32px;
    border-radius: 8px;
}

.interactive-figure {
    margin: 32px 0;
}

/* Demo Container */
.demo-instructions {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--highlight-bg);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}


.demo-controls {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    margin-bottom: 14px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-group label {
    font-size: 12px;
    font-weight: 500;
    min-width: 120px;
}

.control-group input[type="range"] {
    flex: 1;
    max-width: 240px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(53, 80, 112, 0.15);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
}

.control-group select {
    flex: 1;
    max-width: 240px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.control-buttons {
    display: flex;
    gap: 8px;
}

.model-toggle {
    grid-column: 1 / -1;
}
.control-buttons button {
    padding: 6px 10px;
    background: var(--background-subtle);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-buttons button:hover {
    background: var(--highlight-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.demo-visualization {
    margin: 12px 0;
    padding: 12px;
    background: var(--background-subtle);
    border-radius: 6px;
}

.demo-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.status-item {
    padding: 8px 10px;
    background: var(--background-subtle);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-item span:last-child {
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Results */
.result-subsection {
    margin-bottom: 48px;
}

.result-subsection:last-child {
    margin-bottom: 0;
}

.result-content {
    margin-bottom: 24px;
}

/* Broader Impact */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.impact-item {
    padding: 24px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.impact-item h4 {
    color: var(--accent-color);
    margin-bottom: 12px;
}

/* Technical Details */
.technical-details {
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.technical-details summary {
    padding: 16px 20px;
    background: var(--background-subtle);
    cursor: pointer;
    font-weight: 500;
    user-select: none;
    transition: background 0.2s ease;
}

.technical-details summary:hover {
    background: var(--highlight-bg);
}

.technical-details[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.details-content {
    padding: 24px;
    line-height: 1.8;
}

/* Citation */
.citation-box {
    position: relative;
    margin-top: 24px;
}

.citation-box pre {
    background: var(--background-subtle);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
}

.citation-box code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.copy-citation {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-citation:hover {
    background: #c49363;
}

.copy-citation:active {
    transform: scale(0.95);
}

/* Code blocks */
.section-content pre {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 16px 0;
}

.section-content pre code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: #d4d4d4;
}

.section-content pre code .c { color: #6a9955; }
.section-content pre code .k { color: #c586c0; }
.section-content pre code .n { color: #b5cea8; }

/* Footer */
.project-footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-content {
    margin-bottom: 24px;
}

.footer-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.contact-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-button:hover {
    background: #c49363;
    transform: translateY(-2px);
}

.footer-links {
    margin-top: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #bb-viz {
        height: 300px;
    }

    .project-title {
        font-size: 28px;
    }

    .project-subtitle {
        font-size: 16px;
    }

    .project-links {
        flex-direction: column;
        align-items: stretch;
    }

    .project-link {
        justify-content: center;
    }

    .project-section h2 {
        font-size: 24px;
    }

    .decoder-context-figure {
        padding: 10px;
    }

    .demo-controls {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-group label {
        min-width: auto;
    }

    .control-group input[type="range"],
    .control-group select {
        max-width: 100%;
        width: 100%;
    }
}

/* Neural Decoder Visualization */
.neural-decoder-container {
    display: flex;
    gap: 40px;
    padding: 12px 0;
    max-width: none;
    width: 100%;
    align-items: flex-start;
}

.viz-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.viz-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.error-legend {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-label {
    font-weight: 500;
    color: var(--text-primary);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    display: inline-block;
}

.legend-x {
    background: rgba(220, 70, 70, 0.85);
}

.legend-y {
    background: rgba(210, 150, 70, 0.9);
}

.legend-z {
    background: rgba(80, 115, 150, 0.85);
}

/* Left Section - Surface Code */
.decoder-left-section {
    flex: 0 0 500px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
}

.surface-code-svg {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Right Section - Activations */
.decoder-right-section {
    flex: 1;
    min-width: 0;
}

.activation-layer-compact {
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.compact-layer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 6px;
    padding: 2px 0;
    transition: opacity 0.2s ease;
}

.compact-layer-header:hover {
    opacity: 0.7;
}

.layer-chevron {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    display: inline-block;
    width: 12px;
    text-align: center;
}

.compact-layer-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.layer-content {
    display: block;
}

.activation-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-btn {
    flex-shrink: 0;
    width: 32px;
    height: 80px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: var(--highlight-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.activation-grid-carousel {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    flex: 1;
}

.activation-heatmap-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.heatmap-highlight {
    position: absolute;
    border: none;
    outline: 1px solid rgba(0, 0, 0, 0.9);
    outline-offset: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.05s ease;
    z-index: 2;
}

.heatmap-highlight.receptive-field {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.35) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 1px, transparent 1px);
    background-position: 0 0;
}

.heatmap-highlight.active {
    opacity: 1;
}

.carousel-indicator {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.activation-heatmap {
    width: 100%;
    aspect-ratio: 1;
    max-width: 70px;
    max-height: 70px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    image-rendering: pixelated;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.syndrome-heatmap {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    image-rendering: pixelated;
}

/* Loading state */
.decoder-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.decoder-loading::after {
    content: '...';
    animation: pulse 1.5s ease-in-out infinite;
}

/* Print styles */
@media print {
    .project-nav,
    .project-links,
    .demo-controls,
    .copy-citation {
        display: none;
    }

    .project-section {
        page-break-inside: avoid;
    }
}
