/* ═══════════════════════════════════════════
       DESIGN TOKENS
    ═══════════════════════════════════════════ */
:root {
    --navy: #040d1a;
    --navy-mid: #071628;
    --navy-light: #0c2340;
    --panel: rgba(7, 22, 40, 0.75);
    --cyan: #00d4e8;
    --cyan-dim: #00a8b8;
    --teal: #00b89c;
    --teal-dim: #00917b;
    --white: #f0f6ff;
    --muted: #6b8aac;
    --border: rgba(0, 212, 232, 0.18);
    --glow-cyan: 0 0 30px rgba(0, 212, 232, 0.35);
    --glow-teal: 0 0 30px rgba(0, 184, 156, 0.35);
    --radius: 14px;
    --radius-lg: 22px;
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
}

/* ═══════════════════════════════════════════
       RESET & BASE
    ═══════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
}

::selection {
    background: var(--cyan);
    color: var(--navy);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--navy);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan-dim);
    border-radius: 3px;
}

a {
    color: var(--cyan);
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* ═══════════════════════════════════════════
       CANVAS BACKGROUND
    ═══════════════════════════════════════════ */
#neural-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}

/* ═══════════════════════════════════════════
       LAYOUT WRAPPER
    ═══════════════════════════════════════════ */
.site-wrap {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ═══════════════════════════════════════════
       NAV
    ═══════════════════════════════════════════ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    backdrop-filter: blur(18px) saturate(180%);
    background: rgba(4, 13, 26, 0.7);
    border-bottom: 1px solid var(--border);
    transition: padding .3s;
}

nav.scrolled {
    padding: 13px 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--white);
    letter-spacing: -.02em;
}

.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.logo span.accent {
    color: var(--cyan);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 400;
    letter-spacing: .02em;
    transition: color .2s;
}

.nav-links a:hover {
    color: var(--white);
}

.nav-cta {
    padding: 9px 22px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    color: var(--navy) !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
    letter-spacing: .04em !important;
    transition: box-shadow .25s, transform .2s !important;
}

.nav-cta:hover {
    box-shadow: var(--glow-cyan);
    transform: translateY(-1px);
    color: var(--navy) !important;
}

/* ═══════════════════════════════════════════
       HERO
    ═══════════════════════════════════════════ */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 140px 28px 80px;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(0, 212, 232, 0.06);
    font-size: .78rem;
    font-weight: 500;
    font-family: var(--font-mono);
    letter-spacing: .08em;
    color: var(--cyan);
    margin-bottom: 34px;
    animation: fadeUp .8s ease both;
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(.7);
    }
}

.hero-headline {
    font-family: var(--font-head);
    font-size: clamp(2.8rem, 7vw, 5.2rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.04em;
    max-width: 820px;
    animation: fadeUp .9s .1s ease both;
}

.hero-headline .gradient-text {
    background: linear-gradient(100deg, var(--cyan) 0%, var(--teal) 60%, #7affda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    margin-top: 22px;
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 560px;
    font-weight: 300;
    animation: fadeUp 1s .2s ease both;
}

.hero-actions {
    margin-top: 44px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 1s .3s ease both;
}

.btn-primary {
    padding: 15px 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    color: var(--navy);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .03em;
    border: none;
    cursor: pointer;
    transition: box-shadow .3s, transform .2s;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}

.btn-primary:hover {
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.btn-ghost {
    padding: 14px 32px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: transparent;
    font-size: .9rem;
    font-weight: 400;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
    text-decoration: none;
}

.btn-ghost:hover {
    color: var(--white);
    border-color: rgba(0, 212, 232, .4);
    background: rgba(0, 212, 232, .05);
}

/* hero stats */
.hero-stats {
    margin-top: 70px;
    display: flex;
    gap: 52px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeUp 1s .5s ease both;
}

.stat {
    text-align: center;
}

.stat-val {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    color: var(--cyan);
}

.stat-label {
    font-size: .8rem;
    color: var(--muted);
    letter-spacing: .04em;
    margin-top: 2px;
}

/* scroll indicator */
.scroll-hint {
    margin-top: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .75rem;
    letter-spacing: .1em;
    animation: fadeUp 1s .7s ease both;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--border);
    border-radius: 12px;
    position: relative;
    display: flex;
    justify-content: center;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: var(--cyan);
    border-radius: 2px;
    margin-top: 6px;
    animation: scrollWheel 1.8s ease infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(10px);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════
       SECTION SHARED
    ═══════════════════════════════════════════ */
section {
    padding: 100px 0;
}

.section-label {
    font-family: var(--font-mono);
    font-size: .75rem;
    letter-spacing: .15em;
    color: var(--cyan);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.03em;
}

.section-sub {
    color: var(--muted);
    font-size: .97rem;
    max-width: 520px;
    margin-top: 14px;
}

/* scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .8s ease, transform .8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
       DIAGNOSTIC TOOL
    ═══════════════════════════════════════════ */
#diagnostic {
    background: linear-gradient(180deg, transparent, rgba(0, 212, 232, .03) 50%, transparent);
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 60px;
    align-items: start;
}

/* Upload panel */
.upload-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(20px);
}

.upload-area {
    border: 2px dashed rgba(0, 212, 232, .3);
    border-radius: var(--radius);
    padding: 50px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .3s, background .3s, transform .2s;
    position: relative;
    overflow: visible; /* Must NOT be hidden — file input overlay must extend to full area */
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--cyan);
    background: rgba(0, 212, 232, .06);
    transform: scale(1.01);
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--cyan), var(--teal), transparent, var(--cyan));
    opacity: 0;
    transition: opacity .3s;
    z-index: -1;
}


