:root {
    /* Colors - Light Mode */
    --bg-color: #f0f4f8;
    --text-color: #333333;
    --text-muted: #555555; /* Slightly darker */
    --accent-color: #007bff;
    --card-bg: rgba(255, 255, 255, 0.95); /* Much more opaque */
    --card-border: rgba(255, 255, 255, 0.6);
    --shadow-color: rgba(0, 0, 0, 0.2); /* Increased shadow */
    
    /* Layout */
    --card-width: 600px;
    --border-radius: 20px;
}

[data-theme="dark"] {
    /* Colors - Dark Mode */
    --bg-color: #0d1117;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #4da3ff;
    --card-bg: rgba(20, 20, 30, 0.95); /* Much more opaque */
    --card-border: rgba(255, 255, 255, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.6); /* Increased shadow */
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow: hidden; /* Prevent scroll for 3D background */
    height: 100vh;
    width: 100%; /* Changed from 100vw to avoid scrollbar issues */
    transition: background-color 0.3s ease, color 0.3s ease;
    touch-action: pan-y; /* Allow vertical scroll gestures */
}

/* Background Canvas */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Main Container */
.main-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    position: relative;
}

/* Hero Section */
.hero-content {
    text-align: center;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px;
    /* Optional: Subtle glass effect backing for text readability */
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}

[data-theme="dark"] .hero-content {
    background: radial-gradient(circle, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 70%);
}

.hero-logo {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
    margin-bottom: 10px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, #183A8A, #1179BD);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

[data-theme="dark"] .hero-title {
    background: linear-gradient(135deg, #4da3ff, #6FBDCA);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(77, 163, 255, 0.4);
}

.hero-tagline {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.hero-actions {
    margin-top: 20px;
}

/* Buttons */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px; /* Pill shape */
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary.btn-large {
    padding: 16px 48px;
    font-size: 1.2rem;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.w-full {
    width: 100%;
}

/* Footer & Theme Toggle */
.site-footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.theme-toggle-footer button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s;
}

.theme-toggle-footer button:hover {
    color: var(--text-color);
}

.sun-icon { display: block; }
.moon-icon { display: none; }

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Darker overlay for better visibility */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    max-width: 500px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-container h2 {
    margin-bottom: 24px;
    text-align: center;
    font-size: 1.5rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    border-radius: var(--border-radius);
    padding: 40px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.2s, background-color 0.2s;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: rgba(0, 0, 0, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    background: rgba(0, 0, 0, 0.5);
}

.status-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
}

.status-message.success { color: #28a745; }
.status-message.error { color: #dc3545; }

/* Responsive */
@media (max-width: 768px), (max-height: 600px) and (orientation: landscape) {
    /* Background Canvas */
    #canvas-container {
        pointer-events: none; /* Ignore all touch events on canvas */
    }

    html, body {
        overflow-y: auto; /* Enable scroll on mobile */
        overflow-x: hidden; /* Prevent horizontal scroll */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
        height: auto;
        min-height: 100vh;
        min-height: 100dvh; /* Use dvh for real mobile browsers (address bar support) */
    }

    .main-container {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        justify-content: flex-start; /* Align to top to allow scrolling */
        padding-top: 60px;
        padding-bottom: 120px; /* Space for footer and browser UI */
    }

    .hero-content {
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
    }
    
    .hero-logo {
        width: 120px;
    }

    .site-footer {
        position: relative; /* Normal flow on mobile */
        bottom: auto;
        margin-top: auto; /* Push to bottom of container */
        padding-bottom: 40px;
    }
}

/* Gyro Controls */
.gyro-controls {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 900;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gyro-controls.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.glass-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 10px 16px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.glass-btn svg {
    width: 18px;
    height: 18px;
}

[data-theme="light"] .glass-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

[data-theme="light"] .glass-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}
