/* Root color palette and font definitions */
:root {
    --color-obsidian: #0A0E1A;
    --color-deep-naval: #0F1B2D;
    --color-very-dark: #081420;
    --color-parchment: #E8E0D4;
    --color-slate-blue: #8BA4B8;
    --color-cool-silver: #B0BEC5;
    --color-aged-brass: #C9A96E;
    --color-sapphire-ember: #1E3A5F;
    --color-glacial-teal: #4FC3C9;
    --color-moonstone: #D4E5F7;
    --color-dusty-blue: #7B9AAF;
    --color-asterism: #8258;

    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Roboto', sans-serif;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    overflow-x: hidden;
    font-family: var(--font-sans);
    color: var(--color-cool-silver);
    line-height: 1.85;
    background: linear-gradient(135deg, var(--color-obsidian) 0%, var(--color-deep-naval) 40%, var(--color-very-dark) 100%);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: breathe 20s ease-in-out infinite;
}

/* Background breathing animation */
@keyframes breathe {
    0% {
        background-color: var(--color-obsidian);
    }
    50% {
        background-color: var(--color-deep-naval);
    }
    100% {
        background-color: var(--color-obsidian);
    }
}

/* Section styling */
.section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(12, 1fr);
    padding: 3rem 2rem;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(79, 195, 201, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Brass line structural element */
.brass-line {
    position: absolute;
    left: 8%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--color-aged-brass);
    opacity: 0.3;
    z-index: 1;
}

/* Glassmorphic panel base styles */
.glass-panel {
    backdrop-filter: blur(20px) saturate(1.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(232, 224, 212, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 3rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1), transform 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effect for glass panels */
.glass-panel:hover {
    backdrop-filter: blur(28px) saturate(1.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(232, 224, 212, 0.22);
    transition: all 400ms ease;
}

/* Step counter styling */
.step-counter {
    font-family: var(--font-serif);
    font-size: 0.75rem;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.06em;
    color: var(--color-aged-brass);
    display: block;
    margin-bottom: 1.5rem;
    padding-left: 24px;
    border-left: 2px solid var(--color-aged-brass);
    line-height: 1;
}

/* Hero panel - section 0 */
.section-0 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-hero {
    grid-column: 4 / 18;
    grid-row: 3 / 11;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3.2rem, 9vw, 7rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-parchment);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-manifesto {
    font-family: var(--font-sans);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    font-weight: 300;
    line-height: 1.85;
    color: var(--color-cool-silver);
    max-width: 42ch;
    margin-bottom: 2rem;
}

.decorative-line {
    width: 30%;
    height: 1px;
    background-color: var(--color-aged-brass);
    opacity: 0;
    margin: 0 auto;
    transform: scaleX(0);
    transform-origin: center;
    animation: drawLine 800ms ease-in-out 1400ms forwards;
}

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

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

/* Section 1: Three lesson panels */
.panel-lesson-1 {
    grid-column: 2 / 10;
    grid-row: 2 / 8;
}

.panel-lesson-2 {
    grid-column: 8 / 16;
    grid-row: 4 / 10;
    animation-delay: 200ms;
}

.panel-lesson-3 {
    grid-column: 14 / 22;
    grid-row: 6 / 12;
    animation-delay: 400ms;
}

/* Section 2: Ritual panel */
.panel-ritual {
    grid-column: 3 / 18;
    grid-row: 3 / 10;
    width: 80%;
    margin: 0 auto;
}

.accent-ornament-1 {
    grid-column: 1 / 4;
    grid-row: 2 / 5;
    opacity: 0.5;
    animation-delay: 200ms;
}

.accent-ornament-2 {
    grid-column: 18 / 21;
    grid-row: 8 / 11;
    opacity: 0.5;
    animation-delay: 400ms;
}

/* Section 3: Vertical narrow panel */
.panel-vertical {
    grid-column: 8 / 13;
    grid-row: 2 / 12;
    width: 35%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-vertical h2 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: var(--color-glacial-teal);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(79, 195, 201, 0.4);
    animation: drift 60s linear infinite;
    z-index: 1;
}

#particle-1 {
    top: 20%;
    left: 15%;
    animation-duration: 50s;
}

#particle-2 {
    top: 50%;
    left: 70%;
    animation-duration: 70s;
    animation-delay: 10s;
}

#particle-3 {
    top: 75%;
    left: 25%;
    animation-duration: 60s;
    animation-delay: 20s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, 100px);
        opacity: 0;
    }
}

