* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-space: #0a0a14;
    --electric-cyan: #00e5ff;
    --neon-magenta: #ff2d78;
    --soft-hot-pink: #ff6b9d;
    --lavender-white: #d8d0e8;
    --phantom-lilac: #8b7fa8;
    --aurora-green: #39ff8e;
    --midnight-indigo: #1a1040;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-space);
    color: var(--lavender-white);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
}

/* Thought Frames */
.thought-frame {
    position: relative;
    width: 100%;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.frame-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 60%;
    padding: 2rem;
}

.frame-content.top-third {
    align-self: flex-start;
    margin-top: 15vh;
}

.frame-content.bottom-third {
    align-self: flex-end;
    margin-bottom: 15vh;
}

/* Origin Frame */
.origin-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.origin-star {
    opacity: 0;
    animation: starFadeIn 600ms ease-out 800ms forwards;
    filter: drop-shadow(0 0 20px #00e5ff) drop-shadow(0 0 60px rgba(0,229,255,0.3));
}

.origin-star svg {
    animation: starPulse 4s ease-in-out infinite;
}

.origin-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(4rem, 8vw, 9rem);
    letter-spacing: 0.15em;
    color: var(--electric-cyan);
    opacity: 0;
    filter: blur(8px);
    animation: blurFocusIn 600ms ease-out 2000ms forwards;
}

.origin-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--phantom-lilac);
    opacity: 0;
    filter: blur(5px);
    animation: blurFocusIn 600ms ease-out 2400ms forwards;
}

/* Thought Headlines */
.thought-headline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw + 0.5rem, 4.5rem);
    color: var(--electric-cyan);
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
}

.closing-title {
    font-size: clamp(3rem, 6vw + 0.5rem, 7rem);
    font-weight: 300;
}

/* Thought Body */
.thought-body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.8;
    color: var(--lavender-white);
    max-width: 540px;
    margin: 0 auto;
}

/* Blur-focus reveal for scroll elements */
.reveal-element {
    opacity: 0.2;
    filter: blur(10px);
    transition: opacity 700ms ease-out, filter 700ms ease-out;
}

.reveal-element.visible {
    opacity: 1;
    filter: blur(0);
}

/* Star Field */
.star-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.star-icon {
    position: absolute;
    pointer-events: all;
    cursor: default;
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.star-icon svg {
    display: block;
}

.star-icon.four-point svg polygon {
    fill: var(--electric-cyan);
}

.star-icon.eight-point svg line {
    stroke: var(--neon-magenta);
    stroke-width: 2;
}

.star-icon.orbit {
    border-radius: 50%;
    border: 1px solid var(--phantom-lilac);
    box-shadow: 0 0 8px rgba(139,127,168,0.3);
}

/* Star animations */
@keyframes starPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes starBreathe {
    0%, 100% { transform: scale(0.9); }
    50% { transform: scale(1.1); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes starFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes blurFocusIn {
    from { opacity: 0; filter: blur(8px); }
    to { opacity: 1; filter: blur(0); }
}

/* Connection Lines */
.connection-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

.connection-lines line {
    stroke: var(--phantom-lilac);
    stroke-width: 1;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease-out, stroke 400ms ease;
}

.connection-lines.active line {
    stroke-dashoffset: 0;
}

/* Synapse Fields */
.synapse-field {
    position: relative;
    height: 20vh;
    overflow: hidden;
}

.synapse-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--phantom-lilac);
    animation: synapseBlink var(--blink-duration, 5s) ease-in-out infinite;
    animation-delay: var(--blink-delay, 0s);
    opacity: 0;
}

@keyframes synapseBlink {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.6; }
}

/* Star hover gravity effect */
.star-icon.attracted {
    filter: drop-shadow(0 0 12px var(--electric-cyan));
}

.star-icon.hovered {
    transform: scale(1.3) !important;
    filter: drop-shadow(0 0 25px var(--electric-cyan)) drop-shadow(0 0 50px rgba(0,229,255,0.5));
}

/* Responsive */
@media (max-width: 768px) {
    .frame-content {
        max-width: 85%;
        padding: 1rem;
    }

    .thought-headline {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
}
