/* ============================================================
   SWIFTECH — Global Premium Design System (Elite Edition)
   Architecture: Tokens, Reset, Base, Components, Layout, Utils.
   ============================================================ */

/* ---------- 01 DESIGN TOKENS ---------- */
:root {
    /* Brand Tokens */
    --brand-primary: #6366f1;
    --brand-primary-hover: #4338ca;
    --brand-primary-soft: #a5b4fc;
    --brand-secondary: #fbbf24;
    --brand-accent: #10b981;

    /* Semantic Tokens */
    --primary: var(--brand-primary);
    --primary-rgb: 99, 102, 241;
    --primary-dark: var(--brand-primary-hover);
    --primary-light: var(--brand-primary-soft);
    --primary-glow: rgba(var(--primary-rgb), 0.3);

    --secondary: var(--brand-secondary);
    --secondary-rgb: 251, 191, 36;

    --accent: var(--brand-accent);
    --accent-rgb: 16, 185, 129;

    --error: #ef4444;
    --error-rgb: 239, 68, 68;

    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;

    /* Surface Palette (Premium Dark) */
    --bg: #03000a;
    --surface: #0a0712;
    --surface-alt: #120f1e;
    --surface-glass: rgba(10, 7, 18, 0.75);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Text System */
    --text: #f8fafc;
    --text-soft: #94a3b8;
    --text-muted: #64748b;
    --white: #ffffff;

    /* Spacing System (8px Grid) */
    --sp-0-5: 4px;
    --sp-1: 8px;
    --sp-1-5: 12px;
    --sp-2: 16px;
    --sp-2-5: 20px;
    --sp-3: 24px;
    --sp-4: 32px;
    --sp-5: 40px;
    --sp-6: 48px;
    --sp-8: 64px;
    --sp-10: 80px;
    --sp-12: 96px;

    --section-y: clamp(64px, 10vw, 128px);

    /* Radius */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-xl: 48px;
    --radius-pill: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-spring: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    --transition-fast: 200ms var(--ease);
    --transition: 400ms var(--ease);
    --transition-slow: 700ms var(--ease);
}

/* ---------- 02 BASE RESET & DEFAULTS ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    font-size: 16px;
    overflow-x: hidden;
}

#scroll-progress {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 1001;
    width: 0%;
    transition: width 0.1s linear;
}

#sw-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s;
}
#sw-preloader.loaded {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
}
.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(var(--primary-rgb), 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loader-text {
    font-weight: 900;
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    color: var(--text-soft);
    animation: pulse 2s infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100%;
}

[lang="ar"] body {
    font-family: 'Cairo', 'Tajawal', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
    line-height: 1.8;
}

a { color: inherit; text-decoration: none; transition: color var(--transition), opacity var(--transition); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; background: none; border: none; color: inherit; outline: none; }
button { cursor: pointer; border: none; }
ul { list-style: none; }

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    inset-inline-start: var(--sp-3);
    background: var(--primary);
    color: white;
    padding: var(--sp-2) var(--sp-3);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 9999;
    transition: top 0.3s;
}
.skip-link:focus { top: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* ---------- 03 TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5 {
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: 0;
    color: var(--white);
}

h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 5vw, 3rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
h4 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-soft); }

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sw-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary);
    margin-bottom: var(--sp-2);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }

/* ---------- 04 LAYOUT ---------- */
.sw-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--sp-3);
}

.sw-section { padding: var(--section-y) 0; }
.sw-grid { display: grid; gap: var(--sp-3); }

/* View Management */
.app-view { display: none; }
.app-view.active { display: block; animation: viewFade 0.6s var(--ease) both; }

@keyframes viewFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Routing Logic */
.sw-page-section { display: none; }
.sw-page-section.active { display: block; animation: sectionFade 0.6s var(--ease) both; }

@keyframes sectionFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 05 COMPONENTS ---------- */

/* Buttons */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    gap: 12px;
    border: 1px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.sw-btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}
.sw-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.5), 0 0 15px rgba(var(--primary-rgb), 0.2);
    background-color: var(--primary-dark);
}
.sw-btn-primary:active { transform: translateY(0) scale(0.98); }

.sw-btn-secondary {
    background-color: var(--surface-alt);
    border-color: var(--border);
    color: var(--text);
    backdrop-filter: blur(10px);
}
.sw-btn-secondary:hover {
    border-color: var(--primary);
    background-color: var(--surface);
    color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* Glass & Cards */
.sw-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.sw-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sw-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--primary-rgb), 0.1);
}
.sw-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.03) 100%);
    pointer-events: none;
}

