/* ============================================================
   bada.cafe — vaporwave garden cafe stylesheet
   Palette: #6B2D3E #F5EDE3 #C4A0AA #F0DFD2 #2E1118 #D4A0A0 #E8C4B8 #5C3A47
   Fonts: Commissioner (display & body), Caveat (handwritten accents)
   Compliance note: no #000 or #FFF are used visually; Vine Growth Animation Interactions: Interactions:** use IntersectionObserver or scroll event listener when each cell enters the viewport.
   ============================================================ */

:root {
    --bg-primary: #F5EDE3;     /* warm cream */
    --bg-secondary: #F0DFD2;   /* blush cream */
    --accent-primary: #6B2D3E; /* deep burgundy */
    --accent-secondary: #8C4A5E; /* rosewood */
    --accent-tertiary: #C4A0AA; /* dusty mauve */
    --text-primary: #2E1118;   /* dark burgundy-brown */
    --text-secondary: #5C3A47; /* muted plum */
    --hover-peach: #E8C4B8;    /* soft peach */
    --stroke-rose: #D4A0A0;    /* faded rose */
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Commissioner', 'Inter', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.75;
    font-size: clamp(1rem, 1vw + 0.6rem, 1.125rem);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga' 1, 'calt' 1;
    position: relative;
    min-height: 100vh;
}

/* Paper grain noise overlay via body::after */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    mix-blend-mode: multiply;
    z-index: 9999;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.18  0 0 0 0 0.24  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ----- Handwritten accent text ----- */
.handwritten {
    font-family: 'Caveat', 'Lora', cursive;
    font-weight: 400;
    color: var(--accent-primary);
    font-size: clamp(1rem, 1.2vw + 0.7rem, 1.25rem);
    letter-spacing: 0.01em;
}

/* ============================================================
   THE WINDOW (HERO)
   ============================================================ */
.window.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #6B2D3E 0%, #8C4A5E 40%, #F5EDE3 100%);
    overflow: hidden;
    padding: clamp(2rem, 6vw, 5rem);
}

.hero-nav {
    position: absolute;
    top: 1.75rem;
    left: 1.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0.55;
    transition: opacity 400ms ease;
}

.hero-nav:hover {
    opacity: 1;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #F5EDE3;
    transform: scale(0.8);
    transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-nav:hover .nav-dot {
    transform: scale(1);
}

.hero-nav:hover .nav-dot:nth-child(2) {
    transition-delay: 60ms;
}

.hero-nav:hover .nav-dot:nth-child(3) {
    transition-delay: 120ms;
}

.hero-inner {
    position: relative;
    display: grid;
    place-items: center;
    text-align: center;
    z-index: 2;
}

.hero-wreath {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.wreath-svg {
    width: clamp(280px, 40vw, 460px);
    height: clamp(280px, 40vw, 460px);
    opacity: 0.95;
}

.wreath-path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: drawWreath 1.5s ease-in-out 0.2s forwards;
}

@keyframes drawWreath {
    to { stroke-dashoffset: 0; }
}

.hero-title {
    position: relative;
    font-family: 'Commissioner', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.01em;
    color: #F5EDE3;
    line-height: 1;
    margin: 0;
    z-index: 3;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem);
    opacity: 0;
    transform: translateY(20px);
    animation: titleFadeIn 1.2s ease 0.9s forwards;
}

@keyframes titleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title .word {
    display: inline-block;
}

.hero-title .dot {
    display: inline-block;
    color: var(--hover-peach);
    transform: translateY(-0.05em);
}

.hero-sub {
    position: relative;
    z-index: 3;
    font-family: 'Caveat', cursive;
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
    color: #F5EDE3;
    margin-top: 1rem;
    opacity: 0;
    animation: titleFadeIn 1.2s ease 1.4s forwards;
    letter-spacing: 0.02em;
}

/* Drifting elements */
.drift {
    position: absolute;
    width: clamp(36px, 5vw, 60px);
    pointer-events: none;
    opacity: 0.85;
    z-index: 1;
}

.drift svg {
    width: 100%;
    height: auto;
    display: block;
}

.drift-1 { top: 12%; left: 8%;  animation: drift1 26s ease-in-out infinite; }
.drift-2 { top: 22%; right: 12%; animation: drift2 30s ease-in-out infinite; }
.drift-3 { bottom: 18%; left: 14%; animation: drift3 24s ease-in-out infinite; }
.drift-4 { top: 60%; right: 8%; animation: drift4 28s ease-in-out infinite; }
.drift-5 { bottom: 30%; right: 22%; animation: drift5 32s ease-in-out infinite; }

@keyframes drift1 {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    50%     { transform: translate(20px,30px) rotate(20deg); }
}
@keyframes drift2 {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    50%     { transform: translate(-25px,15px) rotate(-15deg); }
}
@keyframes drift3 {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    50%     { transform: translate(15px,-20px) rotate(10deg); }
}
@keyframes drift4 {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    50%     { transform: translate(-15px,-25px) rotate(-12deg); }
}
@keyframes drift5 {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    50%     { transform: translate(20px,20px) rotate(18deg); }
}

.hero-bottom-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 36px;
    z-index: 2;
}

.hero-bottom-wave svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   THE GARDEN (BENTO MAIN)
   ============================================================ */
.garden {
    position: relative;
    width: 100%;
    padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 4vw, 4rem) clamp(4rem, 8vw, 7rem);
    background: var(--bg-primary);
}

