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

:root {
    /* Dark Space Theme Color Palette */
    --space-black: #0a0e27;
    --space-deep: #151932;
    --space-dark: #1a1f3a;
    --space-medium: #252b4a;

    --spicy-red: #FF6B6B;
    --spicy-red-glow: rgba(255, 107, 107, 0.3);
    --cake-yellow: #FFD93D;
    --rice-cream: #F8F9FA;

    --text-bright: #E8EAF6;
    --text-medium: #B8BCCF;
    --text-dim: #8B90A8;

    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.2);

    /* Section Accent Colors */
    --accent-philo: #FFC56D;
    --accent-past: #FFD93D;
    --accent-focus: #6EA8FF;
    --accent-kore: #6EF2C1;

    /* Spacing */
    --spacing-xs: 1rem;
    --spacing-sm: 2rem;
    --spacing-md: 4rem;
    --spacing-lg: 6rem;
    --spacing-xl: 8rem;

    /* Typography */
    --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-condensed: 'Inter Tight', 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-medium);
    background-color: var(--space-black);
    font-size: 18px;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Single unified transparency overlay for entire body content */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.45);
    z-index: 2;
    pointer-events: none;
}

/* NASA Background Layer */
.nasa-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.40;
    transition: opacity 2s ease-in-out;
}

/* Twinkling Stars Canvas Background */
.stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Content Layer */
nav, header, section, footer {
    position: relative;
    z-index: 10;
}
/* Make main content grow and push footer to bottom */
header.hero, .section { flex: 0 0 auto; }
.footer { flex: 0 0 auto; }


/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--space-black);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.25rem 0;
    z-index: 3000;
    isolation: isolate;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* anchor for dropdown */
}

.nav-logo {
    display: block;
    text-decoration: none;
    height: 100%;
}

.nav-logo-container {
    height: 100px;
    width: auto;
    display: flex;
    align-items: center;
}

.nav-logo-container svg {
    height: 100px;
    width: auto;
    animation: breatheAndFloatSubtle 8s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.nav-logo-container svg:hover {
    transform: scale(1.05);
}

.nav-logo-img {
    height: 100px;
    width: auto;
    animation: breatheAndFloatSubtle 8s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.nav-logo-img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    font-family: var(--font-condensed);
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    position: relative;
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-bright);
    font-size: 1.6rem;
    cursor: pointer;
}

.nav.open .nav-links {
    display: flex;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--spicy-red);
    transition: width 0.3s ease;
}

/* Nav accent variants */
.nav-links a[data-accent="philo"]:hover::after { background: var(--accent-philo); }
.nav-links a[data-accent="past"]:hover::after { background: var(--accent-past); }
.nav-links a[data-accent="focus"]:hover::after { background: var(--accent-focus); }
.nav-links a[data-accent="kore"]:hover::after { background: var(--accent-kore); }
.nav-links a[data-accent="contact"]:hover::after { background: var(--spicy-red); }

.nav-links a:hover::after {
    width: 100%;
}

/* Accent hover and active */
.nav-links a[data-accent="philo"]:hover { color: var(--accent-philo); }
.nav-links a[data-accent="past"]:hover { color: var(--accent-past); }
.nav-links a[data-accent="focus"]:hover { color: var(--accent-focus); }
.nav-links a[data-accent="kore"]:hover { color: var(--accent-kore); }
.nav-links a[data-accent="contact"]:hover { color: var(--spicy-red); }

.nav-links a.active { color: var(--text-bright); }
.nav-links a.active[data-accent="philo"] { color: var(--accent-philo); }
.nav-links a.active[data-accent="past"] { color: var(--accent-past); }
.nav-links a.active[data-accent="focus"] { color: var(--accent-focus); }
.nav-links a.active[data-accent="kore"] { color: var(--accent-kore); }
.nav-links a.active[data-accent="contact"] { color: var(--spicy-red); }
.nav-links a.active::after { width: 100%; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Typography */
h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-bright);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 30px var(--spicy-red-glow);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-bright);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-bright);
    margin-bottom: var(--spacing-xs);
}

p {
    margin-bottom: var(--spacing-xs);
    color: var(--text-medium);
}

/* Hero Section */
.hero {
    min-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(0.25rem + 80px) var(--spacing-sm) 1rem;
}