/* Forms */
.sw-form { display: grid; gap: var(--sp-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

.input-group { display: grid; gap: var(--sp-1); }
.input-group label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input,
.input-group select,
.input-group textarea {
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    color: var(--white);
    width: 100%;
    transition: all var(--transition);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    outline: none;
}

.input-group textarea { min-height: 140px; resize: vertical; }

/* ---------- 06 NAVIGATION ---------- */
.sw-header {
    position: fixed;
    top: 0; inset-inline-start: 0; inset-inline-end: 0;
    z-index: 1000;
    height: 90px;
    display: flex;
    align-items: center;
    transition: background var(--transition), height var(--transition), border var(--transition);
}
.sw-header.scrolled {
    background-color: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 70px;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sw-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: -0.04em;
    color: var(--white);
    transition: transform var(--transition-fast);
}
.sw-logo:hover {
    transform: scale(1.02);
}
.sw-logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    transition: transform var(--transition-fast);
}
.sw-logo:hover img {
    transform: rotate(-10deg) scale(1.1);
}

#lang-toggle {
    margin-inline-end: 10px;
}

.sw-nav { display: flex; gap: var(--sp-1); }
.nav-link {
    padding: 10px 20px;
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-pill);
    transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
    color: var(--white);
    background-color: rgba(var(--primary-rgb), 0.1);
}
.nav-link.active {
    color: var(--primary-light);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.menu-toggle:hover { background: rgba(255,255,255,0.05); }

.menu-toggle .bar {
    width: 24px;
    height: 2px;
    background-color: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.is-active .bar {
    background-color: var(--white);
}

.menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg) scaleX(1.1); }
.menu-toggle.is-active .bar:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg) scaleX(1.1); }

/* --- Mobile Drawer Navigation --- */
@media (max-width: 1024px) {
    .sw-nav {
        position: fixed;
        top: 0; inset-inline-start: 0; inset-inline-end: 0; bottom: 0;
        background: radial-gradient(circle at center, var(--surface-alt), var(--bg));
        flex-direction: column;
        justify-content: center;
        padding: var(--sp-12) var(--sp-6);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.6s var(--ease-spring);
        z-index: 2000;
    }
    [dir="rtl"] .sw-nav { transform: translateY(-100%); }
    .sw-nav.active { transform: translateY(0); opacity: 1; visibility: visible; }
    [dir="rtl"] .sw-nav.active { transform: translateY(0); }

    .sw-nav .nav-link {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s var(--ease-out);
    }
    .sw-nav.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }
    .sw-nav.active .nav-link:nth-child(1) { transition-delay: 0.1s; }
    .sw-nav.active .nav-link:nth-child(2) { transition-delay: 0.15s; }
    .sw-nav.active .nav-link:nth-child(3) { transition-delay: 0.2s; }
    .sw-nav.active .nav-link:nth-child(4) { transition-delay: 0.25s; }
    .sw-nav.active .nav-link:nth-child(5) { transition-delay: 0.3s; }
    .sw-nav.active .nav-link:nth-child(6) { transition-delay: 0.35s; }

    .nav-link {
        width: 100%;
        padding: 15px;
        border-radius: var(--radius-md);
        text-align: center;
        font-size: 1.8rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }
    .menu-toggle {
        display: flex;
        z-index: 3000;
        position: relative;
    }

    .sw-header.scrolled .menu-toggle {
        margin-top: 0;
    }
}

/* ---------- 07 PUBLIC SECTIONS ---------- */

/* Hero */
.sw-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: var(--sp-6);
}
.hero-title { margin-bottom: var(--sp-3); }
.hero-lead {
    font-size: 1.25rem;
    color: var(--text-soft);
    margin-bottom: var(--sp-6);
    max-width: 600px;
}
.hero-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.hero-visual { position: relative; }
.visual-container {
    aspect-ratio: 1/1;
    display: grid;
    place-items: center;
    position: relative;
}
.hero-img {
    width: 85%;
    height: 85%;
    object-fit: cover;
    border-radius: 24%;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-strong);
    animation: imageFloat 6s var(--ease) infinite alternate;
}

@keyframes imageFloat {
    from { transform: translateY(0) rotate(0deg); }
    to { transform: translateY(-15px) rotate(2deg); }
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}
.orb-1 {
    width: 60%; height: 60%;
    background: var(--primary);
    top: -10%; inset-inline-start: -10%;
    animation: float 15s infinite alternate ease-in-out;
}
.orb-2 {
    width: 50%; height: 50%;
    background: var(--accent); /* Changed from secondary for better blend */
    bottom: -10%; inset-inline-end: -10%;
    animation: float 18s infinite alternate-reverse ease-in-out;
}
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(40px, -20px) scale(1.1) rotate(5deg); }
    66% { transform: translate(-20px, 40px) scale(0.9) rotate(-5deg); }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

