/* dioded.computer - Enhanced with Animations */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap');

/* Network Animation Styles */
#networkCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Base Styles */
:root {
    /* Minimalist Color Scheme */
    --black: #121212;
    /* Near black */
    --gray-900: #1a1a1a;
    /* Slightly lighter black */
    --gray-800: #2d2d2d;
    /* Dark gray */
    --gray-700: #4a4a4a;
    /* Medium dark gray */
    --gray-600: #666666;
    /* Medium gray */
    --gray-500: #888888;
    /* Neutral gray */
    --gray-400: #aaaaaa;
    /* Light gray */
    --gray-300: #cccccc;
    /* Lighter gray */
    --gray-200: #e5e5e5;
    /* Very light gray */
    --gray-100: #f5f5f5;
    /* Off-white gray */

    /* Semantic Colors */
    --primary: var(--black);
    --primary-light: var(--gray-900);
    --accent: var(--gray-800);
    --accent-hover: var(--gray-900);
    --text: var(--gray-900);
    --text-light: var(--gray-600);
    --background: #fffbf7;
    --secondary-bg: #fffbf7;
    --border: var(--gray-200);
    --code-bg: #fffbf7;
    --card-bg: #fffbf7;
    --header-bg: rgba(255, 251, 247, 0.95);
    --header-border: rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-sans: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
    --spacing-20: 5rem;
    --spacing-24: 6rem;
    --spacing-32: 8rem;

    /* Border radius */
    --radius-sm: 0.125rem;
    --radius: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-outline: 0 0 0 3px rgba(59, 130, 246, 0.5);
    --shadow-none: 0 0 #0000;

    /* Base Styles */
    @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap');

    /* Reset and base styles */
    *,
    ::before,
    ::after {
        box-sizing: border-box;
        border-width: 0;
        border-style: solid;
        border-color: var(--border);
    }

    html {
        line-height: 1.5;
        -webkit-text-size-adjust: 100%;
        -moz-tab-size: 4;
        tab-size: 4;
        font-family: var(--font-sans);
        scroll-behavior: smooth;
    }

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

    /* Typography */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-family: var(--font-mono);
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: -0.02em;
        color: var(--primary);
        margin-top: 0;
        margin-bottom: 0.5em;
    }

    h1 {
        font-size: 3.75rem;
        /* 60px */
        line-height: 1;
        margin-bottom: 2rem;
    }

    h2 {
        font-size: 2.25rem;
        /* 36px */
        line-height: 2.5rem;
        /* 40px */
        margin-bottom: 1.5rem;
    }

    h3 {
        font-size: 1.5rem;
        /* 24px */
        line-height: 2rem;
        /* 32px */
        margin-bottom: 1rem;
    }

    p {
        margin-top: 0;
        margin-bottom: 1.5rem;
        color: var(--text-light);
        font-size: 1rem;
        line-height: 1.75;
    }

    @media (min-width: 768px) {
        p {
            font-size: 1.125rem;
        }
    }

    a {
        color: var(--gray-900);
        text-decoration: none;
        transition: all 0.2s ease;
        border-bottom: 1px solid transparent;
    }

    a:hover {
        color: inherit;
    }

    .nav-link:hover {
        color: var(--black);
    }

    /* Layout */
    .container {
        width: 100%;
        max-width: 80rem;
        /* 1280px */
        margin-left: auto;
        margin-right: auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* Header */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background-color: rgba(255, 251, 247, 0.9);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--header-border);
        transition: all 0.3s ease;
        height: 80px;
        display: flex;
        align-items: center;
    }

    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        max-width: 80rem;
        margin: 0 auto;
        padding: 0 1.5rem;
    }

    /* Navigation */
    .nav {
        display: none;
    }

    .nav-item {
        color: var(--text-light);
        font-weight: 500;
        padding: 0.5rem 1rem;
        border-radius: var(--radius);
        transition: all 0.2s ease;
    }

    .nav-item:hover {
        color: var(--accent);
        background-color: var(--secondary-bg);
    }

    /* Buttons */
    .btn {
        font-family: var(--font-mono);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.875rem;
        font-weight: 600;
        padding: 0.75rem 1.5rem;
        border-radius: var(--radius-full);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        user-select: none;
        border: 2px solid transparent;
        line-height: 1.25;
        white-space: nowrap;
    }

    /* Primary Button */
    .btn-primary {
        background-color: var(--black);
        color: #ffffff !important;
        border-color: var(--black);
    }

    .btn-primary:hover {
        background-color: var(--gray-800);
        border-color: var(--gray-800);
        color: #ffffff !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Outline Button */
    .btn-outline {
        background-color: transparent;
        border: 2px solid var(--black);
        color: var(--black);
    }

    .btn-outline:hover {
        background-color: var(--black);
        color: #ffffff !important;
        transform: translateY(-2px);
    }

    /* Touch targets for mobile */
    @media (max-width: 767px) {
        .btn {
            padding: 1rem 2rem;
            width: 100%;
        }
    }
}

