/* ========================================
   Products Page — Stylesheet
   ======================================== */

/* ---- Page Hero ---- */

.page-hero {
    padding: 140px 0 60px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.breadcrumb a {
    color: var(--text-dim);
}

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

.breadcrumb span {
    color: var(--text-dim);
}

.breadcrumb span:last-child {
    color: var(--text-muted);
}

.page-hero h1 {
    margin-bottom: 16px;
}

.page-hero .hero-sub {
    max-width: 680px;
    margin-bottom: 0;
}

/* ---- CVE Overview ---- */

.cve-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
    margin-bottom: 64px;
}

.cve-text h3 {
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.cve-text p {
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.cve-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.cve-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---- Stack Diagram ---- */

.cve-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 380px;
}

.stack-layer {
    width: 100%;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
    transition: all var(--transition);
}

.stack-layer:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-glow);
}

.stack-fpa {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(0, 102, 255, 0.08));
    border-color: rgba(0, 212, 255, 0.3);
}

.stack-board1 {
    background: var(--bg-card);
}

.stack-board2 {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.08), rgba(0, 212, 255, 0.05));
    border-color: rgba(0, 102, 255, 0.25);
}

.stack-ext {
    background: var(--bg-card);
    border-style: dashed;
    border-color: var(--border-light);
}

.stack-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 4px;
}

.stack-detail {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.stack-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    position: relative;
}

.stack-connector::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-light);
    z-index: 0;
}

.stack-connector span {
    position: relative;
    z-index: 1;
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--bg-dark);
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
}

/* ---- Architecture Cards ---- */

.arch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 64px;
}

.arch-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.arch-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.arch-icon {
    width: 44px;
    height: 44px;
    color: var(--primary);
    margin-bottom: 16px;
}

.arch-icon svg {
    width: 100%;
    height: 100%;
}

.arch-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.arch-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ---- Specs Table ---- */

.specs-section {
    margin-top: 0;
}

.specs-section h3 {
    margin-bottom: 24px;
    font-size: 1.2rem;
}

.specs-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.specs-table thead {
    background: rgba(0, 212, 255, 0.06);
}

.specs-table th {
    text-align: left;
    padding: 14px 20px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
}

.specs-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.specs-table tr:last-child td {
    border-bottom: none;
}

.specs-table td:first-child {
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
}

.specs-table tbody tr {
    transition: background var(--transition);
}

.specs-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.03);
}

/* ---- Application Cards ---- */

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.app-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
}

.app-card:hover {
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.app-card-featured {
    border-color: rgba(0, 212, 255, 0.25);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.04), rgba(0, 102, 255, 0.04));
}

.app-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.app-icon {
    width: 44px;
    height: 44px;
    color: var(--primary);
    flex-shrink: 0;
}

.app-icon svg {
    width: 100%;
    height: 100%;
}

.app-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.app-card h3 {
    font-size: 1.05rem;
}

.app-card-img {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.app-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-card > p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 16px;
    line-height: 1.7;
}

.app-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.app-features li {
    font-size: 0.82rem;
    color: var(--text-dim);
    padding-left: 18px;
    position: relative;
}

.app-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.6;
}

.app-stack {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.app-stack span {
    font-size: 0.75rem;
    padding: 4px 12px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 4px;
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
}

.app-arrow {
    background: none !important;
    border: none !important;
    color: var(--text-dim) !important;
    padding: 0 !important;
    font-size: 0.85rem !important;
}

.app-optional {
    border-style: dashed !important;
    opacity: 0.7;
}

/* ---- Processing Pipeline ---- */

.pipeline-section {
    margin-bottom: 64px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.pipeline {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 900px;
}

.pipeline-step {
    flex: 1;
    padding: 24px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.pipeline-step:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: var(--bg-card-hover);
}

.pipeline-step-out {
    border-color: rgba(0, 212, 255, 0.25);
    background: rgba(0, 212, 255, 0.04);
}

.pipeline-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.pipeline-step h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #fff;
}

.pipeline-step p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.pipeline-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.5;
}

/* ---- Demo Section ---- */

.demo-wrapper {
    max-width: 840px;
    margin: 0 auto;
}

.demo-disclaimer {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    max-width: 640px;
    margin: -8px auto 24px;
    line-height: 1.6;
}

.demo-disclaimer a {
    color: var(--primary);
}

.demo-upload {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}

.demo-upload:hover,
.demo-upload.drag-over {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.03);
}

.demo-upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-dim);
    margin: 0 auto 16px;
    display: block;
}