.upload-icon {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: rgba(0, 212, 232, .1);
    border: 1px solid rgba(0, 212, 232, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.6rem;
    transition: transform .3s, box-shadow .3s;
}

.upload-area:hover .upload-icon {
    transform: translateY(-4px);
    box-shadow: var(--glow-cyan);
}

.upload-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.upload-hint {
    font-size: .82rem;
    color: var(--muted);
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.format-tag {
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(0, 212, 232, .08);
    border: 1px solid rgba(0, 212, 232, .15);
    font-size: .72rem;
    font-family: var(--font-mono);
    color: var(--cyan-dim);
    letter-spacing: .06em;
}

/* File input covers the entire upload-area so native click AND drag-drop both work */
#file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* File selected bar — hidden until a file is chosen */
.file-selected {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(0, 184, 156, .08);
    border: 1px solid rgba(0, 184, 156, .2);
    border-radius: 10px;
    font-size: .85rem;
    color: var(--teal);
    align-items: center;
    gap: 10px;
}

/* Show class toggled by JS after file selection */
.file-selected.show {
    display: flex;
}

/* Preview thumbnail — hidden until a file is chosen */
.preview-thumb {
    display: none;
    margin-top: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-thumb.show {
    display: block;
}

.preview-thumb img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

.submit-row {
    margin-top: 22px;
}

.submit-btn {
    width: 100%;
    margin-top: 18px;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    color: var(--navy);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .95rem;
    border: none;
    cursor: pointer;
    transition: box-shadow .3s, transform .2s, opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Error banner */
.error-banner {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 10px;
    background: rgba(255, 80, 80, .08);
    border: 1px solid rgba(255, 80, 80, .25);
    color: #ff6b6b;
    font-size: .85rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* Uploaded image in result panel */
.result-img {
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.result-img img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

/* Loading state */
#loading-state {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.scan-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--cyan);
    border-right-color: rgba(0, 212, 232, .3);
    animation: spin 1s linear infinite;
    margin: 0 auto 14px;
    position: relative;
}

.scan-ring::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--teal);
    animation: spin 1.4s linear infinite reverse;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-label {
    font-family: var(--font-mono);
    font-size: .85rem;
    color: var(--cyan);
    letter-spacing: .06em;
    margin-top: 10px;
}

.loading-steps {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(0, 212, 232, .04);
    border: 1px solid transparent;
    font-size: .82rem;
    color: var(--muted);
    transition: all .4s;
}

.loading-step.active {
    border-color: rgba(0, 212, 232, .2);
    color: var(--white);
}

.loading-step.done {
    border-color: rgba(0, 184, 156, .2);
    color: var(--teal);
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
    transition: background .3s;
}

.loading-step.active .step-dot {
    background: var(--cyan);
    animation: pulse-dot 1s ease infinite;
}

.loading-step.done .step-dot {
    background: var(--teal);
}

/* Results panel */
.result-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(20px);
}

/* Jinja2: shown only when result exists */
.result-empty {
    text-align: center;
    padding: 90px 20px;
    color: var(--muted);
}

.result-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: .4;
}

.result-empty p {
    font-size: .9rem;
}

/* Jinja result block */
.result-content {
    display: block;
}

.result-header {
    margin-bottom: 30px;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: .75rem;
    font-family: var(--font-mono);
    letter-spacing: .06em;
    margin-bottom: 18px;
}

.result-badge.success {
    background: rgba(0, 184, 156, .12);
    border: 1px solid rgba(0, 184, 156, .25);
    color: var(--teal);
}

.result-badge.warning {
    background: rgba(255, 180, 0, .1);
    border: 1px solid rgba(255, 180, 0, .2);
    color: #ffb400;
}

.result-class {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.result-class .tumor-type {
    color: var(--cyan);
}

.result-desc {
    margin-top: 10px;
    font-size: .88rem;
    color: var(--muted);
}

/* Confidence bar */
.confidence-block {
    margin-top: 30px;
    padding: 24px;
    background: rgba(0, 0, 0, .25);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .05);
}

.conf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.conf-label {
    font-size: .8rem;
    font-family: var(--font-mono);
    color: var(--muted);
    letter-spacing: .06em;
}

.conf-pct {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cyan);
}

.conf-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, .07);
    border-radius: 100px;
    overflow: hidden;
}

