/* =====================================================
   lunchbox.dev v2 — Bento Lacquer
   compartmental-grid, cedar+cream palette, tilt physics
   ===================================================== */

:root {
    --cedar-wood: #8B6F47;
    --wood-grain-dark: #6B5237;
    --cream-interior: #F0E2C8;
    --rice-white: #F8F0DC;
    --cherry-lacquer: #A8332A;
    --cherry-deep: #7A201A;
    --black-lacquer: #1F1A14;
    --tea-green: #5C7A52;
    --mustard-pickle: #D4A02A;
    --shadow-soft: rgba(31, 26, 20, 0.18);
    --shadow-deep: rgba(31, 26, 20, 0.42);

    --font-serif: "Fraunces", Georgia, serif;
    --font-sans: "Nunito", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--black-lacquer);
    background: var(--cedar-wood);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* =====================================================
   LID HERO
   ===================================================== */

.lid {
    position: relative;
    height: 100vh;
    min-height: 620px;
    width: 100%;
    background: var(--cedar-wood);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 900ms cubic-bezier(0.7, 0, 0.2, 1),
                opacity 700ms ease;
    will-change: transform, opacity;
}

.lid.is-opening {
    transform: translate3d(0, -100%, 0);
    opacity: 0;
}

.wood-grain {
    position: absolute;
    inset: 0;
    background-color: var(--cedar-wood);
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(107, 82, 55, 0.32) 0px,
            rgba(107, 82, 55, 0.32) 1px,
            transparent 1px,
            transparent 7px,
            rgba(107, 82, 55, 0.18) 7px,
            rgba(107, 82, 55, 0.18) 8px,
            transparent 8px,
            transparent 19px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(50, 36, 22, 0.12) 0px,
            rgba(50, 36, 22, 0.12) 2px,
            transparent 2px,
            transparent 41px
        ),
        radial-gradient(ellipse at 30% 40%, rgba(212, 160, 42, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 70%, rgba(122, 32, 26, 0.05) 0%, transparent 55%);
    pointer-events: none;
}

.lid-vignette {
    position: absolute;
    inset: 0;
    box-shadow:
        inset 0 0 160px rgba(31, 26, 20, 0.55),
        inset 0 0 60px rgba(31, 26, 20, 0.4);
    pointer-events: none;
}

.lid-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--rice-white);
    padding: 0 24px;
    max-width: 880px;
}

