/* ==========================================================================
   1. CSS Variables (Soft & Clean)
   ========================================================================== */
:root {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --accent: #c084fc;
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-gray: #64748b;
    --card-bg: rgba(255, 255, 255, 0.8); /* Slight transparency for glass effect */
    --border-color: rgba(226, 232, 240, 0.8);
    --header-bg: rgba(248, 250, 252, 0.85);
    --font-main: 'Inter', sans-serif;
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --primary: #a78bfa;
    --primary-hover: #c4b5fd;
    --accent: #e879f9;
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-gray: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.6);
    --border-color: rgba(51, 65, 85, 0.6);
    --header-bg: rgba(15, 23, 42, 0.85);
}

/* Arabic typography: Inter still draws Latin letters and digits, so Arabic pages
   only download the Arabic glyphs of IBM Plex Sans Arabic */
html[lang="ar"] { --font-main: 'Inter', 'IBM Plex Sans Arabic', sans-serif; }

/* ==========================================================================
   2. Base Reset & Typography
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Soft background glow */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(600px circle at 10% 0%, rgba(124, 58, 237, 0.08), transparent 60%),
        radial-gradient(500px circle at 90% 30%, rgba(232, 121, 249, 0.06), transparent 60%);
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

code, pre, .code-block, .code-block * { font-family: 'Fira Code', Consolas, monospace; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 40px;
    font-weight: 700;
}

/* Gradient Text Highlight */
.brand-name {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    font-weight: inherit;
}

.highlight { color: var(--primary); }

/* ==========================================================================
   3. Modern, Friendly Buttons (Pill Shaped)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px; /* Friendly pill shape */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.3s var(--ease-out);
}

.btn i { transition: transform 0.3s ease; }
.btn:hover i { transform: translateX(4px); }
[dir="rtl"] .btn:hover i { transform: translateX(-4px); }

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* Outline Button */
.btn-outline {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.1);
}

.btn-submit:hover i { transform: translate(4px, -4px); }
[dir="rtl"] .btn-submit:hover i { transform: translate(-4px, -4px); }
.btn:disabled { opacity: 0.7; cursor: wait; transform: none; }

/* Icons that point "forward" flip in RTL */
[dir="rtl"] .fa-arrow-right, [dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-chevron-right, [dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-paper-plane { transform: scaleX(-1); }

/* ==========================================================================
   4. Header & Glassmorphism Navigation
   ========================================================================== */
.main-header {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(12px); /* Beautiful frosted glass effect */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 15px 0;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}
.main-header.scrolled { padding: 10px 0; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06); }

.header-container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; color: var(--text-color); text-decoration: none; }
.nav-links { display: flex; list-style: none; gap: 25px; }

.nav-links a {
    position: relative;
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    padding: 4px 0;
}
.nav-links a::after {
    content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0); transition: transform 0.3s var(--ease-out);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after, .nav-links a:hover::after { transform: scaleX(1); }

.nav-controls { display: flex; gap: 15px; align-items: center; }
.icon-btn { background: none; border: none; color: var(--text-color); font-size: 1.2rem; cursor: pointer; transition: color 0.3s ease; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn:hover { color: var(--primary); }
.lang-label { font-size: 0.8rem; font-weight: 700; }
.mobile-menu-toggle { display: none; background: none; border: none; color: var(--text-color); font-size: 1.5rem; cursor: pointer; }

/* ==========================================================================
   5. Dynamic Content & Animations
   ========================================================================== */
.view-container { flex: 1; padding: 40px 20px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.animation-fade-in { animation: fadeIn 0.5s var(--ease-out) forwards; }

.reveal-on-scroll {
    opacity: 0; transform: translateY(50px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    will-change: opacity, transform;
}
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* Children of a revealed grid appear one after another.
   Uses the `translate` property so card hover `transform`s keep working. */
@keyframes staggerIn { from { opacity: 0; translate: 0 25px; } to { opacity: 1; translate: 0 0; } }
.stagger > * { opacity: 0; }
.stagger.is-visible > * { animation: staggerIn 0.6s var(--ease-out) both; }
.stagger.is-visible > *:nth-child(2) { animation-delay: 0.1s; }
.stagger.is-visible > *:nth-child(3) { animation-delay: 0.2s; }
.stagger.is-visible > *:nth-child(4) { animation-delay: 0.3s; }
.stagger.is-visible > *:nth-child(5) { animation-delay: 0.4s; }
.stagger.is-visible > *:nth-child(6) { animation-delay: 0.5s; }


/* ==========================================================================
   6. Soft, Floating Cards (Global for all views)
   ========================================================================== */
.prop-card, .about-card, .testi-card, .project-card, .blog-card,
.service-card, .info-card, .contact-form-wrapper, .showcase-container {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 20px; /* Soft, friendly corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.6s var(--ease-out);
}

.prop-card:hover, .about-card:hover, .testi-card:hover, .project-card:hover,
.blog-card:hover, .service-card:hover {
    transform: translateY(-8px); /* Smooth float upward */
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.08); /* Soft purple glow */
    border-color: rgba(124, 58, 237, 0.3);
}

.prop-icon, .service-icon, .info-icon {
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary);
    border-radius: 14px;
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}
.prop-card:hover .prop-icon { background: var(--primary); color: #fff; transform: scale(1.05) rotate(-4deg); }

/* ==========================================================================
   7. Tags & Badges (Soft Pill Style)
   ========================================================================== */
.skill-tag, .tech-badge, .meta-category {
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary);
    border: 1px solid transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.skill-tag:hover, .tech-badge:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
}
.skill-tag:hover i { color: #fff; }

/* ==========================================================================
   8. Clean Inputs & Forms
   ========================================================================== */
.form-group { margin-bottom: 20px; }

.form-control, .search-container input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5); /* Semi-transparent */
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: inherit;
    outline: none;
}
[data-theme="dark"] .form-control { background: rgba(0, 0, 0, 0.2); }