.hero .container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* HERO LOGO ONLY - specific styles for index page hero */
#hero-logo {
    width: clamp(150px, 30vw, 350px);
    height: auto;
    margin: 0 auto 0.75rem auto;
    display: block;
}

#hero-logo svg,
#hero-logo img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#hero-logo svg {
    animation: breatheAndFloat 8s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.4));
    will-change: transform, filter;
}

/* GENERIC LOGO - for other uses */
.logo {
    width: 100%;
    height: auto;
    margin: 0 0 0.75rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SVG inside logo container */
.logo svg {
    width: clamp(350px, 60vw, 800px);
    height: auto;
    display: block;
    /* All animations removed to prevent position shifting */
    filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.4));
}

/* Fallback image while SVG loads */
.logo img {
    width: clamp(350px, 60vw, 800px);
    height: auto;
    display: block;
}

.tagline {
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 500;
    color: var(--text-bright);
    max-width: 800px;
    margin: 0 auto var(--spacing-sm);
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto;
}

/* Section Styles */
.section {
    padding: var(--spacing-xl) var(--spacing-sm);
}

/* Removed alternating section background to avoid banding while scrolling */
/* .section:nth-child(even) { background-color: rgba(21, 25, 50, 0.3); } */

/* Philosophy Section */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.philosophy-item {
    text-align: center;
    padding: var(--spacing-sm);
    background: transparent;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    transition: all 0.4s ease;
}

.philosophy-item:hover {
    background: transparent;
    border-color: var(--border-medium);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    /* No animation for philosophy emojis */
}

.philosophy-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tagline-text {
    font-size: 1rem; /* subhead */
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

.description-text {
    font-size: 0.95rem; /* body */
    color: var(--text-dim);
    margin-bottom: 0;
}

.philosophy-statement {
    max-width: 800px;
    margin: var(--spacing-md) auto 0;
    text-align: center;
    padding: var(--spacing-sm);
}

.philosophy-statement p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-medium);
    margin-bottom: var(--spacing-xs);
}

.philosophy-statement p:last-child {
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0;
}

/* Journey Section */
.timeline {
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
}

.timeline-item {
    padding: var(--spacing-md) 0;
    border-left: 3px solid var(--spicy-red);
    padding-left: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: var(--spacing-md);
    width: 13px;
    height: 13px;
    background: var(--spicy-red);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--spicy-red-glow);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item h3 {
    color: var(--spicy-red);
    margin-bottom: var(--spacing-xs);
}

.journey-conclusion {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.25rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-bright);
    padding: var(--spacing-md);
    background: transparent;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

/* Focus Areas Section */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-md) auto 0;
    max-width: 900px;
}

.focus-item {
    padding: var(--spacing-md);
    background: transparent;
    border-radius: 12px;
    border: none;
    transition: all 0.4s ease;
    position: relative;
}

.focus-item ul {
    margin-top: 0.5rem;
    margin-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
    color: var(--text-medium);
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
    font-size: 0.95rem; /* body */
    line-height: 1.6;
}

.focus-item li {
    line-height: 1.4;
}

.focus-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    background: transparent;
    border-color: rgba(110, 168, 255, 0.35);
}

/* Card accent utility */
.card-accent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    background: var(--accent-focus);
    opacity: 0.95;
}
.accent-focus::before { background: var(--accent-focus); }
.accent-kore::before { background: var(--accent-kore); }
.accent-past::before { background: var(--accent-past); }
.accent-philo::before { background: var(--accent-philo); }

.section-label {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    color: var(--cake-yellow);
    margin-bottom: var(--spacing-xs);
}

.focus-intro {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.focus-intro h1 {
    text-align: left;
    margin-bottom: var(--spacing-sm);
}

.focus-narrative {
    max-width: 900px;
    display: grid;
    gap: 1.5rem;
}

.focus-narrative p {
    font-size: 1.05rem;
    color: var(--text-bright);
}

.focus-detail h2 {
    text-align: left;
}

.detail-lede {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 860px;
}

.focus-detail-columns {
    margin-top: var(--spacing-md);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-md);
    align-items: start;
}

.focus-detail-body {
    background: transparent;
    border-radius: 12px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-subtle);
}

.focus-side-card {
    background: transparent;
    border-radius: 12px;
    padding: var(--spacing-md);
    border: 1px solid var(--cake-yellow);
}

