/* ============================================
   bcd.day — Desert Rhinestone
   McBling meets futuristic technology
   ============================================ */

/* --- Design Palette Reference ---
   #2B1810 Burnt Mahogany (Background Deep)
   #3E2518 Cocoa Ember (Background Warm)
   #3B2415 Deep Espresso (Text Primary Dark)
   #5C4033 Warm Umber (Body text on light bg)
   #C8956C Bronze Sand (Surface Primary)
   #E8A87C Peach Copper (Surface Accent)
   #D4956E Terracotta Glow (Gem Accent 1)
   #F2C57C Honey Topaz (Gem Accent 2)
   #A67B5B Amber Suede (Gem Accent 3)
   #FFE4C9 Champagne Blush (Gem Highlight)
   #FFF5EB Warm Cream (Text Primary Light)
   #FFF8F0 Diamond White (Sparkle)
   #D4C4B0 Warm Sandstone (Body text on dark)
   --- */

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

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

body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background: #2B1810;
    color: #FFF5EB;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* --- Horizontal Scroll Container --- */
.horizontal-scroll {
    display: flex;
    flex-direction: row;
    width: max-content;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

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

.panel-dark {
    background: #2B1810;
}

.panel-warm {
    background: #3E2518;
}

/* --- Panel Background Patterns --- */
.panel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.06;
    pointer-events: none;
}

.panel-bg-dense {
    opacity: 0.15;
}

.bg-pattern {
    width: 100%;
    height: 100%;
}

/* --- Panel Content --- */
.panel-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
}

/* --- Panel Foreground (Sparkle Layer) --- */
.panel-foreground {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

/* --- Sparkle particles --- */
.sparkle-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFF8F0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    opacity: 0;
    animation: sparkleFloat 5s infinite ease-in-out;
    pointer-events: none;
}

@keyframes sparkleFloat {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }
    15% {
        opacity: 0.8;
        transform: translate(10px, -5px) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(30px, -10px) scale(0.8);
    }
    85% {
        opacity: 0.3;
        transform: translate(50px, -3px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(60px, 0) scale(0.5);
    }
}

/* --- Opening Panel --- */
.opening-content {
    flex-direction: column;
    gap: 0;
}

.opening-diamond {
    position: relative;
    width: clamp(120px, 30vh, 280px);
    height: clamp(120px, 30vh, 280px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: diamondEntrance 1.2s ease-out forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.opening-diamond svg {
    width: 100%;
    height: 100%;
}

/* Diamond outline stroke draw */
.diamond-outline {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: strokeDraw 1s ease-out 0.2s forwards;
}

.diamond-facet {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    opacity: 0.6;
}

.facet-1 {
    animation: strokeDraw 0.6s ease-out 0.6s forwards;
}
.facet-2 {
    animation: strokeDraw 0.6s ease-out 0.7s forwards;
}
.facet-3 {
    animation: strokeDraw 0.6s ease-out 0.8s forwards;
}
.facet-4 {
    animation: strokeDraw 0.6s ease-out 0.9s forwards;
}

@keyframes strokeDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes diamondEntrance {
    0% {
        opacity: 0;
        transform: scale(1.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Vertex sparkles */
.vertex-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vertex-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFF8F0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    opacity: 0;
    animation: vertexPop 0.5s ease-out forwards;
}

.vs-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1s;
}
.vs-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation-delay: 1.1s;
}
.vs-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1.15s;
}
.vs-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation-delay: 1.05s;
}

@keyframes vertexPop {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* Site Title - Typewriter */
.site-title {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 800;
    color: #FFF5EB;
    letter-spacing: 0.02em;
    margin-top: 20px;
    display: flex;
    overflow: hidden;
}

.title-letter {
    opacity: 0;
    animation: typeIn 0.1s ease-out forwards;
    animation-delay: calc(1.2s + var(--i) * 0.1s);
    display: inline-block;
}

@keyframes typeIn {
    to {
        opacity: 1;
    }
}

/* Blinking cursor after title */
.site-title::after {
    content: '|';
    color: #E8A87C;
    font-weight: 400;
    animation: cursorBlink 1s step-end infinite;
    animation-delay: 2.2s;
    opacity: 0;
}

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

/* Swipe hint */
.swipe-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 2.2s forwards;
}