/* Sections */
section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 4rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    /* Adjusted to account for header height */
    padding-bottom: 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
    padding: 0 1.5rem;
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1;
    margin-bottom: 2rem;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.75;
    color: var(--text-light);
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

/* Features */
.features {
    background-color: #fffbf7;
}

/* Keep main outer border on the grid container */
.features-grid {
    display: flex;
    flex-wrap: wrap;
    margin-top: 3rem;
    border: 1px solid #121212; /* MAIN BORDER - preserved */
    border-radius: 0;
    gap: 0;
    box-sizing: border-box;
}

/* Card default (mobile stacked) */
.feature-card {
    flex: 0 0 100%; /* full width on mobile */
    padding: 1.5rem;
    background-color: #fffbf7;
    box-sizing: border-box;
    border-right: 1px solid #121212; /* vertical separator (removed per-breakpoint) */
    border-bottom: 1px solid #121212; /* horizontal separator for stacked/mobile */
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

/* Remove bottom border on the last visible card to avoid double bottom border */
.feature-card:last-child {
    border-bottom: none;
}

/* >=640px & <=1023px : 2-column layout */
@media (min-width: 640px) and (max-width: 1023px) {
    .features-grid .feature-card {
        flex: 0 0 50%;
    }

    /* Right-edge cells should not have a right border (every 2nd item) */
    .features-grid .feature-card:nth-child(2n) {
        border-right: none;
    }

    /* Infrastructure: in 2-column layout add bottom border to top row (items 1 & 2) */
    .features-grid.infrastructure .feature-card:nth-child(-n+2) {
        border-bottom: 1px solid #121212;
    }

    /* three-cols variant (the second features-grid with only 3 cards):
       make the 3rd card span full width to avoid an empty cell */
    .features-grid.three-cols .feature-card:nth-child(3) {
        flex: 0 0 100%;
        border-right: none;
        border-bottom: none;
    }

    /* keep divider between first row and the spanning third card */
    .features-grid.three-cols .feature-card:nth-child(1),
    .features-grid.three-cols .feature-card:nth-child(2) {
        border-bottom: 1px solid #121212;
    }
}

/* >=1024px : desktop - default 3 columns, infrastructure 4 columns */
@media (min-width: 1024px) {
    /* default 3-column layout */
    .features-grid:not(.infrastructure) .feature-card {
        flex: 0 0 33.3333%;
    }

    /* infrastructure: 4-column layout */
    .features-grid.infrastructure .feature-card {
        flex: 0 0 25%;
    }

    /* Remove bottom separators on desktop; keep vertical separators and remove on rightmost column */
    .features-grid .feature-card {
        border-bottom: none;
        border-right: 1px solid #121212;
    }

    /* 3-column: remove right-border on every 3rd item */
    .features-grid:not(.infrastructure) .feature-card:nth-child(3n) {
        border-right: none;
    }

    /* 4-column infra: remove right-border on every 4th item */
    .features-grid.infrastructure .feature-card:nth-child(4n) {
        border-right: none;
    }

    /* ensure three-cols variant (3 items) uses normal 3-column layout on desktop */
    .features-grid.three-cols .feature-card:nth-child(3) {
        flex: 0 0 33.3333%;
    }
}

/* Responsive */
@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-card {
        border-bottom: none;
        border-right: 1px solid #121212;
    }

    .feature-card:nth-child(2n) {
        border-right: none;
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid.infrastructure {
        grid-template-columns: repeat(4, 1fr);
    }

    .feature-card:nth-child(2n) {
        border-right: 1px solid #121212;
    }

    /* .feature-card:nth-child(3n) {
        border-right: none;
    } */

    .nav {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
}

/* Additional responsive breakpoints */
@media (max-width: 1023px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 639px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header {
        height: 70px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 1rem;
    }

    section {
        padding: 3rem 0;
    }
}

/* Code blocks and inline code */
pre,
code {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    color: var(--gray-800);
    overflow-x: auto;
}

pre {
    padding: 1em;
    overflow-x: auto;
    line-height: 1.5;
}

/* Card styling */
.card {
    background: #fffbf7;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

/* Team grid responsive borders */
@media (max-width: 639px) {
    #team .feature-card {
        border-right: none !important;
        border-bottom: 1px solid #121212;
    }

    #team .feature-card:last-child {
        border-bottom: none;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    #team .feature-card {
        border-bottom: none;
        border-right: 1px solid #121212;
    }

    #team .feature-card:nth-child(2n) {
        border-right: none !important;
    }
}