/* Kitchen Video Gallery - Jellyfin-inspired Cards */
.video-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Future: can switch to two-column on wide screens when adding side details */

.video-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    align-items: start;
    gap: 1rem;
    background: transparent;
    border-radius: 8px;
    overflow: visible;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
}

.video-poster {
    position: relative;
    width: 100%;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.2s ease;
}

/* Theater mode handles video playback, no inline player needed */

.video-card:hover .video-poster {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.video-poster img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.3s ease;
}


/* Ensure Shirokuro poster is visible on dark bg */
.video-card[data-video-src*="Shirokuro-Wall"] .video-poster {
    background: #fff;
}

.video-card:hover .video-poster img {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 40%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-button {
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.video-card:hover .play-button {
    transform: scale(1);
}

.play-button svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.video-info { padding: 0; }

.video-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    color: var(--text-bright);
    line-height: 1.3;
}

.video-meta { color: var(--text-medium); font-size: 0.95rem; margin: 0.5rem 0 0.75rem; }
.tech-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.tech-list li { display: inline-block; padding: 0.15rem 0.4rem; border: 1px solid var(--border-subtle); border-radius: 12px; font-size: 0.8rem; white-space: nowrap; }

@media (max-width: 900px) {
  .video-card { grid-template-columns: 1fr; }
}

.video-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-final {
    background: rgba(110, 242, 193, 0.15);
    border-color: rgba(110, 242, 193, 0.4);
    color: #6ef2c1;
}

.badge-hold {
    background: rgba(255, 159, 104, 0.15);
    border-color: rgba(255, 159, 104, 0.4);
    color: #ff9f68;
}

/* Old inline player styles removed - now using theater mode */

/* Theater mode modal */
.theater-mode {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.theater-mode.active {
    display: flex;
}

.theater-container {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.theater-mode video {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    --glow-color: 110, 168, 255;
    box-shadow:
        0 0 40px rgba(var(--glow-color), 0.5),
        0 0 80px rgba(var(--glow-color), 0.3),
        0 0 120px rgba(var(--glow-color), 0.15),
        0 20px 60px rgba(0, 0, 0, 0.8);
    transition: box-shadow 0.5s ease;
}

/* Portrait videos */
.theater-mode video[data-orientation="portrait"] {
    max-height: 80vh;
    max-width: min(60vw, calc(80vh * 9 / 16));
}

/* Landscape videos */
.theater-mode video[data-orientation="landscape"] {
    max-width: 90vw;
    max-height: min(80vh, calc(90vw * 9 / 16));
}

.theater-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: center;
}

.theater-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-bright);
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.theater-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

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

.focus-list {
    list-style: disc;
    margin-left: 1.25rem;
    margin-top: var(--spacing-sm);
    color: var(--text-medium);
}

.focus-list li {
    margin-bottom: 0.5rem;
}

.video-viewer summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--spicy-red);
    margin-bottom: 1rem;
    list-style: none;
}

.video-viewer summary::-webkit-details-marker {
    display: none;
}

.video-viewer[open] summary {
    margin-bottom: 1rem;
}

.video-viewer video {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #000;
}

/* Principles Section */
.principles-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.principle {
    padding: var(--spacing-md);
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-subtle);
}

.principle:hover {
    background: transparent;
    border-color: rgba(110, 242, 193, 0.35);
}

/* Contact Section */
.contact {
    background: transparent;
}

.contact-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
    font-size: 1.25rem;
    color: var(--text-medium);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-bright);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: var(--font-main);
    background: transparent;
    color: var(--text-bright);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--spicy-red);
    background: transparent;
    box-shadow: 0 0 15px var(--spicy-red-glow);
}

.submit-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--space-black);
    background: linear-gradient(135deg, var(--spicy-red), var(--cake-yellow));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

.form-status {
    margin-top: var(--spacing-sm);
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    display: none;
}

