:root {
    /* Premium Light Palette */
    --bg-color: #ffffff;
    --secondary-bg: #f5f5f7;
    --card-bg: rgba(0, 0, 0, 0.03);

    /* Text Colors */
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;

    /* Accents - Electric Indigo & Teal */
    --accent-primary: #4f46e5;
    /* Slightly darker indigo for better contrast on white */
    --accent-glow: rgba(79, 70, 229, 0.2);
    --accent-secondary: #0d9488;

    /* Effects */
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-blur: blur(12px);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
}

body.dark-mode {
    --bg-color: #121212;
    --secondary-bg: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.05);

    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    --accent-primary: #6366f1;
    /* Neon Indigo */
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-secondary: #2dd4bf;
    /* Teal/Cyan */

    --glass-border: rgba(255, 255, 255, 0.1);
}

body.dark-mode .gradient-text {
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .main-header {
    background: rgba(18, 18, 18, 0.8);
}

body.dark-mode .logo-img {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(130deg) drop-shadow(0 0 5px rgba(45, 212, 191, 0.5));
    opacity: 0.9;
}

/* Toggle Button */
#theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background: var(--card-bg);
    color: var(--accent-primary);
}

#theme-toggle .moon-icon {
    display: block;
}

#theme-toggle .sun-icon {
    display: none;
}

body.dark-mode #theme-toggle .moon-icon {
    display: none;
}

body.dark-mode #theme-toggle .sun-icon {
    display: block;
}

#cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: screen;
}

#cursor-follower.active {
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-secondary);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s var(--transition-smooth);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.gradient-text {
    background: linear-gradient(135deg, #111 0%, #666 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--glass-blur);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
    align-items: center;
}

.nav-links a:not(.btn-primary) {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 12px 28px;
    border-radius: 99px;
    /* Pill shape */
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform 0.2s var(--transition-smooth), box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

/* Hero */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 900px;
    padding: 24px;
    margin-top: 22vh;
}

.hero-content h1 {
    font-size: 5rem;
    /* Massive heading */
    line-height: 1.05;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    /* Override the default fade-in slide - just smooth opacity */
    animation: heroFadeIn 2.5s ease-out forwards;
    transform: none !important;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hero-divider {
    color: var(--text-muted);
    font-weight: 300;
    opacity: 0.5;
    margin: 0 0.1em;
}

.hero-japanese {
    font-weight: 500;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

/* Hero Visuals */
.hero-visual {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100vh;
    z-index: 0;
    /* Behind text */
    pointer-events: none;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    height: 120%;
    /* Slight zoom for parallax feel later */
    width: auto;
    object-fit: cover;
    opacity: 0.6;
    /* low opacity to blend with dark bg */
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
    animation: float 20s ease-in-out infinite;
}

/* Canvas */
#moai-canvas {
    width: 900px;
    /* Much larger */
    height: 900px;
    max-width: 90vw;
    max-height: 90vh;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1.0);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* Sections */
.section-padding {
    padding: 120px 0;
    /* Significant vertical breathing room */
}

.section-header {
    margin-bottom: 80px;
    text-align: center;
}

.section-subtitle {
    display: block;
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 24px;
}

/* Scramble text - prevent wrapping during animation */
.scramble-text {
    white-space: nowrap;
    display: inline-block;
}

/* About Grid - Clean & Spacious */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    /* Generous gap */
    margin-top: 60px;
}

.about-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 40px;
    /* Airy padding */
    border-radius: 16px;
    transition: all 0.4s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.about-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-glow);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.about-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
}



.service-item h3 {
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.service-item p {
    color: var(--text-secondary);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

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

/* Timeline / Transmission */
.timeline-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-left: 20px;
    /* Scrollable Area */
    max-height: 500px;
    overflow-y: auto;
    padding-right: 20px;
    /* Space for scrollbar */
    /* Mask fade at bottom to show there's more */
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* Custom Scrollbar for Timeline */
.timeline-container::-webkit-scrollbar {
    width: 4px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.timeline-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
    opacity: 0.5;
}

/* The Vertical Line */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent-primary) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 40px;
    opacity: 0.7;
    transition: all 0.3s var(--transition-smooth);
}

.timeline-item:hover {
    opacity: 1;
    transform: translateX(4px);
}

.timeline-item:first-child {
    opacity: 1;
    /* Latest item always bright */
}

/* The Marker Dot */
.timeline-marker {
    position: absolute;
    left: -4px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
    transition: all 0.3s var(--transition-smooth);
}

.timeline-item:hover .timeline-marker,
.timeline-item:first-child .timeline-marker {
    background: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary);
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.timeline-date {
    font-family: 'Space Grotesk', monospace;
    /* Tech feel */
    font-size: 0.85rem;
    color: var(--accent-primary);
    letter-spacing: 0.05em;
}

.tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Contact Section */
.contact-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s var(--transition-smooth);
}

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

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.social-links a:hover {
    color: var(--accent-primary);
}

/* Active Protocols HUD */
.hud-container {
    position: fixed;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    z-index: 900;
    /* Below header but above background */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Align to right */
    gap: 16px;
    font-family: 'Space Grotesk', monospace;
    mix-blend-mode: normal;
    color: var(--text-secondary);
    pointer-events: none;
    /* Let clicks pass through if needed, but we want hover on items */
}

.hud-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    opacity: 0.5;
    margin-bottom: 24px;
    margin-right: 6px;
}

.hud-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 60px;
    /* Increased from 24px to prevent overlap */
    pointer-events: auto;
    /* Enable interaction */
}

.hud-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: relative;
    cursor: default;
    transition: all 0.3s var(--transition-smooth);
    opacity: 0.6;
    margin-right: 12px;
    /* Pull away from the line */
}

.hud-item:hover {
    opacity: 1;
    transform: translateX(-5px);
}

.hud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.hud-item:hover .hud-dot {
    background: var(--accent-secondary);
    box-shadow: 0 0 8px var(--accent-secondary);
}

.hud-text {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.hud-status {
    position: absolute;
    right: 100%;
    margin-right: 12px;
    font-size: 0.65rem;
    color: var(--accent-primary);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.hud-item:hover .hud-status {
    opacity: 1;
    transform: translateX(0);
}

.hud-desc {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    max-width: 180px;
    text-align: right;
    line-height: 1.4;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.hud-item:hover .hud-desc {
    opacity: 0.8;
    transform: translateY(0);
}

/* Vertical Line Trace */
.hud-line {
    position: absolute;
    top: -20px;
    bottom: -20px;
    right: 2px;
    /* Center with dots roughly */
    width: 1px;
    background: var(--glass-border);
    z-index: -1;
}

@media (max-width: 1300px) {
    .hud-container {
        display: none;
        /* Hide on smaller screens to prevent overlap */
    }
}

/* Mobile Header Fixes */
@media (max-width: 768px) {
    .main-header {
        height: auto;
        padding: 12px 0;
    }

    .nav-container {
        flex-direction: column;
        gap: 12px;
        padding: 0 16px;
    }

    .logo {
        justify-content: center;
    }

    .nav-links {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a:not(.btn-primary) {
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    #theme-toggle {
        padding: 6px;
    }

    /* Adjust hero to account for taller header */
    .hero-section {
        padding-top: 120px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }
}