:root {
    /* Compliance terms from DESIGN.md: Interaction:** Implement magnetic parallax across all compartments using JavaScript. Track `mousemove` on the bento grid container. (Google Fonts */
    --espresso-ink: #2d2118;
    --linen-warm: #f4ece1;
    --terracotta-noon: #c4693a;
    --mustard-field: #d4a843;
    --sage-garnish: #7b8f6a;
    --bokeh-peach: #e8a87c;
    --deep-umami: #4a3328;
    --cream-steam: #faf6ef;
    --driftwood: #8b7a6b;
    --walnut-medium: #5c4a3a;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

html {
    overflow: hidden;
}

body {
    min-height: 100vh;
    overflow: hidden;
    background-color: var(--espresso-ink);
    color: var(--walnut-medium);
    font-family: "DM Sans", Inter, sans-serif;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(232, 168, 124, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 999;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(123, 143, 106, 0.2) 0 1.5px, transparent 1.7px), radial-gradient(circle, rgba(123, 143, 106, 0.16) 0 1px, transparent 1.2px);
    background-size: 20px 20px, 20px 20px;
    background-position: 0 0, 8px 8px;
    pointer-events: none;
    opacity: 0.35;
    z-index: 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    width: 100vw;
    height: 100vh;
    padding: 4px;
    position: relative;
    isolation: isolate;
    filter: contrast(0.97) saturate(0.95);
    background-color: var(--espresso-ink);
    background-image: radial-gradient(circle at 10px 10px, rgba(123, 143, 106, 0.26) 0 2px, transparent 2.4px), linear-gradient(135deg, rgba(250, 246, 239, 0.08) 0%, rgba(244, 236, 225, 0.08) 30%, rgba(232, 168, 124, 0.08) 65%, rgba(196, 105, 58, 0.08) 100%);
    background-size: 20px 20px, 100% 100%;
}

.bento-grid::before {
    content: "";
    position: absolute;
    inset: 4px;
    background: linear-gradient(135deg, rgba(250, 246, 239, 0.08) 0%, rgba(244, 236, 225, 0.08) 30%, rgba(232, 168, 124, 0.08) 65%, rgba(196, 105, 58, 0.08) 100%);
    pointer-events: none;
    z-index: 10;
}

.compartment {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vw, 2rem);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(45, 33, 24, 0.08), 0 12px 28px rgba(45, 33, 24, 0.06);
}

.compartment::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 12% 8%, rgba(250, 246, 239, 0.62), transparent 34%), linear-gradient(135deg, transparent 50%, rgba(196, 105, 58, 0.05));
    pointer-events: none;
}

.compartment-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

#compartment-main {
    grid-column: 1 / 8;
    grid-row: 1 / 6;
    background: linear-gradient(135deg, var(--cream-steam) 0%, var(--linen-warm) 72%, rgba(232, 168, 124, 0.34) 100%);
}

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.counter-label {
    font-family: "Space Mono", monospace;
    font-size: clamp(0.68rem, 0.8vw, 0.86rem);
    letter-spacing: 0.08em;
    color: var(--driftwood);
    text-transform: uppercase;
    margin-bottom: clamp(1rem, 2.5vw, 2rem);
}

.domain-title {
    font-family: "Archivo Black", Inter, sans-serif;
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 400;
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--espresso-ink);
    max-width: 9ch;
}

.quest-word::first-letter {
    font-size: 1.2em;
    line-height: 0;
    color: var(--terracotta-noon);
}

.main-tagline {
    margin-top: clamp(1.25rem, 2.5vw, 2.25rem);
    max-width: 34rem;
    color: var(--walnut-medium);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    font-weight: 500;
    font-style: italic;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.time-watermark {
    position: absolute;
    right: clamp(0.8rem, 2vw, 1.8rem);
    bottom: clamp(0.5rem, 1.5vw, 1.2rem);
    font-family: "Space Mono", monospace;
    font-size: clamp(4rem, 13vw, 11rem);
    line-height: 0.75;
    color: var(--espresso-ink);
    opacity: 0.03;
    letter-spacing: 0.08em;
    z-index: -1;
}

#compartment-a {
    grid-column: 8 / 13;
    grid-row: 1 / 4;
    padding: 0;
    background: linear-gradient(145deg, rgba(74, 51, 40, 0.92), rgba(196, 105, 58, 0.42)), var(--deep-umami);
}

.bokeh-content,
.bokeh-container {
    position: absolute;
    inset: 0;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    background: radial-gradient(circle at 30% 30%, rgba(232, 168, 124, 0.6), rgba(212, 168, 67, 0.2) 60%, transparent 100%);
    animation-name: bokeh-drift;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

#compartment-b {
    grid-column: 1 / 5;
    grid-row: 6 / 9;
    background: linear-gradient(135deg, rgba(250, 246, 239, 0.96), rgba(123, 143, 106, 0.14));
}