.form-status.success {
    display: block;
    background-color: rgba(76, 175, 80, 0.2);
    color: #90EE90;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.form-status.error {
    display: block;
    background-color: rgba(244, 67, 54, 0.2);
    color: #FF8A80;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

/* Footer */
.footer {
    padding: 0.35rem var(--spacing-sm);
    text-align: center;
    background: var(--space-black);
    border-top: 1px solid var(--border-subtle);
}

/* Fixed thin footer for index only */
.footer--fixed-index {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
}

.footer p {
    color: var(--text-medium);
    margin-bottom: 0;
    display: inline;
    font-size: 0.7rem;
}

.footer p + p::before {
    content: ' • ';
    margin: 0 0.5rem;
    opacity: 0.5;
}

.footer-info {
    font-size: 0.7rem;
    opacity: 0.8;
}

.copyright {
    font-size: 0.7rem;
    opacity: 0.6;
}

.footer-emojis {
    display: inline-block;
    animation: breatheAndFloatSubtle 8s ease-in-out infinite;
    animation-delay: -2s;
}

/* Space Info Icon Button in Navigation */
.nav-space-icon {
    background: transparent;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    margin-left: 0.5rem;
    position: relative;
}

.nav-space-icon svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-space-icon:hover {
    color: var(--spicy-red);
    transform: scale(1.15) rotate(-10deg);
}

.nav-space-icon:hover svg {
    filter: drop-shadow(0 0 12px rgba(255, 107, 107, 0.6));
}

/* NASA Info Panel Modal */
.nasa-info-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.nasa-info-panel.active {
    display: flex;
}

.nasa-panel-container {
    background: var(--space-deep);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.4s ease;
}

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

.nasa-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
}

.nasa-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-bright);
}

.nasa-panel-close {
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nasa-panel-close:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--spicy-red);
}

.nasa-panel-content {
    overflow-y: auto;
    max-height: calc(90vh - 100px);
    padding: 2rem;
}

.nasa-panel-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-size: 1.1rem;
}

.nasa-panel-image {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.nasa-panel-image img {
    width: 100%;
    height: auto;
    display: block;
}

.nasa-panel-details {
    color: var(--text-medium);
}

.nasa-image-title {
    font-size: 1.75rem;
    color: var(--text-bright);
    margin-bottom: 1rem;
}

.nasa-image-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.nasa-date,
.nasa-credit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nasa-image-description {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
}

.nasa-panel-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.nasa-link {
    display: inline-block;
    color: var(--spicy-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nasa-link:hover {
    color: var(--cake-yellow);
    transform: translateX(4px);
}

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

@keyframes breatheAndFloat {
    0% {
        transform: translate(0, 0) scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.4));
    }
    25% {
        transform: translate(2px, -3px) scale(1.01);
        filter: drop-shadow(0 0 22px rgba(255, 107, 107, 0.45));
    }
    50% {
        transform: translate(-1px, -2px) scale(1.015);
        filter: drop-shadow(0 0 24px rgba(255, 211, 61, 0.4));
    }
    75% {
        transform: translate(1px, 2px) scale(1.008);
        filter: drop-shadow(0 0 22px rgba(255, 107, 107, 0.45));
    }
    100% {
        transform: translate(0, 0) scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.4));
    }
}

@keyframes breatheAndFloatSubtle {
    0% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(1px, -1px) scale(1.005);
    }
    50% {
        transform: translate(-1px, -1px) scale(1.008);
    }
    75% {
        transform: translate(1px, 1px) scale(1.004);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

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

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Floating emojis - fully randomized animations */
@keyframes float-drift {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateX(var(--move-x)) translateY(var(--move-y)) rotate(calc(360deg * var(--rotation-speed, 1)));
        opacity: 0;
    }
}

.floating-emojis-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    pointer-events: none;
    animation: float-drift 20s ease-in-out infinite;
    filter: blur(0.5px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    --move-x: 0;
    --move-y: -100vh;
    --rotation-speed: 1;
}

/* Gentle lens flare effect on some stars - CSS-based */
.stars-canvas::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background:
        radial-gradient(ellipse 30px 30px at 12% 18%, rgba(255, 255, 255, 0.15), transparent 60%),
        radial-gradient(ellipse 25px 25px at 38% 35%, rgba(255, 215, 61, 0.1), transparent 60%),
        radial-gradient(ellipse 35px 35px at 68% 22%, rgba(255, 255, 255, 0.12), transparent 60%),
        radial-gradient(ellipse 28px 28px at 85% 78%, rgba(255, 255, 255, 0.14), transparent 60%),
        radial-gradient(ellipse 32px 32px at 25% 65%, rgba(255, 215, 61, 0.08), transparent 60%);
    animation: subtle-glow 4s ease-in-out infinite;
}