.latch {
    margin: 0 auto 28px;
    display: inline-block;
    transform-origin: 50% 80%;
    transition: transform 700ms cubic-bezier(0.6, 0.05, 0.3, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.latch.is-unlatching {
    transform: rotate(-22deg) translateY(-4px);
}

.wordmark {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(48px, 9vw, 128px);
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: var(--cherry-lacquer);
    text-shadow:
        0 1px 0 var(--cherry-deep),
        0 2px 0 #5C160F,
        0 3px 6px rgba(0, 0, 0, 0.55),
        0 0 22px rgba(212, 160, 42, 0.12);
}

.wordmark-dot {
    color: var(--mustard-pickle);
    text-shadow:
        0 1px 0 #8B6310,
        0 2px 4px rgba(0, 0, 0, 0.45);
}

.lid-tagline {
    margin-top: 22px;
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(16px, 1.4vw, 21px);
    color: var(--cream-interior);
    letter-spacing: 0.01em;
    opacity: 0.92;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.brand-stamp {
    margin-top: 28px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mustard-pickle);
    display: inline-flex;
    gap: 14px;
    align-items: center;
    padding: 8px 18px;
    border: 1px solid rgba(212, 160, 42, 0.4);
    border-radius: 999px;
    background: rgba(31, 26, 20, 0.32);
}

.stamp-mark {
    color: var(--cherry-lacquer);
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(248, 240, 220, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: scroll-bob 2.2s ease-in-out infinite;
}

.cue-arrow {
    font-size: 16px;
    color: var(--mustard-pickle);
}

@keyframes scroll-bob {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
    50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* =====================================================
   BENTO STAGE
   ===================================================== */

.bento-stage {
    position: relative;
    background:
        radial-gradient(ellipse at top, rgba(212, 160, 42, 0.06) 0%, transparent 55%),
        var(--cedar-wood);
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(107, 82, 55, 0.25) 0px,
            rgba(107, 82, 55, 0.25) 1px,
            transparent 1px,
            transparent 9px,
            rgba(107, 82, 55, 0.14) 9px,
            rgba(107, 82, 55, 0.14) 10px,
            transparent 10px,
            transparent 23px
        ),
        radial-gradient(ellipse at center, rgba(212, 160, 42, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, var(--cedar-wood), #7B5F3A);
    padding: 84px 28px 96px;
    box-shadow: inset 0 12px 36px rgba(31, 26, 20, 0.45);
    z-index: 1;
}

.bento-frame {
    max-width: 1240px;
    margin: 0 auto;
    background: linear-gradient(160deg, #1F1A14 0%, #2A2218 50%, #1A140E 100%);
    border-radius: 24px;
    padding: 42px clamp(20px, 3vw, 56px) 56px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(212, 160, 42, 0.12),
        inset 0 0 1px rgba(212, 160, 42, 0.18);
    position: relative;
}

.bento-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 18px;
    border: 1px solid rgba(212, 160, 42, 0.18);
    pointer-events: none;
}

.bento-intro {
    text-align: center;
    margin-bottom: 38px;
    padding: 8px 0 18px;
    color: var(--cream-interior);
}

.meta-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--mustard-pickle);
    margin-bottom: 14px;
}

.bento-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(32px, 4.4vw, 56px);
    letter-spacing: -0.015em;
    color: var(--cream-interior);
    line-height: 1.05;
}

.bento-lede {
    margin: 16px auto 0;
    max-width: 560px;
    font-family: var(--font-sans);
    font-size: 16px;
    color: rgba(240, 226, 200, 0.78);
    line-height: 1.6;
}

/* =====================================================
   BENTO GRID + COMPARTMENTS
   ===================================================== */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(280px, auto);
    gap: 18px;
    perspective: 1400px;
}

.compartment {
    position: relative;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.55) 0%, transparent 30%),
        radial-gradient(circle at 85% 90%, rgba(122, 32, 26, 0.04) 0%, transparent 60%),
        var(--cream-interior);
    border-radius: 14px;
    padding: 26px 24px 24px;
    box-shadow:
        inset 0 2px 7px rgba(0, 0, 0, 0.10),
        inset 0 -1px 2px rgba(255, 255, 255, 0.6),
        0 10px 24px rgba(0, 0, 0, 0.32),
        0 2px 4px rgba(0, 0, 0, 0.18);
    transform-style: preserve-3d;
    transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1),
                box-shadow 220ms ease,
                opacity 600ms ease;
    will-change: transform;
    color: var(--black-lacquer);
    overflow: hidden;
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.96);
}

.compartment.is-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.compartment::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 10px;
    border: 1px solid rgba(31, 26, 20, 0.08);
    pointer-events: none;
}

.compartment::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background-image:
        repeating-linear-gradient(45deg, rgba(31, 26, 20, 0.012) 0, rgba(31, 26, 20, 0.012) 1px, transparent 1px, transparent 4px);
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.6;
}

.compartment:hover {
    box-shadow:
        inset 0 2px 7px rgba(0, 0, 0, 0.10),
        inset 0 -1px 2px rgba(255, 255, 255, 0.6),
        0 22px 40px rgba(0, 0, 0, 0.42),
        0 4px 8px rgba(0, 0, 0, 0.22);
}

/* Bento layout sizing */
.compartment-rice {
    grid-column: 1 / span 3;
    grid-row: 1;
    background:
        radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.7) 0%, transparent 30%),
        radial-gradient(circle at 80% 90%, rgba(212, 160, 42, 0.04) 0%, transparent 55%),
        var(--rice-white);
    min-height: 320px;
}

.compartment-main-a {
    grid-column: 4 / span 3;
    grid-row: 1;
    min-height: 320px;
}

.compartment-pickle-a {
    grid-column: 1 / span 2;
    grid-row: 2;
}

