/* ========================================
   FAIRGROUND SWEET SHOP — STYLESHEET
   Emerald Green + Cream | Clean Minimalist
   ======================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --color-emerald-900: #064e3b;
    --color-emerald-800: #065f46;
    --color-emerald-700: #047857;
    --color-emerald-600: #059669;
    --color-emerald-500: #10b981;
    --color-emerald-100: #d1fae5;
    --color-emerald-50:  #ecfdf5;
    --color-cream:       #faf8f5;
    --color-cream-dark:  #f5f0e8;
    --color-warm-white:  #fefdfb;
    --color-text:        #1a2e28;
    --color-text-light:  #4a635a;
    --color-text-muted:  #7a9488;
    --color-line:        #e2ebe6;
    --color-line-light:  #eef3f0;
    --color-white:       #ffffff;
    --color-overlay:     rgba(6, 78, 59, 0.72);

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --max-width: 1200px;
    --header-height: 72px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--color-emerald-700);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    z-index: 200;
    font-size: 14px;
}
.skip-link:focus {
    top: 16px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
}

.section-eyebrow {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-emerald-700);
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}

.thin-line {
    width: 48px;
    height: 1px;
    background: var(--color-emerald-300, #6ee7b7);
    background: var(--color-emerald-500);
    margin-bottom: 32px;
}
.thin-line.center {
    margin-left: auto;
    margin-right: auto;
}

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

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.04em;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-emerald-700);
    color: var(--color-white);
    border-color: var(--color-emerald-700);
}
.btn-primary:hover {
    background: var(--color-emerald-800);
    border-color: var(--color-emerald-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(4, 120, 87, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.5);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-white);
}

.btn-full {
    width: 100%;
}

/* ---------- Header / Navigation ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-line);
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 1px 12px rgba(6, 78, 59, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-emerald-800);
    letter-spacing: -0.01em;
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-emerald-700);
    position: relative;
    flex-shrink: 0;
}
.logo-mark::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-emerald-100);
}
.logo-mark::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-emerald-100);
}

.main-nav ul {
    display: flex;
    gap: 36px;
}

.main-nav a {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-light);
    position: relative;
    padding: 4px 0;
    transition: var(--transition);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-emerald-700);
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--color-emerald-700);
}
.main-nav a:hover::after {
    width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle-line {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--color-text);
    transition: var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 5px);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-emerald-900);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url('https://images.pexels.com/photos/11412766/pexels-photo-11412766.jpeg?auto=compress&cs=tinysrgb&fit=crop&w=1920&h=1080') center center / cover no-repeat;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(6, 78, 59, 0.78) 0%,
        rgba(6, 78, 59, 0.65) 50%,
        rgba(6, 30, 20, 0.85) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 720px;
    padding: 120px 24px 80px;
}

.hero-eyebrow {
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-emerald-100);
    margin-bottom: 24px;
    opacity: 0.85;
}

.hero-headline {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 300;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-headline em {
    font-style: italic;
    color: var(--color-emerald-100);
}

.hero-sub {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.4; transform: scaleY(0.6); }
}

/* ---------- Section Base ---------- */
.section {
    padding: 120px 0;
}

/* ---------- About ---------- */
.about {
    background: var(--color-warm-white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/5;
}
.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.about-image:hover img {
    transform: scale(1.03);
}

.about-content p {
    color: var(--color-text-light);
    margin-bottom: 20px;
    font-size: 1rem;
}

.about-stats {
    display: flex;
    gap: 32px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-line);
}

.stat {
    flex: 1;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--color-emerald-700);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.stat-divider {
    width: 1px;
    background: var(--color-line);
    align-self: stretch;
}

/* ---------- Products ---------- */
.products {
    background: var(--color-cream);
}

.section-header {
    margin-bottom: 64px;
}