.demo-upload:hover .demo-upload-icon {
    color: var(--primary);
}

.demo-upload-text {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 6px;
    font-weight: 500;
}

.demo-upload-hint {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.demo-canvas-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.demo-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-run-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.demo-run-btn svg {
    flex-shrink: 0;
}

.demo-status {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-left: auto;
}

.demo-results {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.demo-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.demo-results-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.demo-results-count {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.demo-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.demo-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.demo-result-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.demo-result-label {
    color: #fff;
    font-weight: 500;
    flex-grow: 1;
}

.demo-result-range {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.78rem;
}

.demo-result-conf {
    color: var(--text-dim);
    font-size: 0.75rem;
    min-width: 32px;
    text-align: right;
}

/* ---- Showcase Image ---- */

.showcase-img {
    max-width: 420px;
    margin: 0 auto 48px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.showcase-caption {
    padding: 10px 16px;
    background: var(--bg-card);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    border-top: 1px solid var(--border);
}

/* ---- Engine Cores Grid ---- */

.cores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 64px;
}

.core-card {
    padding: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
}

.core-card:hover {
    border-color: rgba(0, 212, 255, 0.25);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.core-card-primary {
    border-color: rgba(0, 212, 255, 0.3);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(0, 102, 255, 0.03));
}

.core-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 50px;
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    width: fit-content;
}

.core-card h3 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.core-resolution {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1.1;
}

.core-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 24px;
    line-height: 1.7;
}

.core-card .specs-table-wrap {
    margin-bottom: 24px;
    flex-grow: 1;
}

.core-card .btn {
    margin-top: auto;
}

/* ---- AI Module ---- */

.ai-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.ai-text h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.ai-text p {
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.7;
}

.ai-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 28px;
}

.ai-flow-step {
    flex: 1;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-flow-step strong {
    color: #fff;
    font-size: 0.85rem;
}

.ai-flow-step span {
    color: var(--text-dim);
    font-size: 0.78rem;
}

.ai-flow-core {
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.04);
}

.ai-flow-arrow {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--primary);
    font-size: 1.1rem;
    opacity: 0.5;
}

.ai-specs h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
}

.ai-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-features li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-features li strong {
    color: #fff;
    font-size: 0.9rem;
}

.ai-features li span {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

/* ---- Stack Diagram — AI & Optional ---- */

.stack-ai {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 102, 255, 0.06));
    border-color: rgba(0, 212, 255, 0.25);
}

.stack-connector-optional span {
    border-style: dashed;
    color: var(--text-dim);
    opacity: 0.7;
}

/* ---- Active Nav Link ---- */

.nav-links a.active {
    color: var(--primary);
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
    .arch-grid { grid-template-columns: repeat(2, 1fr); }
    .app-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-overview { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .page-hero { padding: 120px 0 40px; }
    .page-hero h1 { font-size: 1.8rem; }

    .cve-overview {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .arch-grid { grid-template-columns: 1fr; }
    .app-grid { grid-template-columns: 1fr; }
    .cores-grid { grid-template-columns: 1fr; }
    .ai-overview { grid-template-columns: 1fr; }

    .core-card { padding: 24px; }
    .core-resolution { font-size: 1.8rem; }
    .arch-card { padding: 24px; }
    .app-card { padding: 24px; }

    .ai-flow {
        flex-direction: column;
    }

    .ai-flow-arrow {
        transform: rotate(90deg);
        padding: 4px 0;
        justify-content: center;
    }

    .pipeline {
        min-width: 0;
        flex-direction: column;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
        padding: 4px 0;
    }

    .specs-table td:first-child {
        white-space: normal;
    }

    .specs-table td,
    .specs-table th {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .showcase-img {
        max-width: 100%;
    }

    .stack-diagram {
        max-width: 100%;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .app-card-img {
        height: 140px;
    }

    .demo-upload {
        padding: 40px 20px;
    }

    .demo-canvas-wrap {
        padding: 12px;
    }

    .demo-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .demo-status {
        margin-left: 0;
        text-align: center;
    }

    .demo-results-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cve-badges { flex-direction: column; }
    .app-stack { flex-direction: column; align-items: flex-start; }
    .app-arrow { transform: rotate(90deg); }
    .page-hero h1 { font-size: 1.5rem; }
    .page-hero .hero-sub { font-size: 0.95rem; }
    .core-card { padding: 20px; }
    .core-resolution { font-size: 1.5rem; }
    .breadcrumb { font-size: 0.75rem; }
}