.compartment-side-a {
    grid-column: 3 / span 2;
    grid-row: 2;
}

.compartment-side-b {
    grid-column: 5 / span 2;
    grid-row: 2;
}

.compartment-side-c {
    grid-column: 1 / span 6;
    grid-row: 3;
    min-height: 220px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: center;
}

.compartment-side-c .compartment-cta {
    text-align: right;
}

@media (max-width: 980px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
    }
    .compartment-rice,
    .compartment-main-a,
    .compartment-pickle-a,
    .compartment-side-a,
    .compartment-side-b,
    .compartment-side-c {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 200px;
    }
    .compartment-side-c {
        display: block;
    }
    .compartment-side-c .compartment-cta {
        text-align: left;
        margin-top: 18px;
    }
}

@media (max-width: 600px) {
    .bento-frame {
        padding: 28px 16px 36px;
    }
    .bento-stage {
        padding: 56px 14px 64px;
    }
}

/* Compartment internals */
.compartment-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.compartment-num {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--cherry-lacquer);
}

.compartment-kind {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(31, 26, 20, 0.55);
}

.compartment-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.18;
    color: var(--black-lacquer);
    margin-bottom: 12px;
    letter-spacing: -0.005em;
}

.compartment-title em {
    font-style: italic;
    color: var(--cherry-lacquer);
    font-weight: 700;
}

.compartment-rice .compartment-title {
    font-size: clamp(24px, 2.4vw, 30px);
}

.compartment-body {
    font-size: 14.5px;
    color: rgba(31, 26, 20, 0.82);
    line-height: 1.65;
    max-width: 56ch;
}

.compartment-rice .compartment-body {
    font-size: 15px;
    max-width: none;
}

/* Code block in rice compartment */
.compartment-code {
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    background: var(--black-lacquer);
    color: var(--cream-interior);
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5),
                0 2px 4px rgba(0, 0, 0, 0.18);
    border-left: 3px solid var(--mustard-pickle);
    overflow-x: auto;
    white-space: pre;
}

.compartment-code .kw {
    color: var(--mustard-pickle);
}

.compartment-code .cmd {
    color: var(--tea-green);
    font-weight: 500;
}

.compartment-code .cm {
    color: rgba(240, 226, 200, 0.55);
    font-style: italic;
}

/* List */
.compartment-list {
    list-style: none;
    margin-top: 14px;
    padding: 0;
}

.compartment-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    color: rgba(31, 26, 20, 0.82);
    border-bottom: 1px dashed rgba(31, 26, 20, 0.12);
}

.compartment-list li:last-child {
    border-bottom: 0;
}

.bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #C04738, var(--cherry-lacquer) 60%, var(--cherry-deep));
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35),
                0 1px 1px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.compartment-stat {
    margin-top: 16px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: var(--black-lacquer);
}

.stat-num {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 38px;
    color: var(--cherry-lacquer);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(31, 26, 20, 0.6);
}

.compartment-quote {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(92, 122, 82, 0.08);
    border-left: 3px solid var(--tea-green);
    border-radius: 0 8px 8px 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 14px;
    color: var(--black-lacquer);
    line-height: 1.55;
}

.compartment-cta {
    margin-top: 14px;
}

.cta-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--cherry-lacquer);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(168, 51, 42, 0.08);
    border: 1px solid rgba(168, 51, 42, 0.28);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}

.cta-link:hover {
    background: rgba(168, 51, 42, 0.18);
    transform: translateX(4px);
}

/* =====================================================
   UMEBOSHI corner dots
   ===================================================== */

.ume {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #D4584C 0%, var(--cherry-lacquer) 55%, var(--cherry-deep) 100%);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.45),
        0 1px 1px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 2;
}

.ume-tl { top: 10px; left: 10px; }
.ume-tr { top: 10px; right: 10px; }
.ume-bl { bottom: 10px; left: 10px; }
.ume-br { bottom: 10px; right: 10px; }

/* =====================================================
   CHOPSTICK REST DIVIDER
   ===================================================== */