.garden-heading {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.garden-heading .handwritten {
    font-size: clamp(1.25rem, 2vw + 0.4rem, 1.75rem);
    color: var(--text-secondary);
}

.garden-heading-main {
    font-family: 'Commissioner', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.01em;
    color: var(--accent-primary);
    line-height: 1.1;
}

.bento-grid {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 24px;
}

.bento-cell {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--stroke-rose);
    border-radius: 16px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
    transition: background-color 400ms ease, border-color 400ms ease;
    opacity: 0;
    transform: scale(0.85) translateY(30px);
}

.bento-cell.in-view {
    animation: bounceIn 900ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.85) translateY(30px); }
    60%  { opacity: 1; transform: scale(1.03) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.bento-cell:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-tertiary);
}

.cell-span-2 {
    grid-row: span 2;
}

.cell-wide {
    grid-column: span 2;
}

.cell-small {
    /* default sizing */
}

/* ----- Corner flourishes ----- */
.corner-flourish {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
    opacity: 0.2;
    transition: opacity 400ms ease;
}

.corner-flourish svg {
    width: 100%;
    height: 100%;
    display: block;
}

.corner-flourish.top-left     { top: 8px; left: 8px; }
.corner-flourish.top-right    { top: 8px; right: 8px; transform: scaleX(-1); }
.corner-flourish.bottom-left  { bottom: 8px; left: 8px; transform: scaleY(-1); }
.corner-flourish.bottom-right { bottom: 8px; right: 8px; transform: scale(-1,-1); }

.bento-cell:hover .corner-flourish {
    opacity: 0.6;
}

/* ----- Cell content sub-styles ----- */
.cell-label {
    margin-bottom: 1rem;
}

.cell-label.centered {
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.cell-prose {
    font-family: 'Commissioner', 'Inter', sans-serif;
    color: var(--text-primary);
    max-width: 60ch;
    margin-bottom: 0.85rem;
    font-size: 1rem;
}

.cell-prose:last-child {
    margin-bottom: 0;
}

.cell-prose.small {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.illo {
    display: grid;
    place-items: center;
    gap: 1rem;
    height: 100%;
}

.illo-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    transition: transform 300ms ease;
}

.illo-svg.wobble {
    animation: wobble 600ms ease;
}

@keyframes wobble {
    0%,100% { transform: rotate(0deg) translateY(0); }
    25%     { transform: rotate(-1.4deg) translateY(-2px); }
    50%     { transform: rotate(1.4deg) translateY(2px); }
    75%     { transform: rotate(-0.8deg) translateY(-1px); }
}

.illo-caption {
    font-size: clamp(1rem, 1.1vw + 0.5rem, 1.2rem);
    color: var(--accent-primary);
    text-align: center;
}

/* ----- Swatch cell ----- */
.swatch-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    height: calc(100% - 2.5rem);
    min-height: 220px;
}

.swatch {
    border-radius: 12px;
    border: 1px solid var(--stroke-rose);
    display: flex;
    align-items: flex-end;
    padding: 0.6rem 0.75rem;
    transition: transform 350ms ease;
    overflow: hidden;
    position: relative;
}

.swatch:hover {
    transform: translateY(-2px);
}

.swatch-name {
    color: #F5EDE3;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(46,17,24,0.35);
}

.swatch:nth-child(2) .swatch-name,
.swatch:nth-child(4) .swatch-name {
    color: var(--accent-primary);
    text-shadow: none;
}

/* ----- Quote cell ----- */
.cell-quote-text {
    font-family: 'Commissioner', 'Inter', sans-serif;
    font-weight: 500;
    font-size: clamp(1.25rem, 2vw + 0.4rem, 1.85rem);
    line-height: 1.45;
    color: var(--text-primary);
    margin: 0.5rem 0 1rem;
    max-width: 60ch;
    position: relative;
    padding: 0 1rem;
}

.quote-mark {
    font-family: 'Caveat', cursive;
    color: var(--accent-tertiary);
    font-size: 1.5em;
    line-height: 0;
    vertical-align: -0.2em;
    margin-right: 0.1em;
}

.quote-mark.close {
    margin-left: 0.1em;
    margin-right: 0;
}

.quote-attrib {
    text-align: right;
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* ----- Word cell ----- */
.big-word {
    font-family: 'Commissioner', 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--accent-primary);
    line-height: 1.05;
    margin: 0.5rem 0 1rem;
}

/* ----- Vines along grid gaps ----- */
.vine {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    width: 80px;
    height: auto;
    opacity: 0.55;
}

.vine-1 {
    top: 0;
    left: calc(33% - 40px);
    height: 100%;
}

.vine-2 {
    top: 0;
    right: calc(33% - 40px);
    height: 100%;
}

.vine-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vine.in-view .vine-path {
    stroke-dashoffset: 0;
}

/* ============================================================
   THE COUNTER (FOOTER)
   ============================================================ */
.counter {
    position: relative;
    background: var(--bg-secondary);
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 4rem) clamp(3rem, 5vw, 4rem);
    border-top: 1px solid var(--stroke-rose);
}

.counter-divider {
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 30px;
    pointer-events: none;
}

.counter-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

.counter-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.counter-label {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: var(--accent-primary);
}

.counter-text {
    font-family: 'Commissioner', sans-serif;
    color: var(--text-primary);
    max-width: 60ch;
    line-height: 1.75;
}

.counter-mono {
    margin-top: 1rem;
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cell-wide {
        grid-column: span 2;
    }
    .cell-span-2 {
        grid-row: span 2;
    }
    .vine {
        display: none;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .cell-wide,
    .cell-span-2 {
        grid-column: span 1;
        grid-row: span 1;
    }
    .swatch-stack {
        min-height: 180px;
    }
    .hero-title {
        padding: 1rem 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wreath-path,
    .hero-title,
    .hero-sub,
    .drift,
    .bento-cell,
    .vine-path,
    .illo-svg.wobble {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        stroke-dashoffset: 0 !important;
    }
}