.section-header .section-title {
    margin-bottom: 16px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.product-card {
    background: var(--color-warm-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-line-light);
    transition: var(--transition);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(6, 78, 59, 0.08);
    border-color: var(--color-emerald-100);
}

.product-image {
    aspect-ratio: 1;
    overflow: hidden;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    padding: 20px 24px 0;
    color: var(--color-text);
}

.product-desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
    padding: 12px 24px 24px;
    line-height: 1.6;
}

/* ---------- Gallery ---------- */
.gallery {
    background: var(--color-emerald-900);
    padding: 100px 0;
}

.gallery .section-eyebrow {
    color: var(--color-emerald-100);
}

.gallery .section-title {
    color: var(--color-white);
}

.gallery .thin-line {
    background: var(--color-emerald-500);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 0;
}

.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: auto;
}
.gallery-item:first-child {
    aspect-ratio: 5/6;
}
.gallery-item:nth-child(4) {
    aspect-ratio: 5/6;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}
.gallery-item:hover img {
    transform: scale(1.05);
}

/* ---------- Visit ---------- */
.visit {
    background: var(--color-warm-white);
}

.visit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: stretch;
}

.visit-details {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 8px;
}

.visit-detail {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.visit-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-emerald-50);
    border: 1px solid var(--color-emerald-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-emerald-700);
}

.visit-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.visit-value {
    display: block;
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.6;
}

.visit-detail a {
    color: var(--color-emerald-700);
    transition: var(--transition);
}
.visit-detail a:hover {
    color: var(--color-emerald-600);
    text-decoration: underline;
}

.visit-map {
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 420px;
    border: 1px solid var(--color-line);
}

/* ---------- Contact ---------- */
.contact {
    background: var(--color-cream);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.contact-content p {
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-light);
}

.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    color: var(--color-text);
    background: var(--color-warm-white);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-success {
    text-align: center;
    padding: 16px;
    background: var(--color-emerald-50);
    border: 1px solid var(--color-emerald-100);
    border-radius: var(--radius-sm);
    color: var(--color-emerald-800);
    font-size: 14px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-emerald-900);
    color: rgba(255, 255, 255, 0.7);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 64px;
    margin-bottom: 64px;
}

.footer-brand .logo {
    color: var(--color-white);
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
    max-width: 280px;
}

.footer-links h4,
.footer-contact h4 {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-emerald-100);
    margin-bottom: 20px;
}

.footer-links ul,
.footer-contact ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a,
.footer-contact a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}
.footer-links a:hover,
.footer-contact a:hover {
    color: var(--color-white);
}

.footer-contact li {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* ---------- Scroll Reveal ---------- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible[data-reveal] {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.products-grid .reveal[data-reveal] { transition-delay: calc(var(--i, 0) * 0.08s); }
.gallery-grid .reveal[data-reveal] { transition-delay: calc(var(--i, 0) * 0.08s); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .about-grid,
    .visit-grid,
    .contact-grid {
        gap: 48px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .nav-toggle {
        display: flex;
        z-index: 110;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: var(--color-cream);
        border-left: 1px solid var(--color-line);
        padding: 100px 40px 40px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 24px;
    }

    .main-nav a {
        font-size: 15px;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 99;
    }
    .nav-overlay.active {
        display: block;
    }

    .hero-content {
        padding: 100px 24px 60px;
    }

    .hero-headline {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .section {
        padding: 80px 0;
    }

    .about-grid,
    .visit-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        aspect-ratio: 16/10;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .gallery-item:first-child,
    .gallery-item:nth-child(4) {
        aspect-ratio: 1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .footer-brand {
        grid-column: auto;
    }

    .hero-scroll {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .about-stats {
        flex-direction: column;
        gap: 20px;
    }
    .stat-divider {
        width: 100%;
        height: 1px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-item:first-child,
    .gallery-item:nth-child(4) {
        aspect-ratio: 4/3;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal[data-reveal] {
        opacity: 1;
        transform: none;
    }
}