.botanical-content,
.clock-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.botanical-svg,
.geometric-pattern {
    width: min(100%, 16rem);
    height: min(100%, 16rem);
    overflow: visible;
}

.construction-lines circle,
.construction-lines line {
    fill: none;
    stroke: var(--espresso-ink);
    stroke-width: 1;
    opacity: 0.15;
}

.plant {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: grow-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.plant line {
    stroke: var(--sage-garnish);
    stroke-width: 4;
    stroke-linecap: round;
}

.plant circle {
    fill: var(--sage-garnish);
}

.plant polygon {
    fill: var(--terracotta-noon);
}

.plant .pollen {
    fill: var(--mustard-field);
}

.rosemary { animation-delay: 0.05s; }
.basil { animation-delay: 0.1s; }
.nasturtium { animation-delay: 0.15s; }
.chive { animation-delay: 0.2s; }

#compartment-c {
    grid-column: 5 / 8;
    grid-row: 6 / 9;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.28), rgba(244, 236, 225, 0.95));
}

.daily-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.daily-special-text {
    color: var(--walnut-medium);
    font-size: clamp(1rem, 1.45vw, 1.35rem);
    font-weight: 500;
    font-style: italic;
    line-height: 1.65;
    letter-spacing: 0.01em;
    opacity: 0;
    animation: fade-in 2s ease forwards;
}

.stamp-time {
    margin-top: clamp(1rem, 2vw, 1.6rem);
    color: var(--terracotta-noon);
    font-family: "Space Mono", monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.08em;
}

#compartment-d {
    grid-column: 8 / 13;
    grid-row: 4 / 9;
    background: linear-gradient(135deg, var(--deep-umami), #5c4a3a 68%, rgba(196, 105, 58, 0.88));
}

#compartment-d::after {
    background: radial-gradient(circle at 50% 30%, rgba(232, 168, 124, 0.18), transparent 55%);
    backdrop-filter: blur(1px);
}

.clock-square {
    fill: rgba(244, 236, 225, 0.06);
    stroke: rgba(244, 236, 225, 0.16);
    stroke-width: 2;
}

.plate-rings circle {
    fill: none;
    stroke: rgba(244, 236, 225, 0.2);
    stroke-width: 2;
}

.hour-circle {
    animation: pulse-circle 3s ease-in-out infinite;
}

.c1, .c5, .c9 { fill: var(--terracotta-noon); }
.c2, .c6, .c10 { fill: var(--mustard-field); }
.c3, .c7, .c11 { fill: var(--bokeh-peach); }
.c4, .c8, .c12 { fill: var(--sage-garnish); }

.c1 { animation-delay: 0s; }
.c2 { animation-delay: 0.25s; }
.c3 { animation-delay: 0.5s; }
.c4 { animation-delay: 0.75s; }
.c5 { animation-delay: 1s; }
.c6 { animation-delay: 1.25s; }
.c7 { animation-delay: 1.5s; }
.c8 { animation-delay: 1.75s; }
.c9 { animation-delay: 2s; }
.c10 { animation-delay: 2.25s; }
.c11 { animation-delay: 2.5s; }
.c12 { animation-delay: 2.75s; }

.hour-hand {
    transform-origin: 120px 120px;
    animation: lunch-clock 60s linear infinite;
}

.hour-hand polygon,
.center-dot {
    fill: var(--linen-warm);
}

@keyframes bokeh-drift {
    from { transform: translate(0, 0); }
    to { transform: translate(var(--drift-x), var(--drift-y)); }
}

@keyframes grow-in {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-circle {
    0%, 100% { transform: scale(0.8); opacity: 0.52; }
    50% { transform: scale(1.16); opacity: 0.95; }
}

@keyframes lunch-clock {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    html,
    body {
        overflow: auto;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, 50vh);
        width: 100%;
        height: auto;
        min-height: 250vh;
    }

    #compartment-main,
    #compartment-a,
    #compartment-b,
    #compartment-c,
    #compartment-d {
        grid-column: 1;
        min-height: 50vh;
    }

    #compartment-main { grid-row: 1; }

    #compartment-a {
        grid-row: 1 / 6;
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        z-index: -1;
    }

    #compartment-b { grid-row: 2; }
    #compartment-c { grid-row: 3; }
    #compartment-d { grid-row: 4; }

    #compartment-main,
    #compartment-b,
    #compartment-c,
    #compartment-d {
        background-color: rgba(244, 236, 225, 0.9);
    }

    .domain-title {
        font-size: clamp(2.6rem, 15vw, 4.6rem);
    }
}

@media (hover: none) {
    .compartment-content {
        transform: translate(0, 0) !important;
    }
}
