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

:root {
    --bg-deep: #1a120b;
    --bg-mid: #2d1f14;
    --surface: #4a3228;
    --border: #6b4c33;
    --text-primary: #f0e6d3;
    --text-secondary: #b8a08a;
    --accent: #c87941;
    --accent-highlight: #e8a84b;
    --accent-warm: #d4622a;
    --darkest: #120c06;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: 0.02em;
}

.mono-text {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === Earth Element === */
.earth {
    position: fixed;
    top: 60px;
    left: 40px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5a3f, #3a7ca5);
    opacity: 0.15;
    animation: earth-rotate 60s linear infinite;
    z-index: 100;
}

@keyframes earth-rotate {
    to { transform: rotate(360deg); }
}

/* === Constellations === */
.constellations {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.constellation-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--text-primary);
    opacity: 0.2;
    border-radius: 50%;
}

/* === Navigation Cube === */
.nav-cube {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    transform-style: preserve-3d;
    animation: cube-tumble 20s linear infinite;
    cursor: pointer;
    z-index: 1000;
}

.cube-face {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--accent);
    background: rgba(74, 50, 40, 0.6);
}

.cube-front  { transform: translateZ(20px); }
.cube-back   { transform: translateZ(-20px) rotateY(180deg); }
.cube-top    { transform: translateY(-20px) rotateX(90deg); }
.cube-bottom { transform: translateY(20px) rotateX(-90deg); }
.cube-left   { transform: translateX(-20px) rotateY(-90deg); }
.cube-right  { transform: translateX(20px) rotateY(90deg); }

@keyframes cube-tumble {
    0%   { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(240deg) rotateZ(300deg); }
}

.cube-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-mid);
    border: 1px solid var(--border);
    padding: 16px;
    z-index: 1001;
}

.cube-menu.active {
    display: flex;
}

.cube-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.cube-menu a:hover {
    color: var(--accent-highlight);
}

/* === Scenes === */
.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

/* === Scene 1: Arrival === */
.scene-arrival {
    height: 100vh;
    background: var(--bg-deep);
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(3rem, 6vw, 6rem);
    color: var(--accent-highlight);
    text-shadow:
        0 0 5px rgba(232, 168, 75, 0.8),
        0 0 10px rgba(232, 168, 75, 0.5),
        0 0 20px rgba(232, 168, 75, 0.3),
        0 0 40px rgba(232, 168, 75, 0.1);
    margin-top: 40px;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2s forwards;
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 12px;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.5s forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Isometric Bar === */
.isometric-bar {
    perspective: 800px;
}

.iso-container {
    transform: rotateX(60deg) rotateZ(-45deg);
    transform-style: preserve-3d;
    position: relative;
    width: 300px;
    height: 300px;
}

.iso-floor {
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    transform-style: preserve-3d;
    opacity: 0;
    animation: isoAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.iso-cellar-floor {
    bottom: 0;
    left: 50px;
    animation-delay: 0.3s;
    background: var(--bg-mid);
}

.iso-main-floor {
    bottom: 80px;
    left: 50px;
    animation-delay: 0.8s;
}

.iso-rooftop-floor {
    bottom: 160px;
    left: 50px;
    animation-delay: 1.3s;
    background: rgba(74, 50, 40, 0.7);
}

.iso-wall {
    position: absolute;
    background: var(--bg-mid);
    border: 1px solid var(--border);
}

.iso-wall-left {
    width: 10px;
    height: 100%;
    left: -10px;
    top: 0;
    transform: skewY(30deg);
    transform-origin: right;
}

.iso-wall-right {
    width: 100%;
    height: 10px;
    bottom: -10px;
    left: 0;
    transform: skewX(30deg);
    transform-origin: top;
}

@keyframes isoAppear {
    from { opacity: 0; transform: scaleY(0); }
    to { opacity: 1; transform: scaleY(1); }
}

/* Isometric objects */
.iso-barstool {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--border);
    border-radius: 50%;
    bottom: 20px;
    left: 40px;
    box-shadow: 0 5px 0 var(--bg-mid);
    opacity: 0;
    animation: fadeInUp 0.5s ease 1.5s forwards;
}

.iso-barstool-2 {
    left: 80px;
    animation-delay: 1.7s;
}

.iso-glass {
    position: absolute;
    width: 12px;
    height: 18px;
    bottom: 30px;
    left: 130px;
    background: linear-gradient(to top, var(--accent-highlight) 60%, transparent 60%);
    clip-path: polygon(20% 100%, 80% 100%, 100% 0%, 0% 0%);
    opacity: 0;
    animation: fadeInUp 0.5s ease 1.9s forwards;
}

.iso-record-player {
    position: absolute;
    width: 35px;
    height: 35px;
    background: var(--bg-deep);
    border-radius: 4px;
    bottom: 15px;
    right: 30px;
    opacity: 0;
    animation: fadeInUp 0.5s ease 2.1s forwards;
}

.iso-vinyl {
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, var(--accent) 15%, #1a120b 16%, #1a120b 45%, var(--border) 46%, var(--border) 48%, #1a120b 49%);
    border-radius: 50%;
    position: absolute;
    top: 3.5px;
    left: 3.5px;
    animation: spin 1.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.iso-table {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--border);
    border-radius: 50%;
    bottom: 30px;
    left: 80px;
    box-shadow: 0 4px 0 var(--bg-mid);
    opacity: 0;
    animation: fadeInUp 0.5s ease 1.8s forwards;
}

.iso-decanter {
    position: absolute;
    width: 16px;
    height: 24px;
    background: linear-gradient(to top, var(--accent-warm) 70%, transparent 70%);
    border-radius: 3px 3px 8px 8px;
    bottom: 20px;
    left: 90px;
    opacity: 0;
    animation: fadeInUp 0.5s ease 1.6s forwards;
}

/* === Curve Dividers === */
.curve-divider {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
}

.curve-divider svg {
    width: 100%;
    height: 100%;
    filter: url(#glow);
}

.curve-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.curve-path.drawn {
    stroke-dashoffset: 0;
}

/* === Skeleton Loading === */
.skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 10;
    border-radius: inherit;
}

.skeleton.revealed::before {
    animation: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* === Scene 2: Rooftop === */
.scene-rooftop {
    min-height: 100vh;
    padding: 100px 40px;
}

.broken-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    max-width: 1100px;
    width: 100%;
    position: relative;
}

.panel {
    background: var(--surface);
    padding: 40px;
    border: 1px solid var(--border);
    position: relative;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel.visible {
    opacity: 1;
}

.panel h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    color: var(--text-primary);
    margin-bottom: 16px;
}

.panel p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.panel-1 {
    transform: translateX(-8%) translateY(20px);
    grid-column: 1;
}

.panel-1.visible {
    transform: translateX(-8%) translateY(0);
}

.panel-2 {
    transform: translateX(5%) translateY(50px);
    grid-column: 2;
    margin-top: -30px;
}

.panel-2.visible {
    transform: translateX(5%) translateY(30px);
}

.panel-3 {
    transform: translateX(0) translateY(40px);
    grid-column: 3;
    margin-top: 20px;
    z-index: 2;
    margin-left: -20px;
    display: flex;
    align-items: center;
}

.panel-3.visible {
    transform: translateX(0) translateY(20px);
}

/* === Scene 3: Main Floor / Drinks === */
.scene-mainfloor {
    min-height: 150vh;
    padding: 100px 40px;
    position: relative;
}

.drinks-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
}

