:root {
    /* Base Theme (Dark - Default) */
    --bg: #09090b;
    --card: #121212;
    --card-hover: #1c1c1f;
    --border: #27272a;
    --text: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #ffffff;
    --accent-inverse: #000000;
    --nav-bg: rgba(9, 9, 11, 0.8);
    --grid-line: rgba(255, 255, 255, 0.15);
    --spotlight-size: 1000px;
}

[data-theme="light"] {
    --bg: #ffffff;
    --card: #fafafa;
    --card-hover: #f4f4f5;
    --border: #e4e4e7;
    --text: #09090b;
    --text-secondary: #52525b;
    --accent: #09090b;
    --accent-inverse: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --grid-line: rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    cursor: default;
}

/* Background Effects */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    
    mask-image: radial-gradient(
        var(--spotlight-size) circle at var(--x, 50%) var(--y, 50%), 
        black 0%, 
        rgb(0,0,0, 0.5) 40%,
        transparent 70%
    );
    -webkit-mask-image: radial-gradient(
        var(--spotlight-size) circle at var(--x, 50%) var(--y, 50%), 
        black 0%, 
        rgb(0,0,0, 0.5) 40%,
        transparent 70%
    );
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

header {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    transform: translateY(-100%); /* Full slide down */
}

header.visible {
    opacity: 1;
    transform: translateY(0);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    clip-path: circle(48% at center); 
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

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

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

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.2s;
    min-width: 40px;
}

.theme-toggle:hover {
    background: var(--card-hover);
    border-color: var(--text);
}

/* Hero Section */
.hero {
    padding: 120px 0 80px; /* Reduced from 160/120 */
    text-align: center;
}

/* Status badge removed in Phase 8 */

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    color: var(--text);
    min-height: 1.1em;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    max-width: 100%;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 32px;
    font-weight: 400;
    opacity: 0;
    /* Animation handled via JS class now for sequencing */
}

.cta-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    /* Animation handled via JS class now for sequencing */
}

/* New sequencing class */
.fade-in-active {
    animation: fadeSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    filter: blur(0);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--text);
}

/* Features Grid */
.features {
    padding: 80px 0; /* Reduced from 100 */
}

.section-title {
    margin-bottom: 40px; /* Reduced from 60 */
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    perspective: 1000px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    transition: transform 0.1s ease-out, background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    transform-style: preserve-3d;
    will-change: transform;
}

.card:hover {
    background: var(--card-hover);
    border-color: var(--text);
    z-index: 10;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transform: translateZ(20px);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    transform: translateZ(10px);
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
    transform: translateZ(5px);
}

/* Dev Log Support */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.log-entry {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.log-marker {
    position: absolute;
    left: 14px;
    top: 6px;
    width: 13px;
    height: 13px;
    background: var(--bg);
    border: 2px solid var(--text);
    border-radius: 50%;
    z-index: 2;
}

.log-date {
    font-family: 'SF Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.log-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.log-content h4 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.log-content ul {
    list-style: none;
}

.log-content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.log-content ul li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--text);
}

/* Footer */
footer {
    padding: 60px 0 30px; /* Reduced from 80/40 */
    border-top: 1px solid var(--border);
    margin-top: 80px; /* Reduced from 120 */
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animations Variables */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        filter: blur(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes shimmer {
    0% { transform: skewX(-20deg) translateX(-150%); }
    50% { transform: skewX(-20deg) translateX(150%); }
    100% { transform: skewX(-20deg) translateX(150%); }
}

.reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    filter: blur(12px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform, filter;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* --- RESPONSIVENESS --- */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    .hero h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 16px 0;
    }

    .nav-links {
        display: none;
    }
    
    .nav-links:last-child {
        display: flex;
    }

    .nav-links {
        gap: 16px;
    }
    .nav-links a {
        display: none;
    }
    
    .hero {
        padding: 100px 0 60px;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 3.5rem); /* Smaller font on mobile */
        white-space: normal; /* Allow wrap on mobile if needed */
        line-height: 1.2;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 16px; /* Tighter gap */
    }
    
    .timeline::before {
        left: 10px;
    }
    .log-entry {
        padding-left: 40px;
        margin-bottom: 32px;
    }
    .log-marker {
        left: 4px;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .cta-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .hero p {
        font-size: 1rem;
    }
}