@media (min-width: 1024px) {
    #team .feature-card:nth-child(3n) {
        border-right: none !important;
    }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-text {
        font-size: 2.5rem;
    }

    .section-padding {
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        color: #000;
        background: #fffbf7;
    }
}

/* --- Neural Network Animation (Vision Section) --- */
#nn-container {
    position: relative;
    width: 100%;
    /* background-color: #02040a; */
    border-radius: 12px;
    overflow: hidden;
    /* border: 1px solid #1e293b; */
}

#nn-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Terminal Animations & Scrollbar --- */

/* Code Terminal Container */
#code-terminal {
    display: block;
    width: 100%;
    height: 280px; /* Mobile default */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    transition: height 0.3s ease;
}

/* Responsive Heights */
@media (min-width: 640px) {
    #code-terminal {
        height: 350px;
    }
}

@media (min-width: 768px) {
    #code-terminal {
        height: 410px;
    }
}

@media (min-width: 1024px) {
    #code-terminal {
        height: 450px;
    }
}

@media (min-width: 1280px) {
    #code-terminal {
        height: 480px;
    }
}

/* Code Body - Proper Scrolling */
#code-terminal .p-4,
#code-terminal .p-6 {
    position: relative;
    height: calc(100% - 50px); /* Account for header */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px; /* Prevent content hiding under scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #4b5563 transparent;
}

/* Webkit Scrollbar Styling */
#code-terminal .p-4::-webkit-scrollbar,
#code-terminal .p-6::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#code-terminal .p-4::-webkit-scrollbar-track,
#code-terminal .p-6::-webkit-scrollbar-track {
    background: transparent;
}

#code-terminal .p-4::-webkit-scrollbar-thumb,
#code-terminal .p-6::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#code-terminal .p-4::-webkit-scrollbar-thumb:hover,
#code-terminal .p-6::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Typing Code Container */
#typing-code {
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    font-size: 0.75rem; /* xs */
    line-height: 1.5;
}

@media (min-width: 768px) {
    #typing-code {
        font-size: 0.875rem; /* sm */
    }
}

@media (min-width: 1024px) {
    #typing-code {
        font-size: 1rem; /* base */
    }
}

/* Cursor Styling */
#cursor {
    display: inline-block;
    width: 6px; /* xs */
    height: 14px; /* xs */
    margin-left: 2px;
    vertical-align: middle;
}

@media (min-width: 768px) {
    #cursor {
        width: 8px; /* md */
        height: 16px; /* md */
    }
}

/* Custom Scrollbar for Terminal */
#code-terminal .overflow-x-auto::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#code-terminal .overflow-x-auto::-webkit-scrollbar-track {
    background: transparent;
}

#code-terminal .overflow-x-auto::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

#code-terminal .overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* ... rest of existing code ... */