/* --- Hero --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding: 140px 20px 40px;
}

#hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
    overflow: hidden;
}

#hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 2s;
    filter: brightness(0.5) saturate(1.2);
}

.hero-content {
    z-index: 10;
    max-width: 800px;
}

.hero-controls {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto;
}

.input-pill {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 6px;
    border-radius: 40px;
    display: flex;
    backdrop-filter: blur(15px);
}

.input-pill input {
    background: none;
    border: none;
    padding: 10px 20px;
    color: white;
    flex: 1;
    outline: none;
    font-size: 0.9rem;
}

.btn-pill {
    background: var(--accent-gradient);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    animation: gradientShift 3s ease infinite;
}

.btn-pill:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(167, 139, 250, 0.4);
}

/* --- Gallery Grid --- */
.gallery-section {
    padding: 80px 8%;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-item-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: 0.5s;
    cursor: pointer;
    position: relative;
}

.card-img-wrapper {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #000;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: 1.2s ease;
}

.grid-item-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.grid-item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(167, 139, 250, 0.3);
    border-color: var(--accent);
}

.grid-item-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    transform: translateY(-4px);
}

.source-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.6rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.source-tag.spacex { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.source-tag.unsplash { color: #00d1ff; border-color: rgba(0, 209, 255, 0.4); }
.source-tag.pexels { color: #05a081; border-color: rgba(5, 160, 129, 0.4); }
.source-tag.nasa { color: #ff3d00; border-color: rgba(255, 61, 0, 0.4); }

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    display: none;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(25px);
}

.modal-content {
    background: #0a0a0a;
    width: 100%;
    max-width: 1100px;
    display: flex;
    border: 1px solid var(--glass-border);
    position: relative;
    max-height: 85vh;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-img-side {
    flex: 1.4;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-img-side img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-text-side {
    flex: 1;
    padding: 50px;
    overflow-y: auto;
    background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 100%);
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020204;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.3;
    animation: drift var(--duration) linear infinite;
}

@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-100vh); }
}

.loader-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.singularity-core {
    position: relative;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 50px 20px rgba(167, 139, 250, 0.9),
                0 0 120px 40px rgba(167, 139, 250, 0.5),
                0 0 200px 80px rgba(167, 139, 250, 0.2);
    animation: singularity-pulse 2.5s ease-in-out infinite;
}

@keyframes singularity-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.4); filter: brightness(1.5); }
}

.orbital-ring {
    position: absolute;
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 50%;
    transform-style: preserve-3d;
}

.ring-1 { width: 100px; height: 100px; animation: orbit1 5s linear infinite; border-width: 1.5px; }
.ring-2 { width: 160px; height: 160px; animation: orbit2 8s linear infinite reverse; border-color: rgba(236, 72, 153, 0.2); }
.ring-3 { width: 220px; height: 220px; animation: orbit1 12s linear infinite; }
.ring-4 { width: 280px; height: 280px; animation: orbit2 15s linear infinite reverse; border-color: rgba(236, 72, 153, 0.15); }

@keyframes orbit1 {
    0% { transform: rotateX(70deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(70deg) rotateY(360deg) rotateZ(360deg); }
}

@keyframes orbit2 {
    0% { transform: rotateX(-60deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(-60deg) rotateY(-360deg) rotateZ(360deg); }
}

/* --- Misc --- */
.support-us-footer {
    max-width: 700px;
    margin: 0 auto 60px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 50px 30px;
    border-radius: 32px;
    backdrop-filter: blur(15px);
}

.support-us-footer h2 {
    font-family: 'Playfair Display';
    font-style: italic;
    font-size: 2rem;
    margin-bottom: 15px;
    color: white;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-section { padding: 130px 16px 50px; min-height: auto; }
    .grid-container { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .modal-content { flex-direction: column; max-height: 100dvh; border-radius: 0; height: 100dvh; width: 100%; }
    .modal-img-side { height: 250px; flex: none; }
    .modal-text-side { padding: 24px 20px; flex: 1; }
}

@media (max-width: 480px) {
    .grid-container { grid-template-columns: 1fr; gap: 14px; }
}

/* --- Utility Classes for Refactored Inline Styles --- */
.hero-h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 25px;
    line-height: 1.1;
    animation: float 6s ease-in-out infinite;
}

.hero-p {
    margin-bottom: 40px;
    color: #aaa;
    letter-spacing: 1px;
    font-weight: 300;
}

.date-input-container {
    max-width: 350px;
    margin: 0 auto;
}

.load-more-container {
    text-align: center;
    margin-top: 60px;
}

.load-more-btn-style {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.support-us-desc {
    color: #888;
    margin-bottom: 30px;
}

.support-kofi-btn {
    padding: 15px 35px;
    font-size: 1rem;
}

.grid-item-copy {
    padding: 22px;
}

.grid-item-date {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.grid-item-title {
    font-size: 1rem;
    margin-top: 8px;
    color: white;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    color: white;
    font-size: 2rem;
    background: none;
    border: none;
    z-index: 100;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-date-style {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
}

.m-title-style {
    font-family: 'Playfair Display', serif;
    margin: 15px 0;
    font-size: 2rem;
}

.m-desc-style {
    color: #bbb;
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 40px;
}

.m-dl-btn {
    width: 100%;
    padding: 18px;
    background: white;
    color: black;
    border: none;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 1px;
}

.legal-close-span {
    position: fixed;
    top: 30px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
}

/* --- Interactive Tools Showcase Section --- */
.tools-showcase-section {
    padding: 80px 8% 100px;
    max-width: 1360px;
    margin: 0 auto;
}

.tools-showcase-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.tools-badge {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.tools-showcase-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-style: italic;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #ffffff 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tools-showcase-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
}

.tools-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.tool-feature-card {
    background: rgba(16, 16, 26, 0.65);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 24px;
    padding: 36px 28px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.tool-feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 20px 45px rgba(167, 139, 250, 0.18);
}

.tool-card-icon {
    font-size: 2.2rem;
    margin-bottom: 18px;
}

.tool-feature-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.tool-feature-card:hover h3 {
    color: #c4b5fd;
}

.tool-feature-card p {
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 24px;
    flex: 1;
}

.tool-cta-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.tool-feature-card:hover .tool-cta-text {
    color: #fff;
    transform: translateX(4px);
}

/* --- Featured Stargazing Guides Section --- */
.featured-guides-section {
    padding: 20px 8% 100px;
    max-width: 1360px;
    margin: 0 auto;
}

.featured-guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.featured-guide-card {
    background: rgba(16, 16, 26, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.featured-guide-card:hover {
    transform: translateY(-8px);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 20px 45px rgba(167, 139, 250, 0.22);
}

.guide-card-img-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.guide-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.featured-guide-card:hover .guide-card-img-wrap img {
    transform: scale(1.05);
}

.guide-card-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.guide-card-content {
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.guide-card-meta {
    font-size: 0.73rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.guide-card-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.featured-guide-card:hover .guide-card-content h3 {
    color: #c4b5fd;
}

.guide-card-content p {
    color: var(--text-dim);
    font-size: 0.86rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.guide-cta {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.featured-guide-card:hover .guide-cta {
    color: #fff;
    transform: translateX(4px);
}

.guides-footer-cta {
    text-align: center;
}


