@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Fraunces:wght@500;600;700;800&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
    /* --- BRAND COLORS --- */
    --primary: #8DB600;
    --primary-glow: rgba(141, 182, 0, 0.35);
    
    /* --- CORE PALETTE (Light Mode) --- */
    --bg-core: #f8f9fa; 
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-main: #1a1a1a;
    --text-muted: #6c757d;
    --text-soft: #adb5bd;
    
    /* --- GLASS --- */
    --glass-border: rgba(141, 182, 0, 0.3); 
    --glass-surface: rgba(255, 255, 255, 0.8);
    
    /* --- FONTS --- */
    --font-en: 'Space Grotesk', sans-serif;
    --font-display: 'Fraunces', serif;
    --font-ar: 'IBM Plex Sans Arabic', sans-serif;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- 1. GLOBAL RESET & TYPOGRAPHY --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-core);
    color: var(--text-main);
    font-family: var(--font-ar), var(--font-en), sans-serif; /* Default to Arabic font preference */
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Theme utility helpers */
.bg-theme-core { background-color: var(--bg-core); }
.text-theme-main { color: var(--text-main); }

h1, h2, h3, h4 {
    font-family: var(--font-display), var(--font-en), sans-serif;
    letter-spacing: 0.01em;
}

p {
    letter-spacing: 0.01em;
}

/* Force RTL Direction for Arabic */
html[dir="rtl"] { direction: rtl; text-align: right; }

html[dir="rtl"] body, html[dir="rtl"] h1, html[dir="rtl"] h2, 
html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] p, 
html[dir="rtl"] span, html[dir="rtl"] a, html[dir="rtl"] button {
    font-family: var(--font-ar) !important;
}

/* --- 2. NAVBAR (Fixed Visibility) --- */
header#navbar {
    position: fixed;
    top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 1.5rem;
    transition: all 0.4s ease;
    background: transparent;
}

/* Top State: Transparent BG + Dark Text */
header#navbar .glass-panel {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: none;
}

header#navbar a, 
header#navbar span, 
header#navbar i,
header#navbar .fa-bars {
    color: #1a1a1a !important;
    text-shadow: none;
}

/* Scrolled State: Light Glass + Dark Text */
header#navbar.scrolled {
    padding-top: 0.5rem; padding-bottom: 0.5rem;
}

header#navbar.scrolled .glass-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

header#navbar.scrolled a, 
header#navbar.scrolled span, 
header#navbar.scrolled i,
header#navbar.scrolled .fa-bars {
    color: #1a1a1a !important;
    text-shadow: none;
}

header#navbar a:hover, 
header#navbar .text-\[\#8DB600\] {
    color: var(--primary) !important;
}

/* --- 3. HERO & TYPEWRITER --- */
#hero-title-slider, 
#hero-desc-slider {
    color: #ffffff !important;
    text-shadow: 0 6px 18px rgba(0,0,0,0.45);
    min-height: 120px;
    display: block;
    font-family: var(--font-ar), var(--font-en), sans-serif;
}

#hero-title-slider {
    font-size: clamp(3rem, 6.5vw, 6.8rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    background: none;
    -webkit-text-fill-color: #ffffff;
}

#hero-title-slider.gradient-text {
    background: none;
    -webkit-text-fill-color: #ffffff;
}

#hero-desc-slider {
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    max-width: 40rem;
}

.space-hero #hero-desc-slider {
    min-height: 0;
}

.space-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 8rem 0 6rem;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.16), transparent 58%),
        linear-gradient(180deg, rgba(5, 6, 8, 0.52), rgba(5, 6, 8, 0.75));
}