/* Services */
.services-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.service-icon-box {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, transparent 100%);
    color: var(--primary);
    display: grid; place-items: center;
    font-size: 1.8rem;
    margin-bottom: var(--sp-3);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    transition: transform var(--transition);
}
.sw-card:hover .service-icon-box {
    transform: scale(1.1) rotate(5deg);
    background: rgba(var(--primary-rgb), 0.2);
}

/* Showcase */
.showcase-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.template-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.template-media {
    aspect-ratio: 16/10;
    position: relative;
    overflow: hidden;
    background-color: var(--surface-alt);
}
.template-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.template-card:hover .template-media img { transform: scale(1.05); }

.template-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--primary-rgb), 0.2);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.template-card:hover .template-overlay {
    opacity: 1;
}

.template-body {
    padding: var(--sp-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}
.template-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: var(--sp-2); }
.template-cat {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

/* Portfolio */
.portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.portfolio-card { padding: 0; overflow: hidden; }
.portfolio-media { aspect-ratio: 4/3; }
.portfolio-media img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-info { padding: var(--sp-3); }

/* FAQ */
.faq-container { max-width: 900px; margin: 0 auto; display: grid; gap: var(--sp-2); }
.faq-item {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.faq-item:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
}
.faq-item[open] {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}
.faq-item summary {
    padding: var(--sp-3) var(--sp-4);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    transition: background var(--transition-fast);
}
.faq-item summary:hover { background: var(--surface-alt); }
.faq-item summary .icon {
    transition: transform var(--transition-fast);
}
.faq-item[open] summary .icon {
    transform: rotate(180deg);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-answer {
    padding: var(--sp-3) var(--sp-4);
    color: var(--text-soft);
    font-size: 1rem;
    background: var(--surface);
    line-height: 1.6;
}

/* Contact */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.4fr; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.contact-info-panel { padding: var(--sp-8); background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, transparent 100%); }
.contact-info-panel h2 { margin-bottom: var(--sp-4); }
.direct-contact { margin: var(--sp-6) 0; display: grid; gap: var(--sp-4); }
.contact-item { display: flex; align-items: center; gap: var(--sp-3); }
.contact-item .icon { font-size: 1.8rem; color: var(--primary); }
.contact-item label { display: block; font-size: 0.65rem; font-weight: 800; color: var(--text-muted); margin-bottom: 4px; }
.contact-item a { font-size: 1.1rem; font-weight: 600; }

.social-panel { display: flex; gap: var(--sp-2); }
.social-link {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: grid; place-items: center;
    font-weight: 800; font-size: 0.75rem;
    transition: all var(--transition-fast);
}
.social-link:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.3);
}

.contact-form-panel { padding: var(--sp-8); border-inline-start: 1px solid var(--border); }

/* Footer */
.sw-footer { padding: var(--sp-12) 0 var(--sp-6); border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-8); margin-bottom: var(--sp-8); }
.footer-col-brand .sw-logo { margin-bottom: var(--sp-3); }
.footer-col-brand p { color: var(--text-soft); max-width: 320px; }
.footer-col-links h4 { margin-bottom: var(--sp-4); font-size: 0.9rem; text-transform: uppercase; color: var(--white); }
.footer-col-links nav { display: grid; gap: var(--sp-2); }
.footer-col-links nav a { color: var(--text-soft); font-size: 0.95rem; }
.footer-col-links nav a:hover { color: var(--primary); padding-inline-start: 5px; }

.footer-bottom {
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: var(--sp-3);
}
.footer-socials { display: flex; gap: var(--sp-3); }
.footer-socials a {
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: inline-block;
}
.footer-socials a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

/* ---------- 08 UTILS & ANIMATIONS ---------- */
.toast-stack { position: fixed; bottom: var(--sp-4); inset-inline-end: var(--sp-4); z-index: 3000; display: grid; gap: var(--sp-2); }
.toast {
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    background: var(--surface-glass);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--white);
    animation: toastIn 0.4s var(--ease) both;
    max-width: 360px;
    position: relative;
    overflow: hidden;
}

.toast.success { border-inline-start: 4px solid var(--success); }
.toast.error { border-inline-start: 4px solid var(--error); }
.toast.info { border-inline-start: 4px solid var(--info); }

