:root {
    --bg-color: #050505;
    --surface-color: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --primary-gradient: linear-gradient(135deg, #00f2ea 0%, #ff0055 100%);
    --accent-cyan: #00f2ea;
    --accent-pink: #ff0055;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    color: var(--accent-cyan);
}

/* Navigation */
.glass-nav {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
}

.btn-sm:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan) !important;
}

/* Architecture Hero */
.hero-architecture {
    min-height: 100vh;
    /* Changed from height: 100vh to allow growth */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* FORCE top alignment */
    background: radial-gradient(circle at 50% 50%, rgba(0, 242, 234, 0.05) 0%, #050505 80%);
    width: 100%;
    overflow: hidden;
    padding-top: 220px;
    /* Definitive clearance */
    padding-bottom: 50px;
    /* Add bottom padding */
    /* Offset for Fixed Navbar (Increased) */
}

.arch-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* transform: scale(1.1); Removed */
    /* Make it pop */
    margin: 0 auto;
    /* Safe vertical centering */
}

/* Nodes */
.arch-node {
    position: relative;
    z-index: 2;
}

.node-box {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.node-box i {
    font-size: 2rem;
    color: var(--accent-cyan);
}

.node-box span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.node-box:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(0, 242, 234, 0.2);
    transform: translateY(-5px);
}

/* Cloud Shape Variation */
.node-box.cloud {
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border-style: dashed;
    border-width: 2px;
}

/* Branch Nodes (Stacked R2/W&B at same vertical slice) */
.arch-branch {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.branch-nodes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.node-box.small {
    padding: 0.8rem 1.2rem;
    min-width: 100px;
    flex-direction: row;
}

.node-box.small i {
    font-size: 1.2rem;
}

/* SVG Connection Layer */
#connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Behind nodes */
    pointer-events: none;
}

.connection-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 2px;
    stroke-linecap: round;
}

.connection-packet {
    fill: var(--accent-cyan);
    filter: drop-shadow(0 0 8px var(--accent-cyan));
}

.connection-label {
    fill: var(--text-secondary);
    font-size: 0.65rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Architecture Grid System - 4 Column Layout */
.arch-grid-complex {
    display: grid;
    /* Col | Space | S3/Stack | Space | WB | Space | Inf */
    grid-template-areas:
        ".    .  .     .  .     .  ."
        "col  .  s3    .  human .  mon"
        ".    .  v1    .  wb    .  inf"
        "yt   .  dvc   .  wb    .  inf"
        ".    .  v2    .  wb    .  inf"
        "reg  .  train .  wb    .  inf"
        ".    .  v3    .  wb    .  inf"
        ".    .  runpod.  wb    .  inf";
    grid-template-columns: 1fr 60px 1fr 60px 1fr 60px 1fr;
    grid-template-rows: auto auto 40px auto 40px auto;
    gap: 1rem;
    align-items: center;
    justify-items: center;
    position: relative;
    z-index: 2;
    max-width: 1200px;
    /* Wider to fit 4 cols */
    width: 95%;
}

/* Node Wrapper */
.node-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    z-index: 2;
    width: 100%;
}

/* Container Registry Node Spanning */
.node-wrapper[style*="reg"] {
    grid-area: reg;
}

/* Human Node Spanning */
.node-wrapper[style*="human"] {
    grid-column: 5;
    /* Aligned with S3 (row 2) */
    grid-row: 2;
    align-self: center;
    margin-bottom: 0;
}

/* Inference Node Spanning */
.node-wrapper[style*="inf"] {
    grid-row: 3 / span 6;
    /* Spans remaining rows, pushed down by Mon */
    align-self: center;
    /* Moves box down to center of span, aligning with WB */
}

/* Monitoring Node Spanning */
.node-wrapper[style*="mon"] {
    grid-area: mon;
    align-self: center;
}

/* W&B Node Spanning */
.node-wrapper[style*="wb"] {
    grid-row: 3 / span 6;
    /* Starts below human, Spans remaining rows (7-1=6) */
    align-self: center;
}