.hero-video {
    filter: saturate(0.8) contrast(1.05) brightness(0.7);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(141, 182, 0, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(141, 182, 0, 0.12) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.12;
    transform: perspective(900px) rotateX(60deg) translateY(20%);
    transform-origin: center;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}

.space-hero--minimal .hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

.space-hero--minimal .hero-copy {
    align-items: center;
}

.hero-tagline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

html[dir="rtl"] .hero-copy { order: 2; }
html[dir="rtl"] .hero-stage { order: 1; }

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-eyebrow {
    color: var(--primary);
    letter-spacing: 0.35em;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.6rem, 4vw, 4.5rem);
    line-height: 1.05;
    font-weight: 700;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 32rem;
    line-height: 1.7;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.btn-secondary {
    border: 1px solid rgba(141, 182, 0, 0.15);
    color: var(--text-main);
    padding: 0.95rem 2rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(12, 12, 12, 0.55);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(141, 182, 0, 0.2);
    border-color: var(--primary);
    color: #0a0a0a;
}

.hero-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.metric-chip {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    background: rgba(12, 12, 12, 0.55);
    border: 1px solid rgba(141, 182, 0, 0.2);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.metric-chip .metric-value {
    color: var(--primary);
    font-weight: 700;
}

.metric-chip .metric-label {
    color: var(--text-main);
    font-weight: 600;
}

/* Fix dark text on dark backgrounds in hero section */
.space-hero .hero-desc,
.space-hero .metric-chip,
.space-hero .metric-chip .metric-label,
.space-hero .btn-secondary,
.space-hero .module-card {
    color: white;
}

.space-hero .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.space-hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.space-hero .metric-chip {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(141, 182, 0, 0.3);
}

.space-hero .module-card {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(141, 182, 0, 0.4);
}

.hero-stage {
    position: relative;
    border-radius: 28px;
    background: radial-gradient(circle at 20% 20%, rgba(141, 182, 0, 0.18), rgba(8, 8, 8, 0.85) 55%);
    border: 1px solid rgba(141, 182, 0, 0.28);
    padding: 2rem;
    min-height: 420px;
    overflow: hidden;
}

.hero-stage::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 22px;
    border: 1px dashed rgba(141, 182, 0, 0.2);
    opacity: 0.7;
}

.stage-ring {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 1px solid rgba(141, 182, 0, 0.4);
    top: -60px;
    right: -80px;
    animation: ring-spin 16s linear infinite;
}

.stage-ring::after {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    border: 1px solid rgba(141, 182, 0, 0.18);
}

.stage-orbit {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid rgba(141, 182, 0, 0.2);
    bottom: -50px;
    left: -40px;
    animation: ring-spin 20s linear infinite reverse;
}

.stage-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(141, 182, 0, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(141, 182, 0, 0.12) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.16;
    transform: perspective(700px) rotateX(70deg) translateY(45%);
    transform-origin: center;
}

.module-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: rgba(12, 12, 12, 0.72);
    border: 1px solid rgba(141, 182, 0, 0.3);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    animation: float 8s ease-in-out infinite;
}

.module-card i { color: var(--primary); }

.module-card:hover {
    transform: scale(1.05) translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(141, 182, 0, 0.6);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.module-1 { top: 20%; left: 10%; animation-delay: -2s; }
.module-2 { top: 45%; right: 10%; animation-delay: -4s; }
.module-3 { bottom: 18%; left: 18%; animation-delay: -6s; }
.module-4 { top: 65%; right: 30%; animation-delay: -1s; }

@keyframes ring-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 980px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-stage {
        min-height: 360px;
    }
}

@media (max-width: 600px) {
    .space-hero {
        padding-top: 6.5rem;
    }
    .hero-ctas {
        flex-direction: column;
        align-items: stretch;
    }
}

.gradient-text {
    background: linear-gradient(135deg, #f7ffd9 0%, #8DB600 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.typing-active::after {
    content: '|';
    color: var(--primary);
    animation: blink 0.9s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- 4. GLASS COMPONENTS --- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.glass-panel:hover::before {
    left: 100%;
}

.blog-content {
    display: none;
}

.glass-card {
    background: linear-gradient(145deg, var(--glass-surface) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: all 0.5s var(--ease-out-expo);
}

.glass-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-5px);
}

/* --- 4B. INTERACTIVE 3D CARDS --- */
.interactive-tilt {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease, border-color 0.35s ease;
    will-change: transform;
}

.interactive-tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(141, 182, 0, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
    pointer-events: none;
}

.interactive-tilt.is-hovered {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(141, 182, 0, 0.15);
    border-color: var(--primary);
}

.interactive-tilt.is-hovered::after {
    opacity: 1;
}

/* --- 5. STATS CONTAINER --- */
.stats-container {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 2rem; margin: 4rem auto; position: relative; z-index: 20;
}

.stat-item {
    position: relative;
    background: rgba(18, 18, 18, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    text-align: center;
    min-width: 240px;
    transition: all 0.4s var(--ease-out-expo);
}

.stat-item::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 18px;
    border: 1px dashed rgba(141, 182, 0, 0.2);
    opacity: 0.6;
    pointer-events: none;
}

.stats-container {
    margin-top: -4rem;
}

@media (max-width: 900px) {
    .stats-container {
        margin-top: 2rem;
    }
}

/* --- GALLERY (OUR WORK) --- */
.gallery-fullscreen #smooth-content {
    background: var(--bg-core);
}