.toast.fade-out { animation: toastOut 0.4s var(--ease) both; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(var(--toast-translate-in)) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(var(--toast-translate-out)) scale(0.9); }
}

:root {
    --toast-translate-in: 100%;
    --toast-translate-out: 100%;
}

[dir="rtl"] {
    --toast-translate-in: -100%;
    --toast-translate-out: -100%;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 2px;
}
.toast.success .toast-icon { background: var(--success); color: white; }
.toast.error .toast-icon { background: var(--error); color: white; }
.toast.info .toast-icon { background: var(--info); color: white; }

.toast-content strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.toast-content p { font-size: 0.85rem; color: var(--text-soft); line-height: 1.4; }

[data-sw-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
    will-change: opacity, transform;
}
[data-sw-reveal].is-revealed { opacity: 1; transform: translateY(0); }

.empty-state { padding: var(--sp-8); text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: var(--radius-md); }

/* Skeleton */
.sw-skeleton {
    background: linear-gradient(90deg, var(--surface-alt) 25%, rgba(255,255,255,0.05) 50%, var(--surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton 2s infinite ease-in-out;
    border-radius: var(--radius-sm);
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-card {
    pointer-events: none;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

/* Filter Buttons */
.filter-wrap {
    display: flex;
    gap: var(--sp-2);
    overflow-x: auto;
    padding: var(--sp-1) 0 var(--sp-2);
    margin-bottom: var(--sp-4);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.filter-wrap::-webkit-scrollbar { display: none; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-weight: 700;
    white-space: nowrap;
    transition: all var(--transition-fast);
    font-size: 0.85rem;
    color: var(--text-soft);
}
.filter-btn:hover { border-color: var(--primary-light); color: var(--white); }
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-count {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    opacity: 0.8;
}
.filter-btn.active .btn-count { background: rgba(0,0,0,0.2); opacity: 1; }

/* Status Pills */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}
.status-pill.new { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
.status-pill.replied { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.status-pill.success { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.status-pill.warning { background: rgba(var(--secondary-rgb), 0.1); color: var(--warning); }
.status-pill.danger { background: rgba(var(--error-rgb), 0.1); color: var(--error); }

/* ---------- 09 MODALS ---------- */
.sw-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-3);
}
.sw-modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); }
.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.5s var(--ease) both;
    width: 100%;
    max-width: 650px;
    padding: var(--sp-8);
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.close-btn {
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), transform var(--transition-fast);
    border: none;
    background: none;
    padding: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-btn:hover {
    color: var(--white);
    transform: scale(1.1);
}

/* Preview Modal */
.preview-modal .modal-content {
    max-width: 90vw;
    width: 1200px;
    height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.preview-header {
    height: 60px;
    padding: 0 var(--sp-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}

.device-switcher {
    display: flex;
    gap: var(--sp-2);
    background: var(--surface);
    padding: 4px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.device-btn {
    width: 44px; /* Improved touch target */
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    opacity: 0.6;
    font-size: 1.2rem;
}

.device-btn.active {
    background: var(--primary);
    opacity: 1;
}

.preview-body {
    flex: 1;
    background: #f1f5f9;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

#preview-frame {
    width: 100%;
    height: 100%;
    transition: width 0.4s var(--ease);
    background: white;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .preview-modal .modal-content { height: 100vh; max-height: none; border-radius: 0; }
    .device-switcher { display: none; }
}

/* ---------- 10 RESPONSIVE ---------- */
@media (max-width: 1200px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-lead { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
    .sw-header { height: 76px; }
    .contact-wrapper { grid-template-columns: 1fr; }
    .contact-form-panel { border-left: none; border-top: 1px solid var(--border); }
    .hide-mobile { display: none; }
}

@media (max-width: 768px) {
    :root { --section-y: 64px; }
    .form-row { grid-template-columns: 1fr; }
    .contact-info-panel, .contact-form-panel { padding: var(--sp-8) var(--sp-4); }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .hero-lead { font-size: 1.1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
    .preview-modal .modal-content { height: 100vh; max-height: none; border-radius: 0; width: 100vw; max-width: none; }
    .device-switcher { display: none; }
    .sw-logo span { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .sw-container { padding: 0 var(--sp-2); }
    .hero-actions .sw-btn { width: 100%; }
    .services-grid, .showcase-grid, .portfolio-grid { grid-template-columns: 1fr; }
    .sw-logo img { width: 32px; height: 32px; }
    .sw-logo span { font-size: 1.1rem; }
}
