/* =========================================================
   chika.webcam (v2) — Dopamine Pastel Geometric Greenhouse-Cam
   Palette:
     #F8EDEB Vanilla Cream
     #F2D2D8 Sherbet Pink
     #FF8AA0 Sherbet Coral
     #D8E8E0 Mint Pearl
     #A8C9B5 Mint Sage
     #E8D2A8 Honey Pastel
     #3F3038 Cocoa Type
     #1A1218 Deepest Ink
   Font: Commissioner (Google Fonts)
   ========================================================= */

:root {
    --vanilla-cream: #F8EDEB;
    --sherbet-pink: #F2D2D8;
    --sherbet-coral: #FF8AA0;
    --mint-pearl: #D8E8E0;
    --mint-sage: #A8C9B5;
    --honey-pastel: #E8D2A8;
    --cocoa-type: #3F3038;
    --deepest-ink: #1A1218;

    --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-pulse: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--vanilla-cream);
    color: var(--cocoa-type);
    font-family: 'Commissioner', system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "tnum";
}

/* =========================================================
   Global noise-texture overlay (4-6% on page surfaces)
   ========================================================= */

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    opacity: 0.05;
    mix-blend-mode: multiply;
    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.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.19 0 0 0 0 0.22 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 240px 240px;
}

/* =========================================================
   Label strip (top of page)
   ========================================================= */

.label-strip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8em;
    padding: 16px 24px;
    background-color: rgba(248, 237, 235, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(63, 48, 56, 0.08);
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(11px, 1.05vw, 14px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cocoa-type);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 240ms var(--ease-soft), transform 240ms var(--ease-soft);
}

.label-strip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.label-segment {
    white-space: nowrap;
}

.label-divider {
    color: rgba(63, 48, 56, 0.35);
    font-weight: 400;
}

.label-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: var(--sherbet-coral);
    font-weight: 700;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--sherbet-coral);
    box-shadow: 0 0 0 0 rgba(255, 138, 160, 0.7);
    animation: live-dot-pulse 1.6s ease-out infinite;
}

@keyframes live-dot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 138, 160, 0.65);
        transform: scale(1);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 138, 160, 0);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 138, 160, 0);
        transform: scale(1);
    }
}

/* =========================================================
   Feed section (Section 0)
   ========================================================= */

.feed-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 32px 48px;
    position: relative;
}

.feed-window {
    position: relative;
    width: 100%;
    max-width: 1100px;
    aspect-ratio: 16 / 10;
    border-radius: 28px;
    overflow: visible;
    background-color: var(--mint-pearl);
    transform: scale(0.96);
    opacity: 0;
    transition: opacity 800ms var(--ease-soft), transform 800ms var(--ease-soft);
}

.feed-window.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Feed pulse-glow frame (2px gradient border, 4s loop) */
.feed-frame {
    position: absolute;
    inset: -2px;
    border-radius: 30px;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(
        135deg,
        rgba(255, 138, 160, 0.65) 0%,
        rgba(242, 210, 216, 0.85) 25%,
        rgba(255, 138, 160, 0.85) 50%,
        rgba(232, 210, 168, 0.65) 75%,
        rgba(255, 138, 160, 0.65) 100%
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    padding: 2px;
    animation: frame-pulse 4s var(--ease-pulse) infinite;
}

@keyframes frame-pulse {
    0% {
        opacity: 0.55;
        filter: drop-shadow(0 0 8px rgba(255, 138, 160, 0.25));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 22px rgba(255, 138, 160, 0.55));
    }
    100% {
        opacity: 0.55;
        filter: drop-shadow(0 0 8px rgba(255, 138, 160, 0.25));
    }
}

.feed-frame.frame-flash {
    animation: frame-flash 0.6s var(--ease-pulse);
}

@keyframes frame-flash {
    0% {
        opacity: 1;
        filter: drop-shadow(0 0 22px rgba(255, 138, 160, 0.55));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 40px rgba(255, 138, 160, 0.85));
    }
    100% {
        opacity: 0.55;
        filter: drop-shadow(0 0 8px rgba(255, 138, 160, 0.25));
    }
}