.fullscreen-panel {
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(3rem, 6vh, 5rem) 0;
    position: relative;
    overflow: hidden;
}

.gallery-hero {
    position: relative;
    display: flex;
    align-items: center;
    color: #ffffff;
}

.gallery-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gallery-hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55) saturate(0.85) contrast(1.05);
}

.gallery-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(141, 182, 0, 0.2), transparent 45%),
        linear-gradient(180deg, rgba(10, 10, 10, 0.7) 0%, rgba(10, 10, 10, 0.45) 45%, rgba(10, 10, 10, 0.8) 100%);
}

.gallery-hero__words {
    position: absolute;
    inset: -10% 0;
    z-index: 1;
    display: grid;
    place-content: center;
    gap: 1.5rem;
    text-align: center;
    pointer-events: none;
    opacity: 0.18;
}

.gallery-hero__words span {
    font-size: clamp(2.6rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.gallery-hero__grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
    min-height: clamp(420px, 70vh, 720px);
}

.gallery-hero__title {
    font-family: var(--font-display), var(--font-en), sans-serif;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 1.05;
    color: #ffffff;
}

.gallery-hero__desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    max-width: 34rem;
    line-height: 1.7;
}

.work-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.4);
}

.work-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

.featured-card {
    display: grid;
    grid-template-columns: 1fr;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(141, 182, 0, 0.3);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.featured-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    min-height: clamp(240px, 40vh, 420px);
}

.featured-content {
    padding: 2rem;
}

.featured-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--primary);
}

.work-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(141, 182, 0, 0.2);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.work-card__media {
    flex: 1;
    min-height: 260px;
    overflow: hidden;
}

.work-card__content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.work-card__media video,
.work-card__media img,
.featured-media video,
.featured-media img,
.work-tile__media video,
.work-tile__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.work-tile {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(141, 182, 0, 0.2);
    aspect-ratio: 4 / 5;
    background: #0b0b0b;
}

.work-tile__media {
    width: 100%;
    height: 100%;
}

.work-tile__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.15));
    color: #fff;
}

.work-tile__overlay h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.work-tile__overlay p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.work-section {
    padding: clamp(2.8rem, 5.5vh, 4.8rem) 0;
    position: relative;
}

.work-section--tight {
    padding-top: clamp(2.2rem, 4.5vh, 3.6rem);
}

.work-section--no-gap {
    padding-bottom: clamp(1.8rem, 3.5vh, 2.8rem);
}

.work-section--no-gap-top {
    padding-top: clamp(1.6rem, 3vh, 2.6rem);
}

.work-section__head {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.work-section__eyebrow {
    display: inline-block;
    font-size: clamp(1.1rem, 2.6vw, 2rem);
    letter-spacing: 0.35em;
}

.work-section__note {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.work-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 50vw);
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
}

.work-carousel::-webkit-scrollbar,
.work-grid--scroll::-webkit-scrollbar {
    display: none;
}

.work-carousel,
.work-grid--scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.work-carousel .work-card {
    scroll-snap-align: start;
    min-height: clamp(280px, 52vh, 520px);
    display: grid;
    grid-template-rows: 1.2fr 0.8fr;
}

.work-carousel .work-card__media {
    min-height: 0;
}

.work-grid--scroll {
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 42vw);
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.work-grid--scroll .work-tile {
    scroll-snap-align: start;
    min-height: clamp(300px, 55vh, 560px);
}


@media (max-width: 1024px) {
    .gallery-hero__grid {
        grid-template-columns: 1fr;
    }
    .gallery-hero__words {
        opacity: 0.12;
    }
}

@media (min-width: 1024px) {
    .work-card {
        flex-direction: row;
    }

    .work-card--reverse {
        flex-direction: row-reverse;
    }

    .work-card__media {
        min-height: 320px;
    }

    .featured-card {
        grid-template-columns: 1.15fr 0.85fr;
        align-items: stretch;
    }

    .featured-media {
        aspect-ratio: auto;
        min-height: 100%;
    }
}

