/* ============================================================
   relativity.quest - Styles
   Cinematic | Magazine-spread | Midnight-blue
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #0A1628;
    color: #C8D0D8;
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.8;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 700;
    line-height: 1.2;
    color: #E8DFD0;
}

h1 {
    font-size: clamp(36px, 6vw, 80px);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(32px, 5vw, 72px);
    margin-bottom: 1.2em;
}

h3 {
    font-size: clamp(20px, 2.5vw, 28px);
    margin-bottom: 0.6em;
}

p {
    margin-bottom: 1.2em;
    color: #C8D0D8;
}

.equation {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: clamp(18px, 2vw, 24px);
    color: #D4A855;
    text-align: center;
    padding: 1em 0;
    letter-spacing: 0.05em;
}

.gold-dot {
    color: #D4A855;
}

/* --- Premiere Shot --- */
.premiere-shot {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: #0A1628;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Starfield */
.starfield {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.star-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #C8D0D8;
}

/* Marble Columns */
.marble-column {
    position: absolute;
    top: 0;
    height: 100%;
    width: 40px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.marble-column.visible {
    opacity: 1;
}

.marble-column-left {
    left: 10px;
}

.marble-column-right {
    right: 10px;
}

.marble-column svg {
    width: 100%;
    height: 100%;
}

/* Premiere Content */
.premiere-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    padding: 0 80px;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 40px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    filter: sepia(0.3) contrast(0.85) brightness(0.95);
}

.hero-illustration {
    width: 100%;
    height: auto;
    display: block;
}

.wordmark {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 1.2s, transform 0.6s ease 1.2s;
}

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

.wordmark h1 {
    margin-bottom: 0.2em;
}

.tagline {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 1.5vw, 18px);
    color: #6B7B8B;
    letter-spacing: 0.04em;
}

/* Gold Reveal Line */
.gold-reveal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #D4A855;
    z-index: 10;
    transform: translateX(-100vw);
    opacity: 0;
    transition: none;
}

.gold-reveal-line.animating {
    opacity: 1;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100vw);
}

/* --- Slide Reveal --- */
.slide-reveal {
    position: relative;
    overflow: hidden;
}

.slide-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #0A1628;
    transform-origin: right;
    transform: scaleX(1);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.slide-reveal.revealed::after {
    transform: scaleX(0);
}

/* Gold line on slide reveal */
.slide-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #D4A855;
    z-index: 6;
    transform: translateX(-10px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.slide-reveal.revealing::before {
    opacity: 1;
    transform: translateX(0);
    animation: slideRevealLine 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideRevealLine {
    0% { left: 0; opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* --- Feature Spreads --- */
.feature-spread {
    position: relative;
    padding: 80px 60px;
    background: #0A1628;
    border-top: 1px solid rgba(107, 123, 139, 0.1);
}

.feature-spread::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: #D4A855;
    opacity: 0.4;
}

.spread-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
    align-items: center;
}

.feature-spread-reversed .spread-grid {
    direction: rtl;
}

.feature-spread-reversed .spread-grid > * {
    direction: ltr;
}

.spread-label {
    display: inline-block;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 13px;
    color: #D4A855;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.2em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(212, 168, 85, 0.3);
}

.spread-text p:last-child {
    margin-bottom: 0;
}

/* Spread Images */
.spread-image {
    position: relative;
}

.image-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(107, 123, 139, 0.2);
}

.image-frame .spread-illustration {
    display: block;
    width: 100%;
    height: auto;
    filter: sepia(0.3) contrast(0.85) brightness(0.95);
}

/* Frame Corners (marble-classical decoration) */
.frame-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #6B7B8B;
    border-style: solid;
    opacity: 0.4;
}

