/* CSS Variables */
:root {
    --bg-charcoal: #0F0F0F;
    --accent-red: #C0392B;
    --text-white: #FDFDFD;
    --success-green: #2ecc71;
    --glass-bg: rgba(253, 253, 253, 0.1);
    --glass-border: rgba(253, 253, 253, 0.2);
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-serif: "Georgia", serif;
}

/* Base Styles (prefers-reduced-motion respected where applicable) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-charcoal);
    color: var(--text-white);
    font-family: var(--font-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-charcoal);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    width: 80%;
    max-width: 400px;
}

.loader-content .brand-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 24px;
    color: var(--text-white);
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: rgba(253, 253, 253, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--accent-red);
    transition: width 0.1s linear;
}

#progress-text {
    font-size: 14px;
    color: var(--text-white);
    opacity: 0.7;
}

/* Header */
.sticky-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Glassmorphism Toggle */
.toggle-container {
    display: flex;
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 4px;
    cursor: pointer;
}

.toggle-option {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
    transition: color 0.3s ease;
    color: rgba(253, 253, 253, 0.6);
}

.toggle-option.active {
    color: var(--text-white);
}

.toggle-slider {
    position: absolute;
    top: 4px; left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background-color: var(--accent-red);
    border-radius: 24px;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Scroll Container */
.scroll-container {
    height: 500vh; /* Allow enough scroll space for the 240 frames */
}

/* Sticky Hero Section */
.hero-section {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Typography Layer */
.typography-layer {
    position: absolute;
    bottom: 48px; /* Mobile first: text at bottom */
    left: 0;
    width: 100%;
    padding: 0 24px;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cinematic-text {
    position: absolute;
    bottom: 80px; /* Base position */
    left: 0;
    width: 100%;
    padding: 0 24px;
    font-family: var(--font-serif);
    font-size: 32px;
    line-height: 1.2;
    font-weight: normal;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.1s linear, transform 0.1s linear;
}

.cta-button {
    position: absolute;
    bottom: 0;
    opacity: 0; /* Fades in at the end */
    pointer-events: none; /* Disable clicks until fully visible */
    background-color: var(--accent-red);
    color: var(--text-white);
    border: none;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.cta-button.visible {
    opacity: 1;
    pointer-events: auto;
}

.cta-button:hover {
    background-color: #a83225;
}

/* Desktop Styles (>=1024px) */
@media (min-width: 1024px) {
    .sticky-header {
        padding: 32px 64px;
    }
    
    .logo h1 {
        font-size: 24px;
    }

    .typography-layer {
        top: 50%;
        bottom: auto;
        left: 64px;
        width: 40%;
        transform: translateY(-50%);
        align-items: flex-start;
        text-align: left;
    }

    .cinematic-text {
        position: absolute;
        top: 0;
        bottom: auto;
        left: 0;
        width: 100%;
        padding: 0;
        font-size: 56px;
    }

    .cta-button {
        top: 100px; /* Relative to the text block */
        bottom: auto;
        left: 0;
    }
    
    #hero-canvas {
        /* On desktop, side hero is used, canvas cover is fine, or we can adjust object-fit */
        object-fit: cover;
    }

    .hero-hint {
        font-size: 2rem;
    }
}

/* Phase 3: Hero Hint Overlay (Centered) */
.hero-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 15, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 16px 32px;
    border-radius: 30px;
    z-index: 20;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    pointer-events: none;
    animation: hintBreathe 3s infinite ease-in-out;
    transition: opacity 0.2s linear;
}

@keyframes hintBreathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* Menu Section */
.menu-section {
    padding: 60px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.tabs-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.glass-tab {
    padding: 12px 24px;
    border-radius: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease, color 0.3s ease;
    color: rgba(253, 253, 253, 0.7);
}

.glass-tab.active {
    background: var(--text-white);
    color: var(--bg-charcoal);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

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

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

/* Product Card */
.product-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.card-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

.card-info .desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-weight: bold;
    font-size: 16px;
    color: var(--text-white);
}

.add-to-cart-btn {
    background: var(--accent-red);
    color: var(--text-white);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-to-cart-btn:hover {
    background: #a83225;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#toast-container.show {
    bottom: 30px;
}

.toast-message {
    background: var(--text-white);
    color: var(--bg-charcoal);
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Footer */
.basic-footer {
    border-top: 1px solid #333;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: rgba(253, 253, 253, 0.8);
    background: var(--bg-charcoal);
}

.basic-footer > div {
    flex: 1;
}

.basic-footer .footer-left {
    text-align: left;
}

.basic-footer .footer-center {
    text-align: center;
}

.basic-footer .footer-right {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-green);
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

@media (max-width: 768px) {
    .basic-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .basic-footer .footer-left,
    .basic-footer .footer-center,
    .basic-footer .footer-right {
        text-align: center;
        justify-content: center;
    }
}