@media (min-width: 768px) {
    .work-section__head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

/* --- Materials Section (Gallery) --- */
.materials-section .materials-panel {
    padding: clamp(2.5rem, 6vw, 4.5rem);
    min-height: clamp(360px, 60vh, 640px);
    display: grid;
    align-items: center;
}

.materials-panel.no-tilt {
    transform: none !important;
}

.materials-panel.no-tilt::before {
    display: none;
}

.materials-section .materials-panel .grid {
    gap: clamp(1rem, 3vw, 2.5rem);
}

.materials-section .materials-panel button {
    min-height: clamp(120px, 18vh, 180px);
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
}

/* --- Footer Sizing --- */
footer.glass-panel {
    padding-top: clamp(3rem, 8vh, 6rem);
    padding-bottom: clamp(2rem, 6vh, 4rem);
}

footer.glass-panel .max-w-7xl {
    max-width: 100%;
    padding-left: clamp(1.5rem, 5vw, 6rem);
    padding-right: clamp(1.5rem, 5vw, 6rem);
}

footer.glass-panel p,
footer.glass-panel a,
footer.glass-panel input,
footer.glass-panel button {
    font-size: clamp(0.85rem, 1.2vw, 1rem);
}

/* --- 6. BACKGROUND & NOISE --- */
#webgl-canvas, #glass-canvas {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

.noise-overlay {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 7. BUTTONS --- */
.btn-magnetic {
    position: relative; display: inline-flex; align-items: center; padding: 1rem 2.5rem; 
    border: 1px solid var(--primary); border-radius: 100px; color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none; overflow: hidden; transition: all 0.4s ease;
}
.btn-magnetic:hover { color: #000 !important; box-shadow: 0 0 30px var(--primary-glow); }
.btn-magnetic::before {
    content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 100%;
    background: var(--primary); z-index: -1; transition: width 0.4s var(--ease-out-expo);
}
.btn-magnetic:hover::before { width: 100%; }

/* --- 8. MATERIAL MODAL (Vertical Animation) --- */
/* Base Modal Container */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Darker backdrop */
    backdrop-filter: blur(8px);
    z-index: 99999;
    
    /* Animation States */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    /* Layout */
    display: flex; align-items: center; justify-content: center;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.material-modal {
    position: relative; width: 100%; max-width: 1200px;
    z-index: 100000;
}

.material-modal-transparent {
    width: 100%; display: flex; flex-wrap: wrap; 
    justify-content: center; gap: 24px;
}

/* Close Button */
.modal-close-btn {
    position: fixed; top: 30px; right: 30px; z-index: 100001;
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%; color: white; font-size: 1.5rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease; backdrop-filter: blur(10px);
}
.modal-close-btn:hover {
    background: #8DB600;
    border-color: #8DB600;
    color: #0a0a0a;
    transform: rotate(90deg);
}

/* Glass Slices - Vertical Opening */
.glass-slice {
    position: relative;
    width: 280px; height: 400px;
    border-radius: 20px; overflow: hidden;
    background-size: cover; background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    cursor: pointer;
    
    /* Vertical Animation Setup */
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    animation: openVertical 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-slice:hover {
    transform: scaleY(1) translateY(-10px) scale(1.02);
    border-color: #8DB600;
    box-shadow: 0 0 20px rgba(141, 182, 0, 0.4);
}

.glass-slice::before {
    content: ''; position: absolute; inset: 0;
    background-image: inherit; background-size: cover; background-position: center;
    transition: transform 0.7s ease; z-index: 0;
}
.glass-slice:hover::before { transform: scale(1.1); }

/* Glass Overlay Text */
.glass-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: fadeInText 0.5s ease 0.3s forwards;
    z-index: 2;
}

.glass-overlay h4 { color: white; font-size: 1.2rem; font-weight: bold; margin-bottom: 5px; }
.glass-overlay p { color: #ccc; font-size: 0.9rem; }

/* Animations */
@keyframes openVertical {
    0% { opacity: 0; transform: scaleY(0); }
    100% { opacity: 1; transform: scaleY(1); }
}
@keyframes fadeInText { to { opacity: 1; } }

/* Stagger Delays */
.slice-delay-1 { animation-delay: 0.1s; }
.slice-delay-2 { animation-delay: 0.2s; }
.slice-delay-3 { animation-delay: 0.3s; }
.slice-delay-4 { animation-delay: 0.4s; }

/* --- 9. CONTACT MODAL (Dark Core Theme) --- */
#contact-modal .material-modal {
    background: rgba(18, 18, 18, 0.96);
    border: 1px solid rgba(141, 182, 0, 0.18);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
#contact-modal h3, #contact-modal h4 { color: var(--text-main) !important; }
#contact-modal p, #contact-modal span { color: var(--text-muted) !important; }
#contact-modal .fa-xmark { color: var(--text-main) !important; }
#contact-modal a {
    background: #1b1b1b !important; border: 1px solid #2a2a2a !important;
}
#contact-modal a:hover {
    background: rgba(141, 182, 0, 0.1) !important; border-color: #8DB600 !important;
}

/* --- 10. MOBILE MENU (Clean) --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem !important; line-height: 1.2; }
    h2 { font-size: 2rem !important; }

    #mobile-menu {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(5, 5, 5, 0.95); backdrop-filter: blur(20px);
        z-index: 9999; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 1.5rem;
        opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    }
    
    #mobile-menu.active { opacity: 1; pointer-events: all; }
    
    #mobile-menu a {
        font-size: 1.2rem; color: white; font-weight: 700;
        text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none;
        background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.01));
        border: 1px solid rgba(255, 255, 255, 0.15);
        padding: 1rem 0; width: 80%; max-width: 300px;
        text-align: center; border-radius: 50px;
        transform: translateY(20px); transition: all 0.3s ease;
    }

    #mobile-menu.active a { transform: translateY(0); }
    #mobile-menu a:hover { background: rgba(255, 255, 255, 0.2); border-color: #8DB600; }
}

@media (min-width: 768px) {
    #mobile-menu, .fa-bars, button[onclick="toggleMobileMenu()"] { display: none !important; }
}
/* --- SPACE KITCHEN EXPERIENCE --- */

/* --- AMBIENT LIGHT EFFECTS --- */

/* The soft glowing light orbs */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Makes it look like soft light, not a solid circle */
    background: radial-gradient(circle, rgba(141, 182, 0, 0.15) 0%, rgba(141, 182, 0, 0) 70%);
    animation: drift 26s ease-in-out infinite alternate;
}

/* Position and size the distinct lights */
.glow-1 {
    width: 600px; height: 600px;
    top: -10%; left: -10%;
    animation-duration: 28s;
}

.glow-2 {
    width: 400px; height: 400px;
    bottom: 20%; right: -5%;
    background: radial-gradient(circle, rgba(141, 182, 0, 0.12) 0%, rgba(141, 182, 0, 0) 70%);
    animation-duration: 32s;
    animation-delay: -10s;
}

.glow-3 {
    width: 500px; height: 500px;
    top: 40%; left: 40%;
    background: radial-gradient(circle, rgba(141, 182, 0, 0.08) 0%, rgba(141, 182, 0, 0) 70%);
    animation-duration: 36s;
    animation-delay: -5s;
}

/* The drifting movement */
@keyframes drift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    33% { transform: translate(5%, 10%) scale(1.1); opacity: 1; }
    66% { transform: translate(-5%, 5%) scale(0.9); opacity: 0.7; }
    100% { transform: translate(10%, -10%) scale(1.05); opacity: 0.9; }
}

