/* ==========================================================
   MOON CAFÉ — style.css
   Sections:
   1. Design tokens (variables)   8. Menu
   2. Reset & base styles         9. Gallery
   3. Layout helpers             10. Contact
   4. Buttons                    11. Footer
   5. Header & navigation        12. Scroll animations
   6. Hero                       13. Responsive (tablet & mobile)
   7. About                      14. Reduced motion
   ========================================================== */


/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    /* Colors */
    --espresso: #2b1b12;
    --espresso-deep: #1c110b;
    --coffee: #4a2f21;
    --caramel: #b98a5e;
    --caramel-dark: #8a5a33;
    /* darker caramel: readable on light backgrounds */
    --beige: #e8d9c3;
    --cream: #f8f1e7;
    --text: #3a271c;
    --text-muted: #6f5a4b;

    /* Fonts */
    --font-heading: "Playfair Display", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Layout & effects */
    --header-height: 76px;
    --container-width: 1200px;
    --radius: 14px;
    --shadow-soft: 0 10px 30px rgba(43, 27, 18, 0.12);
    --shadow-strong: 0 18px 40px rgba(43, 27, 18, 0.25);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}


/* ---------- 2. RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* smooth scrolling for nav links */
    scroll-padding-top: var(--header-height);
    /* stops the fixed header covering titles */
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Visible keyboard focus (good for accessibility) */
:focus-visible {
    outline: 2px solid var(--caramel);
    outline-offset: 3px;
}


/* ---------- 3. LAYOUT HELPERS ---------- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.section {
    padding-block: clamp(4rem, 9vw, 7rem);
}

.section-header {
    max-width: 640px;
    margin: 0 auto clamp(2.5rem, 6vw, 4rem);
    text-align: center;
}

.section-eyebrow {
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--caramel-dark);
}

.section-title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4.5vw, 3rem);
    color: var(--espresso);
}

/* Small decorative line under centered titles */
.section-header .section-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 2px;
    margin: 1.1rem auto 0;
    background: var(--caramel);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
}


/* ---------- 4. BUTTONS ---------- */
.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    transition: transform 0.3s var(--ease), background-color 0.3s var(--ease),
        color 0.3s var(--ease), border-color 0.3s var(--ease),
        box-shadow 0.3s var(--ease);
}

.btn:hover {
    transform: translateY(-3px);
}

.btn-primary {
    background: var(--caramel);
    color: var(--espresso-deep);
    box-shadow: 0 8px 20px rgba(185, 138, 94, 0.35);
}

.btn-primary:hover {
    background: var(--cream);
    box-shadow: 0 12px 26px rgba(185, 138, 94, 0.45);
}

.btn-outline {
    border-color: rgba(248, 241, 231, 0.6);
    color: var(--cream);
}

.btn-outline:hover {
    background: var(--cream);
    border-color: var(--cream);
    color: var(--espresso);
}


/* ---------- 5. HEADER & NAVIGATION ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
    background: rgba(43, 27, 18, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(185, 138, 94, 0.18);
    transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* JavaScript will add this class after scrolling (Step 4) */
.header.scrolled {
    background: rgba(28, 17, 11, 0.96);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--cream);
}

.logo span {
    font-style: italic;
    font-weight: 500;
    color: var(--caramel);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-link {
    position: relative;
    padding-block: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--beige);
}

/* Animated underline */
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--caramel);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease);
}

.nav-link:hover,
.nav-link.active {
    color: var(--cream);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hamburger button (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--cream);
    transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

/* Hamburger turns into an X when JavaScript adds .active */
.nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* ---------- 6. HERO ---------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: var(--header-height);
    color: var(--cream);

    /* Dark gradient on top of the photo keeps the text readable.
     NOTE: this path starts from the css/ folder, so we go up one level (../) */
    background-image:
        linear-gradient(105deg, rgba(28, 17, 11, 0.88) 0%, rgba(43, 27, 18, 0.65) 45%, rgba(43, 27, 18, 0.35) 100%),
        url("../images/hero.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-content>* {
    max-width: 640px;
}

.hero-eyebrow {
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--caramel);
}

.hero-title {
    margin-bottom: 1.5rem;
    font-size: clamp(2.6rem, 7vw, 5rem);
    line-height: 1.1;
}

.hero-text {
    margin-bottom: 2.25rem;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 300;
    color: var(--beige);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Text fades up when the page loads, one piece after another */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hero-eyebrow,
.hero-title,
.hero-text,
.hero-buttons {
    animation: fadeUp 0.9s var(--ease) both;
}

.hero-title {
    animation-delay: 0.15s;
}

.hero-text {
    animation-delay: 0.3s;
}

.hero-buttons {
    animation-delay: 0.45s;
}

/* Small animated "scroll down" line at the bottom of the hero */
.hero::after {
    content: "";
    position: absolute;
    bottom: 2rem;
    left: 50%;
    width: 1px;
    height: 56px;
    background: linear-gradient(to bottom, var(--caramel), transparent);
    animation: scrollHint 2.2s ease-in-out infinite;
}

@keyframes scrollHint {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* Subtle parallax (image stays still while you scroll) on large screens only */
@media (min-width: 1024px) and (hover: hover) {
    .hero {
        background-attachment: scroll, fixed;
    }
}


/* ---------- 7. ABOUT ---------- */
.about {
    background: var(--cream);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}

.about-image {
    position: relative;
}

/* Decorative caramel frame offset behind the photo */
.about-image::before {
    content: "";
    position: absolute;
    inset: 1.25rem -1.25rem -1.25rem 1.25rem;
    z-index: 0;
    border: 2px solid var(--caramel);
    border-radius: var(--radius);
}

.about-image img {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
    transition: transform 0.6s var(--ease);
}

.about-image:hover img {
    transform: scale(1.02);
}

.about-text .section-title {
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1.1rem;
    color: var(--text-muted);
}

.about-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2.25rem;
    padding-top: 2rem;
    border-top: 1px solid var(--beige);
}

.about-features li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.about-features li::before {
    content: "";
    width: 28px;
    height: 2px;
    margin-bottom: 0.6rem;
    background: var(--caramel);
}

.about-features strong {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--coffee);
}