/* Feed content wrapper (the SVG diorama) */
.feed-content {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    overflow: hidden;
    background-color: var(--mint-pearl);
}

.feed-content::after {
    /* Stronger noise on feed itself (8% opacity) */
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.19 0 0 0 0 0.22 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 200px 200px;
    border-radius: 28px;
    z-index: 4;
}

.greenhouse-scene {
    display: block;
    width: 100%;
    height: 100%;
}

/* Scene layer reveal */
.scene-sky,
.scene-roof,
.scene-floor,
.plant {
    opacity: 0;
    transition: opacity 1s var(--ease-soft);
}

.feed-window.is-visible .scene-sky {
    opacity: 1;
    transition-delay: 200ms;
}
.feed-window.is-visible .scene-roof {
    opacity: 1;
    transition-delay: 500ms;
}
.feed-window.is-visible .scene-floor {
    opacity: 1;
    transition-delay: 700ms;
}
.feed-window.is-visible .plant-bg {
    opacity: 1;
    transition-delay: 900ms;
}
.feed-window.is-visible .plant-fg {
    opacity: 1;
    transition-delay: 1100ms;
}
.feed-window.is-visible .plant-hanging {
    opacity: 1;
    transition-delay: 1300ms;
}

/* Sway loops (ambient leaf motion) */
.sway-slow {
    transform-origin: 50% 100%;
    transform-box: fill-box;
    animation: sway 7s ease-in-out infinite;
}
.sway-med {
    transform-origin: 50% 100%;
    transform-box: fill-box;
    animation: sway 5s ease-in-out infinite;
    animation-delay: -1.5s;
}
.sway-fast {
    transform-origin: 50% 100%;
    transform-box: fill-box;
    animation: sway 4s ease-in-out infinite;
    animation-delay: -0.8s;
}

@keyframes sway {
    0%   { transform: rotate(-1.5deg); }
    50%  { transform: rotate(1.5deg); }
    100% { transform: rotate(-1.5deg); }
}

/* Condensation drift on roof */
.cond-drop {
    animation: cond-drift 60s linear infinite;
    transform-box: fill-box;
}
.cond-drop:nth-child(1) { animation-delay: -5s; }
.cond-drop:nth-child(2) { animation-delay: -18s; }
.cond-drop:nth-child(3) { animation-delay: -32s; }
.cond-drop:nth-child(4) { animation-delay: -46s; }
.cond-drop:nth-child(5) { animation-delay: -12s; }

@keyframes cond-drift {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    8% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translate(2px, 80px);
        opacity: 0;
    }
}

/* Watering droplet */
.droplet {
    animation: droplet-fall 24s linear infinite;
    transform-box: fill-box;
}

@keyframes droplet-fall {
    0%, 88% {
        opacity: 0;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    99% {
        opacity: 0.8;
        transform: translateY(360px);
    }
    100% {
        opacity: 0;
        transform: translateY(360px);
    }
}

/* Tape-noise flicker */
.tape-noise {
    pointer-events: none;
    mix-blend-mode: overlay;
}

.tape-noise.flicker {
    animation: tape-flicker 220ms linear;
}

@keyframes tape-flicker {
    0% { opacity: 0; }
    20% { opacity: 0.35; }
    40% { opacity: 0.1; }
    60% { opacity: 0.4; }
    100% { opacity: 0; }
}

/* Pulse-attention halo (svg <circle>) */
.pulse-halo {
    fill: none;
    stroke: var(--sherbet-coral);
    stroke-width: 2;
    transform-box: fill-box;
    transform-origin: center;
    animation: halo-expand 1.4s var(--ease-soft) forwards;
}

@keyframes halo-expand {
    0% {
        opacity: 0.35;
        transform: scale(0.6);
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

/* =========================================================
   Corner ornaments
   ========================================================= */

.corner-ornament {
    position: absolute;
    width: clamp(28px, 3.2vw, 44px);
    height: clamp(28px, 3.2vw, 44px);
    z-index: 6;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 320ms var(--ease-soft), transform 320ms var(--ease-soft);
    cursor: pointer;
    filter: drop-shadow(0 0 0 rgba(255, 138, 160, 0));
}

.corner-ornament.is-visible {
    opacity: 1;
    transform: scale(1);
}

.corner-ornament svg {
    width: 100%;
    height: 100%;
    animation: ornament-pulse var(--orn-duration, 5s) ease-in-out infinite;
    animation-delay: var(--orn-delay, 0s);
}

@keyframes ornament-pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 138, 160, 0));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 10px rgba(255, 138, 160, 0.35));
    }
}