.swipe-text {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #E8A87C;
}

.swipe-arrow {
    width: 40px;
    height: 20px;
    animation: arrowPulse 2s ease-in-out infinite 2.5s;
}

@keyframes arrowPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Content Blocks --- */
.content-block {
    max-width: clamp(360px, 55vw, 680px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-heading {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 800;
    color: #FFF5EB;
    letter-spacing: 0.02em;
    line-height: 1.1;
    position: relative;
    display: inline-block;
}

.panel-warm .section-heading {
    color: #FFF5EB;
}

.panel-light .section-heading {
    color: #3B2415;
}

.panel-light .body-text {
    color: #5C4033;
}

.heading-underline {
    display: block;
    width: 100%;
    height: 12px;
    margin-top: 4px;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    font-weight: 400;
    color: #D4C4B0;
    line-height: 1.65;
}

.panel-warm .body-text {
    color: #D4C4B0;
}

/* --- Gem Flanks --- */
.gem-flank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0 30px;
    flex-shrink: 0;
}

.gem-flank svg {
    width: clamp(40px, 6vw, 80px);
    height: auto;
}

/* --- Interactive Gems --- */
.interactive-gem {
    cursor: pointer;
    transition: transform 0.2s ease-out;
}

.interactive-gem:hover {
    transform: scale(1.08);
}

/* Gem accent color classes */
.gem-accent-terracotta {
    color: #D4956E;
    border-color: #D4956E;
}

.gem-accent-topaz {
    color: #F2C57C;
    border-color: #F2C57C;
}

.gem-accent-suede {
    color: #A67B5B;
    border-color: #A67B5B;
}

.gem-highlight-blush {
    background-color: #FFE4C9;
    color: #3B2415;
}

/* Gem sparkle burst on hover (JS adds class) */
.gem-sparkle-burst {
    position: absolute;
    pointer-events: none;
}

.gem-sparkle-burst .sparkle-particle {
    animation-duration: 0.8s;
    animation-iteration-count: 1;
}

/* --- Gem Stats --- */
.gem-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

.gem-stat svg {
    width: 50px;
    height: auto;
}

.stat-text {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: #FFF5EB;
    letter-spacing: 0.02em;
    line-height: 1;
}

.stat-label {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #E8A87C;
}

.gem-stat-row {
    display: flex;
    gap: 50px;
    justify-content: center;
    margin-top: 20px;
}

/* --- Gem List (diamond bullets) --- */
.gem-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.gem-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gem-list-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.gem-list-item span {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
    color: #D4C4B0;
    font-weight: 400;
}

/* --- Gem Callout (Clickable) --- */
.gem-callout {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    cursor: pointer;
    transition: transform 0.2s ease-out;
}

.gem-callout:hover {
    transform: scale(1.05);
}

.gem-callout svg {
    width: 36px;
    height: 36px;
}

.callout-label {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #E8A87C;
}

/* --- Gem Tooltip --- */
.gem-tooltip {
    position: fixed;
    z-index: 200;
    width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.gem-tooltip.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    animation: tooltipBounce 0.3s ease-out;
}

@keyframes tooltipBounce {
    0% { transform: scale(0.9); }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.tooltip-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tooltip-text {
    position: relative;
    z-index: 1;
    padding: 18px 22px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: #D4C4B0;
    line-height: 1.55;
}

/* --- Beaded Dividers --- */
.beaded-divider {
    width: 20px;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.beaded-divider svg {
    height: 100%;
}

.shimmer-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 248, 240, 0.3) 45%,
        rgba(255, 248, 240, 0.3) 55%,
        transparent 100%
    );
    background-size: 100% 200%;
    background-position: 0% -100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.beaded-divider.shimmer .shimmer-sweep {
    opacity: 1;
    animation: shimmerDown 0.5s ease-out forwards;
}

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

/* --- Crown Navigation Button --- */
.crown-nav-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 150;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s ease-out;
}