/* RunPod Node Spanning */
.node-wrapper[style*="runpod"] {
    grid-area: runpod;
}

/* YouTube Node Spanning */
.node-wrapper[style*="yt"] {
    grid-area: yt;
}

/* Inference Box Styling */
.inference-box {
    background: rgba(15, 15, 20, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--accent-pink);
    border-radius: 16px;
    padding: 1.5rem;
    width: 320px;
    /* Bigger */
    /* Bigger */
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s;
}

.inference-box:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

.inf-header {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.inf-header i {
    color: #f2a900;
    /* Chrome Yellowish */
    font-size: 1.2rem;
}

/* Image Preview / Upload Area */
.inf-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
    padding: 10px;
    /* Pad image inside box */
}

.inf-preview:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 234, 0.05);
}

.inf-preview .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.inf-preview .placeholder i {
    font-size: 2rem;
    color: var(--text-secondary);
}

.inf-preview img.preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inf-preview.has-image {
    border-style: solid;
    border-color: var(--accent-cyan);
}

.inf-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inf-info {
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.7;
}

.inf-text {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.8rem;
    color: white;
    font-size: 0.9rem;
    width: 100%;
    font-family: var(--font-body);
}

.inf-text:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.btn-predict {
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    padding: 1rem;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-predict:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 242, 234, 0.5);
}

.btn-predict:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    filter: grayscale(1);
}

/* Result Overlay */
.inf-result {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 0.5rem;
    min-height: 2rem;
}

.score-badge {
    background: var(--accent-cyan);
    color: #000;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 0 15px var(--accent-cyan);
}

/* Self Loop */
.self-loop {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-pink);
    font-size: 0.7rem;
    white-space: nowrap;
    animation: bounce 2s infinite;
}

/* Animations */
@keyframes flow {
    0% {
        left: -40px;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes flowVertical {
    0% {
        top: -40px;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltips */
.tooltip {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid var(--accent-cyan);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.node-box:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Labels */
/* Disabled per user request
.node-box::before {
    content: attr(data-tech);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.node-box:hover::before {
    opacity: 1;
}
*/

/* Reusing specific box colors */
/* Reusing specific box colors */
/* STANDARD NODES (Pieplines, etc.) - Cyan/Blueish */
.node-box {
    border-color: rgba(0, 242, 234, 0.4);
}

/* CLOUD NODES (S3, RunPod, WB, YouTube) - Pink/Accent */
.node-box.cloud {
    border-color: rgba(255, 0, 85, 0.5);
    /* accent-pink */
}

/* Shared Line Components */
/* These are likely deprecated by SVG connections, but kept if used elsewhere */
.line {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    top: 10px;
    overflow: hidden;
}

.data-packet {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-pink));
    position: absolute;
    left: -40px;
    animation: flow 2s linear infinite;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: translateY(-5px);
}

.arrow-head {
    color: var(--accent-cyan);
    font-size: 0.8rem;
    position: relative;
    top: -2px;
    left: 45px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .hero-architecture {
        display: none !important;
    }

    .mobile-view {
        display: flex !important;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        background: radial-gradient(circle at 50% 50%, rgba(0, 242, 234, 0.05) 0%, #050505 80%);
        padding: 8rem 1rem 2rem 1rem;
        /* Top padding for fixed nav */
    }

    .mobile-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        width: 100%;
        max-width: 500px;
    }

    .mobile-title {
        font-size: 1.5rem;
        text-align: center;
        background: var(--primary-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .mobile-diagram-img {
        width: 100%;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        position: relative;
    }

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

    .tap-hint {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.7rem;
        pointer-events: none;
    }

    .mobile-inf-box {
        width: 100%;
    }
}

/* Modal (Image Viewer) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 95%;
    max-width: 1200px;
    margin-top: 60px;
    /* Space for close button */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.2);
}

.close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    cursor: pointer;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 100px;
    /* Below navbar */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 25, 0.95);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--accent-pink);
    box-shadow: 0 4px 20px rgba(255, 0, 85, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast i {
    color: var(--accent-pink);
    font-size: 1.1rem;
}