.frame-corner-tl {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.frame-corner-tr {
    top: -1px;
    right: -1px;
    border-width: 2px 2px 0 0;
}

.frame-corner-bl {
    bottom: -1px;
    left: -1px;
    border-width: 0 0 2px 2px;
}

.frame-corner-br {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

/* --- Gallery Section --- */
.gallery-section {
    position: relative;
    padding: 80px 0;
    background: #14243A;
    overflow: hidden;
}

.gallery-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
    padding: 0 40px;
}

.gallery-header p {
    font-style: italic;
    color: #6B7B8B;
}

.gallery-track {
    display: flex;
    gap: 30px;
    padding: 0 60px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-track.grabbing {
    cursor: grabbing;
}

.gallery-card {
    flex: 0 0 340px;
    background: #0A1628;
    border: 1px solid rgba(107, 123, 139, 0.15);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.card-image {
    width: 100%;
    overflow: hidden;
}

.card-image svg {
    display: block;
    width: 100%;
    height: auto;
    filter: sepia(0.3) contrast(0.85) brightness(0.95);
}

.gallery-card h3 {
    padding: 20px 24px 0;
    font-size: clamp(18px, 2vw, 22px);
}

.gallery-card p {
    padding: 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #8B7B68;
}

.card-date {
    display: block;
    padding: 12px 24px 20px;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 12px;
    color: #D4A855;
    letter-spacing: 0.1em;
}

/* Gallery Navigation */
.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.gallery-btn {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(107, 123, 139, 0.3);
    background: transparent;
    color: #C8D0D8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.gallery-btn:hover {
    border-color: #D4A855;
    color: #D4A855;
    background: rgba(212, 168, 85, 0.05);
}

/* --- Observatory Footer --- */
.observatory-footer {
    position: relative;
    padding: 100px 40px 60px;
    background: #0A1628;
    text-align: center;
    overflow: hidden;
    border-top: 1px solid rgba(107, 123, 139, 0.1);
}

.footer-starfield {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.footer-columns {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

.footer-column-svg {
    width: 60px;
    height: 160px;
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.footer-wordmark {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    color: #E8DFD0;
    margin-bottom: 1.5em;
}

.footer-quote {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(16px, 1.8vw, 20px);
    color: #C8D0D8;
    line-height: 1.6;
    margin-bottom: 0.5em;
}

.footer-attribution {
    display: block;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 12px;
    color: #6B7B8B;
    letter-spacing: 0.1em;
    margin-bottom: 3em;
}

.footer-frieze {
    max-width: 400px;
    margin: 0 auto;
}

.footer-frieze svg {
    width: 100%;
    height: 10px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .spread-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        min-height: auto;
        padding: 0;
    }

    .feature-spread-reversed .spread-grid {
        direction: ltr;
    }

    .feature-spread {
        padding: 60px 30px;
    }

    .premiere-content {
        padding: 0 40px;
    }

    .marble-column {
        width: 25px;
    }

    .gallery-card {
        flex: 0 0 290px;
    }

    .gallery-track {
        padding: 0 30px;
    }
}

@media (max-width: 600px) {
    .spread-grid {
        gap: 30px;
    }

    .feature-spread {
        padding: 40px 20px;
    }

    .premiere-content {
        padding: 0 20px;
    }

    .marble-column {
        width: 18px;
        opacity: 0.5;
    }

    .marble-column.visible {
        opacity: 0.5;
    }

    .gallery-card {
        flex: 0 0 260px;
    }

    .gallery-track {
        padding: 0 20px;
        gap: 20px;
    }

    .observatory-footer {
        padding: 60px 20px 40px;
    }
}

/* --- Utility Animations --- */
@keyframes twinkle {
    0%, 100% { opacity: var(--star-opacity, 0.4); }
    50% { opacity: calc(var(--star-opacity, 0.4) * 0.3); }
}

.star-dot.twinkle {
    animation: twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
    animation-delay: var(--twinkle-delay, 0s);
}

/* Smooth entrance for sections */
.feature-spread,
.gallery-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-spread.in-view,
.gallery-section.in-view {
    opacity: 1;
    transform: translateY(0);
}
