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

:root {
    --black: #000000;
    --dark-gray: #000000;
    --gray: #000000;
    --text: #ffffff;
    --text-dim: #888888;
    --accent: #ffffff;
    --accent-dim: rgba(255, 255, 255, 0.3);
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: rgba(255, 255, 255, 0.02);
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.15);
}

/* Light mode variables */
[data-theme="light"] {
    --black: #ffffff;
    --dark-gray: #f8f9fa;
    --gray: #f1f3f4;
    --text: #202124;
    --text-dim: #5f6368;
    --accent: #1a73e8;
    --accent-dim: rgba(26, 115, 232, 0.3);
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: rgba(0, 0, 0, 0.02);
    --border-primary: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.15);
}

/* Hide scrollbar but keep functionality */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    cursor: default;
    font-weight: 300;
    line-height: 1.4;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Swarm Visualization */
.swarm-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

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

/* Header */
.header {
    position: fixed;    
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.logo {
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.5px;
    text-decoration: none;
    border-bottom: none;
}

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

.header-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 300;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.header-link:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.2s ease;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 32px;
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

/* Theme transition effects */
.theme-transitioning * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Page content with header spacing */
.page-with-header {
    padding-top: 80px;
}

@media (max-width: 768px) {
    .page-with-header {
        padding-top: 100px;
    }
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 130px 30px 60px;
    min-height: 100vh;
    position: relative;
    z-index: 100;
}

.content-wrapper {
    max-width: 900px;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.1s ease forwards;
}

/* Typography */
.title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    line-height: 0.85;
    letter-spacing: -0.05em;
    margin-bottom: 40px;
    color: var(--text);
}

.accent-text {
    color: var(--accent);
    font-weight: 300;
}

.subtitle {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 50px;
    font-weight: 300;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeInUp 0.1s ease 0.1s forwards;
}

/* Terminal */
.terminal-container {
    margin: 80px auto 120px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.6s forwards;
}

.terminal {
    background: var(--dark-gray);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.8;
    position: relative;
    overflow: hidden;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.01) 0%, transparent 50%);
    pointer-events: none;
}

.terminal-content {
    position: relative;
    z-index: 1;
}

.terminal-line {
    color: var(--accent);
    margin-bottom: 16px;
}

.terminal-output {
    color: var(--text-dim);
    margin-bottom: 24px;
}

.terminal-prompt {
    color: var(--accent);
}

.cursor {
    animation: blink 1s infinite;
    color: var(--accent);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Technical Section */
.technical-section {
    margin: 40px auto 50px;
    max-width: 800px;
    opacity: 0;
    animation: fadeInUp 0.3s ease 0.15s forwards;
}

.technical-description {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dim);
    font-weight: 300;
    text-align: left;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    padding: 28px 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    letter-spacing: 0.2px;
}

.technical-description a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.technical-description a:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* Embedding Visualization */
.embedding-container {
    margin: 25px auto 30px;
    max-width: 900px;
    opacity: 0;
    animation: fadeInUp 0.3s ease 0.2s forwards;
}

.embedding-space {
    position: relative;
    height: 350px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.embedding-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 40px 40px 32px;
    z-index: 100;
}

.info-panel h3 {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.info-panel p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.metrics {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.metric {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#embedding-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

#embedding-canvas:hover {
    cursor: pointer;
}

/* Access Button */
.access-section {
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.9s forwards;
}

.access-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    width: 100%;
    max-width: 280px;
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.access-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 255, 136, 0.02);
}

.preview-btn {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 16px 32px;
    width: 100%;
    max-width: 280px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: lowercase;
    color: var(--text );
    letter-spacing: 0.5px;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
}

.preview-btn:hover {
    border-color: var(--text);
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
}

.access-note {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 300;
    margin-bottom: 20px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 40px;
    z-index: 200;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 300;
}

.footer-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-right {
    display: flex;
    align-items: center;
}

.research-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    font-weight: 300;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.research-link:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* Success Message */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--black);
    color: var(--accent);
    padding: 20px 40px;
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    opacity: 0;
    pointer-events: none;
    transition: all 0.1s ease;
    z-index: 1000;
}

.success-message.show {
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(0, 255, 136, 0.015) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.01) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Subtle cursor effect */
body::after {
    content: '';
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.1s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    
    .main {
        padding: 130px 20px 100px;
    }
    
    .content-wrapper {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .title {
        font-size: 42px;
        letter-spacing: -0.02em;
        line-height: 1.1;
        margin-bottom: 24px;
    }
    
    .subtitle {
        font-size: 18px;
        line-height: 1.5;
        margin-bottom: 30px;
        max-width: 100%;
    }
    
    .technical-section {
        margin: 20px auto 25px;
        padding: 0 10px;
    }
    
    .technical-description {
        font-size: 13px;
        line-height: 1.7;
        padding: 20px 24px;
    }
    
    .embedding-container {
        margin: 20px auto 25px;
        padding: 0 5px;
    }
    
    .embedding-space {
        height: 280px;
        border-radius: 6px;
    }
    
    .embedding-info {
        padding: 20px;
    }
    
    .info-panel h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .info-panel p {
        font-size: 13px;
        margin-bottom: 16px;
        line-height: 1.5;
    }
    
    .metrics {
        gap: 8px;
        justify-content: center;
    }
    
    .metric {
        font-size: 10px;
        padding: 6px 10px;
        white-space: nowrap;
    }
    
    .access-section {
        padding: 0 20px;
    }
    
    .access-note {
        font-size: 11px;
        margin-bottom: 16px;
    }
    
    .access-btn {
        padding: 14px 28px;
        font-size: 13px;
        width: 100%;
        max-width: 280px;
    }
    
    .terminal {
        padding: 20px;
        font-size: 12px;
    }
    
    .footer {
        padding: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .footer-left {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 130px 16px 80px;
    }
    
    .content-wrapper {
        padding: 0 5px;
    }
    
    .title {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 20px;
    }
    
    .subtitle {
        font-size: 16px;
        line-height: 1.4;
        margin-bottom: 40px;
    }
    
    .embedding-container {
        margin: 40px auto 30px;
        padding: 0 5px;
    }
    
    .technical-section {
        margin: 15px auto 20px;
        padding: 0 8px;
    }
    
    .technical-description {
        font-size: 12px;
        line-height: 1.6;
        padding: 16px 20px;
    }
    
    .embedding-space {
        height: 250px;
    }
    
    .embedding-info {
        padding: 16px;
    }
    
    .info-panel h3 {
        font-size: 15px;
    }
    
    .info-panel p {
        font-size: 12px;
        margin-bottom: 14px;
    }
    
    .metrics {
        gap: 6px;
        flex-direction: column;
        align-items: center;
    }
    
    .metric {
        font-size: 9px;
        padding: 5px 8px;
        min-width: 120px;
        text-align: center;
    }
    
    .access-section {
        padding: 0 16px;
    }
    
    .access-note {
        font-size: 10px;
        margin-bottom: 14px;
    }
    
    .access-btn {
        padding: 12px 24px;
        font-size: 12px;
        width: 100%;
        max-width: 250px;
    }
}

/* High-end devices */
@media (min-width: 1200px) {
    .title {
        font-size: 8rem;
    }
    
    .subtitle {
        font-size: 28px;
    }
}

/* Dark mode adjustments for high contrast displays */
@media (prefers-contrast: high) {
    :root {
        --text-dim: #999999;
        --accent: #00ff99;
    }
    
    .terminal {
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Demo Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
