:root {
    --primary: #1b3b18;
    --primary-light: #2d5a27;
    --primary-rgb: 27, 59, 24;
    --cream: #f9f6ef;
    --cream-dark: #f0ebe1;
    --gold: #c5a059;
    --gold-light: #e6cca1;
    --charcoal: #141414;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(197, 160, 89, 0.2);
    --shadow: 0 20px 40px rgba(27, 59, 24, 0.08);
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --primary: #4a7c59;
    --primary-light: #689d77;
    --cream: #0e120e;
    --cream-dark: #161c16;
    --gold: #d4af8f;
    --gold-light: #b08d6c;
    --charcoal: #f0ebe1;
    --white: #161c16;
    --glass: rgba(22, 28, 22, 0.85);
    --glass-border: rgba(212, 175, 143, 0.2);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--cream);
    color: var(--charcoal);
    overflow-x: hidden;
    transition: background-color 0.6s ease, color 0.6s ease;
}

h1, h2, h3, .logo {
    font-family: 'Playfair Display', serif;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--cream);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.whisk-loader {
    width: 60px; height: 60px;
    border: 3px solid var(--gold-light);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin-bottom: 20px;
}
.preloader-text {
    font-family: 'Playfair Display', serif;
    letter-spacing: 4px;
    font-size: 0.9rem;
    color: var(--gold);
    text-transform: uppercase;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Ambient Background --- */
#canvas-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* --- Navigation --- */
header {
    position: fixed;
    top: 0; width: 100%;
    padding: 25px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

header.scrolled { padding: 15px 60px; box-shadow: var(--shadow); }

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    display: flex; align-items: center; gap: 8px;
    letter-spacing: -0.5px;
}
.logo span { color: var(--gold); font-weight: 400; font-size: 1.1rem; }

.nav-links { display: flex; gap: 35px; list-style: none; align-items: center; }
.nav-links a {
    text-decoration: none;
    color: var(--charcoal);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition);
    position: relative;
    opacity: 0.8;
}
.nav-links a:hover, .nav-links a.active { opacity: 1; color: var(--gold); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -6px; left: 0;
    width: 0; height: 1.5px; background: var(--gold);
    transition: var(--transition);
}
.nav-links a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 20px; }
.theme-toggle, .cart-btn {
    background: var(--cream-dark); border: 1px solid var(--glass-border);
    width: 42px; height: 42px; border-radius: 50%;
    cursor: pointer; font-size: 1.1rem; color: var(--charcoal);
    display: flex; justify-content: center; align-items: center;
    transition: var(--transition);
    position: relative;
}
.theme-toggle:hover, .cart-btn:hover { background: var(--gold); color: white; border-color: var(--gold); }
.cart-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--gold); color: white;
    font-size: 0.65rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex; align-items: center;
    padding: 0 8%;
    position: relative;
    overflow: hidden;
}
.hero-content { max-width: 650px; z-index: 2; margin-top: 60px; }
.hero-badge {
    display: inline-block;
    padding: 6px 16px; background: rgba(197, 160, 89, 0.12);
    border: 1px solid var(--gold); border-radius: 30px;
    color: var(--gold); font-size: 0.8rem; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase; margin-bottom: 25px;
}
.hero h1 { font-size: 4.5rem; line-height: 1.1; margin-bottom: 25px; color: var(--primary); font-weight: 900; }
.hero p { font-size: 1.1rem; line-height: 1.7; margin-bottom: 35px; opacity: 0.85; }

.btn {
    padding: 16px 36px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary); color: white;
    box-shadow: 0 15px 30px rgba(var(--primary-rgb), 0.25);
    border: 1px solid transparent;
}
.btn-primary:hover {
    background: var(--gold); color: var(--charcoal);
    transform: translateY(-3px);
    box-shadow: 0 20px 35px rgba(197, 160, 89, 0.3);
}
.btn-outline {
    background: transparent; color: var(--charcoal);
    border: 1px solid var(--glass-border);
}
.btn-outline:hover {
    border-color: var(--gold); color: var(--gold);
    transform: translateY(-3px);
}

