/* ====================================================
   BBOTTL.com - Prismatic Apothecary
   ==================================================== */

/* @property definitions for animatable custom properties */
@property --fill-level {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 0%;
}

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

@property --radial-spread {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 20%;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: #e8e6f0;
    background-color: #0a0a14;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Noise Overlay ---- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ---- Refraction Lines ---- */
.refraction-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.refraction-line {
    position: absolute;
    background: rgba(232, 230, 240, 0.06);
    mix-blend-mode: screen;
}

.refraction-line-1 {
    width: 200%;
    height: 1px;
    top: 20%;
    left: -50%;
    transform: rotate(-15deg);
}

.refraction-line-2 {
    width: 200%;
    height: 1px;
    top: 45%;
    left: -50%;
    transform: rotate(8deg);
}

.refraction-line-3 {
    width: 200%;
    height: 1px;
    top: 65%;
    left: -50%;
    transform: rotate(-22deg);
}

.refraction-line-4 {
    width: 200%;
    height: 1px;
    top: 80%;
    left: -50%;
    transform: rotate(12deg);
}

.refraction-line-5 {
    width: 200%;
    height: 1px;
    top: 35%;
    left: -50%;
    transform: rotate(-5deg);
}

/* ---- Depth Indicator ---- */
.depth-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.depth-track {
    width: 3px;
    height: 160px;
    background: rgba(232, 230, 240, 0.1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.depth-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #8b5cf6, #2dd4bf);
    border-radius: 3px;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.depth-labels {
    position: absolute;
    top: 0;
    left: -24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.depth-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: #9694a8;
    transition: color 0.4s ease, opacity 0.4s ease;
    opacity: 0.4;
    cursor: pointer;
}

.depth-label.active {
    color: #2dd4bf;
    opacity: 1;
}

/* ---- Chamber (Shared) ---- */
.chamber {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ====================================================
   CHAMBER 1: Hero
   ==================================================== */
.chamber-1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0a0a14;
    position: relative;
}

/* Bottle Silhouette */
.bottle-hero {
    position: relative;
    width: 200px;
    height: 420px;
    margin-bottom: 40px;
}

.bottle-silhouette {
    position: relative;
    width: 100%;
    height: 100%;
    clip-path: polygon(
        35% 0%, 65% 0%,
        65% 15%, 75% 25%,
        78% 35%, 78% 88%,
        72% 96%, 50% 100%,
        28% 96%, 22% 88%,
        22% 35%, 25% 25%,
        35% 15%
    );
    background: rgba(232, 230, 240, 0.03);
    border: none;
    overflow: hidden;
}

.bottle-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--fill-level, 0%);
    background: linear-gradient(to top, #0a0a14 0%, #3d1c56 40%, #8b5cf6 70%, #d4a853 90%, #f472b6 100%);
    transition: height 0.1s linear;
}

.bottle-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 20%, rgba(232, 230, 240, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.bottle-neck-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 20%;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.3) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.bottle-neck-glow.visible {
    opacity: 1;
}

/* Hero Title */
.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 8vw;
    line-height: 0.95;
    text-align: center;
    color: #e8e6f0;
    position: relative;
    z-index: 2;
}

.hero-title-line {
    display: block;
}

.hero-title-accent {
    background: linear-gradient(90deg, #8b5cf6, #2dd4bf, #d4a853, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Scroll hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    animation: fadeInHint 2s ease-in-out infinite alternate;
}

.scroll-hint-text {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #9694a8;
}

.scroll-hint-arrow {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, #9694a8, transparent);
    position: relative;
}

.scroll-hint-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 7px;
    height: 7px;
    border-right: 1px solid #9694a8;
    border-bottom: 1px solid #9694a8;
    transform: rotate(45deg);
}

@keyframes fadeInHint {
    0% { opacity: 0.3; transform: translateY(0); }
    100% { opacity: 0.7; transform: translateY(6px); }
}

/* Bubble Container */
.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.4), rgba(45, 212, 191, 0.1));
    animation: bubbleRise linear infinite;
    opacity: 0;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift, 20px)) scale(0.5);
        opacity: 0;
    }
}

/* ====================================================
   CHAMBER 2: Narrative
   ==================================================== */
.chamber-2 {
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px;
}

.narrative-strips {
    display: flex;
    width: 100%;
    max-width: 1200px;
    gap: 0;
    position: relative;
}

.strip {
    position: relative;
}

.strip-left {
    flex: 0 0 35%;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.strip-center {
    flex: 0 0 40%;
    padding: 0 40px;
}

.strip-right {
    flex: 0 0 25%;
    padding-top: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

/* Glass Shards */
.glass-shard {
    opacity: 0;
    transform: translateY(40px) rotate(0deg);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.glass-shard.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--shard-rotation, 0deg));
}

