/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --midnight-void: #0a0a1a;
    --cream-linen: #f8f5ef;
    --moonlight-white: #e8e4dc;
    --deep-graphite: #1a1a2e;
    --electric-fuchsia: #ff2ecc;
    --neon-cyan: #00f5d4;
    --voltage-yellow: #ffd60a;
    --phantom-lavender: #b388ff;
    --nav-overlay-bg: #0a0a2e;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--midnight-void);
    color: var(--moonlight-white);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
}

/* ===== SCROLL SNAP ===== */
#scroll-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
}

/* ===== SECTIONS ===== */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

.section--dark {
    background: var(--midnight-void);
    color: var(--moonlight-white);
}

.section--light {
    background: var(--cream-linen);
    color: var(--deep-graphite);
}

.section__content {
    max-width: 680px;
    width: 100%;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.section__content--wide {
    max-width: 100%;
    padding: 2rem 4rem;
}

/* ===== NAVIGATION ===== */
#nav-anchor {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

#nav-diamond {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diamond-shape {
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--voltage-yellow);
    transform: rotate(45deg);
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#nav-diamond:hover .diamond-shape {
    transform: rotate(45deg) scale(1.3);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 46, 0.92); /* #0a0a2e at 92% */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.nav-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.nav-overlay ul {
    list-style: none;
    text-align: center;
}

.nav-overlay li {
    margin: 1.5rem 0;
}

.nav-overlay a {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--moonlight-white);
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: 0.02em;
}

.nav-overlay a:hover {
    color: var(--neon-cyan);
}

/* ===== HERO ===== */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-line {
    width: 60vw;
    max-width: 600px;
    height: 1px;
    background: var(--neon-cyan);
    transform: scaleX(0);
    transform-origin: center;
    margin-bottom: 1rem;
}

.hero-line.animate {
    animation: drawLine 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes drawLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--moonlight-white);
    opacity: 0;
    transform: translateY(15px);
    text-shadow: 0 0 20px rgba(0, 245, 212, 0.4), 0 0 40px rgba(0, 245, 212, 0.15);
    order: -1;
    margin-bottom: 0.25rem;
}

.hero-title.animate {
    animation: fadeRise 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.hero-tld {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--electric-fuchsia);
    opacity: 0;
}