.drink-card {
    background: var(--surface);
    padding: 40px 30px;
    border: 1px solid var(--border);
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s;
}

.drink-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.drink-card:nth-child(1) { margin-top: 40px; }
.drink-card:nth-child(2) { margin-top: -20px; }
.drink-card:nth-child(3) { margin-top: 60px; }

.drink-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(26, 18, 11, 0.6);
}

.drink-card h3 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--accent-highlight);
    margin: 20px 0 12px;
}

.drink-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* Drink glass illustrations */
.drink-iso-glass {
    width: 50px;
    height: 60px;
    margin: 0 auto;
    position: relative;
}

.drink-coupe::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 30px;
    background: var(--border);
}

.drink-coupe::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 30px;
    border-radius: 0 0 50% 50%;
    background: linear-gradient(to bottom, transparent 20%, var(--accent-highlight) 20%);
    border: 2px solid var(--border);
    border-top: none;
}

.drink-rocks::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 40px;
    background: linear-gradient(to top, var(--accent-warm) 50%, transparent 50%);
    border: 2px solid var(--border);
    border-radius: 2px;
}

.drink-flute::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 25px;
    background: var(--border);
}

.drink-flute::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 40px;
    background: linear-gradient(to top, var(--accent-warm) 40%, transparent 40%);
    border: 2px solid var(--border);
    border-radius: 2px 2px 4px 4px;
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
}

.drinks-curve {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* === Scene 4: The Cellar === */
.scene-cellar {
    min-height: 100vh;
    background: var(--darkest);
    position: relative;
    overflow: hidden;
}

.cellar-content {
    max-width: 700px;
    text-align: center;
}

.philosophy-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    line-height: 1.4;
    color: var(--text-primary);
}

.philosophy-text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    margin-right: 0.3em;
}

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

.cellar-curves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
}

/* === Scene 5: Last Call === */
.scene-lastcall {
    min-height: 50vh;
    background: var(--bg-deep);
}

.lastcall-diorama {
    width: 120px;
    height: 80px;
    position: relative;
    margin-bottom: 30px;
    perspective: 600px;
}

.mini-bar {
    width: 100%;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    transform: rotateX(60deg) rotateZ(-45deg);
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mini-bar.rotated {
    transform: rotateX(60deg) rotateZ(-30deg);
}

.lastcall-domain {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.lastcall-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-highlight);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .broken-grid {
        grid-template-columns: 1fr;
    }

    .panel-1, .panel-2, .panel-3 {
        grid-column: 1;
        margin-left: 0;
        margin-top: 0;
    }

    .drinks-grid {
        grid-template-columns: 1fr;
    }

    .drink-card:nth-child(1),
    .drink-card:nth-child(2),
    .drink-card:nth-child(3) {
        margin-top: 0;
    }

    .nav-cube {
        top: 15px;
        right: 15px;
    }

    .iso-container {
        transform: rotateX(60deg) rotateZ(-45deg) scale(0.7);
    }
}