/* Section 4: Six moment cards */
.card-moment {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
}

#card-1 {
    grid-column: 2 / 8;
    grid-row: 2 / 5;
}

#card-2 {
    grid-column: 8 / 14;
    grid-row: 1 / 4;
    margin-top: 4px;
}

#card-3 {
    grid-column: 14 / 20;
    grid-row: 2 / 5;
    margin-left: 6px;
}

#card-4 {
    grid-column: 3 / 9;
    grid-row: 5 / 8;
    margin-left: 8px;
}

#card-5 {
    grid-column: 9 / 15;
    grid-row: 6 / 9;
    margin-left: 10px;
}

#card-6 {
    grid-column: 15 / 21;
    grid-row: 5 / 8;
    margin-left: 12px;
}

.moment-text {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--color-slate-blue);
}

/* Section 5: Final meditation */
.final-meditation {
    grid-column: 6 / 16;
    grid-row: 5 / 9;
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--color-parchment);
    line-height: 1.6;
    text-align: center;
    opacity: 0;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Common heading and text styles */
h2 {
    font-family: var(--font-sans);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-slate-blue);
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

.body-text {
    font-family: var(--font-sans);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    font-weight: 300;
    line-height: 1.85;
    color: var(--color-cool-silver);
    max-width: 42ch;
}

/* Stagger animation for panels within sections */
.section-1 .glass-panel:nth-child(2) {
    animation-delay: 0ms;
}

.section-1 .glass-panel:nth-child(3) {
    animation-delay: 200ms;
}

.section-1 .glass-panel:nth-child(4) {
    animation-delay: 400ms;
}

.section-2 .glass-panel:nth-child(2) {
    animation-delay: 0ms;
}

.section-2 .glass-panel:nth-child(3) {
    animation-delay: 200ms;
}

.section-2 .glass-panel:nth-child(4) {
    animation-delay: 400ms;
}

.section-3 .glass-panel {
    animation-delay: 0ms;
}

.section-4 .glass-panel:nth-of-type(1) {
    animation-delay: 0ms;
}

.section-4 .glass-panel:nth-of-type(2) {
    animation-delay: 200ms;
}

.section-4 .glass-panel:nth-of-type(3) {
    animation-delay: 400ms;
}

.section-4 .glass-panel:nth-of-type(4) {
    animation-delay: 600ms;
}

.section-4 .glass-panel:nth-of-type(5) {
    animation-delay: 800ms;
}

.section-4 .glass-panel:nth-of-type(6) {
    animation-delay: 1000ms;
}

/* Responsive design */
@media (max-width: 768px) {
    .section {
        padding: 2rem 1.5rem;
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: repeat(8, 1fr);
    }

    .brass-line {
        left: 5%;
    }

    .panel-hero,
    .panel-lesson-1,
    .panel-lesson-2,
    .panel-lesson-3,
    .panel-ritual,
    .panel-vertical,
    .card-moment {
        grid-column: 1 / 11 !important;
        grid-row: 2 / 8 !important;
    }

    .accent-ornament-1,
    .accent-ornament-2 {
        display: none;
    }

    .particle {
        display: none;
    }

    .panel-vertical {
        writing-mode: initial;
    }

    .final-meditation {
        grid-column: 1 / 11 !important;
    }

    #card-1, #card-2, #card-3, #card-4, #card-5, #card-6 {
        grid-row: 2 / 8 !important;
        grid-column: 1 / 11 !important;
        margin: 1rem 0 !important;
    }

    .body-text {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1.5rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .body-text {
        font-size: 0.9rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .step-counter {
        padding-left: 16px;
    }
}