@keyframes subtle-glow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --spacing-md: 3rem;
        --spacing-lg: 4rem;
        --spacing-xl: 5rem;
    }

    .nav-container { align-items: center; }
    .nav-toggle { display: block; }
    .nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--space-black);
        border: 1px solid var(--border-subtle);
        border-right: 0;
        border-top: 0;
        padding: 0.75rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        min-width: 220px;
        /* Slide/bounce reveal (closed state) */
        max-height: 0;
        overflow: hidden;
        transform-origin: top right;
        transform: translateY(-10px) scaleY(0.96);
        opacity: 0;
        filter: drop-shadow(0 0 0 rgba(0,0,0,0));
        z-index: 2000;
        visibility: hidden;
        pointer-events: none;
        transition:
            max-height 400ms cubic-bezier(.2,.8,.2,1),
            transform 420ms cubic-bezier(.2,1.2,.2,1),
            opacity 300ms ease,
            filter 420ms ease;
        will-change: max-height, transform, opacity, filter;
    }
    .nav.open .nav-links {
        max-height: 80vh;
        transform: translateY(0) scaleY(1);
        opacity: 1;
        filter: drop-shadow(0 14px 28px rgba(0,0,0,.45));
        visibility: visible;
        pointer-events: auto;
    }
    /* Add a little bounce on children */
    .nav.open .nav-links a {
        animation: navLinkPop 320ms cubic-bezier(.2,1.1,.2,1) both;
    }
    .nav.open .nav-links a:nth-child(1){animation-delay:60ms}
    .nav.open .nav-links a:nth-child(2){animation-delay:90ms}
    .nav.open .nav-links a:nth-child(3){animation-delay:120ms}
    .nav.open .nav-links a:nth-child(4){animation-delay:150ms}
    .nav.open .nav-links a:nth-child(5){animation-delay:180ms}
    .nav.open .nav-links a:nth-child(6){animation-delay:210ms}
    @keyframes navLinkPop {
        0% { transform: translateY(6px) scale(.98); opacity: 0; }
        60% { transform: translateY(-2px) scale(1.015); opacity: 1; }
        100% { transform: translateY(0) scale(1); }
    }
    .nav-logo-img { height: 52px; }

    .focus-grid { grid-template-columns: 1fr; max-width: 640px; gap: var(--spacing-md); }
    .principles-list { grid-template-columns: 1fr; }

    .focus-intro {
        min-height: auto;
        padding-top: var(--spacing-lg);
    }

    .focus-detail-columns {
        grid-template-columns: 1fr;
    }

    .focus-side-card {
        order: -1;
    }

    .timeline-item {
        padding-left: var(--spacing-xs);
    }

    /* Keep philosophy items in a row on mobile */
    .philosophy-grid {
        gap: var(--spacing-xs);
    }

    .philosophy-item {
        padding: 1rem 0.5rem;
    }

    .emoji {
        font-size: 2.5rem;
        margin-bottom: 0.25rem;
    }

    .philosophy-item h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .tagline-text {
        font-size: 0.85rem;
    }

    .description-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .nasa-info-panel {
        padding: 1rem;
    }

    .nasa-panel-container {
        max-height: 95vh;
    }

    .nasa-panel-content {
        padding: 1.5rem;
        max-height: calc(95vh - 80px);
    }

    .nasa-image-title {
        font-size: 1.4rem;
    }

    .nasa-image-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .nasa-image-description {
        font-size: 0.95rem;
    }

    .nav-space-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .focus-grid { grid-template-columns: 1fr; }

    /* Extra compact for small phones */
    .philosophy-item {
        padding: 0.75rem 0.25rem;
    }

    .emoji {
        font-size: 2rem;
    }

    .philosophy-item h3 {
        font-size: 0.9rem;
    }

    .tagline-text {
        font-size: 0.75rem;
    }

    .description-text {
        font-size: 0.7rem;
    }

    .nasa-info-panel {
        padding: 0.5rem;
    }

    .nasa-panel-header {
        padding: 1rem;
    }

    .nasa-panel-header h3 {
        font-size: 1.2rem;
    }

    .nasa-panel-content {
        padding: 1rem;
    }

    .nasa-image-title {
        font-size: 1.2rem;
    }

    .nav-space-icon svg {
        width: 22px;
        height: 22px;
    }
}