.corner-tl { top: -22px; left: -22px; --orn-duration: 5.2s; --orn-delay: 0s; }
.corner-tr { top: -22px; right: -22px; --orn-duration: 4.4s; --orn-delay: -1.1s; }
.corner-br { bottom: -22px; right: -22px; --orn-duration: 6.6s; --orn-delay: -2.4s; }
.corner-bl { bottom: -22px; left: -22px; --orn-duration: 5.8s; --orn-delay: -3.6s; }

.corner-ornament:hover svg {
    transform: scale(1.18);
}

/* =========================================================
   Timestamp overlay (inside feed)
   ========================================================= */

.timestamp-overlay {
    position: absolute;
    bottom: 18px;
    left: 22px;
    z-index: 6;
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(63, 48, 56, 0.72);
    background-color: rgba(248, 237, 235, 0.55);
    padding: 4px 10px 4px 24px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(2px);
}

.ts-rec {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--sherbet-coral);
    animation: live-dot-pulse 1.6s ease-out infinite;
}

/* =========================================================
   Status meta (below feed)
   ========================================================= */

.status-meta {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    flex-wrap: wrap;
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(11px, 0.9vw, 12px);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(63, 48, 56, 0.78);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 600ms var(--ease-soft) 2100ms, transform 600ms var(--ease-soft) 2100ms;
    font-variant-numeric: tabular-nums;
}

.feed-section.is-ready .status-meta {
    opacity: 1;
    transform: translateY(0);
}

.meta-segment {
    white-space: nowrap;
}

.meta-divider {
    color: rgba(63, 48, 56, 0.32);
}

.meta-value {
    color: var(--cocoa-type);
    font-weight: 600;
    display: inline-block;
    transition: color 200ms var(--ease-soft), text-shadow 200ms var(--ease-soft);
}

.meta-value.pulse {
    animation: meta-pulse 220ms ease-out;
}

@keyframes meta-pulse {
    0% {
        color: var(--cocoa-type);
        text-shadow: 0 0 0 rgba(255, 138, 160, 0);
    }
    50% {
        color: var(--sherbet-coral);
        text-shadow: 0 0 8px rgba(255, 138, 160, 0.6);
    }
    100% {
        color: var(--cocoa-type);
        text-shadow: 0 0 0 rgba(255, 138, 160, 0);
    }
}

/* Status meta (mini, in closing section) */
.status-meta-mini {
    margin-top: 20px;
    opacity: 1;
    transform: none;
    transition: none;
}

/* =========================================================
   Scroll hint
   ========================================================= */

.scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(63, 48, 56, 0.55);
    opacity: 0;
    transition: opacity 500ms var(--ease-soft) 2400ms;
    pointer-events: none;
}

.feed-section.is-ready .scroll-hint {
    opacity: 1;
}

.scroll-hint-arrow {
    font-size: 14px;
    animation: arrow-bob 2.2s ease-in-out infinite;
}

@keyframes arrow-bob {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(4px); opacity: 1; }
}

/* =========================================================
   Section divider
   ========================================================= */

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 0;
}

.section-divider svg {
    opacity: 0.6;
}

