/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navigation styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.nav-links a:hover {
    color: #0ff;
    transform: translateY(-4px);
    animation: jump 0.5s ease;
}

.try-btn {
    background: rgba(0, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.try-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-4px);
    animation: jump 0.5s ease;
}

@keyframes jump {
    0%, 100% { transform: translateY(-4px); }
    50% { transform: translateY(-8px); }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 15px;
    position: relative;
    z-index: 2;
}

.nav-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    opacity: 0;
}

.nav-toggle:hover::before {
    opacity: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.1);
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.nav-toggle:hover span {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Gallery and Certificates styles */
.gallery-grid, .certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.gallery-item, .certificate-item {
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.gallery-item:hover, .certificate-item:hover {
    transform: translateY(-5px);
}

.gallery-item img, .certificate-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certificate-title {
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #ccc;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        gap: 2rem;
    }

    .nav-links.active {
        right: 0;
    }

    .gallery-grid, .certificates-grid {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }
}

/* Cosmic background with stars */
body {
    background-color: #000;
    color: #fff;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
}

/* Starry background implementation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #fff 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    z-index: -2;
    pointer-events: none;
}

/* Twinkling stars animation */
@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Create multiple star layers with different animation */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(#fff 1px, transparent 1px),
        radial-gradient(#fff 1px, transparent 1px),
        radial-gradient(#fff 1px, transparent 1px);
    background-size: 80px 80px, 120px 120px, 160px 160px;
    background-position: 
        0 0,
        40px 60px,
        80px 20px;
    animation: twinkle 8s infinite alternate;
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
}

/* Main container with max-width constraint */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styling */
header {
    text-align: center;
    padding: 80px 20px 40px;
    position: relative;
}

h1 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

h1.visible {
    opacity: 1;
    transform: translateY(0);
}

.subtitle {
    font-size: 1.4rem;
    color: #ccc;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out 0.2s;
}

.subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section styling */
section {
    margin: 80px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #555;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 2px;
    background: #fff;
    transition: width 0.4s ease;
}

section.visible h2::after {
    width: 120px;
}

p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #e0e0e0;
}

/* Media placeholder styling */
.media-placeholder {
    height: 300px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.media-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #222 25%, #333 25%, #333 50%, #222 50%, #222 75%, #333 75%, #333 100%);
    background-size: 20px 20px;
    opacity: 0.2;
}

.media-placeholder p {
    position: relative;
    z-index: 2;
    color: #aaa;
    text-align: center;
    padding: 20px;
    font-style: italic;
    max-width: 80%;
}

/* Refined responsive image styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Media placeholder adjustments */
.media-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    border: 1px solid #333;
}

.media-placeholder img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 768px) {
    .media-placeholder {
        aspect-ratio: 4/3;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .media-placeholder {
        aspect-ratio: 1/1;
        margin: 15px 0;
    }
}

/* Milestone highlight */
.milestone {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #fff;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.milestone strong {
    color: #0ff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

/* Link styling */
a {
    color: #0ff;
    text-decoration: none;
    transition: all 0.3s;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

a:hover {
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.7);
}

/* Scroll to top button */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.005);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    animation: bounce 0.8s ease-in-out infinite;
}

.scroll-top-btn svg {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.scroll-top-btn:hover svg {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .scroll-top-btn {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

/* Footer styling */
footer {
    text-align: center;
    padding: 40px 0 30px;
    margin-top: 60px;
    border-top: 1px solid #333;
    color: #777;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.4rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 15px;
    }
    
    section {
        margin: 60px 0;
    }
    
    .media-placeholder {
        height: 220px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .media-placeholder {
        height: 180px;
    }
}

/* Animation for the cosmic line */
.cosmic-line {
    height: 2px;
    background: linear-gradient(to right, transparent, #fff, transparent);
    width: 0;
    margin: 40px auto;
    transition: width 1.5s ease-out;
}

section.visible .cosmic-line {
    width: 60%;
}