:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --border: #e0e0e0;
    --code-bg: #f5f5f5;
    --code-text: #1a1a1a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

header {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 300;
}

.description {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 800px;
    margin: 1.5rem auto 0;
    font-weight: 400;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero {
    margin: 4rem 0;
    text-align: center;
}

.hero-image {
    width: 100%;
    max-width: 1200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.hero-image:hover {
    transform: scale(1.01);
    box-shadow: 0 25px 70px rgba(99, 102, 241, 0.25);
}

.video-section {
    margin: 6rem 0;
}

.video-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
}

.video-row:last-child {
    margin-bottom: 0;
}

.video-row-reverse {
    direction: rtl;
}

.video-row-reverse > * {
    direction: ltr;
}

.video-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.2);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    cursor: pointer;
}

.video-description {
    padding: 2rem;
}

.video-description h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.video-description p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.8;
}

.features {
    margin: 8rem 0;
}

.features > h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

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

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    color: var(--accent-hover);
}

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.feature-item code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.architecture {
    margin: 8rem 0;
}

.architecture > h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

.architecture-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.architecture-section {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.architecture-section h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.architecture-section ul {
    list-style: none;
    padding-left: 0;
}

.architecture-section li {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 1.5rem;
    position: relative;
}

.architecture-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.architecture-section strong {
    color: var(--text-primary);
}

.architecture-section code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 6rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 10000;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
}

.lightbox-video {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    color: var(--accent-hover);
    transform: scale(1.1);
}

.lightbox-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 968px) {
    .video-row {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 4rem;
    }

    .video-row-reverse {
        direction: ltr;
    }

    .video-description {
        order: -1;
    }

    .architecture-content {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    header {
        padding: 2rem 1rem 1rem;
    }

    main {
        padding: 0 1rem;
    }

    .hero {
        margin: 2rem 0;
    }

    .video-section {
        margin: 4rem 0;
    }

    .features,
    .architecture {
        margin: 4rem 0;
    }

    .video-description {
        padding: 1.5rem;
    }

    .feature-item,
    .architecture-section {
        padding: 1.5rem;
    }

    .video-container:hover {
        transform: none;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 2.5rem;
    }

    .lightbox-image,
    .lightbox-video {
        max-width: 95vw;
        max-height: 85vh;
    }
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

