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

:root {
    /* Dark mode (default) */
    --bg: #0a0a0a;
    --text: #fafafa;
    --text-dim: #71717a;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.05);
    --video-brightness: 0.92;
    --overlay-gradient: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.3));
    --shadow: rgba(0,0,0,0.3);
    
    /* Typography - Inter */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Japanese-inspired light mode */
[data-theme="light"] {
    --bg: #f5f1e8;              /* Kinari - creamy beige like washi paper */
    --text: #2d2d2d;            /* Sumi - charcoal ink */
    --text-dim: #786f5e;        /* Warm gray-brown */
    --glass: rgba(255, 253, 248, 0.5);
    --glass-hover: rgba(255, 253, 248, 0.7);
    --border: rgba(45, 45, 45, 0.08);
    --video-brightness: 0.96;
    --overlay-gradient: linear-gradient(to bottom, rgba(245,241,232,0.1), rgba(245,241,232,0.35));
    --shadow: rgba(45,45,45,0.15);
}

@import url('https://rsms.me/inter/inter.css');

html {
    scroll-behavior: smooth;
    font-feature-settings: 'cv11', 'ss01';
    overflow: hidden;
    height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-optical-sizing: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
    height: 100%;
    position: fixed;
    width: 100%;
}

/* Hero Section */
.hero-video {
    position: relative;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100dvh; /* Dynamic viewport height - adjusts for mobile browser UI */
    overflow: hidden;
    background: var(--bg);
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(var(--video-brightness));
    transition: filter 0.3s ease;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-gradient);
    pointer-events: none;
    transition: background 0.3s ease;
}

.video-overlay > * {
    pointer-events: auto;
}

/* Top Left - Name & Tagline */
.top-left {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

h1 {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 8px var(--shadow);
}

.tagline {
    font-size: 0.8125rem;
    color: var(--text-dim);
    font-weight: 400;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 6px var(--shadow);
}

/* Bottom Left - Social Links */
.bottom-left {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    z-index: 10;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    transition: all 0.2s ease;
}

.social-links a:hover {
    background: var(--glass-hover);
    border-color: var(--border);
    transform: translateX(2px);
}

.social-links svg {
    width: 16px;
    height: 16px;
}

.social-links a.placeholder {
    opacity: 0.35;
    cursor: not-allowed;
}

.social-links a.placeholder:hover {
    opacity: 0.5;
    transform: none;
}

/* Controls - Bottom Right (Theme + Sound) */
.controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 20;
}

.theme-toggle,
.sound-toggle {
    width: 36px;
    height: 36px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover,
.sound-toggle:hover {
    background: var(--glass-hover);
    border-color: var(--border);
}

.theme-toggle svg,
.sound-toggle svg {
    width: 14px;
    height: 14px;
    color: var(--text);
}

.hidden {
    display: none;
}

/* Desktop Optimization */
@media (min-width: 1024px) {
    /* Desktop: zoomed/cropped video for immersive feel */
    #hero-video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .top-left {
        top: 3rem;
        left: 3rem;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .tagline {
        font-size: 0.875rem;
    }
    
    .bottom-left {
        bottom: 3rem;
        left: 3rem;
    }
    
    .controls {
        bottom: 3rem;
        right: 3rem;
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    #hero-video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .top-left {
        top: 1.5rem;
        left: 1.5rem;
    }
    
    h1 {
        font-size: 1rem;
    }
    
    .tagline {
        font-size: 0.75rem;
    }
    
    .bottom-left {
        bottom: 1.5rem;
        left: 1.5rem;
    }
    
    .social-links a {
        width: 34px;
        height: 34px;
    }
    
    .controls {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .theme-toggle,
    .sound-toggle {
        width: 34px;
        height: 34px;
    }
}

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

.top-left {
    animation: fadeIn 1.2s ease 0.4s both;
}

.bottom-left {
    animation: fadeIn 1.2s ease 0.6s both;
}

.controls {
    animation: fadeIn 1.2s ease 0.8s both;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* System preference for light mode */
@media (prefers-color-scheme: light) {
    body:not([data-theme]) {
        --bg: #f5f1e8;
        --text: #2d2d2d;
        --text-dim: #786f5e;
        --glass: rgba(255, 253, 248, 0.5);
        --glass-hover: rgba(255, 253, 248, 0.7);
        --border: rgba(45, 45, 45, 0.08);
        --video-brightness: 0.96;
        --overlay-gradient: linear-gradient(to bottom, rgba(245,241,232,0.1), rgba(245,241,232,0.35));
        --shadow: rgba(45,45,45,0.15);
    }
}

/* Fallback for browsers without Inter */
@supports not (font-family: 'Inter') {
    :root {
        --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
}