/* --- AMBIENT LIGHT EFFECTS --- */

/* The soft glowing light orbs */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Makes it look like soft light, not a solid circle */
    background: radial-gradient(circle, rgba(141, 182, 0, 0.15) 0%, rgba(141, 182, 0, 0) 70%);
    animation: drift 26s ease-in-out infinite alternate;
}

/* Position and size the distinct lights */
.glow-1 {
    width: 600px; height: 600px;
    top: -10%; left: -10%;
    animation-duration: 28s;
}

.glow-2 {
    width: 400px; height: 400px;
    bottom: 20%; right: -5%;
    background: radial-gradient(circle, rgba(141, 182, 0, 0.12) 0%, rgba(141, 182, 0, 0) 70%);
    animation-duration: 32s;
    animation-delay: -10s;
}

.glow-3 {
    width: 500px; height: 500px;
    top: 40%; left: 40%;
    background: radial-gradient(circle, rgba(141, 182, 0, 0.08) 0%, rgba(141, 182, 0, 0) 70%);
    animation-duration: 36s;
    animation-delay: -5s;
}

/* The drifting movement */
@keyframes drift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    33% { transform: translate(5%, 10%) scale(1.1); opacity: 1; }
    66% { transform: translate(-5%, 5%) scale(0.9); opacity: 0.7; }
    100% { transform: translate(10%, -10%) scale(1.05); opacity: 0.9; }
}