.hero-image-container {
    position: absolute; right: 8%;
    width: 40%; height: 70%;
    display: flex; justify-content: center; align-items: center;
}
.hero-image {
    width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1515822369045-8178a5435056?q=80&w=1974&auto=format&fit=crop') center/cover;
    border-radius: 40% 60% 70% 30% / 40% 50% 50% 60%;
    animation: morph 12s ease-in-out infinite;
    box-shadow: var(--shadow);
    border: 2px solid var(--glass-border);
}
@keyframes morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 50% 60%; }
    50% { border-radius: 60% 40% 30% 70% / 50% 30% 70% 50%; }
}

/* --- Sections Common --- */
section { padding: 120px 8%; position: relative; }
.section-title { text-align: center; margin-bottom: 70px; }
.section-title h2 { font-size: 3rem; color: var(--primary); margin-top: 10px; font-weight: 700; }
.section-title p { color: var(--gold); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; font-size: 0.85rem; }

/* --- Story Section --- */
.story-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 70px; align-items: center; }
.story-img-wrapper { position: relative; }
.story-img {
    width: 100%; height: 450px;
    background: url('https://images.unsplash.com/photo-1576092768241-dec231879fc3?q=80&w=1974&auto=format&fit=crop') center/cover;
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.story-badge-float {
    position: absolute; bottom: -30px; right: -30px;
    background: var(--glass); backdrop-filter: blur(20px);
    padding: 30px; border-radius: 20px; border: 1px solid var(--glass-border);
    box-shadow: var(--shadow); max-width: 240px;
}
.story-badge-float h4 { font-size: 2rem; color: var(--gold); font-family: 'Playfair Display'; margin-bottom: 5px; }
.story-badge-float p { font-size: 0.85rem; opacity: 0.8; }
.story-text h3 { font-size: 2.2rem; margin-bottom: 25px; line-height: 1.3; }
.story-text p { line-height: 1.8; opacity: 0.85; margin-bottom: 20px; }

/* --- Taste Quiz --- */
.quiz-card {
    background: var(--glass);
    padding: 60px;
    border-radius: 35px;
    max-width: 850px; margin: 0 auto;
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    text-align: center;
}
.quiz-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 40px; }
.quiz-opt {
    padding: 24px; background: var(--white);
    border: 1px solid var(--glass-border); border-radius: 18px;
    cursor: pointer; transition: var(--transition);
    font-weight: 600; font-size: 1.05rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.02);
}
.quiz-opt:hover, .quiz-opt.active {
    border-color: var(--gold); transform: translateY(-4px);
    background: rgba(197, 160, 89, 0.08); color: var(--primary);
    box-shadow: 0 15px 30px rgba(197, 160, 89, 0.15);
}

/* --- Menu Section --- */
.menu-filter {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 50px; flex-wrap: wrap;
}
.filter-btn {
    background: var(--glass); border: 1px solid var(--glass-border);
    padding: 12px 30px; border-radius: 30px;
    cursor: pointer; color: var(--charcoal); font-weight: 600;
    font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase;
    transition: var(--transition);
}
.filter-btn.active, .filter-btn:hover { background: var(--gold); color: white; border-color: var(--gold); box-shadow: 0 10px 20px rgba(197, 160, 89, 0.2); }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
}
.menu-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 25px; border-radius: 28px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative; overflow: hidden;
    backdrop-filter: blur(10px);
}
.menu-item:hover { transform: translateY(-10px); box-shadow: 0 30px 60px rgba(0,0,0,0.12); border-color: var(--gold); }
.menu-img {
    width: 100%; height: 240px; border-radius: 20px;
    background-size: cover; background-position: center;
    margin-bottom: 20px; transition: var(--transition);
}
.menu-item:hover .menu-img { transform: scale(1.03); }
.menu-info h3 { font-size: 1.4rem; margin-bottom: 8px; }
.menu-info p { font-size: 0.9rem; opacity: 0.7; margin-bottom: 15px; }
.menu-footer { display: flex; justify-content: space-between; align-items: center; }
.menu-price { color: var(--gold); font-weight: 700; font-size: 1.3rem; font-family: 'Playfair Display'; }
.add-to-cart-btn {
    background: var(--primary); color: white;
    border: none; width: 45px; height: 45px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; font-size: 1.2rem; transition: var(--transition);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2);
}
.add-to-cart-btn:hover { background: var(--gold); transform: scale(1.1); }

/* --- Epic Customizer --- */
.customizer-container {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px;
    background: var(--glass); padding: 60px; border-radius: 40px;
    backdrop-filter: blur(25px); border: 1px solid var(--glass-border);
    box-shadow: var(--shadow); align-items: center;
}