.about-features span {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
}


/* ---------- 8. MENU ---------- */
.menu {
    color: var(--cream);
    background-color: var(--espresso);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(185, 138, 94, 0.12), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(185, 138, 94, 0.08), transparent 40%);
}

.menu .section-eyebrow {
    color: var(--caramel);
}

.menu .section-title {
    color: var(--cream);
}

.menu .section-subtitle {
    color: var(--beige);
    opacity: 0.8;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.menu-item {
    padding: 1.75rem 2rem;
    background: rgba(74, 47, 33, 0.45);
    border: 1px solid rgba(185, 138, 94, 0.2);
    border-radius: var(--radius);
    transition: transform 0.35s var(--ease), background-color 0.35s var(--ease),
        border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.menu-item:hover {
    transform: translateY(-6px);
    background: rgba(74, 47, 33, 0.85);
    border-color: var(--caramel);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.menu-item-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.menu-item-header h3 {
    display: flex;
    flex: 1;
    align-items: baseline;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--cream);
}

/* Dotted line between the drink name and its price */
.menu-item-header h3::after {
    content: "";
    flex: 1;
    margin-left: 0.85rem;
    border-bottom: 1px dotted rgba(232, 217, 195, 0.35);
}

.price {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--caramel);
}

.menu-item p {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--beige);
    opacity: 0.8;
}


/* ---------- 9. GALLERY ---------- */
.gallery {
    background: var(--beige);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}

/* Dark gradient that fades in on hover */
.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(43, 27, 18, 0.55), transparent 55%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover::after {
    opacity: 1;
}

/* You have 4 gallery photos, so hide the 5th and 6th slots.
   DELETE this rule if you add gallery-5.jpg and gallery-6.jpg later. */
.gallery-item:nth-child(n + 5) {
    display: none;
}

@media (min-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}


/* ---------- 10. CONTACT ---------- */
.contact {
    background: var(--cream);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.contact-card {
    padding: 2.25rem 2rem;
    text-align: center;
    background: #fffaf3;
    border: 1px solid var(--beige);
    border-radius: var(--radius);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
        border-color 0.35s var(--ease);
}

.contact-card:hover {
    transform: translateY(-6px);
    border-color: var(--caramel);
    box-shadow: var(--shadow-soft);
}

.contact-card h3 {
    margin-bottom: 1.1rem;
    font-size: 1.3rem;
    color: var(--coffee);
}

.contact-card address {
    font-style: normal;
    color: var(--text-muted);
}

.contact-card li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--beige);
    font-size: 0.92rem;
    color: var(--text-muted);
}

.contact-card li:last-child {
    border-bottom: none;
}

.contact-card li span {
    font-weight: 600;
    color: var(--coffee);
}

.contact-card p {
    margin-bottom: 0.4rem;
}

.contact-card a {
    font-weight: 500;
    color: var(--coffee);
    border-bottom: 1px solid transparent;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.contact-card a:hover {
    color: var(--caramel-dark);
    border-bottom-color: currentColor;
}


/* ---------- 11. FOOTER ---------- */
.footer {
    padding-block: 3.5rem 2rem;
    color: var(--beige);
    background: var(--espresso-deep);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2rem;
}

.footer-links a {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
    transition: color 0.3s var(--ease), opacity 0.3s var(--ease);
}

.footer-links a:hover {
    color: var(--caramel);
    opacity: 1;
}

.footer-copy {
    width: 100%;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(185, 138, 94, 0.2);
    font-size: 0.85rem;
    opacity: 0.6;
}


/* ---------- 12. SCROLL ANIMATIONS (pure CSS) ---------- */
/* Sections fade up as they scroll into view.
   Browsers that don't support this yet simply show everything normally. */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@supports (animation-timeline: view()) {

    .section-header,
    .about-image,
    .about-text,
    .menu-grid,
    .gallery-grid,
    .contact-grid {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }
}


/* ---------- 13. RESPONSIVE ---------- */

/* Tablets */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        max-width: 460px;
        margin-inline: auto;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin-inline: auto;
    }
}

/* Phones */
@media (max-width: 768px) {

    /* Mobile navigation: a dropdown panel opened by the hamburger */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 1rem 1.5rem 1.75rem;
        background: rgba(28, 17, 11, 0.97);
        border-bottom: 1px solid rgba(185, 138, 94, 0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
            visibility 0.3s var(--ease);
    }

    /* JavaScript adds .active to open the menu */
    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 1rem 0;
        font-size: 0.95rem;
    }

    .nav-link::after {
        display: none;
    }

    .logo {
        font-size: 1.4rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .menu-item {
        padding: 1.5rem;
    }

    .about-features {
        grid-template-columns: 1fr;
    }
}


/* ---------- 14. REDUCED MOTION ---------- */
/* Respect visitors who turn off animations in their device settings */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}