/* --- ADDITIONAL LIGHT MODE EFFECTS --- */

/* Floating particles */
.floating-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(141, 182, 0, 0.6);
    border-radius: 50%;
    animation: float-particle 20s linear infinite;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.particle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: rgba(141, 182, 0, 1);
    font-size: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.particle:nth-child(1)::before { content: '\f187'; } /* Cabinet */
.particle:nth-child(2)::before { content: '\f2dc'; } /* Fridge */
.particle:nth-child(3)::before { content: '\f043'; } /* Sink */
.particle:nth-child(4)::before { content: '\f26b'; } /* Stove */
.particle:nth-child(5)::before { content: '\f187'; } /* Cabinet again */

.particle:hover {
    width: 16px;
    height: 16px;
    background: rgba(141, 182, 0, 0.2);
    box-shadow: 0 0 15px rgba(141, 182, 0, 0.8);
}

.particle:hover::before {
    opacity: 1;
}

.particle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 30%; left: 70%; animation-delay: 2s; }
.particle:nth-child(3) { top: 50%; left: 10%; animation-delay: 4s; }
.particle:nth-child(4) { top: 70%; left: 80%; animation-delay: 6s; }
.particle:nth-child(5) { top: 20%; left: 50%; animation-delay: 8s; }

@keyframes float-particle {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-100vh) rotate(180deg); opacity: 0.8; }
    100% { transform: translateY(-200vh) rotate(360deg); opacity: 0; }
}

/* Gradient background animation */
body {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef, #f8f9fa);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Text outline utility */
.text-outline {
    -webkit-text-stroke: 1px #000;
    -webkit-text-fill-color: transparent;
}

/* Enhanced glass panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(141, 182, 0, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Hover effects */
.btn-magnetic {
    transition: all 0.3s ease;
}

.btn-magnetic:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(141, 182, 0, 0.3);
}

/* =======================================================
   BLOG MODAL STYLES
   ======================================================= */

#blog-modal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#blog-modal.show {
    opacity: 1;
    pointer-events: auto;
}

#blog-modal .glass-panel {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(50px) saturate(200%) contrast(1.2);
    border: 1px solid rgba(141, 182, 0, 0.2);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#modal-backdrop {
    animation: fadeIn 0.4s ease;
    backdrop-filter: blur(12px);
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1; 
        backdrop-filter: blur(12px);
    }
}

#blog-modal .glass-panel {
    animation: slideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal content styling */
#modal-content {
    max-width: none;
    padding-bottom: 2rem;
    direction: rtl;
    text-align: right;
}

#modal-content > div {
    width: 100%;
}

#modal-content .flex.items-center.gap-2 {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(141, 182, 0, 0.2);
}

#modal-content h2 {
    color: #1a1a1a;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    line-height: 1.2;
}

#modal-content h3 {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1.5rem 0;
    line-height: 1.3;
}

#modal-content p {
    color: #374151;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

#modal-content ul {
    list-style: disc;
    margin: 1.5rem 0;
    padding-right: 2rem;
}

#modal-content li {
    color: #374151;
    margin-bottom: 0.75rem;
    line-height: 1.7;
    font-size: 1.1rem;
}

#modal-content .prose {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

#modal-content .prose p:last-child {
    margin-bottom: 0;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    #blog-modal .glass-panel {
        margin: 1rem;
        padding: 2rem;
        max-height: 95vh;
    }
    
    #modal-close {
        top: 1rem;
        left: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    #modal-content h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    #modal-content h3 {
        font-size: 1.25rem;
        margin: 2rem 0 1rem 0;
    }
    
    #modal-content p {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    #modal-content li {
        font-size: 1rem;
    }
}
