/* =========================================
   1. Space-Inspired Color Palette & Variables
   ========================================= */
:root {
    --deep-space: #0b0d17;
    --star-white: #f8f9fa;
    --nebula-blue: #4db8ff;
    --slate-gray: #1a1d2b;
    --hull-gray: #161b22;
    --success-glow: rgba(77, 184, 255, 0.25);
    --text-main: #e0e0e0;
    --text-dim: #b0b0b0;
}

/* =========================================
   2. Global Styles & Layout Engineering
   ========================================= */
body {
    background-color: var(--deep-space);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    /* Centers the website container */
    padding: 0 20px;
    /* Gutter space for mobile */
}

/* Ensure images inside articles/sections don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   3. Header & Navigation (UPDATED TO MATCH SCREENSHOT)
   ========================================= */
header {
    text-align: center;
    padding: 60px 0 30px 0;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 30px;
    /* Added spacing for the tiered look */
    color: #ffffff;
}

/* Primary Navigation Level */
nav ul {
    display: flex;
    justify-content: center;
    list-style-type: none;
    padding: 0;
    gap: 60px;
    /* Horizontal spacing between Home, Experience, Education */
    align-items: flex-start;
    /* Keeps main links on the same horizontal line */
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--nebula-blue);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    position: relative;
    /* For the animated underline */
}

/* Nested Sub-Navigation (The Bullet Points under Home) */
.sub-nav {
    display: flex;
    flex-direction: column;
    /* Vertical stack for Home contents */
    gap: 8px;
    margin-top: 15px;
    padding-left: 15px;
    border-left: 1px solid #333;
    /* Vertical guide line from screenshot */
    align-items: flex-start;
    list-style-type: disc;
    /* Enables bullet points */
}

.sub-nav li {
    font-size: 0.75rem;
    margin-bottom: 2px;
    color: #666;
    /* Dimmed color for secondary items */
    display: list-item;
    /* Ensures bullet shows up */
}

.sub-nav a {
    text-transform: capitalize;
    font-weight: normal;
    color: #8899a6;
    font-size: 0.8rem;
}

.sub-nav a:hover {
    color: var(--nebula-blue);
}

.sub-nav a::after {
    display: none;
}

/* Remove underline effect for sub-nav */

/* Specific style for the "Back" link on Project Pages */
header p a {
    color: #8899a6;
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: bold;
}

header p a:hover {
    color: var(--nebula-blue);
}

/* Underline Hover Effect for Primary Links */
nav>ul>li>a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--nebula-blue);
    transition: width 0.3s ease;
}

nav>ul>li>a:hover::after {
    width: 100%;
}

nav a:hover {
    color: #ffffff;
}

/* Header Resume Button (Branding Upgrade) */
.nav-resume-btn {
    border: 1px solid var(--nebula-blue);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.75rem !important;
}

.nav-resume-btn:hover {
    background: var(--nebula-blue);
    color: var(--deep-space) !important;
}

/* =========================================
   4. Hero Section (Home Page)
   ========================================= */
.hero-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    margin: 40px 0;
    border-bottom: 1px solid var(--slate-gray);
    padding-bottom: 40px;
}

#about {
    flex: 2;
    min-width: 300px;
}

#about h2 {
    margin-top: 0;
    color: #ffffff;
}

.profile-photo {
    flex: 1;
    max-width: 250px;
    width: 100%;
    height: auto;
    border: 2px solid #333;
    border-radius: 4px;
}

/* =========================================
   5. General Section & Text Styling
   ========================================= */
section {
    padding: 40px 0;
    border-bottom: 1px solid var(--slate-gray);
}

h2 {
    color: var(--nebula-blue);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

p {
    color: var(--text-dim);
}

/* Spacing for Lists inside Project Detail Pages */
main ul li {
    margin-bottom: 10px;
}

main ul li strong {
    color: var(--nebula-blue);
}

/* =========================================
   6. Project Items & Cards (Interactive Polish)
   ========================================= */
.project-item {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--success-glow);
    border-color: var(--nebula-blue);
    background: #1c2128;
}