.visual-area {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.03); padding: 40px; border-radius: 30px;
    border: 1px solid var(--glass-border);
}
.cup-wrapper { position: relative; width: 220px; height: 300px; margin-bottom: 30px; }
.cup {
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.25);
    border: 4px solid var(--glass-border); border-top: none;
    border-radius: 15px 15px 70px 70px;
    position: relative; overflow: hidden;
    z-index: 2;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.05);
}
.liquid-layer { position: absolute; width: 100%; bottom: 0; transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }
.layer-milk { background: #fcf9f2; height: 0%; z-index: 1; }
.layer-base { background: #2d5a27; height: 0%; z-index: 2; opacity: 0.9; }
.layer-topping { background: rgba(197, 160, 89, 0.7); height: 0%; z-index: 3; }
.cup-handle {
    position: absolute; right: -45px; top: 60px;
    width: 65px; height: 110px;
    border: 5px solid var(--glass-border); border-radius: 0 50% 50% 0;
    z-index: 1;
}

.price-display {
    font-size: 2.8rem; font-family: 'Playfair Display';
    color: var(--gold); font-weight: 700; margin-bottom: 10px;
}

.controls-area { display: flex; flex-direction: column; gap: 25px; }
.control-group h4 { margin-bottom: 12px; font-size: 0.8rem; text-transform: uppercase; color: var(--gold); letter-spacing: 2px; }
.option-pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pill {
    padding: 10px 22px; border-radius: 25px; border: 1px solid var(--glass-border);
    cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: var(--transition);
    background: var(--white);
}
.pill:hover, .pill.active { background: var(--gold); color: white; border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 15px rgba(197, 160, 89, 0.2); }

/* --- Testimonials --- */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.testimonial-card {
    background: var(--glass); border: 1px solid var(--glass-border);
    padding: 35px; border-radius: 25px; box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}
.testimonial-card p { font-style: italic; opacity: 0.85; margin-bottom: 20px; line-height: 1.7; }
.client-info h5 { font-size: 1.1rem; color: var(--primary); }
.client-info span { font-size: 0.8rem; color: var(--gold); letter-spacing: 1px; }

/* --- Cart Drawer --- */
#cart-modal {
    position: fixed; top: 0; right: -450px; width: 450px; height: 100%;
    background: var(--white); z-index: 2000;
    box-shadow: -20px 0 50px rgba(0,0,0,0.15);
    transition: var(--transition);
    padding: 40px;
    display: flex; flex-direction: column;
    border-left: 1px solid var(--glass-border);
}
#cart-modal.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--cream-dark); padding-bottom: 20px; }
.cart-items { flex-grow: 1; overflow-y: auto; padding-right: 5px; }
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--cream-dark);
}

/* --- Contact Section --- */
#contact > div { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

.contact-form {
    background: var(--glass);
    padding: 40px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 0;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--white);
    color: var(--charcoal);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
}

.contact-form textarea {
    resize: none;
    min-height: 120px;
}

.contact-form textarea:invalid {
    border-color: #ff5555;
}

.contact-btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.form-error {
    color: #ff5555;
    font-size: 0.85rem;
    margin-top: -10px;
    display: block;
    min-height: 20px;
}

/* --- Menu Item Alt Text Support --- */
.menu-img {
    background-size: cover;
    background-position: center;
}

[alt] {
    max-width: 100%;
}

footer {
    background: var(--charcoal); color: var(--cream);
    padding: 90px 8% 40px; text-align: center;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 50px; text-align: left; margin-bottom: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 60px;
}
.footer-logo { font-size: 2.2rem; margin-bottom: 15px; color: var(--gold); }
.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-links a {
    width: 42px; height: 42px; background: var(--glass);
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%; color: var(--charcoal); text-decoration: none;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}
.social-links a svg {
    width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round;
}
.social-links a:hover { background: var(--gold); border-color: var(--gold); color: white; transform: translateY(-3px); }
.social-links a:hover svg { stroke: white; fill: white; }

