/* ============================================
   bada.day — Chrome-Metallic Horizontal Scroll
   ============================================ */

/* Custom Property for Animated Border Angle */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ---- CSS Variables ---- */
:root {
    --chrome-base: #c0c0c8;
    --chrome-deep: #3a3a4a;
    --midnight: #0d0d1a;
    --candle-amber: #c8a45e;
    --candle-glow: #e8d5a0;
    --molten-chrome: #e8e8f0;
    --wax-cream: #f5f0e6;
    --ember: #8b6914;
    --dark-amber-bg: #1a1810;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Work Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    overflow: hidden;
    height: 100%;
    width: 100%;
    background: var(--midnight);
    font-family: var(--font-body);
    color: var(--wax-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Scroll Hijack Container ---- */
.scroll-hijack {
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.horizontal-track {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: max-content;
}

/* ---- Panel Base ---- */
.panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    overflow: hidden;
}

/* ---- Panel Dividers ---- */
.panel-divider {
    width: 4px;
    height: 100vh;
    flex-shrink: 0;
    background: linear-gradient(var(--angle), var(--chrome-base), var(--candle-amber), var(--chrome-deep), var(--candle-amber), var(--chrome-base));
    animation: borderRotate 6s linear infinite;
}

@keyframes borderRotate {
    0%   { --angle: 0deg; }
    100% { --angle: 360deg; }
}

/* ============================================
   PANEL 1 — THE ARRIVAL
   ============================================ */
.panel-arrival {
    background: var(--midnight);
    flex-direction: column;
}

.candle-arrival {
    opacity: 0;
    animation: candleFadeIn 1.2s 0.6s var(--ease-reveal) forwards;
}

@keyframes candleFadeIn {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.arrival-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.2rem;
    color: var(--wax-cream);
    text-transform: lowercase;
    margin-top: 2rem;
    opacity: 0;
    animation: textFadeIn 1.2s 1.8s var(--ease-reveal) forwards;
    letter-spacing: 0.01em;
}

@keyframes textFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

.scroll-hint {
    position: absolute;
    bottom: 3.5rem;
    right: 3rem;
    opacity: 0;
    animation: hintFadeIn 1s 3s var(--ease-reveal) forwards;
}

@keyframes hintFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 0.6; }
}

.scroll-hint-arrow {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--candle-amber);
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50%      { opacity: 0.8; transform: translateX(6px); }
}

/* ============================================
   CANDLE COMPONENT (shared)
   ============================================ */
.candle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.candle-body {
    width: 36px;
    height: 160px;
    border-radius: 5% / 50%;
    background: linear-gradient(to right, var(--wax-cream), var(--candle-glow), var(--candle-amber), var(--candle-glow), var(--wax-cream));
    position: relative;
    box-shadow:
        0 4px 20px rgba(200, 164, 94, 0.15),
        inset 0 -20px 30px rgba(139, 105, 20, 0.2);
}

.candle-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 2px;
    background: linear-gradient(var(--angle), var(--chrome-base), var(--candle-amber), var(--chrome-deep), var(--candle-amber), var(--chrome-base));
    animation: borderRotate 6s linear infinite;
}

.candle-body-tall {
    height: 200px;
    width: 32px;
}

.candle-body-short {
    height: 130px;
    width: 30px;
}

.candle-body-large {
    height: 220px;
    width: 44px;
}

.candle-wick {
    width: 2px;
    height: 12px;
    background: var(--chrome-deep);
    position: relative;
    z-index: 1;
    order: -1;
}

.candle-flame-wrap {
    position: relative;
    order: -2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.candle-flame {
    width: 16px;
    height: 30px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at center 60%, var(--wax-cream) 0%, var(--candle-amber) 50%, var(--ember) 100%);
    filter: blur(1px);
    animation: flicker 3s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
}

.candle-flame-slow {
    animation: flicker 3.7s ease-in-out infinite alternate;
}

.candle-flame-fast {
    animation: flicker 2.6s ease-in-out infinite alternate;
}

.candle-flame-large {
    width: 22px;
    height: 40px;
}

@keyframes flicker {
    0%   { transform: scaleY(1) scaleX(1); }
    50%  { transform: scaleY(1.12) scaleX(0.94); }
    100% { transform: scaleY(0.96) scaleX(1.02); }
}