.conf-bar-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--cyan), var(--teal));
    width: 0%;
    transition: width 1.2s cubic-bezier(.16, 1, .3, 1);
    box-shadow: 0 0 12px rgba(0, 212, 232, .6);
}

/* class probabilities */
.classes-grid {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.class-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .82rem;
}

.class-name {
    min-width: 110px;
    font-family: var(--font-mono);
    font-size: .77rem;
    color: var(--muted);
    letter-spacing: .04em;
}

.class-bar-track {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, .06);
    border-radius: 100px;
    overflow: hidden;
}

.class-bar-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--navy-light), var(--cyan-dim));
    transition: width 1.4s cubic-bezier(.16, 1, .3, 1);
}

.class-bar-fill.predicted {
    background: linear-gradient(90deg, var(--cyan), var(--teal));
}

.class-pct {
    min-width: 44px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: .77rem;
    color: var(--muted);
}

/* Disclaimer */
.result-disclaimer {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 180, 0, .05);
    border: 1px solid rgba(255, 180, 0, .12);
    font-size: .78rem;
    color: rgba(255, 180, 0, .8);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.disclaimer-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ═══════════════════════════════════════════
       ARCHITECTURE SECTION
    ═══════════════════════════════════════════ */
#architecture {
    background: rgba(0, 0, 0, .15);
}

.arch-header {
    max-width: 600px;
}

.arch-flow {
    margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    align-items: center;
    position: relative;
}

.arch-step {
    text-align: center;
    position: relative;
    padding: 0 8px;
}

.arch-step-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 16px;
    position: relative;
    z-index: 1;
    transition: transform .3s, box-shadow .3s;
}

.arch-step:hover .arch-step-icon {
    transform: translateY(-4px);
}

.arch-step-icon.s1 {
    background: rgba(0, 212, 232, .12);
    border: 1px solid rgba(0, 212, 232, .25);
    box-shadow: 0 0 20px rgba(0, 212, 232, .08);
}

.arch-step-icon.s2 {
    background: rgba(0, 184, 156, .12);
    border: 1px solid rgba(0, 184, 156, .25);
    box-shadow: 0 0 20px rgba(0, 184, 156, .08);
}

.arch-step-icon.s3 {
    background: rgba(90, 120, 255, .12);
    border: 1px solid rgba(90, 120, 255, .25);
    box-shadow: 0 0 20px rgba(90, 120, 255, .08);
}

.arch-step-icon.s4 {
    background: rgba(200, 80, 255, .12);
    border: 1px solid rgba(200, 80, 255, .25);
    box-shadow: 0 0 20px rgba(200, 80, 255, .08);
}

.arch-step-icon.s5 {
    background: rgba(0, 212, 232, .12);
    border: 1px solid rgba(0, 212, 232, .25);
    box-shadow: 0 0 20px rgba(0, 212, 232, .08);
}

.arch-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.arch-connector::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--border), rgba(0, 212, 232, .35), var(--border));
}

.connector-arrow {
    font-size: .7rem;
    color: var(--cyan);
    position: relative;
    z-index: 1;
    background: var(--navy);
    padding: 0 4px;
}