/* Project Thumbnails Layout (New) */
.project-flex {
    display: flex;
    gap: 25px;
    align-items: center;
}

.project-thumbnail {
    flex: 1;
    max-width: 180px;
    border-radius: 6px;
    border: 1px solid var(--slate-gray);
    overflow: hidden;
}

.project-thumbnail img {
    filter: grayscale(30%);
    transition: filter 0.3s ease;
}

.project-flex:hover .project-thumbnail img {
    filter: grayscale(0%);
}

.project-content {
    flex: 3;
}

.project-item h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.project-item a.read-more {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.project-item a.read-more:hover {
    color: var(--nebula-blue);
    padding-left: 5px;
}

/* =========================================
   7. Skills & Definition Lists
   ========================================= */
dt {
    color: var(--nebula-blue);
    font-weight: bold;
    margin-top: 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

dd {
    margin-left: 0;
    margin-top: 5px;
    border-left: 2px solid var(--nebula-blue);
    padding-left: 15px;
    color: var(--text-dim);
}

/* =========================================
   8. Experience Cards (experience.html)
   ========================================= */
.exp-card {
    background: var(--hull-gray);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--nebula-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.exp-card:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px var(--success-glow);
}

.exp-card h3 {
    margin-top: 0;
    color: #ffffff;
}

.date {
    color: var(--nebula-blue);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 10px;
    display: block;
}

/* =========================================
   9. Philosophy & Blockquotes
   ========================================= */
#philosophy blockquote {
    font-style: italic;
    font-size: 1.1rem;
    color: #ffffff;
    border-left: 4px solid var(--nebula-blue);
    padding: 20px;
    margin: 20px 0;
    background: var(--hull-gray);
    border-radius: 0 8px 8px 0;
}

/* =========================================
   10. Footer & Buttons
   ========================================= */
footer {
    text-align: center;
    padding: 60px 0;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid var(--slate-gray);
    margin-top: 40px;
}

.contact-links,
.social-links,
.footer-content {
    margin-bottom: 20px;
}

.footer-link,
.github-link {
    text-decoration: none;
    color: var(--nebula-blue);
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer-link:hover,
.github-link:hover {
    color: #ffffff;
}

.download-btn {
    display: inline-block;
    background-color: var(--nebula-blue);
    color: var(--deep-space) !important;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: transform 0.2s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(77, 184, 255, 0.3);
}

.download-btn:hover {
    background-color: #ffffff;
    transform: translateY(-3px);
}

.repo-btn {
    display: inline-block;
    background-color: #24292e;
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #444;
    transition: background 0.3s;
    margin-top: 15px;
}

.repo-btn:hover {
    background-color: var(--nebula-blue);
    color: var(--deep-space) !important;
}

/* =========================================
   11. Project Deep-Dive Elements (Deep Dive Pages)
   ========================================= */
.project-hero {
    background: linear-gradient(135deg, var(--hull-gray) 0%, var(--deep-space) 100%);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--slate-gray);
    margin-bottom: 40px;
}

.project-hero h1 {
    margin: 0;
    color: var(--nebula-blue);
}

.project-hero .subtitle {
    font-size: 1.1rem;
    color: #8899a6;
    margin-top: 10px;
}

.project-hero .meta {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--nebula-blue);
    text-transform: uppercase;
    font-weight: bold;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid var(--slate-gray);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* =========================================
   12. Experience Link Readability Fix
   ========================================= */
.exp-card a,
.exp-card a.read-more {
    color: var(--nebula-blue) !important;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.exp-card a:hover,
.exp-card a.read-more:hover {
    color: #ffffff !important;
    padding-left: 5px;
}

/* =========================================
   13. Engineering Gallery Grid
   ========================================= */
.engineering-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.grid-item {
    background: var(--hull-gray);
    border: 1px solid var(--slate-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.02);
    border-color: var(--nebula-blue);
}

.grid-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--slate-gray);
}

.caption {
    padding: 15px;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}


/* =========================================
   14. Rocket "Scroll to Top" Styles
   ========================================= */
#rocket-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    user-select: none;
}

