/* =========================================
   Studio Haim — CSS V32.0 "THE POLISH EDITION"
   ✅ שדרוג מלא של הקיים
   ✅ Micro-interactions
   ✅ ביצועים משופרים
   ✅ אנימציות מתקדמות
   ✅ נגישות מלאה
   ========================================= */

/* --- 1. Base & Reset (משודרג) --- */
*, *::before, *::after { 
    box-sizing: border-box; 
}

html { 
    scroll-behavior: smooth; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: "Heebo", sans-serif;
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    
    /* 🆕 Smooth transitions for theme */
    transition: 
        background-color 0.3s ease,
        color 0.3s ease;
}

img { 
    max-width: 100%; 
    display: block; 
    height: auto; 
}

a { 
    text-decoration: none; 
    color: inherit; 
    transition: color 0.3s ease, transform 0.2s ease; 
}

button, input, textarea, select { 
    font-family: inherit; 
}

/* 🆕 מניעת tap highlight במובייל */
* { 
    -webkit-tap-highlight-color: transparent; 
}

/* 🆕 Smooth scrolling for anchor links */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* --- 2. Colors & Variables (משודרג) --- */
:root {
    --c-primary: #00A896;
    --c-secondary: #A2D5AB;
    --c-bg: #FDFCF8;
    --c-text: #2D3748;
    --c-card-bg: rgba(255, 255, 255, 0.75);
    --border: rgba(0, 168, 150, 0.15);
    --shadow: 0 18px 60px rgba(0, 168, 150, 0.08);
    --max: 1140px;
    --r-card: 24px;
    --glass: rgba(255, 255, 255, 0.6);
    
    /* Treehouse */
    --wood: #8D6E63;
    --wood-dark: #5D4037;
    --sky-soft: #E3F2FD;
    --grass: #8BC34A;
    
    /* 🆕 Animation Timing */
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme="dark"] {
    --c-primary: #00A896;
    --c-secondary: #007a6e;
    --c-bg: #11151c;
    --c-text: #e2e8f0;
    --c-card-bg: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
    --glass: rgba(0, 0, 0, 0.3);
}

/* 🆕 Dark mode images adjustment */
@media (prefers-color-scheme: dark) {
    img:not([data-no-filter]) {
        opacity: 0.9;
        transition: opacity 0.3s ease;
    }
    
    img:not([data-no-filter]):hover {
        opacity: 1;
    }
}

/* --- 3. Utilities (משודרג) --- */
.container { 
    max-width: var(--max); 
    margin: 0 auto; 
    padding: 0 20px;
    width: 100%;
}

.section { 
    padding: 80px 0; 
    position: relative; 
    isolation: isolate;
    max-width: 100vw;
    overflow-x: hidden;
}

.section.soft { 
    background: rgba(0, 168, 150, 0.03); 
}