.arch-step-name {
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.arch-step-desc {
    font-size: .73rem;
    color: var(--muted);
    line-height: 1.5;
}

/* VGG16 detail cards */
.arch-cards {
    margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.arch-card {
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    transition: border-color .3s, transform .3s, box-shadow .3s;
}

.arch-card:hover {
    border-color: rgba(0, 212, 232, .35);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4), 0 0 30px rgba(0, 212, 232, .06);
}

.arch-card-num {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--cyan);
    letter-spacing: .1em;
    margin-bottom: 12px;
}

.arch-card-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.arch-card-text {
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.6;
}

/* layer viz */
.layer-viz {
    margin-top: 14px;
    display: flex;
    gap: 4px;
    align-items: flex-end;
}

.layer-block {
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cyan), var(--teal));
    opacity: .6;
}

/* ═══════════════════════════════════════════
       TUMOR CLASSES
    ═══════════════════════════════════════════ */
#classes .classes-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 56px;
}

.class-card {
    padding: 28px 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    transition: border-color .3s, transform .3s, box-shadow .3s;
    cursor: default;
}

.class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.class-card.glioma:hover {
    border-color: #ff6b6b;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 107, 107, .08);
}

.class-card.meningioma:hover {
    border-color: #ffb400;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 180, 0, .08);
}

.class-card.pituitary:hover {
    border-color: var(--cyan);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 30px rgba(0, 212, 232, .08);
}

.class-card.notumor:hover {
    border-color: var(--teal);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 30px rgba(0, 184, 156, .08);
}

.class-card-emoji {
    font-size: 2rem;
    margin-bottom: 14px;
}

.class-card-name {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.class-card-name.glioma {
    color: #ff6b6b;
}

.class-card-name.meningioma {
    color: #ffb400;
}

.class-card-name.pituitary {
    color: var(--cyan);
}

.class-card-name.notumor {
    color: var(--teal);
}

.class-card-desc {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
       CLINICAL IMPACT
    ═══════════════════════════════════════════ */
#impact {
    background: linear-gradient(180deg, transparent, rgba(0, 184, 156, .03) 50%, transparent);
}

.impact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-top: 60px;
}

.impact-text .section-sub {
    max-width: 100%;
    margin-bottom: 32px;
}

.impact-bullets {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.impact-bullet {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.bullet-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 212, 232, .1);
    border: 1px solid rgba(0, 212, 232, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.bullet-head {
    font-family: var(--font-head);
    font-size: .92rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.bullet-desc {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.55;
}

/* impact cards right */
.impact-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.impact-card {
    padding: 26px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: border-color .3s, transform .3s;
}

.impact-card:hover {
    border-color: rgba(0, 184, 156, .3);
    transform: translateX(4px);
}

.impact-card-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.impact-card-title {
    font-family: var(--font-head);
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.impact-card-desc {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ═══════════════════════════════════════════
       FOOTER
    ═══════════════════════════════════════════ */
footer {
    padding: 50px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer .logo {
    justify-content: center;
    margin-bottom: 16px;
}

footer p {
    font-size: .8rem;
    color: var(--muted);
}

.footer-warning {
    margin-top: 14px;
    font-size: .75rem;
    color: rgba(255, 180, 0, .6);
}

/* ═══════════════════════════════════════════
       ANIMATIONS
    ═══════════════════════════════════════════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
       RESPONSIVE
    ═══════════════════════════════════════════ */
@media (max-width: 900px) {

    .tool-grid,
    .impact-grid {
        grid-template-columns: 1fr;
    }

    .arch-flow {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .arch-connector {
        display: none;
    }

    .arch-cards {
        grid-template-columns: 1fr;
    }

    #classes .classes-panel {
        grid-template-columns: 1fr 1fr;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 600px) {
    #classes .classes-panel {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        gap: 30px;
    }
}

/* ═══════════════════════════════════════════
       FLASK JINJA2: result visibility
       In real use: controlled via {% if result %}
    ═══════════════════════════════════════════ */
.jinja-if-result {
    display: none;
}

/* shown via Jinja: {% if result %} */
.jinja-if-no-result {
    display: block;
}

/* shown via Jinja: {% if not result %} */

/* Preview demo toggle */
body.has-result .jinja-if-result {
    display: block;
}

body.has-result .jinja-if-no-result {
    display: none;
}

/* ─── glassmorphism hover util ─── */
.glass-hover {
    transition: background .3s, border-color .3s, box-shadow .3s, transform .3s;
}

.glass-hover:hover {
    background: rgba(0, 212, 232, .07) !important;
    border-color: rgba(0, 212, 232, .3) !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    transform: translateY(-3px);
}