.shard-1 {
    width: 80px;
    height: 120px;
    --shard-rotation: -12deg;
    clip-path: polygon(20% 0%, 100% 15%, 80% 100%, 0% 70%);
    background: conic-gradient(from 45deg, rgba(139, 92, 246, 0.25), rgba(45, 212, 191, 0.15), rgba(212, 168, 83, 0.2), rgba(244, 114, 182, 0.15), rgba(139, 92, 246, 0.25));
    transition-delay: 0s;
}

.shard-2 {
    width: 60px;
    height: 90px;
    --shard-rotation: 8deg;
    clip-path: polygon(0% 10%, 90% 0%, 100% 80%, 15% 100%);
    background: conic-gradient(from 120deg, rgba(244, 114, 182, 0.2), rgba(139, 92, 246, 0.25), rgba(45, 212, 191, 0.15), rgba(244, 114, 182, 0.2));
    transition-delay: 0.15s;
}

.shard-3 {
    width: 100px;
    height: 70px;
    --shard-rotation: -5deg;
    clip-path: polygon(10% 0%, 100% 20%, 85% 100%, 0% 80%);
    background: conic-gradient(from 200deg, rgba(45, 212, 191, 0.2), rgba(212, 168, 83, 0.25), rgba(139, 92, 246, 0.15), rgba(45, 212, 191, 0.2));
    transition-delay: 0.3s;
}

.shard-4 {
    width: 70px;
    height: 110px;
    --shard-rotation: 15deg;
    clip-path: polygon(5% 0%, 95% 10%, 100% 90%, 10% 100%);
    background: conic-gradient(from 90deg, rgba(212, 168, 83, 0.25), rgba(244, 114, 182, 0.15), rgba(139, 92, 246, 0.2), rgba(212, 168, 83, 0.25));
    transition-delay: 0.45s;
}

.shard-5 {
    width: 50px;
    height: 80px;
    --shard-rotation: -10deg;
    clip-path: polygon(15% 0%, 100% 5%, 90% 100%, 0% 85%);
    background: conic-gradient(from 270deg, rgba(139, 92, 246, 0.3), rgba(45, 212, 191, 0.2), rgba(244, 114, 182, 0.15), rgba(139, 92, 246, 0.3));
    transition-delay: 0.6s;
}

/* Narrative Typography */
.narrative-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2dd4bf;
    display: block;
    margin-bottom: 24px;
}

.narrative-heading {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 3.5rem;
    line-height: 1.1;
    color: #e8e6f0;
    margin-bottom: 40px;
}

.narrative-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    line-height: 1.75;
    color: #e8e6f0;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.narrative-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================================
   CHAMBER 3: Collection
   ==================================================== */
.chamber-3 {
    background: #0a0a14;
    padding: 120px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.collection-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2dd4bf;
    display: block;
    margin-bottom: 16px;
}

.collection-heading {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 3.5rem;
    line-height: 1.1;
    color: #e8e6f0;
    margin-bottom: 80px;
    text-align: center;
}

/* Masonry Layout */
.collection-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1100px;
    width: 100%;
}

