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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #f5f0e8;
    color: #4a3f5c;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* === Hero Section === */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f0e8;
    position: relative;
}

.hero-domain {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inconsolata', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7d6e8a;
    opacity: 0.6;
}

.hero-center {
    text-align: center;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(5rem, 15vw, 12rem);
    color: #3b2d4f;
    letter-spacing: 0.03em;
    line-height: 1.1;
    animation: heroReveal 1.8s ease-out forwards;
    opacity: 0;
    filter: blur(8px);
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #a88fbf;
    margin-top: 0.5rem;
    animation: heroReveal 1.8s ease-out 0.3s forwards;
    opacity: 0;
    filter: blur(8px);
}

@keyframes heroReveal {
    to {
        opacity: 1;
        filter: blur(0px);
    }
}

/* === Reading Column === */
.reading-column {
    max-width: 620px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    position: relative;
}

/* === Typography === */
.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: #3b2d4f;
    letter-spacing: 0.03em;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.reading-column p {
    margin-bottom: 1.5rem;
    color: #4a3f5c;
}

/* === Margin Annotations === */
.margin-annotation {
    position: absolute;
    width: 160px;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    color: #a88fbf;
    opacity: 0.7;
    line-height: 1.4;
}

.margin-annotation.left {
    left: -200px;
    text-align: right;
}

.margin-annotation.right {
    right: -200px;
    text-align: left;
}

/* === Fade-Reveal System === */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

.margin-annotation[data-reveal].revealed {
    opacity: 0.7;
}

/* === Section Dividers === */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    max-width: 300px;
    margin: 0 auto;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #c9a0b5;
    opacity: 0.4;
}

.divider-stars {
    flex-shrink: 0;
}

/* === Constellation Sections === */
.constellation-section {
    position: relative;
    min-height: 80vh;
    background: #2c2440;
    display: flex;
    flex-direction: column;
}

.constellation-transition-top {
    height: 30vh;
    background: linear-gradient(to bottom, #f5f0e8, #2c2440);
    flex-shrink: 0;
}

.constellation-transition-bottom {
    height: 30vh;
    background: linear-gradient(to bottom, #2c2440, #f5f0e8);
    flex-shrink: 0;
}

.constellation-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 60vh;
    padding: 4rem 2rem;
}

.constellation-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.constellation-phrase {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: #d4c5a0;
    text-align: center;
    max-width: 600px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.constellation-closing {
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 9rem);
    color: #d4c5a0;
    letter-spacing: 0.03em;
}

.constellation-closing-sub {
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #a88fbf;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-top: 1rem;
}

/* Constellation label hover */
.constellation-label {
    cursor: default;
    transition: opacity 300ms, transform 300ms;
}

.constellation-label:hover {
    opacity: 1 !important;
    transform: scale(1.05);
}

/* Star animations */
.constellation-section.in-view .star {
    animation: starFadeIn 400ms ease-out forwards;
}

.constellation-section.in-view .star-line {
    stroke-dashoffset: 200;
    animation: lineDraw 1200ms ease-out 500ms forwards;
}

@keyframes starFadeIn {
    to { opacity: 0.8; }
}

@keyframes lineDraw {
    to { stroke-dashoffset: 0; }
}

.star-line {
    stroke-dashoffset: 200;
}

/* === Photograph Sections === */
.photograph-section {
    width: 100%;
    overflow: hidden;
}

.photograph-container {
    position: relative;
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.photograph-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: contrast(0.85) brightness(1.05) saturate(0.2);
    transform: scale(1.08);
    transition: transform 1.5s ease-out;
}

.photograph-image.zoomed {
    transform: scale(1.0);
}

/* Photo placeholder gradients (since no actual images) */
#photo-1 {
    background: linear-gradient(135deg, #8a7e9a 0%, #b8a8c0 30%, #9e96a8 60%, #7d7590 100%);
}

#photo-2 {
    background: linear-gradient(160deg, #a09088 0%, #c4b8b0 35%, #8e8680 65%, #6e6860 100%);
}

.photograph-overlay {
    position: absolute;
    inset: 0;
    background: #d8d0e4;
    mix-blend-mode: multiply;
    opacity: 0.4;
}

.photograph-caption {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #e8dfd4;
    z-index: 1;
}

/* === Prose Section === */
.prose-section {
    background: #f5f0e8;
    position: relative;
}

/* === Mobile Adaptation === */
@media (max-width: 1200px) {
    .margin-annotation {
        position: relative;
        left: auto !important;
        right: auto !important;
        width: auto;
        text-align: left !important;
        border-left: 2px solid #c9a0b5;
        padding-left: 1rem;
        margin: 1.5rem 0;
        font-style: italic;
        opacity: 0.8;
    }

    .margin-annotation[data-reveal].revealed {
        opacity: 0.8;
    }
}

@media (max-width: 768px) {
    .constellation-section {
        min-height: 60vh;
    }

    .constellation-content {
        min-height: 40vh;
    }

    .photograph-overlay {
        opacity: 0.3;
    }

    .reading-column {
        padding: 3rem 1.25rem;
    }

    .constellation-transition-top,
    .constellation-transition-bottom {
        height: 20vh;
    }
}

/* === Last constellation has no bottom transition to cream === */
.constellation-final .constellation-transition-bottom {
    background: linear-gradient(to bottom, #2c2440, #2c2440);
    height: 10vh;
}
