/* aei.st - Cinematic Contemplative Design */
/* Color Palette:
   Void/Primary Dark: #0f0e17
   Surface/Frame Base: #1a1a2e
   Text/Primary (Silver Breath): #e2ddd5
   Text/Secondary (Ash Fog): #8a8578
   Accent/Warm (Aged Gold): #b8a07e
   Accent/Cool (Celestial Blue): #4a6fa5
   Gradient/Overlay (Twilight): #2d2b55
*/

:root {
    --void: #0f0e17;
    --surface: #1a1a2e;
    --text-primary: #e2ddd5;
    --text-secondary: #8a8578;
    --accent-warm: #b8a07e;
    --accent-cool: #4a6fa5;
    --twilight: #2d2b55;
    --frame-index: 0;
    --scroll-depth: 0;
    --star-opacity: 0.1;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--void);
    color: var(--text-primary);
    font-family: 'Cormorant Garamond', Georgia, serif;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--void);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(184, 160, 126, 0.08);
}

.bead-chain {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.bead {
    width: 48px;
    height: 48px;
    position: relative;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.bead:hover {
    transform: scale(1.1);
}

.bead-inner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 2;
    filter: sepia(0.3) saturate(0.15) contrast(1.1);
    transition: filter 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.bead.active .bead-inner {
    filter: sepia(0.15) saturate(0.3) contrast(1.2);
}

.bead-image {
    width: 100%;
    height: 100%;
    display: block;
}

.bead-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(184, 160, 126, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    z-index: 1;
}

.bead.active .bead-glow {
    opacity: 1;
}

.bead-line {
    width: 1px;
    height: 24px;
    background: var(--accent-warm);
    opacity: 0.3;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 240px;
    scroll-behavior: smooth;
}

/* ===== FRAME SECTIONS ===== */
.frame {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    transition: opacity 1.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.frame.visible {
    opacity: 1;
}

.frame-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.cinematic-container {
    max-width: 1200px;
    width: 100%;
    aspect-ratio: 2.35 / 1;
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border-radius: 2px;
}

.frame-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.frame-bg-gradient {
    background: linear-gradient(135deg, var(--void) 0%, var(--surface) 40%, var(--twilight) 100%);
}

.vintage-photo {
    width: 100%;
    height: 100%;
    filter: sepia(0.3) saturate(0.15) contrast(1.1);
}

.vintage-photo svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Film Grain Overlay */
.film-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    opacity: 0.03;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
}

/* Frame Overlay (left gradient for text readability) */
.frame-overlay-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, rgba(15, 14, 23, 0.6) 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* ===== FRAME CONTENT ===== */
.frame-content {
    position: relative;
    z-index: 10;
    padding: 40px 60px;
    max-width: 100%;
    transform: translateY(20px);
    transition: transform 1.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.frame.visible .frame-content {
    transform: translateY(0);
}

.frame-content-centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    text-align: center;
    width: 80%;
}

.frame.visible .frame-content-centered {
    transform: translate(-50%, -50%) translateY(0);
}

.frame-content-left {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%) translateY(20px);
    text-align: left;
    width: 50%;
    padding-left: 80px;
}

.frame.visible .frame-content-left {
    transform: translateY(-50%) translateY(0);
}

.frame-content-right {
    position: absolute;
    top: 50%;
    right: 0;
    left: auto;
    transform: translateY(-50%) translateY(20px);
    text-align: right;
    width: 50%;
    padding-right: 80px;
}

.frame.visible .frame-content-right {
    transform: translateY(-50%) translateY(0);
}

/* ===== TYPOGRAPHY ===== */
.headline {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 48px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.headline-hero {
    font-size: 72px;
}

.headline-large {
    font-size: 60px;
}

.headline-reveal {
    display: block;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.headline-reveal:nth-child(2) {
    transition-delay: 0.3s;
}

.frame.visible .headline-reveal {
    clip-path: inset(0 0 0 0);
}

.body-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.9;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    max-width: 540px;
    margin-bottom: 24px;
}

.body-text-intro {
    margin-left: auto;
    margin-right: auto;
}

.body-text-wide {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.body-text-final {
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

.meta-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 2.0em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 16px;
}

/* ===== DECORATIVE ELEMENTS ===== */
.crescent-divider {
    margin: 16px 0;
    opacity: 0.6;
    display: inline-block;
}

.observation-line {
    position: absolute;
    left: 0;
    top: 50%;
    width: 60px;
    height: 1px;
    background: var(--accent-warm);
    opacity: 0.15;
}

.observation-line-right {
    left: auto;
    right: 0;
}

.north-star {
    display: inline-block;
    animation: pulse-star 4s ease-in-out infinite;
    margin-top: 12px;
}

.north-star-abs {
    position: absolute;
}

@keyframes pulse-star {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1.0; }
}

/* Constellation */
.constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.constellation svg {
    width: 100%;
    height: 100%;
}

.constellation-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.frame.visible .constellation-path {
    stroke-dashoffset: 0;
}

/* ===== BREATH SPACES ===== */
.breath-space {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--void);
    overflow: hidden;
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.breath-word {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 2.0em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    position: relative;
    z-index: 2;
}

.breath-space.visible .breath-word {
    opacity: 0.5;
}

/* ===== FINAL FRAME FADE ===== */
.final-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to bottom, transparent, var(--void));
    z-index: 20;
    pointer-events: none;
}

.frame-final {
    margin-bottom: 0;
    padding-bottom: 10vh;
}

/* ===== STAR DOTS (generated via JS) ===== */
.star-dot {
    position: absolute;
    border-radius: 50%;
    background: var(--text-primary);
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 48px;
    }

    .bead {
        width: 16px;
        height: 16px;
    }

    .bead-inner {
        width: 16px;
        height: 16px;
    }

    .bead-glow {
        width: 24px;
        height: 24px;
    }

    .bead-line {
        height: 12px;
    }

    .main-content {
        margin-left: 48px;
    }

    .cinematic-container {
        aspect-ratio: 16 / 9;
    }

    .headline {
        font-size: 32px;
    }

    .headline-hero {
        font-size: 42px;
    }

    .headline-large {
        font-size: 36px;
    }

    .frame-content-left,
    .frame-content-right {
        width: 80%;
        padding-left: 30px;
        padding-right: 30px;
    }

    .body-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .cinematic-container {
        aspect-ratio: 4 / 3;
    }

    .headline {
        font-size: 28px;
    }

    .headline-hero {
        font-size: 36px;
    }

    .headline-large {
        font-size: 32px;
    }

    .frame-content-left,
    .frame-content-right,
    .frame-content-centered {
        width: 90%;
        padding: 20px;
    }

    .frame-content-left {
        padding-left: 20px;
    }

    .frame-content-right {
        padding-right: 20px;
    }

    .frame-inner {
        padding: 20px;
    }

    .body-text {
        font-size: 15px;
        line-height: 1.7;
    }

    .meta-text {
        letter-spacing: 1.0em;
        font-size: 10px;
    }
}