.crown-nav-btn:hover {
    transform: scale(1.1);
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(43, 24, 16, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.nav-overlay-inner {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 40px;
}

.nav-close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    background: none;
    border: none;
    color: #E8A87C;
    font-size: 36px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out;
}

.nav-close-btn:hover {
    transform: scale(1.15) rotate(90deg);
}

.nav-charm-arc {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.nav-gem-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s ease-out;
}

.nav-gem-link:hover {
    transform: scale(1.12);
}

.nav-gem-link span {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #E8A87C;
}

/* --- Gem Rail --- */
.gem-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gem-rail-line {
    position: absolute;
    bottom: 24px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: #C8956C;
    opacity: 0.5;
    border-radius: 1px;
}

.gem-rail-markers {
    display: flex;
    align-items: center;
    gap: clamp(30px, 6vw, 80px);
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.gem-marker {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    transition: transform 0.2s ease-out;
}

.gem-marker svg {
    width: 16px;
    height: 16px;
    transition: fill 0.3s, transform 0.3s;
}

.gem-marker.active svg {
    fill: #C8956C;
    animation: gemPulse 1.5s ease-in-out infinite;
}

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

/* Gem rail label on hover */
.gem-marker::before {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #E8A87C;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    padding-bottom: 4px;
}

.gem-marker:hover::before {
    opacity: 1;
}

/* --- Scroll Error Gem (Vertical Scroll Attempt) --- */
.scroll-error-gem {
    position: fixed;
    z-index: 250;
    width: 40px;
    height: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}

.scroll-error-gem.visible {
    opacity: 1;
    animation: errorGemFade 0.6s ease-out forwards;
}

@keyframes errorGemFade {
    0% { opacity: 1; transform: scale(1); }
    70% { opacity: 0.8; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* --- Shake Animation --- */
@keyframes shake {
    0% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.shaking {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* --- Closing Panel --- */
.closing-content {
    flex-direction: column;
    gap: 24px;
}

.closing-crown {
    width: clamp(120px, 25vw, 220px);
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-crown svg {
    width: 100%;
    height: auto;
}

/* Crown stroke-draw animation */
.crown-outline {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.crown-base {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.crown-jewel {
    opacity: 0;
}

.closing-crown.animate .crown-outline {
    animation: strokeDraw 1.2s ease-out forwards;
}

.closing-crown.animate .crown-base {
    animation: strokeDraw 0.6s ease-out 0.8s forwards;
}

.closing-crown.animate .crown-jewel {
    animation: fadeIn 0.4s ease-out forwards;
    animation-delay: 1.2s;
}

.closing-heading {
    font-family: 'Baloo 2', cursive;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    color: #FFF5EB;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.1;
}

.closing-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #D4C4B0;
    text-align: center;
    line-height: 1.65;
}

/* --- Closing Gem Links (Social) --- */
.closing-gems {
    display: flex;
    gap: 28px;
    justify-content: center;
    margin-top: 16px;
}

.closing-gem-link {
    display: flex;
    text-decoration: none;
    transition: transform 0.2s ease-out;
}

.closing-gem-link:hover .charm-gem {
    animation: charmJingle 0.2s ease-in-out 3;
}

@keyframes charmJingle {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.charm-gem {
    width: 36px;
    height: 36px;
}

/* --- Panel transition opacity (controlled by JS) --- */
.panel-content {
    transition: opacity 0.3s ease-out;
}

/* --- Cross-dissolve effect classes (JS) --- */
.panel-entering .panel-content {
    opacity: 0.4;
}

.panel-exiting .panel-content {
    opacity: 0.4;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .gem-flank {
        display: none;
    }

    .content-block {
        max-width: 90vw;
        padding: 0 20px;
    }

    .panel-content {
        padding: 40px 16px;
    }

    .gem-stat-row {
        gap: 24px;
    }

    .closing-gems {
        gap: 16px;
    }

    .nav-charm-arc {
        gap: 20px;
    }

    .gem-rail-markers {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .gem-stat-row {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
}