/* =========================================================
   Reveal-on-scroll
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms var(--ease-soft), transform 700ms var(--ease-soft);
}

.reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   Section headers
   ========================================================= */

.section-head {
    text-align: center;
    padding: 0 32px;
    max-width: 720px;
    margin: 0 auto 32px;
}

.section-eyebrow {
    display: inline-block;
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(63, 48, 56, 0.55);
    margin-bottom: 12px;
}

.section-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(22px, 2.6vw, 36px);
    line-height: 1.2;
    color: var(--cocoa-type);
    letter-spacing: -0.01em;
    margin-bottom: 14px;
}

.section-lede {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.65;
    color: rgba(63, 48, 56, 0.78);
}

/* =========================================================
   Plants section (Section 1)
   ========================================================= */

.plants-section {
    padding: 32px 32px 48px;
    max-width: 980px;
    margin: 0 auto;
}

.plant-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    padding: 0;
    margin: 0;
}

.plant-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 18px;
    background-color: rgba(216, 232, 224, 0.28);
    border: 1px solid rgba(63, 48, 56, 0.08);
    cursor: pointer;
    transition: background-color 220ms var(--ease-soft), border-color 220ms var(--ease-soft), transform 220ms var(--ease-soft);
    position: relative;
}

.plant-card:hover {
    background-color: rgba(242, 210, 216, 0.35);
    border-color: rgba(255, 138, 160, 0.45);
    transform: translateY(-2px);
}

.plant-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms var(--ease-soft);
}

.plant-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    transition: fill 220ms var(--ease-soft);
}

.plant-card:hover .plant-icon {
    animation: icon-scale-pulse 320ms var(--ease-soft);
}

.plant-card:hover .plant-icon svg > * {
    fill: var(--sherbet-coral);
}

@keyframes icon-scale-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.plant-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.plant-name {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(13px, 1vw, 15px);
    letter-spacing: 0.02em;
    color: var(--cocoa-type);
    text-transform: none;
}

.plant-note {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(12px, 0.85vw, 13.5px);
    line-height: 1.55;
    color: rgba(63, 48, 56, 0.7);
    transition: color 220ms var(--ease-soft);
}

.plant-card:hover .plant-note {
    color: var(--deepest-ink);
}

/* =========================================================
   About section (Section 2)
   ========================================================= */

.about-section {
    padding: 32px 32px 48px;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.about-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: 1.75;
    color: var(--cocoa-type);
}

.about-body em {
    font-style: italic;
    color: rgba(63, 48, 56, 0.85);
}

/* =========================================================
   Caretaker section (Section 3)
   ========================================================= */

.caretaker-section {
    padding: 32px 32px 48px;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.caretaker-line {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(13px, 1vw, 16px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(63, 48, 56, 0.85);
    margin-top: 8px;
}

/* =========================================================
   Closing section (Section 4)
   ========================================================= */

.closing-section {
    padding: 64px 32px 96px;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.closing-line {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(16px, 1.4vw, 22px);
    color: var(--cocoa-type);
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 640px) {
    .label-strip {
        font-size: 10px;
        gap: 0.5em;
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .feed-section {
        padding: 80px 16px 32px;
        min-height: auto;
    }

    .feed-window {
        border-radius: 20px;
    }

    .feed-content,
    .feed-content::after {
        border-radius: 20px;
    }

    .feed-frame {
        border-radius: 22px;
    }

    .corner-ornament {
        width: 24px;
        height: 24px;
    }

    .corner-tl { top: -14px; left: -14px; }
    .corner-tr { top: -14px; right: -14px; }
    .corner-br { bottom: -14px; right: -14px; }
    .corner-bl { bottom: -14px; left: -14px; }

    .status-meta {
        font-size: 10px;
        gap: 0.4em;
    }

    .plants-section {
        padding: 16px 16px 32px;
    }

    .plant-list {
        grid-template-columns: 1fr;
    }

    .scroll-hint {
        display: none;
    }
}