.form-control:focus, .search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    background: var(--card-bg);
}

.form-status { display: none; margin-bottom: 20px; padding: 14px 18px; border-radius: 12px; font-weight: 500; }
.form-status.success { display: block; background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.form-status.error { display: block; background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   9. Home Page
   ========================================================================== */
.home-hero { position: relative; min-height: 85vh; padding-bottom: 120px; display: flex; align-items: center; justify-content: space-between; gap: 50px; flex-wrap: wrap; }
.home-content { flex: 1; min-width: 300px; }
.home-content h1 { font-size: clamp(2.8rem, 8vw, 4.5rem); margin-bottom: 10px; line-height: 1.1; }
.home-content h2 { font-size: clamp(1.2rem, 4vw, 1.8rem); color: var(--text-gray); margin-bottom: 25px; font-weight: 400; min-height: 1.5em; }
.home-content p { max-width: 600px; margin-bottom: 35px; color: var(--text-gray); font-size: 1.1rem; line-height: 1.7; }
.hero-visual { flex: 1; display: flex; justify-content: center; align-items: center; min-width: 300px; }

/* Typing caret for the rotating hero role */
.typed-role::after { content: "|"; margin-inline-start: 2px; color: var(--primary); animation: caretBlink 1s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: var(--text-gray); font-size: 0.8rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
    animation: fadeIn 2s ease forwards;
}
[lang="ar"] .scroll-indicator { letter-spacing: 0; }
.scroll-indicator i { font-size: 1.2rem; color: var(--primary); animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.smart-ball {
    width: clamp(250px, 40vw, 350px); height: clamp(250px, 40vw, 350px); position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 40%, var(--accent) 70%, var(--primary) 100%);
    background-size: 300% 300%; border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: inset 15px 15px 40px rgba(255, 255, 255, 0.2), inset -15px -15px 40px rgba(0, 0, 0, 0.2), 0 15px 45px rgba(124, 58, 237, 0.3);
    animation: highWavesMorph 6s ease-in-out infinite alternate, liquidColorFlow 10s linear infinite;
    transition: translate 0.2s ease-out;
}
.smart-ball::before {
    content: ""; position: absolute; top: 10%; left: 15%; width: 50%; height: 40%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.4) 0%, transparent 70%); border-radius: 50%; filter: blur(5px);
    animation: lightShimmer 4s ease-in-out infinite alternate;
}
@keyframes highWavesMorph { 0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: scale(1); } 33% { border-radius: 50% 50% 30% 70% / 50% 70% 30% 50%; transform: scale(1.05); } 66% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; transform: scale(0.98); } 100% { border-radius: 40% 60% 40% 60% / 60% 40% 60% 40%; transform: scale(1.02); } }
@keyframes liquidColorFlow { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
@keyframes lightShimmer { 0% { transform: translate(-10px, -5px) scale(0.8); opacity: 0.5; } 100% { transform: translate(15px, 10px) scale(1.2); opacity: 0.8; } }

.value-props { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; padding-top: 40px; border-top: 1px solid var(--border-color); }
.prop-card { padding: 30px; }
.prop-card h3 { font-size: 1.25rem; margin-bottom: 12px; color: var(--text-color); }
.prop-card p { color: var(--text-gray); font-size: 0.95rem; line-height: 1.6; }

.home-services { padding: 80px 0; border-top: 1px solid var(--border-color); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.service-card { padding: 40px 30px; text-align: center; }
.service-card .service-icon { margin: 0 auto 20px; font-size: 1.8rem; }
.service-title { font-size: 1.3rem; margin-bottom: 15px; color: var(--text-color); }
.service-desc { color: var(--text-gray); font-size: 0.95rem; }

/* Code Showcase */
.code-showcase { padding: 60px 0; border-top: 1px solid var(--border-color); margin-top: 40px; }
.showcase-container { display: flex; flex-wrap: wrap; overflow: hidden; padding: 0; }
.showcase-sidebar { width: 100%; flex: 1 1 300px; background: var(--bg-color); border-inline-end: 1px solid var(--border-color); padding: 20px 0; }
.showcase-tab { display: block; width: 100%; text-align: start; background: none; border: none; color: inherit; padding: 15px 20px; cursor: pointer; border-inline-start: 3px solid transparent; transition: all 0.3s ease; }
.showcase-tab:hover { background: rgba(124, 58, 237, 0.05); }
.showcase-tab.active { background: rgba(124, 58, 237, 0.1); border-inline-start-color: var(--primary); }
.showcase-tab h4 { font-size: 0.95rem; margin-bottom: 5px; color: var(--text-color); font-weight: 600; }
.showcase-tab p { font-size: 0.8rem; color: var(--text-gray); }
.showcase-content { flex: 2 1 500px; padding: 20px; background: #1e1e1e; direction: ltr; text-align: left; min-width: 0; }
.mock-window-header { display: flex; gap: 8px; margin-bottom: 20px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.code-block { font-size: 0.9rem; color: #d4d4d4; overflow-x: auto; margin: 0; transition: opacity 0.25s ease; }
.code-block.switching { opacity: 0; }
.code-block .k { color: #c586c0; }  /* control keywords */
.code-block .d { color: #569cd6; }  /* declarations */
.code-block .f { color: #dcdcaa; }  /* functions */
.code-block .c { color: #4ec9b0; }  /* classes */
.code-block .s { color: #ce9178; }  /* strings */
.code-block .n { color: #b5cea8; }  /* numbers */

/* Testimonials marquee (always scrolls LTR; cards follow the page direction) */
.testimonials { overflow: hidden; padding: 80px 0; border-top: 1px solid var(--border-color); }
.marquee-wrapper { position: relative; width: 100vw; margin-left: calc(-50vw + 50%); display: flex; overflow: hidden; padding: 20px 0; direction: ltr; }
.marquee-wrapper::before, .marquee-wrapper::after { content: ""; position: absolute; top: 0; width: 15vw; height: 100%; z-index: 2; pointer-events: none; }
.marquee-wrapper::before { left: 0; background: linear-gradient(to right, var(--bg-color), transparent); }
.marquee-wrapper::after { right: 0; background: linear-gradient(to left, var(--bg-color), transparent); }
.marquee-track { display: flex; gap: 30px; width: max-content; animation: scrollMarquee 40s linear infinite; }
.marquee-wrapper:hover .marquee-track { animation-play-state: paused; }
.marquee-track .testi-card { width: 450px; flex-shrink: 0; white-space: normal; margin: 0; padding: 30px; position: relative; }
[dir="rtl"] .marquee-track .testi-card { direction: rtl; }
.testi-card::before { content: "\201C"; position: absolute; top: 10px; inset-inline-end: 20px; font-size: 4rem; color: rgba(124, 58, 237, 0.1); font-family: Georgia, serif; line-height: 1; }
.testi-text { color: var(--text-gray); font-style: italic; margin-bottom: 20px; position: relative; z-index: 2; line-height: 1.6; }
[lang="ar"] .testi-text { font-style: normal; }
.testi-author { display: flex; align-items: center; gap: 15px; }
.testi-avatar { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; flex-shrink: 0; }
.testi-info h4 { font-size: 1rem; color: var(--text-color); margin-bottom: 3px; }
.testi-info p { font-size: 0.85rem; color: var(--text-gray); }
@keyframes scrollMarquee { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-50% - 15px)); } }

/* Home Connection */
.home-connection { padding: 60px 0; border-top: 1px solid var(--border-color); text-align: center; }
.home-connection > p { color: var(--text-gray); }
.contact-form-wrapper { max-width: 600px; margin: 40px auto 0; padding: 40px; text-align: start; }
.btn-block { width: 100%; }

/* Card & hero images (project images are set via "image" in js/data.js; the icon is the fallback) */
.project-image-placeholder, .featured-image, .blog-image-placeholder, .single-post-hero { position: relative; overflow: hidden; }
.project-image-placeholder img, .featured-image img, .blog-image-placeholder img, .single-post-hero img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.6s var(--ease-out);
}
.project-card:hover .project-image-placeholder img, .featured-post:hover .featured-image img,
.blog-card:hover .blog-image-placeholder img { transform: scale(1.06); }

/* Profile photo: drop images/profile.jpg in place; the initials show until then */
.avatar-photo { position: relative; overflow: hidden; }
.avatar-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Keeps [hidden] working on elements that set their own display, such as .btn */
[hidden] { display: none !important; }

/* Honeypot: invisible to people, so only spam bots fill it in */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Popup (certificate viewer) */
.modal {
    position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 20px;
    background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    /* visibility flips instantly on open (so focus can move inside) and only after the fade on close */
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.modal.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
.modal-dialog {
    width: min(100%, 860px); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    transform: translateY(24px) scale(0.96); transition: transform 0.4s var(--ease-out);
}
.modal.open .modal-dialog { transform: none; }
.modal-header { display: flex; align-items: center; gap: 15px; padding: 18px 22px; border-bottom: 1px solid var(--border-color); }
.modal-icon {
    width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent));
}
.modal-title { font-size: 1.1rem; line-height: 1.4; }
.modal-sub { font-size: 0.85rem; color: var(--text-gray); }
.modal-close {
    margin-inline-start: auto; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
    color: var(--text-color); background: rgba(124, 58, 237, 0.08); transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.modal-close:hover { background: var(--primary); color: #fff; transform: rotate(90deg); }
.modal-body {
    flex: 1; min-height: 220px; overflow: auto; padding: 22px; display: grid; place-items: center;
    background: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.08), transparent 70%);
}
.modal-body img { max-width: 100%; max-height: calc(100vh - 230px); border-radius: 12px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25); }
.modal-body iframe { width: 100%; height: calc(100vh - 230px); border: 0; border-radius: 12px; background: #fff; }
.modal-external { text-align: center; color: var(--text-gray); display: grid; gap: 18px; justify-items: center; }
.modal-external > i { font-size: 3.5rem; color: var(--primary); }
.modal-footer { display: flex; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border-color); }
.modal-footer[hidden] { display: none; }
.modal-footer .btn { padding: 10px 22px; font-size: 0.9rem; }
body.modal-open { overflow: hidden; }

/* Simple centered message views (404, coming soon) */
.message-view { text-align: center; padding: 80px 20px; max-width: 560px; margin: 0 auto; }
.message-view .message-icon { font-size: 4rem; color: var(--primary); margin-bottom: 20px; }
.message-view .message-code { font-size: clamp(4rem, 15vw, 7rem); font-weight: 800; line-height: 1; margin-bottom: 10px; }
.message-view p { color: var(--text-gray); margin: 15px 0 30px; }

/* ==========================================================================
   10. Footer Styles
   ========================================================================== */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 0; text-align: center; color: var(--text-gray);
}
.footer-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.footer-links { display: flex; gap: 15px; }
.footer-links a { color: var(--text-gray); font-size: 1.3rem; transition: color 0.3s ease, transform 0.3s ease; display: inline-block; }
.footer-links a:hover { color: var(--primary); transform: translateY(-2px); }

/* ==========================================================================
   11. Utilities & Media Queries
   ========================================================================== */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: -35px; left: 50%; transform: translateX(-50%);
    background: var(--text-color); color: var(--bg-color); padding: 6px 12px; border-radius: 8px; font-size: 0.8rem;
    font-weight: 500; white-space: nowrap; z-index: 100; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#backToTop {
    position: fixed; bottom: 30px; inset-inline-end: 30px; background: var(--primary); color: #fff; border: none; border-radius: 50%;
    width: 50px; height: 50px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3); transition: all 0.3s ease; z-index: 999;
    opacity: 0; visibility: hidden; transform: translateY(20px);
}
#backToTop.visible { opacity: 1; visibility: visible; transform: none; }
#backToTop:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4); }

@media (max-width: 900px) {
    .mobile-menu-toggle { display: block; order: 3; }
    .main-nav {
        position: absolute; top: 100%; inset-inline: 0;
        background: var(--bg-color); /* solid: backdrop-filter doesn't work inside the blurred header */
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease-out);
    }
    .main-nav.open { max-height: 480px; }
    .nav-links { flex-direction: column; gap: 0; padding: 10px 20px 20px; }
    .nav-links a { display: block; padding: 12px 0; font-size: 1.05rem; }
    .nav-links a::after { display: none; }
    .nav-controls { margin-inline-start: auto; }
    .logo { white-space: nowrap; font-size: 1.05rem; }
    .footer-container { justify-content: center; flex-direction: column-reverse; }
}

@media (max-width: 768px) {
    .marquee-track .testi-card { width: 320px; }
    .home-hero { min-height: auto; padding-bottom: 100px; }
    .contact-form-wrapper { padding: 25px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
    .reveal-on-scroll, .stagger > * { opacity: 1; transform: none; translate: none; }
}