.hero-tld.animate {
    animation: fadeRise 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Diamond pulse */
.diamond-pulse {
    animation: diamondPulse 0.4s ease forwards;
}

@keyframes diamondPulse {
    0% { transform: rotate(45deg) scale(1); }
    50% { transform: rotate(45deg) scale(1.3); }
    100% { transform: rotate(45deg) scale(1); }
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.section-heading.visible {
    animation: fadeRise 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.section--dark .section-heading {
    text-shadow: 0 0 20px rgba(255, 46, 204, 0.3), 0 0 40px rgba(255, 46, 204, 0.1);
}

/* ===== SECTION BODY TEXT ===== */
.section-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    max-width: 60ch;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.section-body.visible {
    animation: fadeRise 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== SECTION DIVIDERS ===== */
.section-divider {
    height: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: none;
}

.section-divider::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    transform-origin: center;
}

.section-divider[data-color="fuchsia"]::after {
    background: var(--electric-fuchsia);
}

.section-divider[data-color="cyan"]::after {
    background: var(--neon-cyan);
}

.section-divider.visible::after {
    animation: drawLine 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== BACKGROUND ATMOSPHERIC SHAPES ===== */
.bg-shape {
    position: absolute;
    opacity: 0.06;
    z-index: 1;
    pointer-events: none;
}

.bg-shape--circle {
    border-radius: 50%;
    border: 1px solid var(--phantom-lavender);
    animation: rotateShape 100s linear infinite;
}

.bg-shape--hexagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid var(--neon-cyan);
    background: transparent;
    animation: rotateShape 120s linear infinite;
}

.bg-shape--hexagon::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid var(--neon-cyan);
}

@keyframes rotateShape {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== SVG LINE ILLUSTRATIONS ===== */
.meadow-svg,
.horizon-svg {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.svg-line--base {
    stroke: var(--moonlight-white);
}

.svg-line--cyan {
    stroke: var(--neon-cyan);
}

.svg-line--fuchsia {
    stroke: var(--electric-fuchsia);
}

.svg-line--yellow {
    stroke: var(--voltage-yellow);
}

/* Light section SVG colors */
.svg-line--dark {
    stroke: var(--deep-graphite);
}

.svg-line--dark-cyan {
    stroke: var(--neon-cyan);
}

.svg-line--dark-fuchsia {
    stroke: var(--electric-fuchsia);
}

.svg-line--dark-yellow {
    stroke: var(--voltage-yellow);
}

/* ===== GEOMETRIC OVERLAYS ===== */
.geo-overlay {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.geo-overlay.visible {
    opacity: 1;
}

.geo-overlay--circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    opacity: 0.3;
    animation: rotateShape 80s linear infinite;
}

.geo-overlay--circle.visible {
    opacity: 0.3;
}

.geo-overlay--diamond {
    width: 60px;
    height: 60px;
    border: 1px solid var(--electric-fuchsia);
    transform: rotate(45deg);
    opacity: 0.3;
    animation: rotateShape 60s linear infinite;
}

.geo-overlay--diamond.visible {
    opacity: 0.3;
}

.geo-overlay--dark {
    border-color: var(--deep-graphite);
}

.geo-overlay--circle.geo-overlay--dark {
    border-color: var(--deep-graphite);
}

.geo-overlay--diamond.geo-overlay--dark {
    border-color: var(--electric-fuchsia);
}

/* ===== DECORATIVE FRAGMENTS ===== */
.decorative-fragment {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 8rem);
    color: var(--phantom-lavender);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}

.decorative-fragment--dark {
    color: var(--deep-graphite);
    opacity: 0.08;
}

/* ===== CARD FLIP SECTION ===== */
.card-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.flip-card {
    width: 200px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px) rotateX(10deg);
}

.flip-card.visible {
    animation: cardEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(40px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.flip-card__inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-card__inner {
    transform: rotateY(180deg);
}

.flip-card__front,
.flip-card__back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.flip-card__front {
    background: var(--midnight-void);
    border: 1px solid rgba(0, 245, 212, 0.2);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.08);
}

.flip-card__back {
    background: var(--cream-linen);
    border: 1px solid rgba(26, 26, 46, 0.1);
    transform: rotateY(180deg);
}

.card-illustration {
    width: 100%;
    height: 100%;
}

.card-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--deep-graphite);
    line-height: 1.6;
    text-align: center;
}

.card-tap-hint {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--phantom-lavender);
    text-align: center;
    margin-top: 1rem;
    opacity: 0.6;
    display: none;
}

/* ===== CLOSE SECTION ===== */
.close-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.close-shape-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

.close-shape {
    width: 80px;
    height: 80px;
    border: 1px solid var(--voltage-yellow);
    border-radius: 50%;
    animation: rotateShape 60s linear infinite;
    opacity: 0.5;
}

.close-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    max-width: 50ch;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    text-shadow: 0 0 30px rgba(255, 46, 204, 0.3), 0 0 60px rgba(255, 46, 204, 0.1);
}

.close-text.visible {
    animation: fadeRise 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .card-row {
        flex-direction: column;
        align-items: center;
    }

    .flip-card {
        width: 240px;
        height: 320px;
    }

    .bg-shape {
        display: none;
    }

    .nav-overlay {
        width: 100vw;
        height: 100vh;
    }

    .card-tap-hint {
        display: block;
    }

    .section__content--wide {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .section {
        min-height: auto;
        padding-block: 4rem;
    }

    .section-body {
        line-height: 1.85;
    }

    .flip-card {
        width: 220px;
        height: 300px;
    }

    .card-tap-hint {
        display: block;
    }

    .decorative-fragment {
        display: none;
    }
}

/* ===== HOVER STATES FOR DESKTOP CARDS ===== */
@media (hover: hover) {
    .flip-card:hover .flip-card__inner {
        transform: rotateY(180deg);
    }

    .flip-card.flipped .flip-card__inner {
        transform: rotateY(0deg);
    }

    .card-tap-hint {
        display: none;
    }
}
