/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Caveat:wght@400&family=Play:wght@300;400;700&display=swap');

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

body {
    font-family: 'Play', sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #121317 url('pleiades.jpg') center 35% / 150% no-repeat fixed;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    pointer-events: none;
    z-index: 0;
}

/* Background stars */
.stars, .stars2, .stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 0;
}

.stars {
    background:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent),
        radial-gradient(1px 1px at 140px 120px, white, transparent),
        radial-gradient(1px 1px at 30px 100px, white, transparent),
        radial-gradient(2px 2px at 110px 45px, white, transparent),
        radial-gradient(1px 1px at 170px 150px, white, transparent),
        radial-gradient(2px 2px at 25px 165px, white, transparent);
    background-size: 200px 200px;
    background-repeat: repeat;
    animation: twinkle 3s ease-in-out infinite alternate, drift 60s linear infinite;
    opacity: 0.9;
}

.stars2 {
    background:
        radial-gradient(1px 1px at 40px 60px, #ffffff, transparent),
        radial-gradient(1px 1px at 100px 100px, #ffffff, transparent),
        radial-gradient(1px 1px at 150px 25px, #ffffff, transparent),
        radial-gradient(2px 2px at 75px 125px, #aaaaff, transparent),
        radial-gradient(1px 1px at 10px 90px, #ffffff, transparent),
        radial-gradient(1px 1px at 160px 70px, #ffffff, transparent),
        radial-gradient(1px 1px at 45px 140px, #ffffff, transparent),
        radial-gradient(1px 1px at 115px 35px, #ffffff, transparent);
    background-size: 200px 200px;
    background-repeat: repeat;
    animation: twinkle 4s ease-in-out infinite alternate-reverse, drift 90s linear infinite;
    opacity: 0.7;
}

.stars3 {
    background:
        radial-gradient(1px 1px at 70px 40px, #ffffaa, transparent),
        radial-gradient(2px 2px at 120px 90px, #ffaaaa, transparent),
        radial-gradient(1px 1px at 35px 15px, #ffffff, transparent),
        radial-gradient(1px 1px at 95px 130px, #aaffff, transparent),
        radial-gradient(1px 1px at 145px 55px, #ffffff, transparent),
        radial-gradient(1px 1px at 55px 110px, #ffffff, transparent);
    background-size: 250px 250px;
    background-repeat: repeat;
    animation: twinkle 5s ease-in-out infinite alternate, drift 120s linear infinite;
    opacity: 0.5;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(-200px, -200px); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Main Frame */
#main-frame {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 700px;
    margin: 60px auto;
    background: url('pleiades.jpg') center center / cover no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.site-title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Kalam', cursive;
    font-size: 3rem;
    font-weight: 400;
    color: #f0e6d2;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9),
                 0 0 5px rgba(0, 0, 0, 1),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 5;
    line-height: 1.3;
}

.site-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5),
                 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#shooting-stars-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#nav-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    padding: 40px 20px;
}

@media (max-width: 480px) {
    #nav-container {
        padding: 20px 10px;
    }

    .site-title {
        font-size: 2rem;
        top: 15px;
    }

    .site-subtitle {
        font-size: 0.9rem;
        text-shadow: 0 0 3px rgba(0, 0, 0, 0.4),
                     1px 1px 1px rgba(0, 0, 0, 0.3);
    }
}

.nav-link {
    font-family: 'Play', sans-serif;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9),
                 0 0 5px rgba(0, 0, 0, 1),
                 2px 2px 3px rgba(0, 0, 0, 0.7);
    transition: color 0.3s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.nav-link:hover {
    color: white;
}

.nav-link.name {
    font-family: 'Play', sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #f0e6d2;
    pointer-events: none;
}

.star-name {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Footer Inside Frame */
.footer-inside {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    text-align: center;
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 100;
}

.contact-link {
    font-family: 'Kalam', cursive;
    color: #e85d4d;
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    border-bottom: 1px solid rgba(232, 93, 77, 0.5);
}

.contact-link:hover {
    color: #ff7d6d;
    border-bottom-color: rgba(255, 125, 109, 0.8);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Kalam', cursive;
}

.footer-info {
    font-family: 'Kalam', cursive;
    color: #999;
    font-size: 1rem;
    font-weight: 300;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        background-size: 250%;
    }

    #main-frame {
        height: 500px;
        margin: 20px 10px;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .nav-link.name {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    body {
        background-size: 300%;
    }

    .container {
        padding: 10px;
    }

    #main-frame {
        height: 650px;
        margin: 10px 5px;
    }

    .nav-link {
        font-size: 1.2rem;
        letter-spacing: 0.02em;
    }

    .nav-link.name {
        font-size: 1.5rem;
        letter-spacing: 0.05em;
    }

    .star-name {
        font-size: 1rem;
    }

    .footer-inside {
        font-size: 0.7rem;
        gap: 10px;
        bottom: 40px;
    }

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

/* Page Layouts */
.page-frame {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: #9bb3e0;
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #ffffff;
}

.page-title {
    font-family: 'Kalam', cursive;
    font-size: 3rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(155, 179, 224, 0.5);
}

.page-description {
    text-align: center;
    font-size: 1.2rem;
    color: #9bb3e0;
    margin-bottom: 3rem;
    font-style: italic;
}

.page-content {
    min-height: 50vh;
}

/* Grid Layouts */
.musings-grid,
.photos-grid,
.webapps-grid,
.tools-grid,
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Card Styles */
.musing-card,
.photo-card,
.webapp-card,
.tool-card,
.book-card {
    background: rgba(18, 19, 23, 0.8);
    border: 1px solid rgba(155, 179, 224, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.musing-card:hover,
.photo-card:hover,
.webapp-card:hover,
.tool-card:hover,
.book-card:hover {
    border-color: rgba(155, 179, 224, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(155, 179, 224, 0.3);
}

.musing-card h3,
.photo-card h3,
.webapp-card h3,
.tool-card h3,
.book-card h3 {
    font-family: 'Kalam', cursive;
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1rem;
}

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

/* Thumbnails */
.photo-thumbnail,
.webapp-thumbnail,
.tool-thumbnail,
.book-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.3);
}

.photo-thumbnail img,
.webapp-thumbnail img,
.tool-thumbnail img,
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Subdomain Display */
.photo-subdomain,
.webapp-subdomain {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #7a9bc4;
    margin-bottom: 0.5rem;
}

/* Descriptions */
.musing-description,
.photo-description,
.webapp-description,
.tool-description,
.book-description {
    color: #c0c0c0;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Dates and Metadata */
.musing-date {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

.book-status,
.book-year {
    font-size: 0.9rem;
    color: #9bb3e0;
}

/* Tags */
.webapp-tags,
.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(155, 179, 224, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    color: #9bb3e0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9bb3e0;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.empty-state .hint {
    font-size: 0.9rem;
    color: #7a9bc4;
    font-family: 'Courier New', monospace;
}

.empty-state code {
    background: rgba(155, 179, 224, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

/* Responsive adjustments for pages */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .musings-grid,
    .photos-grid,
    .webapps-grid,
    .tools-grid,
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .page-frame {
        padding: 2rem 1rem;
    }
}
