:root {
    --bg-void: #0f0610;
    --burgundy-core: #6b1d3a;
    --burgundy-glow: #9e2d52;
    --cream: #f2e8d5;
    --gold: #c9a87c;
    --star-white: #faf5ed;
    --nebula: #3d1f47;
    --smoke: #4a3f3a;
    --dark-burgundy: #2a1520;
    --deep-wine: #1f1018;
    --sidebar-width: 280px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-void);
    color: var(--cream);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-left: var(--sidebar-width);
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(15, 6, 16, 0.03) 2px, rgba(15, 6, 16, 0.03) 4px);
}

/* Cursor Glow */
#cursor-glow {
    position: fixed;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(158, 45, 82, 0.15), transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    will-change: transform;
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-void);
    background-image: repeating-linear-gradient(2deg, transparent, transparent 10px, #2a1520 10px, #1f1018 11px);
    border-right: 1px solid var(--gold);
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--burgundy-core) var(--bg-void);
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-logo {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 2rem;
    color: var(--star-white);
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    list-style: none;
    margin-bottom: auto;
}

.sidebar-nav li {
    margin-bottom: 1.5rem;
}

.nav-link {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: clamp(0.85rem, 1vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--smoke);
    text-decoration: none;
    transition: color 0.3s, text-shadow 0.3s;
}

.nav-link:hover {
    color: var(--burgundy-glow);
    text-shadow: 0 0 12px rgba(158, 45, 82, 0.5);
}

.sidebar-constellation {
    margin-top: 2rem;
    opacity: 0.4;
}

.sidebar-constellation svg {
    width: 60px;
    height: 200px;
}

/* Main Content */
#main-content {
    position: relative;
}

.act {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Act I — The Street */
#act-street {
    background: linear-gradient(180deg, #0f0610 0%, #3d1f47 40%, #6b1d3a 100%);
}

.hero-content {
    text-align: center;
    position: relative;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 9rem);
    color: var(--star-white);
    letter-spacing: -0.02em;
    line-height: 1;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: letterIn 0.6s forwards;
    animation-delay: calc(1.5s + var(--i) * 0.1s);
}

@keyframes letterIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-tld {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    font-size: clamp(1rem, 3vw, 2.7rem);
    color: var(--gold);
    opacity: 0;
    animation: fadeIn 1s forwards 2.2s;
}

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

/* Glitch effect on hero */
.hero-title::before {
    content: 'miris';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 9rem);
    color: var(--burgundy-glow);
    opacity: 0;
    clip-path: inset(40% 0 50% 0);
    transform: translateX(4px);
    animation: glitch 8s infinite steps(1);
}

@keyframes glitch {
    0%, 97% { opacity: 0; }
    97.5% { opacity: 0.4; }
    97.65% { opacity: 0; }
}

.constellation-pour {
    position: absolute;
    bottom: 5vh;
    width: 80%;
    max-width: 500px;
}

.pour-svg {
    width: 100%;
}

.pour-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawPath 3s forwards 2s ease-out;
}

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

/* Act II — The Counter */
#act-counter {
    background: var(--bg-void);
    padding: 5rem 2rem;
}

.counter-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    max-width: 1100px;
    width: 100%;
    align-items: center;
}

.story-paragraph {
    margin-bottom: 1.5rem;
    color: var(--cream);
}

.gold {
    color: var(--gold);
    font-weight: 600;
}

.rotating-constellation {
    width: 100%;
    max-width: 350px;
    animation: slowRotate 120s linear infinite;
}

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

/* Act III — Star Menu */
#act-menu {
    background: linear-gradient(180deg, var(--bg-void) 0%, var(--nebula) 100%);
    padding: 5rem 2rem;
    min-height: 100vh;
}

.star-burst {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ray {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1px;
    height: 40px;
    background: linear-gradient(to top, var(--gold), transparent);
    transform-origin: center bottom;
    transform: translateX(-50%) rotate(calc(var(--r) * 30deg));
}

.drink-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.drink-card {
    background: rgba(15, 6, 16, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gold);
    padding: 2rem;
    transition: transform 0.4s, opacity 0.6s;
    transition-delay: var(--delay);
}

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

.card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--star-white);
    margin-bottom: 0.75rem;
}

.card-desc {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    color: var(--cream);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-tags span {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gold);
    border: 1px solid rgba(201, 168, 124, 0.3);
    padding: 0.2rem 0.6rem;
}

/* Act IV — The Deep Room */
#act-deep {
    background: var(--bg-void);
    padding: 5rem 2rem;
    flex-direction: column;
    justify-content: center;
}

.deep-text {
    max-width: 60ch;
    text-align: center;
    margin: 0 auto;
}

.deep-line {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 3.5;
    color: var(--star-white);
    position: relative;
}

.deep-line::before {
    content: '';
    position: absolute;
    left: var(--star-x);
    top: var(--star-y);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.4;
}

.constellation-hour {
    width: 100%;
    margin-top: 4rem;
    overflow: hidden;
}

.hour-svg {
    width: 100%;
    height: 60px;
}

.hour-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 3s ease-out;
}

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

/* Fade-in elements */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        margin-left: 0;
        margin-bottom: 48px;
    }

    #sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        height: 48px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--gold);
    }

    .sidebar-inner {
        flex-direction: row;
        align-items: center;
        padding: 0 1rem;
    }

    .sidebar-logo {
        margin-bottom: 0;
        margin-right: 1rem;
        font-size: 1.2rem;
    }

    .sidebar-nav {
        display: flex;
        gap: 1rem;
    }

    .sidebar-nav li {
        margin-bottom: 0;
    }

    .sidebar-constellation {
        display: none;
    }

    .counter-layout {
        grid-template-columns: 1fr;
    }

    .drink-cards {
        grid-template-columns: 1fr;
    }

    #cursor-glow {
        left: 50% !important;
        top: 50% !important;
        animation: pulse 4s ease-in-out infinite;
    }

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

@media (prefers-reduced-motion: reduce) {
    .letter {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .hero-tld {
        animation: none;
        opacity: 1;
    }
    .hero-title::before {
        animation: none;
    }
    .pour-path {
        animation: none;
        stroke-dashoffset: 0;
    }
    .rotating-constellation {
        animation: none;
    }
    .fade-in {
        opacity: 1;
        transform: none;
    }
    #cursor-glow {
        display: none;
    }
}
