/**
 * Spacecraft/rocket attitude control simulation - Stylesheet
 */


/* === FONTS === */

/**
 * Import custom webfonts.
 */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:wght@500&display=swap');

/* === RESET & BASE STYLES === */

/**
 * CSS Reset: Remove default browser styling for consistent cross-browser appearance
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/**
 * Body: Full-screen space environment
 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

/* === CANVAS STYLES === */

/**
 * Canvas: Full-screen simulation surface
 */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: default;
    touch-action: manipulation;
}

/* === UI PANEL SYSTEM === */

/**
 * Panel: Glassmorphism-style floating UI elements
 */
.panel {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    font-size: 14px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Newsreader', serif;
}

/* === NAME PANEL === */
#name-panel {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    font-size: 22px;
    font-weight: 500;
    white-space: nowrap;
    
    /* Flexbox layout for alignment */
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90vw;
    max-width: 450px;
}

/* Nudge name text up slightly for better vertical alignment with Newsreader font */
#name-panel .name {
    position: relative;
    top: 3px;
    color: #e2e8f0;
}

/* Styling for the name link to remove default underline */
#name-panel a.name-link,
#name-panel a.name-link:visited {
    text-decoration: none;
    color: #e2e8f0;
    transition: color 0.2s ease-in-out;
}

#name-panel a.name-link:hover {
    color: #fff;
}

/* Container for social icons */
.social-icons {
    display: flex;
    align-items: center;
    gap: 18px; /* Creates space between the icons */
}

/* Styling for the icon links */
.social-icons a {
    color: #e2e8f0;
    display: inline-flex;
    transition: all 0.2s ease-in-out;
}

.social-icons a:hover {
    color: #fff;
    transform: scale(1.1);
}

/* SVG icon sizing */
.social-icons svg {
    width: 22px;
    height: 22px;
}


/* === INSTRUCTIONS PANEL === */

/**
 * Instructions
 */
.instructions {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    max-width: 90vw;
}

/**
 * Close Button
 */
.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.05);
}

.close-btn:active {
    transform: scale(0.95);
}

/* === COMING SOON TEXT === */
.coming-soon-text {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    color: #e2e8f0;
    font-family: 'Newsreader', serif;
    font-size: 24px;
    white-space: nowrap;
    background: transparent;
    border: none;
    padding: 0;
}

/* === RESPONSIVE DESIGN === */

/**
 * Progressive font size reduction for smaller screens
 * Keeps text on single line while maintaining readability
 */

/* Large tablets and small desktops */
@media (max-width: 768px) {
    .instructions {
        font-size: 13px;
        gap: 9px;
        padding: 10px 14px;
        max-width: 92vw;
    }
    
    .close-btn {
        font-size: 15px;
    }
}

/* Small tablets */
@media (max-width: 640px) {
    .instructions {
        font-size: 12px;
        gap: 8px;
        padding: 9px 13px;
        max-width: 94vw;
    }
    
    .close-btn {
        font-size: 14px;
        padding: 2px 5px;
    }
}

/* Large phones */
@media (max-width: 480px) {
    .instructions {
        font-size: 11px;
        gap: 7px;
        padding: 10px 12px;
        bottom: 15px;
        max-width: 96vw;
    }
    
    .panel {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .close-btn {
        font-size: 13px;
        padding: 1px 4px;
    }
    #name-panel {
        font-size: 19px;
        padding: 10px 15px;
    }
    #name-panel .name {
        top: 2px;
    }
    .social-icons {
        gap: 14px;
    }
    .social-icons svg {
        width: 21px;
        height: 21px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .instructions {
        font-size: 10px;
        gap: 6px;
        padding: 8px 10px;
        bottom: 10px;
        max-width: 98vw;
    }
    
    .close-btn {
        font-size: 12px;
        padding: 1px 3px;
    }
    #name-panel {
        font-size: 17px;
    }
    .social-icons {
        gap: 12px;
    }
    .social-icons svg {
        width: 19px;
        height: 19px;
    }
}

/* Very small phones */
@media (max-width: 320px) {
    .instructions {
        font-size: 9px;
        gap: 5px;
        padding: 7px 8px;
        max-width: 99vw;
    }
    
    .close-btn {
        font-size: 11px;
        padding: 1px 2px;
    }
    #name-panel {
        font-size: 15px;
        padding: 8px 12px;
    }
    #name-panel .name {
        top: 1px;
    }
    .social-icons {
        gap: 8px;
    }
    .social-icons svg {
        width: 17px;
        height: 17px;
    }
}

/**
 * High DPI Display Optimization
 * - Ensures crisp rendering on Retina/high-DPI screens
 * - Prevents blurry text on modern displays
 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .panel {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* === ACCESSIBILITY IMPROVEMENTS === */

/**
 * Focus Indicators
 */
.close-btn:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/**
 * Reduced Motion: Respect user preferences
 */
@media (prefers-reduced-motion: reduce) {
    .close-btn {
        transition: none;
    }
    
    .close-btn:hover {
        transform: none;
    }
    
    .close-btn:active {
        transform: none;
    }
}

/* === PRINT STYLES === */

/**
 * Print Optimization: Hide interactive elements when printing
 */
@media print {
    canvas,
    .panel {
        display: none;
    }
    
    body::after {
        content: "This is an interactive rocket simulation. Please view online for the full experience.";
        display: block;
        padding: 20px;
        text-align: center;
        color: #000;
        background: #fff;
    }
}