[data-theme="dark"] .section.soft { 
    background: rgba(0, 168, 150, 0.05); 
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.tiny { font-size: 0.85rem; opacity: 0.8; }
.muted { color: var(--c-text); opacity: 0.7; }
.hidden { display: none !important; }
.no-scroll { overflow: hidden !important; }

.badge {
    display: inline-block; 
    background: rgba(0, 168, 150, 0.1); 
    color: var(--c-primary); 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: 700; 
    margin-bottom: 20px;
    
    /* 🆕 Subtle animation */
    animation: fadeInUp 0.6s ease both;
}

/* 🆕 Visually Hidden (נגישות) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

/* --- 4. Typography (משודרג) --- */
h1, h2, h3, h4 { 
    font-weight: 800; 
    line-height: 1.1; 
    margin-bottom: 0.5em; 
    color: var(--c-text); 
}

h1 { 
    font-size: clamp(2.5rem, 5vw, 4rem); 
    letter-spacing: -1.5px; 
}

h2, .h2 { 
    font-size: clamp(1.8rem, 3vw, 2.5rem); 
    color: var(--c-primary); 
    font-weight: 800;
}

.h3 { 
    font-size: clamp(1.3rem, 2.5vw, 1.8rem); 
    font-weight: 700; 
}

.lead { 
    font-size: 1.2rem; 
    font-weight: 300; 
    max-width: 700px; 
    margin: 0 auto 30px; 
}

.lead-bold { 
    font-weight: 500; 
    font-size: 1.1rem; 
}

.highlight {
    background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* 🆕 GPU acceleration */
    will-change: background-position;
}

.link-inline { 
    color: var(--c-primary); 
    text-decoration: underline; 
    text-underline-offset: 4px;
    transition: text-underline-offset 0.2s ease;
}

.link-inline:hover {
    text-underline-offset: 6px;
}

/* --- 5. Header V2 (משודרג) --- */
.hdr2 { 
    position: sticky; 
    top: 15px; 
    z-index: 1000; 
    padding: 0 15px;
    width: 100%;
    
    /* 🆕 Smooth transitions */
    transition: top 0.3s ease;
}

.hdr2-pill {
    max-width: var(--max); 
    margin: 0 auto;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px 24px;
    background: var(--c-card-bg);
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 50px;
    box-shadow: var(--shadow);
    
    /* 🆕 Smooth transitions */
    transition: 
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.hdr2-pill:hover {
    box-shadow: 0 20px 70px rgba(0, 168, 150, 0.12);
}

.hdr2-brand { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 800; 
    font-size: 1.1rem;
}

.hdr2-mark { 
    height: 60px;
    width: auto; 
    animation: breathe 6s infinite;
    object-fit: contain;
    
    /* 🆕 GPU acceleration */
    will-change: transform, opacity;
}

.hdr2-name { 
    display: none; 
}

.hdr2-nav { 
    display: flex; 
    gap: 20px; 
}

.hdr2-nav a { 
    font-weight: 600; 
    opacity: 0.8; 
    font-size: 0.95rem; 
    position: relative;
    padding-bottom: 5px;
}

/* 🆕 Underline animation משודרג */
.hdr2-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
    transition: width 0.3s var(--ease-smooth);
}

.hdr2-nav a:hover { 
    opacity: 1; 
    color: var(--c-primary); 
}

.hdr2-nav a:hover::after { 
    width: 100%; 
}

.hdr2-actions { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.hdr2-theme-toggle {
    background: transparent; 
    border: 1px solid var(--border);
    color: var(--c-text); 
    padding: 6px; 
    border-radius: 50%;
    cursor: pointer; 
    width: 36px; 
    height: 36px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1rem; 
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* 🆕 Ripple effect */
.hdr2-theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 168, 150, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.hdr2-theme-toggle:active::before {
    width: 100px;
    height: 100px;
}

.hdr2-theme-toggle:hover { 
    border-color: var(--c-primary); 
    background: rgba(0, 168, 150, 0.1);
    transform: scale(1.05) rotate(15deg);
}

.hdr2-burger { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    color: var(--c-text); 
    cursor: pointer; 
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    transition: transform 0.3s ease;
}

.hdr2-burger:hover {
    transform: scale(1.1);
}

/* --- 6. Hero Section (משודרג) --- */
.hero {
    padding-top: 140px;
    padding-bottom: 120px;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    max-width: 100vw;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 20;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
}

.hero__bg-wave {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: 150%;
    height: 120%;
    max-height: none;
    background-image: url("../assets/img/hero-wave.webp");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    opacity: 0.85;
    z-index: 1;
    pointer-events: none;
    
    /* 🆕 GPU acceleration */
    will-change: transform, opacity;
    transition: transform 0.5s var(--ease-smooth);
}

/* 🆕 Parallax effect (needs JS) */
.hero__bg-wave.parallax {
    transition: transform 0.5s var(--ease-smooth);
}

/* Blobs (משודרג) */
.section.has-blobs::before, 
.section.has-blobs::after {
    content: ""; 
    position: absolute; 
    width: 600px; 
    height: 500px;
    background-size: contain; 
    background-repeat: no-repeat;
    z-index: 0; 
    pointer-events: none;
    
    /* 🆕 GPU acceleration */
    will-change: transform;
    transition: transform 0.8s var(--ease-smooth);
}

.section.has-blobs::before {
    top: -100px; 
    right: -150px; 
    background-image: url("../assets/img/blob-1.webp"); 
    opacity: 0.5; 
    filter: blur(5px);
}

.section.has-blobs::after {
    bottom: -100px; 
    left: -150px; 
    background-image: url("../assets/img/blob-2.webp"); 
    opacity: 0.4; 
    filter: blur(5px);
}

.section.has-blobs:hover::before { 
    transform: scale(1.05) rotate(2deg); 
}

.section.has-blobs:hover::after { 
    transform: scale(1.05) rotate(-2deg); 
}

.hero__copy { 
    position: relative; 
    z-index: 10; 
}

.hero__cta { 
    display: flex; 
    gap: 15px; 
    margin-top: 30px; 
    flex-wrap: wrap; 
}

.hero__features-list, .list { 
    list-style: none; 
    padding: 0; 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    margin-top: 25px; 
}

.hero__features-list li, .list li {
    background: rgba(0, 168, 150, 0.1); 
    border: 1px solid var(--border);
    padding: 6px 12px; 
    border-radius: 12px; 
    font-weight: 600; 
    font-size: 0.85rem; 
    color: var(--c-text);
    
    /* 🆕 Subtle animation */
    transition: all 0.3s ease;
}

.hero__features-list li:hover, .list li:hover {
    background: rgba(0, 168, 150, 0.2);
    transform: translateY(-2px);
}

.list li { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.list li::before { 
    content: "•"; 
    color: var(--c-primary); 
    font-size: 1.2rem; 
    line-height: 0; 
}

.hero__cards { 
    display: grid; 
    gap: 20px; 
}

/* 🆕 Stagger animation for cards */
.hero__cards .card:nth-child(1) { animation-delay: 0s; }
.hero__cards .card:nth-child(2) { animation-delay: 0.1s; }
.hero__cards .card:nth-child(3) { animation-delay: 0.2s; }

.card, .glass {
    background: var(--c-card-bg);
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 30px;
    box-shadow: var(--shadow);
    
    /* 🆕 Enhanced transitions */
    transition: 
        transform 0.3s ease, 
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    
    /* 🆕 Initial animation */
    animation: fadeInUp 0.6s ease both;
}

.card:hover { 
    transform: translateY(-5px) translateZ(0);
    border-color: var(--c-primary); 
    box-shadow: 
        0 20px 70px rgba(0, 168, 150, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.feature { 
    position: relative; 
}

.feature__icon { 
    font-size: 2rem; 
    margin-bottom: 10px; 
}

.feature__icon img { 
    width: 48px; 
    height: auto; 
    animation: breathe 5s infinite; 
    will-change: transform;
}

/* --- 7. Buttons (משודרג + Ripple!) --- */
.btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    padding: 12px 30px; 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 1rem;
    border: none; 
    cursor: pointer; 
    transition: all 0.3s ease;
    text-align: center;
    min-height: 44px; 
    text-decoration: none;
    position: relative;
    overflow: hidden;
    
    /* 🆕 GPU acceleration */
    transform: translateZ(0);
}

/* 🆕 RIPPLE EFFECT! */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn--primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
    color: white; 
    box-shadow: 0 4px 15px rgba(0,168,150,0.3);
}

.btn--primary:hover { 
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 8px 25px rgba(0,168,150,0.4); 
}

/* 🆕 Pulse animation משודרג */
.btn--pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(0,168,150,0.3); 
    }
    50% { 
        box-shadow: 0 4px 25px rgba(0,168,150,0.6), 
                    0 0 0 10px rgba(0,168,150,0.1); 
    }
}

.btn--secondary {
    background: transparent; 
    color: var(--c-text); 
    border: 1px solid var(--border); 
    margin-right: 10px;
}

.btn--secondary:hover { 
    background: rgba(0,0,0,0.05); 
    border-color: var(--c-text); 
}

[data-theme="dark"] .btn--secondary:hover { 
    background: rgba(255,255,255,0.1); 
}

.btn--outline {
    background: transparent; 
    border: 2px solid var(--c-primary); 
    color: var(--c-primary);
}

.btn--outline:hover { 
    background: var(--c-primary); 
    color: white; 
}

.btn--full { 
    width: 100%; 
    background: var(--c-text);
    color: var(--c-bg);
    border: 1px solid transparent;
}

.btn--full:hover { 
    background: var(--c-primary); 
    border-color: var(--c-primary);
    color: white;
}

[data-theme="dark"] .btn--full {
    background: white;
    color: var(--c-bg);
}

[data-theme="dark"] .btn--full:hover {
    background: var(--c-primary);
    color: white;
}

.btn--sm { 
    padding: 8px 20px; 
    font-size: 0.9rem; 
}

.btn--wide { 
    min-width: 200px; 
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- 8. Products Store (משודרג) --- */
.product-card { 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.product-icon { 
    width: 100px; 
    height: 100px; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.product-icon img { 
    max-height: 100%; 
    width: auto; 
    filter: drop-shadow(0 10px 15px rgba(0,168,150,0.2)); 
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

.product-actions { 
    margin-top: auto; 
    padding-top: 20px; 
    width: 100%; 
}

.grid3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; 
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .grid2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.grid4 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 15px; 
}

.mini-card { 
    padding: 15px; 
    text-align: center; 
    border-radius: 16px; 
    background: rgba(255,255,255,0.4);
    transition: transform 0.2s ease, background 0.2s ease;
}

.mini-card:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.6);
}

[data-theme="dark"] .mini-card { 
    background: rgba(0,0,0,0.2); 
}

[data-theme="dark"] .mini-card:hover {
    background: rgba(0,0,0,0.3);
}

.mini-card h4 { 
    font-size: 1rem; 
    margin-bottom: 5px; 
    color: var(--c-text); 
}

.lab-section { 
    margin-top: 60px; 
}

/* --- Services & Systems (משודרג) --- */
.service-card, .system-card {
    text-align: center;
    padding: 40px 30px;
    transition: 
        transform 0.3s ease, 
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.service-card:hover, .system-card:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--c-primary);
}

.service-icon {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

.price-tag-small {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-primary);
    padding: 10px 20px;
    background: rgba(0, 168, 150, 0.1);
    border-radius: 50px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.price-tag-small:hover {
    background: rgba(0, 168, 150, 0.2);
    transform: scale(1.05);
}

[data-theme="dark"] .price-tag-small {
    background: rgba(0, 168, 150, 0.2);
}

/* --- 9. Demo Widget (משודרג) --- */
.wellness-widget {
    background: var(--c-card-bg); 
    border: 1px solid var(--c-primary);
    border-radius: var(--r-card); 
    padding: 40px;
    max-width: 600px; 
    margin: 0 auto; 
    text-align: center;
    position: relative; 
    overflow: hidden;
    
    /* 🆕 Glassmorphism משודרג */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.demo__controls { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

.demo__stats { 
    margin: 20px 0; 
}

.stat__label { 
    font-weight: 600; 
    margin-bottom: 10px; 
}

.stat__value { 
    font-size: 2rem; 
    font-weight: 800; 
    color: var(--c-primary);
    
    /* 🆕 Number animation */
    font-variant-numeric: tabular-nums;
}

.seg__btn {
    background: transparent; 
    border: 1px solid var(--c-primary); 
    color: var(--c-primary);
    padding: 8px 16px; 
    border-radius: 20px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

/* 🆕 Ripple για seg buttons */
.seg__btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 168, 150, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.seg__btn:active::after {
    width: 200px;
    height: 200px;
}

.seg__btn.is-active { 
    background: var(--c-primary); 
    color: white; 
}

/* --- 10. Pricing (משודרג) --- */
.price { 
    text-align: center; 
    border-bottom: 4px solid var(--c-primary); 
    display: flex; 
    flex-direction: column;
    position: relative;
}

.price.recommended {
    position: relative;
    border-bottom-width: 6px;
    
    /* 🆕 Gradient border */
    border-image: linear-gradient(135deg, var(--c-primary), var(--c-secondary)) 1;
}

.price__tag { 
    font-size: 2.5rem; 
    font-weight: 800; 
    color: var(--c-primary); 
    margin: 15px 0;
    
    /* 🆕 Number styling */
    font-variant-numeric: tabular-nums;
}

.price-list, .price ul { 
    list-style: none; 
    padding: 0; 
    text-align: right; 
    margin-bottom: 25px; 
    flex-grow: 1; 
}

.price-list li, .price ul li { 
    margin-bottom: 8px; 
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.price-list li:hover, .price ul li:hover {
    transform: translateX(-5px);
}

.ribbon {
    position: absolute; 
    top: 15px; 
    left: 15px; 
    background: var(--c-primary);
    color: white; 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: bold;
    z-index: 10;
    animation: pulse 2s ease-in-out infinite;
}

/* --- 11. Contact Form (משודרג) --- */
.glass-form-wrapper { 
    max-width: 700px; 
    margin: 0 auto; 
    padding: 40px; 
    background: var(--c-card-bg); 
    border-radius: var(--r-card); 
    border: 1px solid var(--border);
    
    /* 🆕 Glassmorphism משודרג */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.form-header { 
    margin-bottom: 30px; 
}

.form__grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.field { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.field--full { 
    grid-column: 1 / -1; 
}

label { 
    font-weight: 700; 
    font-size: 0.9rem; 
    color: var(--c-text); 
}

input, textarea, select {
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 12px;
    background: rgba(255,255,255,0.8); 
    outline: none; 
    transition: all 0.3s ease; 
    width: 100%;
    color: #2D3748; 
    font-size: 16px;
}

[data-theme="dark"] input, 
[data-theme="dark"] textarea,
[data-theme="dark"] select { 
    background: rgba(0,0,0,0.2); 
    color: white; 
}

/* 🆕 Focus styles משודרגים */
input:focus, textarea:focus, select:focus { 
    border-color: var(--c-primary); 
    box-shadow: 
        0 0 0 3px rgba(0,168,150,0.1),
        0 4px 12px rgba(0,168,150,0.15);
    transform: translateY(-1px);
}

.check-label { 
    display: flex; 
    gap: 15px; 
    align-items: flex-start; 
    cursor: pointer; 
    font-size: 0.9rem; 
    margin-top: 10px; 
    margin-bottom: 30px;
}

.check-label input { 
    width: 20px; 
    height: 20px; 
    margin: 0; 
    flex-shrink: 0; 
    margin-top: 2px; 
}

.form__actions { 
    margin-top: 20px; 
}

.form-feedback { 
    margin-top: 15px; 
    padding: 10px; 
    border-radius: 8px; 
    text-align: center;
    animation: slideDown 0.3s ease;
}

/* --- 12. Footer (משודרג) --- */
.footer { 
    padding: 60px 0 30px; 
    margin-top: 80px; 
    background: linear-gradient(to bottom, var(--c-bg), rgba(0, 168, 150, 0.05));
    border-top: 1px solid var(--border); 
    color: var(--c-text);
}

.footer-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    flex-wrap: wrap; 
    gap: 40px; 
    margin-bottom: 40px; 
}

.footer-brand p { 
    margin: 5px 0; 
}

.footer-brand strong { 
    font-size: 1.2rem; 
    color: var(--c-primary); 
}

.footer-links { 
    display: flex; 
    gap: 30px; 
    font-size: 0.95rem; 
    font-weight: 500; 
}

.footer-links a { 
    position: relative; 
    padding-bottom: 5px; 
}

/* 🆕 Gradient underline */
.footer-links a::after {
    content: ""; 
    position: absolute; 
    bottom: 0; 
    right: 0;
    width: 0; 
    height: 2px; 
    background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
    transition: width 0.3s ease;
}

.footer-links a:hover { 
    color: var(--c-primary); 
}

.footer-links a:hover::after { 
    width: 100%; 
}

.copyright { 
    text-align: center; 
    opacity: 0.6; 
    font-size: 0.8rem; 
    border-top: 1px solid rgba(0,0,0,0.05); 
    padding-top: 20px; 
}

[data-theme="dark"] .copyright { 
    border-top-color: rgba(255,255,255,0.05); 
}

/* --- 13. Focus Overlay (משודרג) --- */
.focus-overlay {
    position: fixed; 
    inset: 0; 
    width: 100vw; 
    height: 100vh;
    background: #061316; 
    z-index: 999999;
    display: none; 
    opacity: 0; 
    transition: opacity 0.4s ease;
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 20px;
    
    /* 🆕 Backdrop blur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.focus-overlay.active { 
    display: flex !important; 
    opacity: 1 !important; 
}

.focus-content { 
    text-align: center; 
    color: white;
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 0.6s ease both;
}

.focus-content h2, 
.focus-content p, 
.timer { 
    color: white; 
}

.focus-content h2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 20px;
}

.focus-content p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin: 10px 0;
}

.timer { 
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 100; 
    margin: 20px 0; 
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.breathing-circle {
    width: clamp(80px, 20vw, 120px);
    height: clamp(80px, 20vw, 120px);
    background: var(--c-primary); 
    border-radius: 50%;
    margin: 0 auto 30px; 
    box-shadow: 
        0 0 60px rgba(0, 168, 150, 0.6),
        0 0 100px rgba(0, 168, 150, 0.4);
    animation: breathe 5s infinite;
    will-change: transform, opacity;
}

.close-focus {
    position: absolute; 
    top: 20px; 
    right: 20px; 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white; 
    font-size: 1.5rem; 
    cursor: pointer; 
    padding: 10px;
    width: 44px; 
    height: 44px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1000000;
}

.close-focus:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

/* --- 14. Lab Overlays (משודרג) --- */
.lab-overlay { 
    background: rgba(12, 16, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
}

.lab-content-wrapper { 
    width: 100%; 
    max-width: 900px; 
    padding: 40px; 
    max-height: 90vh; 
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-primary) rgba(255,255,255,0.1);
}

.lab-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.lab-content-wrapper::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.lab-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--c-primary);
    border-radius: 10px;
}

.lab-content-wrapper h2 { 
    color: #fff; 
    margin-bottom: 10px; 
}

.lab-content-wrapper p.muted { 
    color: rgba(255, 255, 255, 0.7); 
}

.lab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 30px;
    margin-top: 30px;
    align-items: stretch;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px; 
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.glass-panel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-panel label { 
    color: rgba(255,255,255,0.9); 
    margin-bottom: 8px; 
    display: block; 
}

.glass-panel input, 
.glass-panel textarea {
    background: rgba(0, 0, 0, 0.3); 
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    margin-bottom: 15px;
}

.glass-panel input:focus, 
.glass-panel textarea:focus {
    border-color: var(--c-primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.2);
}

/* Candles (משודרג) */
.candle-wall-container {
    display: flex; 
    flex-direction: column; 
    gap: 15px;
    max-height: 450px; 
    overflow-y: auto; 
    padding-right: 15px;
}

.mini-candle-card {
    background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    padding: 20px; 
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    border-right: 4px solid var(--c-primary); 
    display: flex; 
    gap: 20px; 
    align-items: flex-start;
    animation: slideIn 0.6s var(--ease-smooth);
    transition: all 0.3s ease;
}

.mini-candle-card:hover { 
    transform: translateX(-5px); 
    background: rgba(255,255,255,0.08); 
    border-right-color: var(--c-secondary);
}

.candle-flame-icon {
    font-size: 2rem; 
    filter: drop-shadow(0 0 15px rgba(255, 165, 0, 0.6));
    animation: flick 2s infinite alternate ease-in-out;
}

.candle-info h4 { 
    margin: 0 0 5px 0; 
    font-size: 1.1rem; 
    color: #fff; 
    font-weight: 700; 
}

.candle-info p { 
    margin: 0; 
    font-size: 0.95rem; 
    color: rgba(255,255,255,0.8); 
    line-height: 1.4; 
}

.empty-wall-msg { 
    text-align: center; 
    color: rgba(255,255,255,0.4); 
    margin-top: 60px; 
    font-size: 1.1rem; 
    border: 1px dashed rgba(255,255,255,0.1);
    padding: 30px; 
    border-radius: 20px;
}

/* Confession (משודרג) */
.confession-wrapper { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 80vh; 
}

.confession-container { 
    max-width: 500px; 
    width: 100%; 
    position: relative; 
}

.confession-form { 
    border-top: 4px solid #a29bfe;
    transition: all 1s ease;
}

.icon-header { 
    font-size: 3.5rem; 
    text-align: center; 
    margin-bottom: 15px; 
    filter: drop-shadow(0 0 20px rgba(162, 155, 254, 0.4));
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

.confession-success { 
    text-align: center; 
    padding: 50px 30px; 
    background: rgba(255,255,255,0.05); 
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    display: none; 
    animation: fadeIn 1s ease;
}

.confession-success.active { 
    display: block; 
}

.confession-success h3 { 
    font-size: 2rem; 
    color: #fff; 
    margin-bottom: 10px; 
    font-weight: 800; 
}

.confession-success p { 
    color: rgba(255,255,255,0.8); 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
}

.lock-animation { 
    font-size: 5rem; 
    margin-bottom: 20px; 
    height: 80px; 
}

.form-dissolving {
    filter: blur(10px);
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
    pointer-events: none;
}

/* Join System (משודרג) */
.smart-progress-container {
    margin-bottom: 35px;
    background: rgba(0, 0, 0, 0.25);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.progress-label {
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 10px;
    font-size: 0.95rem; 
    font-weight: 700; 
    color: var(--c-primary);
    text-transform: uppercase; 
    letter-spacing: 1px;
}

.progress-track {
    width: 100%; 
    height: 10px; 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 20px; 
    overflow: hidden;
}

.progress-fill {
    height: 100%; 
    width: 0%; 
    background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
    border-radius: 20px;
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 15px rgba(0, 168, 150, 0.6);
}

.info-accordion { 
    margin-bottom: 30px; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.acc-item { 
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 4px solid var(--c-primary); 
    border-radius: 12px; 
    overflow: hidden;
    transition: all 0.2s ease;
}

.acc-item:hover { 
    background: rgba(255, 255, 255, 0.06); 
}

.acc-header {
    width: 100%; 
    padding: 16px 20px; 
    text-align: right; 
    background: none; 
    border: none; 
    color: white; 
    font-weight: 700; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.acc-header::after { 
    content: '+'; 
    color: var(--c-primary); 
    font-weight: 300; 
    font-size: 1.5rem; 
    transition: transform 0.3s;
}

.acc-item.active .acc-header::after { 
    content: '−'; 
    transform: rotate(180deg); 
}

.acc-body { 
    display: none; 
    padding: 0 20px 20px; 
    color: rgba(255, 255, 255, 0.75); 
    font-size: 0.95rem; 
    line-height: 1.6; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.acc-item.active .acc-body { 
    display: block; 
    animation: slideIn 0.3s ease; 
}

.form-control-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 5px; 
    background-color: rgba(0, 0, 0, 0.3); 
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300A896' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 20px;
}

.form-control-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.4);
}

.form-control-select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(0, 168, 150, 0.15);
}

.form-control-select option {
    background-color: #1a202c;
    color: white;
    padding: 12px;
    font-size: 1rem;
}

.dynamic-field {
    display: none;
    background: rgba(0, 168, 150, 0.05);
    padding: 25px; 
    border-radius: 16px;
    border: 1px dashed rgba(0, 168, 150, 0.4);
    margin-bottom: 25px;
    opacity: 0; 
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dynamic-field.visible { 
    display: block; 
    opacity: 1; 
    transform: translateY(0);
    animation: glowPulse 1s ease 1;
}

.dynamic-title {
    color: var(--c-primary); 
    margin: 0 0 15px 0; 
    font-size: 0.95rem; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    font-weight: 800;
    display: flex; 
    align-items: center; 
    gap: 8px;
    border-bottom: 1px solid rgba(0, 168, 150, 0.2);
    padding-bottom: 8px;
}

.dynamic-field input, 
.dynamic-field textarea {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dynamic-field input:focus, 
.dynamic-field textarea:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: var(--c-primary) !important;
}

/* --- 15. Treehouse (משודרג) --- */
#treehouseOverlay {
    background: var(--sky-soft);
}

.treehouse-wrapper {
    width: 100%;
    max-width: none;
    padding: 20px;
}

.treehouse-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 30px;
    border: 5px solid var(--wood);
    box-shadow: 0 20px 50px rgba(93, 64, 55, 0.2);
    
    /* 🆕 Animation */
    animation: fadeInUp 0.6s ease both;
}

.treehouse-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.gahali-welcome-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.gahali-host {
    width: 80px;
    display: block;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

.welcome-bubble {
    background: #E0F7FA;
    color: #006064;
    padding: 10px 20px;
    border-radius: 20px;
    border-bottom-left-radius: 0;
    display: inline-block;
    font-weight: bold;
    font-size: 0.95rem;
    animation: slideIn 0.5s ease;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.games-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.tool-card {
    background: #fff;
    border-radius: 30px;
    padding: 25px;
    border: 3px solid #eee;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.tool-title {
    display: block;
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.diary-card { 
    border-color: #FFF59D; 
    background-color: #FFFFF0; 
}

.drawing-card { 
    border-color: #FFCCBC; 
    background-color: #fff; 
}

.capsule-card { 
    border-color: #CE93D8; 
    background-color: #F3E5F5; 
    min-height: auto; 
}

.game-card { 
    border: 4px dashed #81D4FA; 
    text-align: center; 
    min-height: 250px; 
}

.diary-input {
    width: 100%;
    flex-grow: 1;
    background: transparent;
    border: none;
    resize: none;
    font-size: 1.1rem;
    line-height: 1.8;
    background-image: linear-gradient(transparent 1.7rem, #E0E0E0 1.8rem);
    background-size: 100% 1.8rem;
    outline: none;
    color: #5D4037;
}

canvas#drawCanvas {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    border: 2px dashed #FFCCBC;
    cursor: crosshair;
    flex-grow: 1;
    margin-bottom: 10px;
    background: #fff;
    touch-action: none;
}

.colors-bar {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
    width: 100%;
    flex-wrap: wrap;
}

.color-dot {
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    cursor: pointer;
    border: 2px solid #fff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.color-dot.active { 
    transform: scale(1.2); 
    border-color: #333; 
}

.color-dot:hover {
    transform: scale(1.15);
}

.garden-area {
    height: 150px;
    background: #DCEDC8;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    border-bottom: 10px solid #C5E1A5;
    cursor: crosshair;
    width: 100%;
}

.flower {
    position: absolute; 
    bottom: 0; 
    font-size: 2rem;
    animation: grow 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.btn-tool {
    border: none; 
    padding: 8px 18px; 
    border-radius: 50px;
    font-weight: bold; 
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* 🆕 Ripple for tool buttons */
.btn-tool::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-tool:active::after {
    width: 150px;
    height: 150px;
}

.btn-save { 
    background: #E3F2FD; 
    color: #1976D2; 
}

.btn-clear { 
    background: #FFEBEE; 
    color: #D32F2F; 
}

.btn-tool:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.music-player-strip {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-music-toggle {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-music-toggle:hover { 
    background: #f0f0f0; 
    transform: scale(1.1); 
}

.mood-section {
    margin-bottom: 30px;
    text-align: center;
}

.mood-wheel {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.mood-btn {
    font-size: 2.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: transform 0.2s ease;
    user-select: none;
}

.mood-btn:hover, 
.mood-btn.selected { 
    transform: scale(1.25); 
}

.mood-btn:active {
    transform: scale(1.15);
}

#panicBtn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #FF5252;
    color: white;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 100;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

#panicBtn:hover { 
    transform: scale(1.05); 
    background: #ff1744; 
}

/* 🆕 Close button enhanced */
#closeTreehouseBtn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    background: #FF5252;
    color: white;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

#closeTreehouseBtn:hover {
    background: #ff1744;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.5);
}

#closeTreehouseBtn:active {
    transform: scale(0.95);
}

/* --- 16. Cookie Banner (משודרג) --- */
.cookie-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-left: 5px solid var(--c-primary);
    border-radius: 16px;
    padding: 20px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] .cookie-banner {
    background: rgba(17, 21, 28, 0.95);
}

.cookie-banner.hidden {
    display: none;
}

.cookie-content h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* --- 17. Skip Link (נגישות) --- */
.skip-link {
    position: absolute;
    top: -999px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--c-primary);
    color: #fff;
    padding: 12px 24px;
    z-index: 10001;
    border-radius: 0 0 12px 12px;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: -4px;
}

/* --- 18. Keyframes (משודרג) --- */
@keyframes breathe { 
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.9; 
    } 
    50% { 
        transform: scale(1.1); 
        opacity: 0.6; 
    } 
}

@keyframes float { 
    0%, 100% { 
        transform: translateY(0); 
    } 
    50% { 
        transform: translateY(-10px); 
    } 
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translate(-50%, 50px); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, 0); 
    }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes flick {
    0% { 
        opacity: 0.7; 
        transform: scale(0.95) rotate(-2deg); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1) rotate(2deg); 
    }
    100% { 
        opacity: 0.8; 
        transform: scale(1) rotate(-1deg); 
    }
}

@keyframes grow { 
    0% { 
        transform: scale(0); 
        bottom: -10px; 
    } 
    100% { 
        transform: scale(1); 
        bottom: 0; 
    } 
}

@keyframes glowPulse {
    0% { 
        box-shadow: 0 0 0 rgba(0,0,0,0); 
    }
    50% { 
        box-shadow: 0 0 20px rgba(0, 168, 150, 0.15); 
    }
    100% { 
        box-shadow: 0 0 0 rgba(0,0,0,0); 
    }
}

@keyframes lockSnap {
    0% { 
        transform: scale(1); 
    }
    40% { 
        transform: scale(1.3) rotate(-10deg); 
    }
    60% { 
        transform: scale(1.3) rotate(10deg); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* --- 19. MOBILE RESPONSIVE (משודרג) --- */
@media (max-width: 900px) {
    body { 
        overflow-x: hidden; 
    }
    
    .hdr2 { 
        position: sticky;
        top: 10px;
        padding: 0 10px;
    }
    
    .hdr2-pill { 
        padding: 10px 16px; 
    }
    
    .hdr2-brand { 
        font-size: 1rem; 
        gap: 8px; 
    }
    
    .hdr2-mark { 
        height: 28px; 
    }
    
    .hdr2-nav { 
        display: none;
        position: absolute;
        top: 65px;
        left: 10px;
        right: 10px;
        background: var(--c-card-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 20px;
        border-radius: 20px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
        animation: slideDown 0.3s ease;
    }
    
    .hdr2-nav.is-open { 
        display: flex; 
    }
    
    .hdr2-burger { 
        display: block; 
    }
    
    .hero { 
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    .hero__inner { 
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
        padding: 0 15px;
    }
    
    .hero__bg-wave {
        width: 160%;
        height: 60%;
        bottom: 0;
        opacity: 0.3;
        max-height: 350px;
    }
    
    .hero__cta {
        justify-content: center;
    }
    
    .form__grid { 
        grid-template-columns: 1fr; 
    }
    
    .grid3, .grid4, .grid2 { 
        grid-template-columns: 1fr; 
    }
    
    .footer-content { 
        flex-direction: column; 
        text-align: center; 
        align-items: center; 
    }
    
    .footer-links { 
        flex-direction: column; 
        gap: 15px; 
    }
    
    .section { 
        padding: 60px 0; 
    }
    
    .lab-grid { 
        grid-template-columns: 1fr; 
    }
    
    .lab-content-wrapper { 
        padding: 20px; 
    }
    
    .workspace-grid, 
    .games-section { 
        grid-template-columns: 1fr; 
    }
    
    .treehouse-container { 
        padding: 15px; 
    }
    
    .tool-card { 
        min-height: 350px; 
    }
    
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        width: 95%;
    }
    
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hdr2-mark { 
        height: 20px; 
    }
    
    h1 { 
        font-size: 1.8rem; 
    }
    
    h2 { 
        font-size: 1.5rem; 
    }
    
    .container { 
        padding: 0 15px; 
    }
    
    .card { 
        padding: 20px; 
    }
}

/* --- 20. Accessibility & Performance (🆕) --- */

/* 🆕 Focus Visible (A11y) */
:focus-visible {
    outline: 3px solid var(--c-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* 🆕 High Contrast Mode */
@media (prefers-contrast: high) {
    .btn {
        border: 3px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--c-text);
    }
}

/* 🆕 Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 🆕 Print Styles */
@media print {
    .hdr2, 
    .footer, 
    .btn, 
    .cookie-banner,
    .focus-overlay,
    .lab-overlay { 
        display: none; 
    }
    
    body { 
        background: white; 
        color: black; 
    }
    
    .section { 
        page-break-inside: avoid; 
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* 🆕 Touch-Friendly Targets */
@media (hover: none) and (pointer: coarse) {
    .btn, 
    .hdr2-nav a,
    .mood-btn,
    .color-dot {
        min-height: 44px;
        min-width: 44px;
    }
}











/* === HARD OVERLAY FIX (must be last in file) === */
.overlay,
.modal,
.lab-overlay,
#candleOverlay,
#confessionOverlay,
#joinOverlay,
#treehouseOverlay,
#focusOverlay,
#cookieBanner {
  display: none !important;
}

#candleOverlay.active,
#confessionOverlay.active,
#joinOverlay.active,
#treehouseOverlay.active,
#focusOverlay.active {
  display: flex !important;
}

#candleOverlay,
#confessionOverlay,
#joinOverlay,
#treehouseOverlay,
#focusOverlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: rgba(0,0,0,0.65) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* inner content container (give it something visible even if your CSS missing) */
.overlay__panel,
.modal__panel,
.lab-panel,
.treehouse-panel,
#candleOverlay .panel,
#confessionOverlay .panel,
#joinOverlay .panel,
#treehouseOverlay .panel {
  background: #fff !important;
  color: #111 !important;
  width: min(920px, 96vw) !important;
  max-height: 88vh !important;
  overflow: auto !important;
  border-radius: 18px !important;
  padding: 18px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35) !important;
}

.no-scroll { overflow: hidden !important; }







/* === LAB OVERLAY MUST OPEN === */
.lab-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
}

/* make sure lab content is visible */
.lab-content-wrapper,
.lab-content-wrapper * {
  color: #fff;
}

.lab-content-wrapper .muted {
  color: rgba(255,255,255,0.75) !important;
}










/* === OPEN LAB OVERLAYS (force) === */
.lab-overlay.active {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* make inner shell visible */
#treehouseOverlay .lab-shell {
  background: #fff !important;
  color: #111 !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35) !important;
  width: min(980px, 96vw) !important;
  max-height: 88vh !important;
  overflow: auto !important;
  padding: 18px !important;
}










/* === END OF CSS V32 === */