/* Base styles and variables */
:root {
    --noir: #272322;
    --grove: #44468E;
    --mushroom: #857670;
    --ivory: #E6E1D8;
    --gold: #C5A46D;
    
    --heading-font: 'Cinzel', serif;
    --body-font: 'Cardo', serif;
    --accent-font: 'Forum', cursive;
    --alt-accent-font: 'Karla', sans-serif;
    
    --container-padding: 1.5rem;
    --section-spacing: 4rem;
    --card-radius: 4px;
    --transition: all 0.3s ease;

    --mobile-container-padding: 1rem;
    --tablet-container-padding: 1.5rem;
    --desktop-container-padding: 2rem;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    color: var(--ivory);
    background-color: var(--noir);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--ivory);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--gold);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--mobile-container-padding);
    padding-right: var(--mobile-container-padding);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: "✦";
    display: block;
    font-size: 1rem;
    margin-top: 0.5rem;
    color: var(--mushroom);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid;
    border-radius: 2px;
    font-family: var(--heading-font);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button,
.nav-links a,
.footer-links a,
.social-icons a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: transparent;
    border-color: var(--ivory);
    color: var(--ivory);
}

.btn-primary:hover {
    background-color: var(--ivory);
    color: var(--noir);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--mushroom);
    color: var(--ivory);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-text {
    border: none;
    padding: 0;
    position: relative;
    font-family: var(--accent-font);
    display: inline-flex;
    align-items: center;
}

.btn-text::after {
    content: "→";
    margin-left: 0.25rem;
    transition: var(--transition);
}

.btn-text:hover::after {
    transform: translateX(3px);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px; /* revert back to original size */
}

.navbar.transparent {
    background-color: transparent;
    backdrop-filter: none;
    border-bottom: none;
}