/* Hidden state: slightly lower and invisible */
.rocket-hidden {
    opacity: 0;
    transform: translateY(50px);
    pointer-events: none;
}

/* Visible state */
.rocket-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Launch Animation: Rocket flies up the screen */
.rocket-launch {
    transform: translateY(-100vh) !important;
    transition: transform 0.8s cubic-bezier(.47, 0, .74, .71) !important;
}

/* =========================================
   15. Unified Education Logo Styling
   ========================================= */
/* Target both the SVG (vector) and JPEG (raster) logos with the same rules */
.edu-logo-vector, 
.edu-logo-raster {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px;
    max-width: 45px;
    object-fit: contain;
    flex-shrink: 0;
    background-color: #ffffff; 
    border-radius: 4px;
    padding: 4px;
    display: block;
    box-sizing: border-box; /* 🟢 Prevents padding from making JPEGs look bigger */
    
    /* 🟢 Keeps the Goyang-si school JPEGs sharp and clear */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.edu-item-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* =========================================
   16. Current Mission Log Styling
   ========================================= */
.log-container {
    border-left: 1px solid #333; /* Matches your sub-nav style */
    padding-left: 20px;
    margin-left: 10px;
}

.log-entry {
    margin-bottom: 25px;
    position: relative;
}

/* The "Dot" on the timeline */
.log-entry::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--nebula-blue); /* */
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success-glow); /* */
}

.log-date {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--nebula-blue); /* */
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.log-content p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.log-content strong {
    color: #ffffff;
}


/* =========================================
   17. Contact Form (Balanced Dark Theme)
   ========================================= */
.contact-card {
    background: var(--hull-gray); /* Matches project cards */
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--slate-gray);
    max-width: 600px; /* Limits width to keep it centered and professional */
    margin: 40px auto; /* Centers the form on the page */
}

.form-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column; /* Stacks label on top of input */
    align-items: flex-start;
}

.form-group label {
    color: var(--nebula-blue); /* Consistent blue labels */
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.form-group input, 
.form-group textarea {
    width: 100%; /* Spans full width of the card for balance */
    padding: 12px;
    background-color: var(--deep-space) !important; /* Removes white background */
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box; /* Prevents overflow */
}

/* Focused state for high-tech feedback */
.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--nebula-blue);
    box-shadow: 0 0 10px var(--success-glow); /* Adds that signature glow */
}

.contact-card button {
    width: 100%; /* Makes the button as wide as the inputs for symmetry */
    margin-top: 10px;
    cursor: pointer;
}

/* =========================================
   18. Satellite Signal Animation
   ========================================= */
.satellite-pulse {
    display: inline-block;
    border-radius: 50%;
    animation: signal-pulse 2s infinite;
}

@keyframes signal-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(77, 184, 255, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(77, 184, 255, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(77, 184, 255, 0);
    }
}

/* =========================================
   19. Utility: Full-Screen Centering
   ========================================= */
.full-screen-center {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100vh !important;
    max-width: none !important; /* Breaks out of the 900px body limit */
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    text-align: center;
}

/* =========================================
   20. Starfield Background Logic
   ========================================= */
.starfield {
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    overflow: hidden;
    position: relative;
}

/* Creating CSS-only stars */
.starfield::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: white;
    /* This creates 50+ "stars" using box-shadows */
    box-shadow: 
        15vw 10vh #fff, 35vw 45vh #fff, 85vw 25vh #fff, 
        10vw 80vh #fff, 50vw 20vh #fff, 70vw 60vh #fff, 
        90vw 90vh #fff, 25vw 30vh #fff, 5vw 50vh #fff;
    opacity: 0.5;
    animation: twinkle 5s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}


/* =========================================
   Creative Link Customization
   ========================================= */

/* 1. Set the default color to your Swiss Orange */
nav > ul > li > a.nav-creative {
    color: #FF4500;
}

/* 2. Fix the Underline: Override the blue with orange */
nav > ul > li > a.nav-creative::after {
    background-color: #FF4500;
}

/* 3. Restore the Special Effect: Ensure it turns white on hover like others */
nav > ul > li > a.nav-creative:hover {
    color: #ffffff;
}