@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    background: #0a0e1a;
    color: #e8edf5;
    overflow-x: hidden;
    line-height: 1.75;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Sections */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.section-veil,
.section-cards,
.section-constellation,
.section-return {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-passage {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Marble Backgrounds */
.marble-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0a0e1a 0%, #111b33 40%, #1a2744 70%, #0f1628 100%);
    z-index: -2;
}

.marble-bg-1 {
    filter: url(#marble1);
}

.marble-bg-2 {
    filter: url(#marble2);
}

.marble-bg-3 {
    filter: url(#marble1);
    background: linear-gradient(135deg, #0a0e1a 0%, #111b33 30%, #1a2744 60%, #1a1a28 100%);
}

/* Atmosphere Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(78,225,245,0.35), rgba(155,114,207,0.1) 60%, transparent);
    filter: blur(2px);
    pointer-events: none;
    z-index: 1;
    animation: float 20s ease-in-out infinite alternate;
}

.orb-1 {
    width: clamp(80px, 15vw, 200px);
    height: clamp(80px, 15vw, 200px);
    top: 10%;
    left: 15%;
    animation-delay: 0s;
}

.orb-2 {
    width: clamp(60px, 10vw, 150px);
    height: clamp(60px, 10vw, 150px);
    top: 30%;
    right: 10%;
    animation-delay: -7s;
}

.orb-3 {
    width: clamp(100px, 18vw, 220px);
    height: clamp(100px, 18vw, 220px);
    top: 60%;
    left: 5%;
    animation-delay: -13s;
}

.orb-4 {
    width: clamp(50px, 8vw, 120px);
    height: clamp(50px, 8vw, 120px);
    top: 75%;
    right: 20%;
    animation-delay: -4s;
}

.orb-5 {
    width: clamp(70px, 12vw, 180px);
    height: clamp(70px, 12vw, 180px);
    top: 45%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-40px); }
}

/* Section 1: The Veil */
.veil-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 100;
    font-size: clamp(2.5rem, 8vw, 7rem);
    text-transform: uppercase;
    letter-spacing: 0.35em;
    text-shadow: 0 0 40px rgba(78,225,245,0.4), 0 0 80px rgba(78,225,245,0.15);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 2s ease forwards;
}

.hero-subtitle {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.85rem, 1.1vw, 1.1rem);
    letter-spacing: 0.06em;
    color: #8aa0c0;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 2s ease 1s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section 2: The Cards */
.section-cards {
    background: linear-gradient(135deg, #0a0e1a 0%, #111b33 50%, #0f1628 100%);
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    width: 90%;
    max-width: 1100px;
    padding: 2rem;
}

.card {
    position: relative;
    border-radius: 12px;
    padding: 2px;
    background: conic-gradient(from var(--border-angle), #4ee1f5, #9b72cf, #f0c45a, #4ee1f5);
    animation: rotateBorder 4s linear infinite;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.card:hover {
    filter: brightness(1.3);
}

.card-1 { justify-self: start; }
.card-2 { justify-self: center; }
.card-3 { justify-self: end; }

.card-inner {
    background: rgba(26, 39, 68, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}

.card-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    margin: 1rem 0 0.75rem;
    color: #e8edf5;
}

.card-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    color: #8aa0c0;
    line-height: 1.7;
}

/* Sigils */
.sigil {
    width: 60px;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigil-eye {
    width: 70px;
    height: 40px;
}

.eye-outer {
    position: absolute;
    width: 70px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #4ee1f5;
    box-shadow: 0 0 10px rgba(78,225,245,0.4);
}

.eye-iris {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #4ee1f5, #9b72cf);
    box-shadow: 0 0 15px #4ee1f5;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sigil-crescent {
    width: 50px;
    height: 50px;
}

.crescent-outer {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4ee1f5;
    box-shadow: 0 0 15px rgba(78,225,245,0.5);
}

.crescent-inner {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(26, 39, 68, 0.95);
    top: 2px;
    left: 12px;
}

.sigil-crystal {
    width: 50px;
    height: 50px;
}

.crystal-shape {
    width: 50px;
    height: 50px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(180deg, #4ee1f5, #9b72cf);
    box-shadow: 0 0 15px rgba(78,225,245,0.4);
}

/* Section 3: The Passage */
.section-passage {
    background: #0a0e1a;
}

.passage-line {
    width: 80%;
    max-width: 600px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4ee1f5, transparent);
}

.marble-band {
    position: relative;
    width: 100%;
    padding: 4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.passage-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 100;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    letter-spacing: 0.2em;
    text-align: center;
    position: relative;
    z-index: 2;
}

.highlight-word {
    position: relative;
    color: #4ee1f5;
}

.highlight-word::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #4ee1f5, #9b72cf, #f0c45a, #4ee1f5);
    background-size: 300% 100%;
    animation: shimmerLine 3s linear infinite;
}

@keyframes shimmerLine {
    0% { background-position: 0% 0; }
    100% { background-position: 300% 0; }
}

/* Section 4: The Constellation */
.section-constellation {
    background: #0a0e1a;
}

.constellation-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.constellation-lines line {
    stroke: rgba(78,225,245,0.1);
    stroke-width: 1;
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #e8edf5;
    box-shadow: 0 0 6px #4ee1f5;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.3s, box-shadow 0.3s;
}

.star:hover {
    transform: scale(2);
    box-shadow: 0 0 12px #4ee1f5, 0 0 24px rgba(78,225,245,0.3);
}

.tooltip {
    position: absolute;
    width: 200px;
    padding: 1rem;
    background: rgba(26, 39, 68, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(78,225,245,0.3);
    border-radius: 8px;
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.95rem;
    color: #e8edf5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    box-shadow: 0 0 20px rgba(78,225,245,0.1);
}

.tooltip.active {
    opacity: 1;
}

/* Section 5: The Return */
.section-return {
    background: #0a0e1a;
}

.return-orb {
    position: absolute;
    width: clamp(200px, 40vw, 500px);
    height: clamp(200px, 40vw, 500px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(240,196,90,0.25), rgba(78,225,245,0.15) 40%, rgba(155,114,207,0.08) 70%, transparent);
    mix-blend-mode: screen;
    animation: pulse 6s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.return-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.return-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 100;
    font-size: clamp(2.5rem, 8vw, 7rem);
    text-transform: uppercase;
    letter-spacing: 0.35em;
    text-shadow: 0 0 40px rgba(78,225,245,0.4), 0 0 80px rgba(78,225,245,0.15), 0 0 60px rgba(240,196,90,0.2);
}

.return-subtitle {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.85rem, 1.1vw, 1.1rem);
    letter-spacing: 0.06em;
    color: #8aa0c0;
    margin-top: 1.5rem;
}

/* Sparkle particles */
.sparkle {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #f0c45a;
    pointer-events: none;
    z-index: 100;
}

/* Responsive */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card-1, .card-2, .card-3 {
        justify-self: center;
    }

    .orb {
        transform: scale(0.6);
    }

    .section-passage {
        min-height: 40vh;
    }

    .star {
        width: 6px;
        height: 6px;
    }
}
