/* ============================================
   lunch.day — Neomorphic Lunchbox
   Interaction Details:** IntersectionObserver` for scroll-triggered animations. Each hexagon has `opacity: 0
   ============================================ */

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

:root {
    --bg: #f5efe6;
    --shadow-light: #fffcf5;
    --shadow-dark: #d9cfc2;
    --text: #5a4a3a;
    --accent-terracotta: #c4725a;
    --accent-honey: #e8a840;
    --accent-herb: #7a9e6d;
    --accent-yolk: #f0c040;
    --espresso: #3a2e24;
    --muted: #a89480;

    --neo-convex: 8px 8px 16px #d9cfc2, -8px -8px 16px #fffcf5;
    --neo-concave: inset 8px 8px 16px #d9cfc2, inset -8px -8px 16px #fffcf5;
    --neo-convex-sm: 4px 4px 8px #d9cfc2, -4px -4px 8px #fffcf5;
    --neo-concave-sm: inset 4px 4px 8px #d9cfc2, inset -4px -4px 8px #fffcf5;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* --- Neomorphic Utilities --- */
.hex-convex {
    box-shadow: var(--neo-convex);
}

.hex-concave {
    box-shadow: var(--neo-concave);
}

/* --- Scene base --- */
.scene {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Section 1: Hero
   ============================================ */
#hero {
    min-height: 100vh;
    padding: 2rem;
}

.hero-hex {
    width: clamp(280px, 70vw, 600px);
    height: clamp(280px, 70vw, 600px);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-title {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    gap: 0;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
}

.hero-title .char.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-title .char.breathing {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.hero-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.8s ease 0.8s;
}

.hero-subtitle.visible {
    opacity: 1;
}

.scroll-hint {
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInHint 1s ease 2s forwards;
}

@keyframes fadeInHint {
    to { opacity: 0.5; }
}

.doodle-arrow {
    animation: bobDown 2s ease-in-out infinite;
}

@keyframes bobDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ============================================
   Section 2: Honeycomb
   ============================================ */
#honeycomb {
    min-height: 400vh;
    padding: 4rem 1rem;
}

.honeycomb-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
}

.hex-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: -30px;
}

.hex-row:first-child {
    margin-top: 0;
}

.hex-row.offset {
    transform: translateX(calc(clamp(60px, 10vw, 100px)));
}

.hex-cell {
    width: clamp(120px, 20vw, 200px);
    height: clamp(120px, 20vw, 200px);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.4s ease;
    cursor: default;
    position: relative;
    flex-shrink: 0;
    padding: 20px;
    text-align: center;
}

.hex-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.hex-cell.convex {
    box-shadow: var(--neo-convex);
}

.hex-cell.concave {
    box-shadow: var(--neo-concave);
}

.hex-cell:hover.convex {
    box-shadow: var(--neo-concave);
    transform: scale(1.03);
}

.hex-cell:hover.concave {
    box-shadow: var(--neo-convex);
    transform: scale(1.03);
}

.hex-cell .hex-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 1.5vw, 0.95rem);
    color: var(--text);
    line-height: 1.4;
}

.hex-cell .hex-text.caveat {
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--accent-terracotta);
}

.hex-cell.accent-terracotta { background: #c4725a22; }
.hex-cell.accent-honey { background: #e8a84022; }
.hex-cell.accent-herb { background: #7a9e6d22; }
.hex-cell.accent-yolk { background: #f0c04022; }

.hex-cell .food-svg {
    transition: transform 0.3s ease;
}

.hex-cell:hover .food-svg {
    transform: perspective(600px) rotateX(5deg) rotateY(-5deg);
}

/* ============================================
   Section 3: Transition Corridor
   ============================================ */
#corridor {
    min-height: 150vh;
    overflow: hidden;
    justify-content: center;
}

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 4rem 0;
}

.marquee-track {
    display: flex;
    align-items: center;
    gap: 3rem;
    white-space: nowrap;
    animation: marquee 60s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-word {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text);
    display: inline-block;
    flex-shrink: 0;
}

.marquee-word.nunito {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--muted);
}

.marquee-word.accent-t { color: var(--accent-terracotta); }
.marquee-word.accent-h { color: var(--accent-honey); }
.marquee-word.accent-g { color: var(--accent-herb); }
.marquee-word.accent-y { color: var(--accent-yolk); }

.corridor-doodle {
    margin-top: 2rem;
    opacity: 0.4;
}

/* ============================================
   Section 4: Deep Plate
   ============================================ */
#deep-plate {
    min-height: 200vh;
    padding: 10vh 2rem;
}

.plate-container {
    position: sticky;
    top: 10vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80vh;
}

.plate-ring {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.plate-ring-outer {
    width: clamp(300px, 70vw, 600px);
    height: clamp(300px, 70vw, 600px);
}

.plate-ring-middle {
    width: 70%;
    height: 70%;
}

.plate-ring-inner {
    width: 65%;
    height: 65%;
}

.plate-center-text {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--accent-terracotta);
}

.plate-orbit {
    position: absolute;
    width: clamp(300px, 70vw, 600px);
    height: clamp(300px, 70vw, 600px);
    transition: transform 0.1s linear;
}

.orbit-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.orbit-label {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: var(--muted);
}

.orbit-item-1 { top: -10%; left: 50%; transform: translateX(-50%); }
.orbit-item-2 { top: 15%; right: -5%; }
.orbit-item-3 { bottom: 15%; right: -5%; }
.orbit-item-4 { bottom: -10%; left: 50%; transform: translateX(-50%); }
.orbit-item-5 { bottom: 15%; left: -5%; }
.orbit-item-6 { top: 15%; left: -5%; }

/* ============================================
   Section 5: The Close
   ============================================ */
#close {
    min-height: 100vh;
    justify-content: center;
    gap: 2rem;
}

.close-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.close-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-terracotta);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.close-dot.visible { opacity: 1; }

.close-word {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.close-word.visible {
    opacity: 1;
    transform: translateY(0);
}

.close-question {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
}

.close-question.visible { opacity: 1; }

.close-button {
    width: 160px;
    height: 160px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.4s ease, transform 0.2s ease;
    opacity: 0;
    margin-top: 1rem;
}

.close-button.visible { opacity: 1; }

.close-button:active {
    box-shadow: var(--neo-concave);
    transform: scale(0.97);
}

.close-btn-text {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-terracotta);
}

.site-footer {
    position: absolute;
    bottom: 2rem;
}

.footer-text {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--muted);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-title .char.breathing { animation: none; }
    .marquee-track { animation: none; }
    .doodle-arrow { animation: none; }
    .scroll-hint { animation: none; opacity: 0.5; }
    .hero-title .char {
        opacity: 1;
        transform: none;
    }
    .hero-subtitle {
        opacity: 1;
        transition: none;
    }
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 768px) {
    .hero-hex {
        width: 90vw;
        height: 90vw;
    }

    .hex-row.offset {
        transform: translateX(calc(clamp(30px, 10vw, 60px)));
    }

    .orbit-item .food-svg {
        width: 50px;
        height: 50px;
    }

    .plate-ring-outer {
        width: 85vw;
        height: 85vw;
    }

    .plate-orbit {
        width: 85vw;
        height: 85vw;
    }
}