.chopstick-rest {
    margin: 44px auto 32px;
    max-width: 92%;
    height: 24px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.chopstick-rest svg {
    display: block;
}

/* =====================================================
   PAIRINGS / CHEF'S NOTES
   ===================================================== */

.pairings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .pairings {
        grid-template-columns: 1fr;
    }
}

.pairing-col {
    background: var(--cream-interior);
    border-radius: 14px;
    padding: 26px 28px;
    box-shadow:
        inset 0 2px 7px rgba(0, 0, 0, 0.10),
        inset 0 -1px 2px rgba(255, 255, 255, 0.55),
        0 8px 18px rgba(0, 0, 0, 0.28);
    color: var(--black-lacquer);
    position: relative;
}

.chefs-notes {
    background:
        radial-gradient(circle at 90% 10%, rgba(212, 160, 42, 0.08) 0%, transparent 40%),
        var(--rice-white);
}

.pairing-head {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 22px;
    margin: 6px 0 14px;
    color: var(--black-lacquer);
    letter-spacing: -0.005em;
}

.pairing-list,
.rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pairing-list li {
    display: grid;
    grid-template-columns: 80px 16px 1fr;
    align-items: baseline;
    gap: 6px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(31, 26, 20, 0.14);
    font-size: 14px;
}

.pairing-list li:last-child {
    border-bottom: 0;
}

.pair-key {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cherry-lacquer);
}

.pair-sep {
    color: rgba(31, 26, 20, 0.4);
    text-align: center;
}

.pair-val {
    color: var(--black-lacquer);
}

.rules-list {
    counter-reset: rule;
}

.rules-list li {
    counter-increment: rule;
    position: relative;
    padding: 10px 0 10px 38px;
    font-size: 14.5px;
    color: rgba(31, 26, 20, 0.85);
    border-bottom: 1px dashed rgba(31, 26, 20, 0.14);
    line-height: 1.6;
}

.rules-list li:last-child {
    border-bottom: 0;
}

.rules-list li::before {
    content: counter(rule);
    position: absolute;
    left: 0;
    top: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cherry-lacquer);
    color: var(--rice-white);
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

.rules-list li em {
    color: var(--tea-green);
    font-style: italic;
    font-weight: 600;
}

/* =====================================================
   FOOTER
   ===================================================== */

#bento-footer {
    position: relative;
    background: var(--cedar-wood);
    color: var(--cream-interior);
    padding: 56px 24px 38px;
    overflow: hidden;
    text-align: center;
}

.footer-grain {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(50, 36, 22, 0.18) 0px,
            rgba(50, 36, 22, 0.18) 1px,
            transparent 1px,
            transparent 9px,
            rgba(50, 36, 22, 0.10) 9px,
            rgba(50, 36, 22, 0.10) 10px,
            transparent 10px,
            transparent 23px
        );
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.footer-inner {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 0 auto;
}

.footer-mark {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 40px);
    color: var(--cherry-lacquer);
    text-shadow:
        0 1px 0 var(--cherry-deep),
        0 2px 0 #5C160F,
        0 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.015em;
}

.footer-tagline {
    margin-top: 8px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 16px;
    color: var(--cream-interior);
    opacity: 0.86;
}

.footer-links {
    margin-top: 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mustard-pickle);
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links span {
    cursor: pointer;
    transition: color 200ms ease;
}

.footer-links span:hover {
    color: var(--rice-white);
}

.footer-links .dot {
    color: rgba(212, 160, 42, 0.5);
    cursor: default;
}

.footer-copy {
    margin-top: 28px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: rgba(240, 226, 200, 0.55);
}

/* =====================================================
   REVEAL ON LOAD
   ===================================================== */

.compartment[data-index="1"] { transition-delay: 0ms; }
.compartment[data-index="2"] { transition-delay: 80ms; }
.compartment[data-index="3"] { transition-delay: 160ms; }
.compartment[data-index="4"] { transition-delay: 240ms; }
.compartment[data-index="5"] { transition-delay: 320ms; }
.compartment[data-index="6"] { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .compartment {
        opacity: 1;
        transform: none;
    }
}