.navbar.scrolled {
    background-color: rgba(39, 35, 34, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(133, 118, 112, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    color: var(--ivory);
}

.logo:hover {
    color: var(--ivory);
    opacity: 0.9;
}

.logo img {
    height: 35px;
    margin-right: 0.5rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.logo h1 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.nav-menu {
    position: static;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    position: relative;
    padding: 10px;
    margin: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--ivory);
    margin: 6px 0;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

.nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(39, 35, 34, 0.98);
    width: 200px;
    padding: 1rem;
    display: none;
    list-style: none;
    text-align: center;
    border: 1px solid rgba(133, 118, 112, 0.2);
}

.nav-links.active {
    display: block;
}

.nav-links li {
    margin: 1rem 0;
}

.cart-search {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-search .icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.cart-icon {
    font-size: 1.25rem;
}

.cart-count {
    display: inline-block;
    background-color: var(--gold);
    color: var(--noir);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.75rem;
    text-align: center;
    line-height: 18px;
    margin-left: 2px;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
    margin-top: 0;
    background-image: linear-gradient(
        rgba(39, 35, 34, 0.75), 
        rgba(39, 35, 34, 0.9)
    ), url('https://images.pexels.com/photos/7947733/pexels-photo-7947733.jpeg');
    background-blend-mode: soft-light;
    filter: sepia(30%) brightness(0.9) contrast(1.1);
    position: relative;
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--noir);
    opacity: 0.25;
    mix-blend-mode: color;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 2rem;
    max-width: 20ch;
    margin: 0 auto 1.5rem;
}

.hero p {
    max-width: 30ch;
    margin: 0 auto 2rem;
    font-family: var(--accent-font);
    font-size: 1.25rem;
}

.hero-logo {
    margin-bottom: 2rem;
}

.hero-logo img {
    height: 250px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Categories Section */
.categories {
    padding: var(--section-spacing) 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(133, 118, 112, 0.1);
    padding: 1.5rem;
    border-radius: var(--card-radius);
    text-align: center;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    background-color: rgba(133, 118, 112, 0.2);
}

.category-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.category-card h3 {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Featured Products */
.featured-products {
    padding: var(--section-spacing) 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

.product-card {
    text-align: center;
    transition: var(--transition);
}

/* Product images */
.product-image {
    background-color: rgba(133, 118, 112, 0.1);
    border-radius: var(--card-radius);
    margin-bottom: 1rem;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* SVG product images */
.product-image img[src$=".svg"] {
    height: 120px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    padding: 2rem;
    transition: var(--transition);
}

/* Photo product images */
.product-image img[src$=".jpg"],
.product-image img[src$=".jpeg"],
.product-image img[src$=".png"] {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
    opacity: 1;
    transition: var(--transition);
}

.product-card:hover .product-image {
    background-color: rgba(133, 118, 112, 0.2);
}

/* New hover effects */
.product-card:hover .product-image img[src$=".svg"] {
    opacity: 1;
    transform: scale(1.1);
}

.product-card:hover .product-image img[src$=".jpg"],
.product-card:hover .product-image img[src$=".jpeg"],
.product-card:hover .product-image img[src$=".png"] {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Moon Phase Tracker */
.moon-phase {
    padding: var(--section-spacing) 0;
    background-color: rgba(68, 70, 142, 0.08);
    position: relative;
    overflow: hidden;
    background-image: 
        radial-gradient(1px at 20% 30%, var(--ivory) 0%, transparent 100%),
        radial-gradient(1px at 40% 70%, var(--ivory) 0%, transparent 100%),
        radial-gradient(1px at 65% 25%, var(--ivory) 0%, transparent 100%),
        radial-gradient(1px at 85% 65%, var(--ivory) 0%, transparent 100%),
        radial-gradient(1px at 15% 85%, var(--ivory) 0%, transparent 100%);
    background-size: 200% 200%;
}

.moon-phase::before {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(68, 70, 142, 0.1) 0%, rgba(39, 35, 34, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.moon-phase .container {
    position: relative;
    z-index: 2;
}

.moon-tracker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.moon-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.moon-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: rgba(68, 70, 142, 0.1);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px rgba(68, 70, 142, 0.15);
    margin-bottom: 0.5rem;
}

.moon-visual {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--ivory);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(197, 164, 109, 0.2),
                0 0 15px rgba(230, 225, 216, 0.2);
    --moon-illumination: 50%; /* Default value, will be updated via JS */
}

.moon-visual::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(68, 70, 142, 0.25);
    box-shadow: inset 0 0 8px rgba(39, 35, 34, 0.5);
    transform: scale(1.1);
}

/* Waxing phases (shadow on left) */
.moon-visual.phase-left::before {
    left: 0;
    top: 0;
    transform-origin: center right;
    transform: scale(1.1) translateX(calc(-100% + var(--moon-illumination)));
}

/* Waning phases (shadow on right) */
.moon-visual.phase-right::before {
    right: 0;
    top: 0;
    transform-origin: center left;
    transform: scale(1.1) translateX(calc(100% - var(--moon-illumination)));
}

/* Full moon - no shadow */
.moon-visual.phase-full::before {
    opacity: 0;
}

/* New moon - full shadow */
.moon-visual.phase-new::before {
    background-color: rgba(68, 70, 142, 0.4);
    box-shadow: inset 0 0 15px rgba(39, 35, 34, 0.5);
    transform: scale(1);
}

.moon-stars {
    position: absolute;
    width: 240%;
    height: 240%;
    top: -70%;
    left: -70%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: var(--ivory);
    border-radius: 50%;
    opacity: 0.7;
    animation: twinkle 2s infinite ease-in-out;
}

.star-tiny {
    width: 1px;
    height: 1px;
    opacity: 0.5;
}

.star-medium {
    width: 3px;
    height: 3px;
    opacity: 0.8;
    box-shadow: 0 0 3px var(--ivory);
}

/* Position each star individually for more natural look */
.star:nth-child(1) {
    top: 20%;
    left: 10%;
    width: 3px;
    height: 3px;
    animation-delay: 0.3s;
}

.star:nth-child(2) {
    top: 15%;
    right: 15%;
    animation-delay: 0.7s;
}

.star:nth-child(3) {
    bottom: 25%;
    left: 20%;
    animation-delay: 1.1s;
}

.star:nth-child(4) {
    top: 45%;
    left: 85%;
    animation-delay: 1.5s;
}

.star:nth-child(5) {
    top: 65%;
    left: 35%;
    animation-delay: 0.9s;
}

.star:nth-child(6) {
    top: 75%;
    left: 80%;
    width: 2px;
    height: 2px;
    animation-delay: 1.7s;
}

.star:nth-child(7) {
    top: 35%;
    left: 50%;
    animation-delay: 0.2s;
}

.star:nth-child(8) {
    top: 22%;
    left: 75%;
    animation-delay: 1.3s;
}

.star:nth-child(9) {
    top: 88%;
    left: 65%;
    animation-delay: 0.5s;
}

.star:nth-child(10) {
    top: 55%;
    left: 22%;
    animation-delay: 1.9s;
}

.star:nth-child(11) {
    top: 28%;
    left: 40%;
    animation-delay: 0.4s;
}

.star:nth-child(12) {
    top: 62%;
    left: 60%;
    animation-delay: 1.2s;
}

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

/* Add a second animation for variety */
@keyframes twinkle-alt {
    0%, 100% { opacity: 0.5; }
    30% { opacity: 0.8; }
    70% { opacity: 0.3; }
}

/* Apply alternate animation to some stars */
.star:nth-child(3n) {
    animation: twinkle-alt 3s infinite ease-in-out;
}

/* Make stars with odd indices fade in and out more dramatically */
.star:nth-child(odd) {
    animation-duration: 2.5s;
}

.moon-info {
    max-width: 400px;
    margin: 0 auto;
}

.moon-info h3 {
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.moon-date {
    font-size: 0.9rem;
    color: var(--mushroom);
    margin: 0.75rem 0 1.25rem;
    font-family: var(--accent-font);
}

#moon-phase-desc {
    font-style: italic;
    line-height: 1.5;
}

#moon-phase-usage {
    color: var(--ivory);
    font-style: normal;
}

/* Journal Section */
.journal {
    padding: var(--section-spacing) 0;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: rgba(133, 118, 112, 0.05);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.article-image {
    background-color: rgba(133, 118, 112, 0.1);
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.article-image img {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
    opacity: 1;
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-content h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--gold);
}

.article-content p {
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    flex-grow: 1;
}

.journal-cta {
    text-align: center;
    margin-top: 1rem;
}

/* Email Signup */
.email-signup {
    padding: var(--section-spacing) 0;
    text-align: center;
    background-color: rgba(133, 118, 112, 0.1);
}

.email-signup h2 {
    margin-bottom: 0.5rem;
}

.email-signup p {
    max-width: 400px;
    margin: 0 auto 2rem;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.signup-form input {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(133, 118, 112, 0.3);
    border-radius: 2px;
    background-color: rgba(39, 35, 34, 0.8);
    color: var(--ivory);
    font-family: var(--body-font);
}

.signup-form input::placeholder {
    color: rgba(230, 225, 216, 0.6);
}

/* Footer */
footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(133, 118, 112, 0.2);
    background-color: rgba(39, 35, 34, 0.8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

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

.footer-logo img {
    height: 60px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-logo h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--gold);
}

.footer-logo p {
    font-family: var(--accent-font);
    color: var(--mushroom);
}

.footer-links h4 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--ivory);
    opacity: 0.8;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--gold);
    opacity: 1;
    padding-left: 5px;
}

.footer-social h4 {
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icons a {
    color: var(--ivory);
    opacity: 0.8;
    transition: var(--transition);
}

.social-icons a:hover {
    color: var(--gold);
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(133, 118, 112, 0.2);
    font-size: 0.875rem;
    color: var(--mushroom);
}

.footer-bottom p:last-child {
    margin-bottom: 0;
}

@media screen and (min-width: 576px) {
    .container {
        padding-left: var(--tablet-container-padding);
        padding-right: var(--tablet-container-padding);
    }
    
    h1 { font-size: 2.25rem; }
    h2 { font-size: 2rem; }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 768px) {
    :root {
        --container-padding: 2rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .nav-links {
        display: flex;
        position: static;
        width: auto;
        background-color: transparent;
        padding: 0;
        border: none;
    }
    
    .nav-links li {
        margin: 0 1.5rem;
    }
    
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .moon-tracker {
        flex-direction: row;
        text-align: left;
        align-items: center;
        justify-content: center;
    }
    
    .moon-container {
        width: auto;
        margin-right: 1rem;
    }
    
    .moon-info {
        flex: 1;
        max-width: 400px;
    }
    
    .article-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .signup-form {
        flex-direction: row;
    }
    
    .signup-form input {
        flex: 1;
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-logo {
        text-align: left;
    }
    
    .footer-bottom {
        display: flex;
        justify-content: space-between;
        text-align: left;
    }
    
    .container {
        max-width: 720px;
        margin: 0 auto;
    }
    
    .hero {
        min-height: 500px;
    }
}

@media screen and (min-width: 992px) {
    html {
        font-size: 18px;
    }
    
    .navbar-container {
        height: 80px;
    }
    
    .hero h2 {
        font-size: 3rem;
    }
    
    .container {
        max-width: 960px;
        padding-left: var(--desktop-container-padding);
        padding-right: var(--desktop-container-padding);
    }
    
    .hero {
        min-height: 600px;
    }
}

@media screen and (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Improved mobile navigation */
@media screen and (max-width: 767px) {
    .nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background-color: rgba(39, 35, 34, 0.95);
        z-index: 9999;
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        padding: 1rem 0;
    }
    
    .nav-links li {
        margin: 0;
        padding: 0;
    }
    
    .nav-links a {
        padding: 12px var(--mobile-container-padding);
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .article-grid, .product-grid, .category-grid, .footer-grid {
        gap: 1.5rem;
    }
}

/* Animations and magical effects */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h2, .hero p, .hero .btn {
    animation: fadeIn 1s ease forwards;
}

.hero p {
    animation-delay: 0.3s;
}

.hero .btn {
    animation-delay: 0.6s;
}

.product-card:hover .product-image {
    background-color: rgba(133, 118, 112, 0.2);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-primary:hover {
    box-shadow: 0 0 10px rgba(197, 164, 109, 0.3);
}