/* Staggered card positioning */
.bottle-card {
    position: relative;
    padding: 3px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottle-card:hover {
    transform: scale(1.02);
}

.bottle-card-1 {
    transform: rotate(-2deg);
    margin-top: 0;
}

.bottle-card-2 {
    transform: rotate(1.5deg);
    margin-top: 60px;
}

.bottle-card-3 {
    transform: rotate(-3deg);
    margin-top: 20px;
}

.bottle-card-4 {
    transform: rotate(2deg);
    margin-top: -20px;
}

.bottle-card-5 {
    transform: rotate(-1deg);
    margin-top: 40px;
}

.bottle-card-6 {
    transform: rotate(3deg);
    margin-top: 0;
}

.bottle-card-1:hover { transform: rotate(-2deg) scale(1.02); }
.bottle-card-2:hover { transform: rotate(1.5deg) scale(1.02); }
.bottle-card-3:hover { transform: rotate(-3deg) scale(1.02); }
.bottle-card-4:hover { transform: rotate(2deg) scale(1.02); }
.bottle-card-5:hover { transform: rotate(-1deg) scale(1.02); }
.bottle-card-6:hover { transform: rotate(3deg) scale(1.02); }

/* Prismatic Border */
.card-prismatic-border {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: conic-gradient(from var(--hue-rotate, 0deg), #8b5cf6, #2dd4bf, #d4a853, #f472b6, #8b5cf6);
    z-index: 0;
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.bottle-card:hover .card-prismatic-border {
    opacity: 1;
    animation: prismaticSpin 3s linear infinite;
}

@keyframes prismaticSpin {
    0% { --hue-rotate: 0deg; }
    100% { --hue-rotate: 360deg; }
}

.card-inner {
    position: relative;
    z-index: 1;
    background: #151520;
    border-radius: 10px;
    padding: 40px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(12px) saturate(1.4);
    text-align: center;
}

.card-bottle-icon {
    width: 60px;
    height: 120px;
    margin-bottom: 24px;
    color: #e8e6f0;
    opacity: 0.6;
    transition: opacity 0.4s ease, color 0.4s ease;
}

.bottle-card:hover .card-bottle-icon {
    opacity: 1;
    color: #8b5cf6;
}

.bottle-svg {
    width: 100%;
    height: 100%;
}

.card-edition {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #9694a8;
    margin-bottom: 12px;
}

.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.5rem;
    color: #e8e6f0;
    margin-bottom: 8px;
}

.card-volume {
    font-family: 'Inconsolata', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #d4a853;
    text-transform: uppercase;
}

/* ====================================================
   CHAMBER 4: Story (Horizontal Scroll)
   ==================================================== */
.chamber-4 {
    background: #0a0a14;
    padding: 120px 0 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.story-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2dd4bf;
    display: block;
    margin-bottom: 16px;
}

.story-heading {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 3.5rem;
    line-height: 1.1;
    color: #e8e6f0;
    margin-bottom: 60px;
    text-align: center;
}

.horizontal-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.horizontal-scroll-track {
    display: flex;
    width: max-content;
    gap: 0;
    padding: 0 calc((100vw - 80vw) / 2);
}

.story-panel {
    width: 80vw;
    min-height: 50vh;
    flex-shrink: 0;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.panel-content {
    display: flex;
    gap: 60px;
    max-width: 700px;
    width: 100%;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.panel-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 10px;
}

.timeline-line {
    width: 1px;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(to bottom, #8b5cf6, rgba(139, 92, 246, 0.1));
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    flex-shrink: 0;
    margin-bottom: 10px;
}

.panel-text {
    flex: 1;
}

.panel-chapter {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #d4a853;
    display: block;
    margin-bottom: 16px;
}

.panel-title {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 2.2rem;
    line-height: 1.15;
    color: #e8e6f0;
    margin-bottom: 24px;
}

.panel-body {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    line-height: 1.75;
    color: #e8e6f0;
    letter-spacing: 0.02em;
}

/* Panel background accents */
.story-panel-1 {
    background: radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
}

.story-panel-2 {
    background: radial-gradient(ellipse at 80% 50%, rgba(45, 212, 191, 0.06) 0%, transparent 60%);
}

.story-panel-3 {
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 168, 83, 0.06) 0%, transparent 60%);
}

/* ====================================================
   CHAMBER 5: Close
   ==================================================== */
.chamber-5 {
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.close-radial-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(61, 28, 86, 0.05) var(--radial-spread, 20%), transparent 70%);
    animation: breathePulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes breathePulse {
    0%, 100% { --radial-spread: 20%; transform: translate(-50%, -50%) scale(1); }
    50% { --radial-spread: 40%; transform: translate(-50%, -50%) scale(1.15); }
}

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

.close-statement {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 4.5vw;
    line-height: 1.3;
    color: #e8e6f0;
    margin-bottom: 60px;
}

.close-line {
    display: block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.close-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.close-line:nth-child(2) {
    transition-delay: 0.3s;
}

.close-line:nth-child(3) {
    transition-delay: 0.6s;
}

.close-line-accent {
    background: linear-gradient(90deg, #8b5cf6, #f472b6, #d4a853);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #9694a8;
    opacity: 0;
    transition: opacity 1.5s ease;
    transition-delay: 1s;
}

.close-label.visible {
    opacity: 1;
}

/* ====================================================
   Responsive
   ==================================================== */
@media (max-width: 900px) {
    .narrative-strips {
        flex-direction: column;
    }

    .strip-left,
    .strip-center,
    .strip-right {
        flex: none;
        width: 100%;
        padding: 20px 0;
    }

    .strip-left,
    .strip-right {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        padding-top: 0;
    }

    .narrative-heading {
        font-size: 2.5rem;
    }

    .collection-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .bottle-card-1,
    .bottle-card-2,
    .bottle-card-3,
    .bottle-card-4,
    .bottle-card-5,
    .bottle-card-6 {
        margin-top: 0;
        transform: rotate(0deg);
    }

    .bottle-card-1:hover,
    .bottle-card-2:hover,
    .bottle-card-3:hover,
    .bottle-card-4:hover,
    .bottle-card-5:hover,
    .bottle-card-6:hover {
        transform: scale(1.02);
    }

    .hero-title {
        font-size: 12vw;
    }

    .close-statement {
        font-size: 7vw;
    }

    .story-heading,
    .collection-heading {
        font-size: 2.5rem;
    }

    .depth-indicator {
        right: 12px;
    }
}

@media (max-width: 600px) {
    .collection-masonry {
        grid-template-columns: 1fr;
    }

    .chamber-2,
    .chamber-3 {
        padding: 80px 20px;
    }

    .story-panel {
        width: 90vw;
        padding: 20px;
    }

    .panel-content {
        flex-direction: column;
        gap: 24px;
    }

    .panel-timeline {
        flex-direction: row;
        padding-top: 0;
    }

    .timeline-line {
        width: 100%;
        height: 1px;
        min-height: auto;
    }

    .bottle-hero {
        width: 140px;
        height: 300px;
    }
}
