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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #f5f5f0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
.title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.subtitle, .text-large {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 300;
    opacity: 0.85;
    max-width: 320px;
}

.text-large {
    margin-bottom: 1rem;
}

/* Sections */
.section {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    text-align: center;
}

.content {
    max-width: 340px;
    margin-bottom: 3rem;
}

/* CTA Buttons */
.cta {
    background: transparent;
    border: 1px solid rgba(245, 245, 240, 0.3);
    color: #f5f5f0;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 4rem;
    border-radius: 2px;
}

.cta:hover, .cta:focus {
    background: rgba(245, 245, 240, 0.1);
    border-color: rgba(245, 245, 240, 0.5);
    outline: none;
}

.cta:active {
    transform: scale(0.98);
}

/* Animations */
.fade-in-delayed {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1s;
}

.cta-delayed {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 2s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered reveal lines */
.staggered .reveal-line {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.staggered .reveal-line:nth-child(1) { animation-delay: 0.3s; }
.staggered .reveal-line:nth-child(2) { animation-delay: 1s; }

/* Section 4: Cards */
.cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 320px;
    margin-bottom: 3rem;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    border-radius: 4px;
    text-align: left;
}

.card p {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

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

/* Section 5: Reveal with Background Image */
.section-reveal {
    overflow: hidden;
}

.background-image {
    position: absolute;
    inset: 0;
    background-image: url('assets/copenhagen.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.4) saturate(0.8);
    z-index: 0;
}

.overlay-content {
    position: relative;
    z-index: 1;
}

.city-name {
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 200;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.city-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.8;
}

/* Section 6: Detail Cards */
.detail-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 300px;
    margin-bottom: 3rem;
}

.detail-card {
    background: rgba(255, 255, 255, 0.04);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
    display: block;
    margin-bottom: 0.5rem;
}

.detail-card p {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 0.25rem;
}

.detail-sub {
    opacity: 0.6;
    font-size: 0.95rem !important;
}

/* Section 7: Personal Note */
.section-note {
    background: #1a1a1a;
}

.note-text {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 300;
    margin-bottom: 1.25rem;
    opacity: 0.9;
    line-height: 1.7;
}

.signature {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 2.5rem;
    opacity: 0.7;
    font-style: italic;
}

/* Intersection Observer Animation Classes */
.section.visible .content,
.section.visible .cards,
.section.visible .detail-cards {
    animation: sectionFadeIn 0.8s ease forwards;
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Desktop adjustments (not optimized, just acceptable) */
@media (min-width: 768px) {
    .section {
        padding: 4rem 2rem;
    }

    .content, .cards, .detail-cards {
        max-width: 400px;
    }

    .cta {
        bottom: 5rem;
    }
}

/* Tall phones / safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .cta {
        bottom: calc(4rem + env(safe-area-inset-bottom));
    }
}

/* Section 8: Photo Gallery */
.section-gallery {
    min-height: auto;
    padding: 2rem 0;
    scroll-snap-align: start;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    padding: 0 1rem;
}

.gallery-item {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    animation: galleryFadeIn 0.8s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: saturate(0.9);
    transition: filter 0.3s ease;
}

@keyframes galleryFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Desktop gallery */
@media (min-width: 768px) {
    .gallery {
        max-width: 600px;
        padding: 0 2rem;
    }
}