.candle-glow {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 164, 94, 0.2), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: glowExpand 2s 0.6s var(--ease-reveal) forwards;
}

.candle-glow-large {
    width: 140px;
    height: 140px;
}

@keyframes glowExpand {
    0%   { width: 0; height: 0; opacity: 0; }
    100% { width: 120px; height: 120px; opacity: 1; }
}

.candle-flame-wrap-large .candle-glow {
    animation: glowExpandLarge 2s 0.6s var(--ease-reveal) forwards;
}

@keyframes glowExpandLarge {
    0%   { width: 0; height: 0; opacity: 0; }
    100% { width: 200px; height: 200px; opacity: 1; }
}

/* ============================================
   PANEL 2 — CHROME LANDSCAPE
   ============================================ */
.panel-chrome-landscape {
    background: linear-gradient(135deg, var(--chrome-base) 0%, var(--chrome-deep) 50%, var(--molten-chrome) 100%);
    background-size: 200% 200%;
    animation: chromeShift 12s ease infinite alternate;
}

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

.chrome-text-block {
    position: absolute;
    left: 6%;
    top: 50%;
    transform: translateY(-50%);
    width: 30%;
    min-width: 280px;
    z-index: 2;
}

.chrome-text-border {
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(var(--angle), var(--chrome-base), var(--candle-amber), var(--chrome-deep), var(--candle-amber), var(--chrome-base)) 1;
    animation: borderRotate 6s linear infinite;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
}

.chrome-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.8;
    color: var(--midnight);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.chrome-text:last-child {
    margin-bottom: 0;
}

.chrome-sphere {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--molten-chrome) 0%, var(--chrome-base) 25%, var(--chrome-deep) 60%, var(--midnight) 100%);
    box-shadow: 0 0 60px rgba(200, 164, 94, 0.08);
}

.chrome-sphere-large {
    width: 300px;
    height: 300px;
    position: absolute;
    right: 12%;
    top: 50%;
    transform: translateY(-50%);
    animation: sphereRotate 20s linear infinite;
    z-index: 1;
}

@keyframes sphereRotate {
    0%   { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* ============================================
   PANEL 3 — THE WORD
   ============================================ */
.panel-word {
    background: var(--midnight);
    flex-direction: column;
}

.word-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.the-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5rem, 20vw, 18rem);
    letter-spacing: -0.03em;
    text-transform: lowercase;
    background: linear-gradient(135deg, var(--chrome-base) 0%, var(--chrome-deep) 50%, var(--molten-chrome) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: chromeShift 8s ease infinite alternate;
    line-height: 1;
}

.word-line {
    width: 0;
    height: 2px;
    background: linear-gradient(var(--angle), var(--chrome-base), var(--candle-amber), var(--chrome-deep), var(--candle-amber), var(--chrome-base));
    animation: borderRotate 6s linear infinite;
    transition: width 1.5s var(--ease-reveal);
}

.word-line.expanded {
    width: 60vw;
}

/* ============================================
   PANEL 4 — THE SECOND CANDLE
   ============================================ */
.panel-second-candle {
    background: radial-gradient(ellipse at 50% 80%, var(--candle-amber) 0%, var(--ember) 40%, var(--midnight) 100%);
    background-size: 100% 100%;
    justify-content: center;
    gap: 4rem;
    padding: 0 5%;
}

.candle-left,
.candle-right {
    flex-shrink: 0;
}

.second-candle-text {
    max-width: 380px;
    text-align: center;
}

.second-candle-text p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    line-height: 1.7;
    color: var(--candle-glow);
    margin-bottom: 1.2rem;
    letter-spacing: 0.01em;
}

.second-candle-text p:last-child {
    margin-bottom: 0;
    font-style: italic;
}

/* ============================================
   PANEL 5 — CHROME REFLECTION (Bright)
   ============================================ */
.panel-chrome-bright {
    background: var(--molten-chrome);
    flex-direction: column;
}

.bright-border-frame {
    position: absolute;
    inset: 12px;
    border: 2px solid transparent;
    border-image: linear-gradient(var(--angle), var(--chrome-base), var(--candle-amber), var(--chrome-deep), var(--candle-amber), var(--chrome-base)) 1;
    animation: borderRotate 6s linear infinite;
    pointer-events: none;
    z-index: 2;
}