/* --- Animations --- */
[data-aos] { opacity: 0; transform: translateY(40px); transition: 1s cubic-bezier(0.16, 1, 0.3, 1); }
[data-aos].animate { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 968px) {
    .hero { flex-direction: column; text-align: center; padding-top: 140px; padding-bottom: 80px; }
    .hero h1 { font-size: 3rem; line-height: 1.2; }
    .hero p { font-size: 1rem; }
    .hero-image-container { position: relative; width: 280px; height: 280px; right: auto; margin-top: 40px; }
    .story-grid, .customizer-container { grid-template-columns: 1fr; gap: 40px; }
    header { padding: 18px 25px; }
    .logo { font-size: 1.4rem; }
    .logo span { font-size: 1rem; }
    .nav-links { display: none; }
    section { padding: 80px 6%; }
    .section-title h2 { font-size: 2.5rem; }
    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
    .testimonial-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
    #cart-modal { width: 100%; right: -100%; }
    .story-badge-float { bottom: -20px; right: -20px; padding: 20px; max-width: 200px; }
    .story-badge-float h4 { font-size: 1.6rem; }
}

@media (max-width: 640px) {
    .hero { padding: 120px 5% 60px; }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 0.95rem; margin-bottom: 25px; }
    .hero-badge { font-size: 0.7rem; padding: 5px 14px; margin-bottom: 20px; }
    .hero-image-container { width: 240px; height: 240px; margin-top: 35px; }
    header { padding: 15px 20px; }
    .logo { font-size: 1.2rem; }
    .logo span { font-size: 0.9rem; }
    .theme-toggle, .cart-btn { width: 38px; height: 38px; font-size: 1rem; }
    .header-actions { gap: 12px; }
    section { padding: 60px 5%; }
    .section-title { margin-bottom: 50px; }
    .section-title h2 { font-size: 2rem; }
    .section-title p { font-size: 0.75rem; letter-spacing: 2px; }
    .btn { padding: 14px 28px; font-size: 0.8rem; letter-spacing: 1.2px; }
    .story-img { height: 320px; }
    .story-text h3 { font-size: 1.8rem; }
    .story-text p { font-size: 0.95rem; }
    .story-badge-float { position: static; margin-top: 20px; max-width: 100%; }
    .quiz-card { padding: 40px 25px; border-radius: 25px; }
    .quiz-card h3 { font-size: 1.5rem; }
    .quiz-options { grid-template-columns: 1fr; gap: 15px; margin-top: 30px; }
    .quiz-opt { padding: 18px; font-size: 0.95rem; }
    .menu-grid { grid-template-columns: 1fr; gap: 20px; }
    .menu-item { padding: 20px; }
    .menu-img { height: 200px; }
    .menu-info h3 { font-size: 1.2rem; }
    .menu-price { font-size: 1.2rem; }
    .add-to-cart-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .customizer-container { padding: 40px 25px; gap: 35px; border-radius: 30px; }
    .visual-area { padding: 30px 20px; }
    .cup-wrapper { width: 180px; height: 240px; margin-bottom: 20px; }
    .cup-handle { right: -40px; width: 55px; height: 90px; }
    .price-display { font-size: 2.2rem; }
    .control-group h4 { font-size: 0.75rem; margin-bottom: 10px; }
    .pill { padding: 9px 18px; font-size: 0.8rem; }
    .testimonial-card { padding: 25px; border-radius: 20px; }
    .testimonial-card p { font-size: 0.95rem; margin-bottom: 15px; }
    .client-info h5 { font-size: 1rem; }
    .contact-grid { display: flex; flex-direction: column; gap: 40px; }
    #contact h3 { font-size: 1.6rem; }
    #contact form { padding: 30px 20px; }
    footer { padding: 60px 5% 30px; }
    .footer-grid { grid-template-columns: 1fr; gap: 35px; text-align: center; }
    .footer-logo { font-size: 1.8rem; }
    .social-links { justify-content: center; }
    #cart-modal { padding: 30px 20px; }
    .cart-header h3 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.9rem; line-height: 1.6; }
    .hero-image-container { width: 200px; height: 200px; }
    section { padding: 50px 5%; }
    .section-title h2 { font-size: 1.7rem; }
    .story-img { height: 260px; border-radius: 18px; }
    .story-text h3 { font-size: 1.5rem; margin-bottom: 20px; }
    .quiz-card { padding: 30px 20px; }
    .quiz-card h3 { font-size: 1.3rem; }
    .menu-filter { gap: 10px; }
    .filter-btn { padding: 10px 20px; font-size: 0.75rem; }
    .customizer-container { padding: 30px 20px; }
    .cup-wrapper { width: 150px; height: 200px; }
    .price-display { font-size: 1.8rem; }
    #contact form input, #contact form textarea { padding: 12px 16px; font-size: 0.9rem; }
}