.chrome-spheres-scatter {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.chrome-sphere-xs {
    width: 60px;
    height: 60px;
    position: absolute;
    opacity: 0.5;
    animation: sphereFloat 15s ease-in-out infinite alternate;
}

.chrome-sphere-sm {
    width: 80px;
    height: 80px;
    position: absolute;
    opacity: 0.6;
    animation: sphereFloat 18s ease-in-out infinite alternate;
}

.chrome-sphere-md {
    width: 120px;
    height: 120px;
    position: absolute;
    opacity: 0.5;
    animation: sphereFloat 22s ease-in-out infinite alternate;
}

.chrome-sphere-lg {
    width: 200px;
    height: 200px;
    position: absolute;
    opacity: 0.4;
    animation: sphereFloat 25s ease-in-out infinite alternate;
}

@keyframes sphereFloat {
    0%   { transform: scale(1) translateY(0); }
    50%  { transform: scale(1.05) translateY(-10px); }
    100% { transform: scale(0.95) translateY(8px); }
}

.bright-statement {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--midnight);
    text-align: center;
    letter-spacing: -0.03em;
    line-height: 1.15;
    z-index: 1;
    position: relative;
    max-width: 85%;
}

/* ============================================
   PANEL 6 — DEPARTURE
   ============================================ */
.panel-departure {
    background: var(--midnight);
    flex-direction: column;
}

.candle-departure {
    margin-bottom: 2rem;
}

.departure-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    color: var(--wax-cream);
    line-height: 1.7;
    text-align: center;
    max-width: 440px;
    margin-bottom: 2.5rem;
    letter-spacing: 0.01em;
}

.departure-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.day-counter {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--candle-amber);
}

.departure-line {
    width: 120px;
    height: 2px;
    background: linear-gradient(var(--angle), var(--chrome-base), var(--candle-amber), var(--chrome-deep), var(--candle-amber), var(--chrome-base));
    animation: borderRotate 6s linear infinite, departurePulse 3s ease-in-out 1;
}

@keyframes departurePulse {
    0%   { opacity: 0; width: 0; }
    50%  { opacity: 1; width: 120px; }
    100% { opacity: 0.7; width: 120px; }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 16px;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    animation: progressFadeIn 1s 3s var(--ease-reveal) forwards;
}

@keyframes progressFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--candle-amber);
    transition: width 0.3s ease;
}

.progress-dots {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    padding: 0 10%;
    pointer-events: none;
}

.progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chrome-deep);
    transition: background 0.5s ease;
}

.progress-dot.active {
    background: var(--candle-amber);
}

/* ============================================
   PANEL REVEAL ANIMATIONS
   ============================================ */
.panel-reveal {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 1.2s var(--ease-reveal), transform 1.2s var(--ease-reveal);
}

.panel-reveal.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Panel-specific chrome-landscape text reveal */
.chrome-text-block {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 1.2s var(--ease-reveal), transform 1.2s var(--ease-reveal);
}

.chrome-text-block.visible {
    opacity: 1;
    transform: translateX(0) translateY(-50%);
}

/* Second candle text reveal */
.second-candle-text {
    opacity: 0;
    transition: opacity 1.2s var(--ease-reveal);
}

.second-candle-text.visible {
    opacity: 1;
}

/* Bright statement reveal */
.bright-statement {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s var(--ease-reveal), transform 1.2s var(--ease-reveal);
}

.bright-statement.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Departure text reveal */
.departure-text {
    opacity: 0;
    transition: opacity 1.2s 0.4s var(--ease-reveal);
}

.departure-text.visible {
    opacity: 1;
}

.departure-meta {
    opacity: 0;
    transition: opacity 1.2s 0.8s var(--ease-reveal);
}

.departure-meta.visible {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .chrome-text-block {
        left: 5%;
        width: 55%;
        min-width: 200px;
    }

    .chrome-sphere-large {
        width: 180px;
        height: 180px;
        right: 5%;
    }

    .panel-second-candle {
        gap: 2rem;
        padding: 0 3%;
    }

    .second-candle-text {
        max-width: 240px;
    }

    .bright-statement {
        font-size: clamp(2rem, 7vw, 5rem);
    }
}

@media (max-width: 480px) {
    .chrome-text-block {
        width: 70%;
    }

    .chrome-sphere-large {
        width: 120px;
        height: 120px;
        right: 3%;
        top: 15%;
        transform: none;
    }

    .panel-second-candle {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}
