@import url('https://fonts.googleapis.com/css2?family=Syncopate:wght@400;700&family=Outfit:wght@100;300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700;800&display=swap');

:root {
    --bg-black: #050505;
    --primary: #00f2ff;
    --primary-dim: rgba(0, 242, 255, 0.1);
    --primary-glow: rgba(0, 242, 255, 0.4);
    --secondary: #ff00ea;
    --accent: #7000ff;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Syncopate', sans-serif;
    --transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-black);
    color: var(--text-white);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 1.6rem;
}

body.loading { overflow: hidden; }

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-black);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
}

.loader-content {
    width: 90%;
    max-width: 80rem;
    text-align: center;
}

.loader-text {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    margin-bottom: 2rem;
    color: var(--text-white);
    white-space: nowrap;
    animation: textBlurPulse 2s infinite alternate;
}

@media (max-width: 768px) {
    .loader-text { font-size: 2rem; letter-spacing: 0.2rem; }
}

@keyframes textBlurPulse {
    from { filter: blur(0px); opacity: 1; }
    to { filter: blur(4px); opacity: 0.4; }
}

.loader-bar {
    width: 0%;
    height: 2px;
    background: var(--primary);
    margin: 0 auto;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    z-index: 10001;
}

/* Background Effects */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(0, 242, 255, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(112, 0, 255, 0.05) 0%, transparent 40%);
    z-index: -2;
}

.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    pointer-events: none;
    z-index: -1;
    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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Aurora Background */
#aurora-canvas {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    pointer-events: none;
    opacity: 0.6;
}

/* Smoke Canvas */
#smoke-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: none;
}

/* Custom Cursor - FIXED Z-INDEX */
.cursor-dot, .cursor-outline, .cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    display: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: width, height, transform, opacity, left, top;
}

@media (pointer: fine) {
    .cursor-dot, .cursor-outline, .cursor-trail { display: block; }
    * { cursor: none !important; }
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 242, 255, 0.5);
    z-index: 10001;
    transition: width 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                height 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                background 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                border-color 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.cursor-trail {
    width: 25px;
    height: 25px;
    background: rgba(0, 242, 255, 0.15);
    filter: blur(8px);
    z-index: 10000;
}

.cursor-outline.hovered {
    width: 90px;
    height: 90px;
    background: rgba(0, 242, 255, 0.08);
    border-color: var(--primary);
    border-width: 2px;
}

.cursor-outline.clicked {
    transform: translate(-50%, -50%) scale(0.6);
    background: var(--primary);
    border-color: var(--primary);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
}

.header.sticky {
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    padding: 1.5rem 10%;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-white);
    text-decoration: none;
}

.logo span {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar { display: flex; align-items: center; gap: 3.5rem; }

.navbar a {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    text-decoration: none;
}

.navbar a:hover, .navbar a.active { color: var(--primary); }

#menu-icon {
    font-size: 3rem;
    color: var(--text-white);
    display: none;
    cursor: pointer;
}

.nav-btn {
    padding: 0.8rem 2rem;
    border: 1px solid var(--primary);
    border-radius: 100px;
    color: var(--primary) !important;
}

.nav-btn:hover { background: var(--primary); color: black !important; }

/* Home Section */
section { padding: 12rem 10% 10rem; }

.home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--primary-dim);
    border: 1px solid var(--primary-glow);
    border-radius: 100px;
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 3rem;
}

.dot-pulse {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 8.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: -4px;
}

.hero-title span {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-animation {
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 3rem;
    color: var(--text-white);
    min-height: 4.5rem;
}

.hero-desc {
    font-size: 1.8rem;
    color: var(--text-gray);
    max-width: 60rem;
    margin-bottom: 4rem;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.btn-premium {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.8rem 3.5rem;
    background: var(--text-white);
    color: black;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.6rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 242, 255, 0.2);
}

.social-minimal {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.social-minimal a {
    width: 4.2rem;
    height: 4.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass);
    transition: var(--transition);
    text-decoration: none;
}

.social-minimal a i {
    font-size: 2rem;
    line-height: 1;
}

.social-minimal a:hover {
    color: var(--primary);
    border-color: var(--primary-glow);
    transform: translateY(-3px);
}

.sep { color: var(--glass-border); }

/* Hero Visual */
.hero-visual { position: relative; }

.image-wrapper {
    position: relative;
    width: 45rem;
    height: 55rem;
}

.hero-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3rem;
    filter: grayscale(0.5) brightness(0.8);
    transition: var(--transition);
    border: 1px solid var(--glass-border);
}

.image-wrapper:hover .hero-portrait {
    filter: grayscale(0) brightness(1);
}

.floating-card {
    position: absolute;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem 2.5rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 2;
    animation: float 4s ease-in-out infinite;
}

.floating-card i { font-size: 2.4rem; color: var(--primary); }
.floating-card span { font-weight: 700; font-size: 1.4rem; }

.c1 { top: 15%; right: -10%; animation-delay: 0s; }
.c2 { bottom: 15%; left: -10%; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Common Section Intro */
.section-intro { margin-bottom: 8rem; }
.pre-title {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    display: block;
    margin-bottom: 1.5rem;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-weight: 800;
    letter-spacing: -2px;
}
.section-title span { color: var(--primary); }

/* Expertise V3 */
.skills-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.skill-category-v3 {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 5rem 4rem;
    border-radius: 3.5rem;
    transition: var(--transition);
}

.skill-category-v3:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateY(-10px);
}

.sc-header { display: flex; align-items: center; gap: 2rem; margin-bottom: 3.5rem; }
.sc-header i { font-size: 4rem; color: var(--primary); }
.sc-header h3 { font-size: 2.4rem; font-weight: 700; }

.skill-list-v3 { list-style: none; }
.skill-list-v3 li {
    font-size: 1.6rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
}
.skill-list-v3 li span { font-size: 1.1rem; color: var(--text-gray); text-transform: uppercase; }

/* Projekte V3 */
.project-container-v3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38rem, 1fr));
    gap: 4rem;
}

.p-card-v3 {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 3rem;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.p-card-v3:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary-glow);
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.p-img-v3 {
    height: 28rem;
    position: relative;
    overflow: hidden;
    margin: 1.5rem;
    border-radius: 2rem;
}

.p-img-v3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.p-card-v3:hover .p-img-v3 img { transform: scale(1.08); }

.p-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.p-card-v3:hover .p-overlay { opacity: 1; }

.p-links { display: flex; gap: 1.5rem; }

.p-btn-circle {
    width: 6rem;
    height: 6rem;
    background: var(--primary);
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    text-decoration: none;
    transition: var(--transition);
    transform: translateY(20px);
}

.p-card-v3:hover .p-btn-circle { transform: translateY(0); }
.p-btn-circle:hover { transform: scale(1.1) rotate(10deg); background: white; }

.p-meta { padding: 2rem 3.5rem 4rem; }

.p-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.p-tags span {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1.2rem;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: 50px;
    border: 1px solid var(--primary-glow);
}

.p-meta h3 {
    font-size: 2.6rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.p-meta p {
    color: var(--text-gray);
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.p-read-more {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.4rem;
    transition: var(--transition);
}

.p-read-more i {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.p-read-more:hover { color: var(--primary); }
.p-read-more:hover i { transform: translateX(5px); }

/* Process Section */
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
}

.process-step {
    padding: 4rem;
    background: var(--glass);
    border-radius: 3rem;
    border-top: 2px solid var(--primary);
    transition: var(--transition);
}

.process-step:hover { transform: translateY(-5px); background: rgba(255,255,255,0.05); }

.step-num { font-family: var(--font-mono); color: var(--primary); font-size: 1.4rem; display: block; margin-bottom: 2rem; }
.process-step h3 { font-size: 2.2rem; margin-bottom: 1.5rem; }
.process-step p { color: var(--text-gray); font-size: 1.5rem; }

/* Vita V3 */
.dual-timeline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8rem;
}

.t-label {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 2.2rem;
    margin-bottom: 4rem;
    color: var(--primary);
}

.t-item-v3 {
    margin-bottom: 4rem;
    padding-left: 3rem;
    border-left: 1px solid var(--glass-border);
    position: relative;
}

.t-item-v3::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 9px;
    height: 9px;
    background: var(--primary);
    border-radius: 50%;
}

.t-date { font-family: var(--font-mono); font-size: 1.2rem; color: var(--text-gray); margin-bottom: 1rem; display: block; }
.t-item-v3 h5 { font-size: 2rem; margin-bottom: 0.8rem; }
.t-item-v3 p { color: var(--text-gray); font-size: 1.6rem; }

.extra-info-v3 {
    margin-top: 8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.info-pill {
    flex: 1;
    min-width: 30rem;
    background: var(--glass);
    padding: 3rem;
    border-radius: 2.5rem;
    border: 1px solid var(--glass-border);
}

.info-pill h5 { color: var(--primary); font-size: 1.8rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; }

/* Contact V3 */
.contact-card-premium {
    background: linear-gradient(145deg, #0a0a0a 0%, #151515 100%);
    padding: 10rem;
    border-radius: 6rem;
    border: 1px solid var(--glass-border);
}

.contact-header { text-align: center; margin-bottom: 8rem; }
.contact-header h2 { font-size: 6rem; font-family: var(--font-heading); letter-spacing: -3px; }
.contact-header h2 span { color: var(--primary); }

.form-v3 { max-width: 90rem; margin: 0 auto; }
.input-grid-v3 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }

.field-v3 { position: relative; margin-bottom: 4rem; }
.field-v3 input, .field-v3 textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    color: white;
    font-size: 1.8rem;
    transition: var(--transition);
    outline: none;
}

/* AUTOFILL FIX */
.field-v3 input:-webkit-autofill,
.field-v3 input:-webkit-autofill:hover,
.field-v3 input:-webkit-autofill:focus,
.field-v3 textarea:-webkit-autofill,
.field-v3 textarea:-webkit-autofill:hover,
.field-v3 textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-white) !important; /* لون النص أبيض */
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important; /* خلفية شفافة */
    transition: background-color 5000s ease-in-out 0s; /* لضمان بقاء الخلفية شفافة */
    background: transparent !important;
}

.field-v3 textarea { height: 12rem; resize: none; }

.field-v3 label {
    position: absolute;
    left: 0;
    top: 1.5rem;
    color: var(--text-gray);
    pointer-events: none;
    transition: var(--transition);
}

.field-v3 input:focus ~ label, .field-v3 input:not(:placeholder-shown) ~ label,
.field-v3 textarea:focus ~ label, .field-v3 textarea:not(:placeholder-shown) ~ label {
    top: -1.5rem;
    font-size: 1.2rem;
    color: var(--primary);
}

.field-v3 input:focus, .field-v3 textarea:focus { border-color: var(--primary); }

.btn-submit-v3 {
    width: 100%;
    padding: 2.5rem;
    background: var(--primary);
    color: black;
    border-radius: 2rem;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit-v3:hover { filter: brightness(1.1); transform: scale(1.01); }

/* Footer V3 */
.footer-v3 { padding: 8rem 10% 4rem; border-top: 1px solid var(--glass-border); }
.f-main { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 5rem; margin-bottom: 6rem; }
.f-brand h3 { font-size: 3rem; font-family: var(--font-heading); margin-bottom: 2rem; }
.f-brand p { color: var(--text-gray); max-width: 30rem; }
.f-nav { display: flex; flex-direction: column; gap: 1.5rem; }
.f-nav a { color: var(--text-gray); font-weight: 600; text-decoration: none; transition: 0.3s; }
.f-nav a:hover { color: var(--primary); }
.f-social { display: flex; gap: 2rem; }
.f-social a { font-size: 2.4rem; color: var(--text-white); transition: 0.3s; }
.f-social a:hover { color: var(--primary); }
.f-copy { display: flex; justify-content: space-between; color: var(--text-gray); font-size: 1.4rem; border-top: 1px solid var(--glass-border); padding-top: 4rem; }

/* Responsive */
@media (max-width: 1200px) {
    html { font-size: 58%; } /* Adjust base font size for larger tablets/small desktops */
    .header { padding: 1.5rem 5%; }
    .header.sticky { padding: 1rem 5%; }
    section { padding: 10rem 5% 8rem; }
    .hero-title { font-size: 6rem; }
    .text-animation { font-size: 2.8rem; }
    .hero-desc { font-size: 1.7rem; }
    .image-wrapper { width: 35rem; height: 45rem; }
    .skills-showcase { grid-template-columns: repeat(2, 1fr); }
    .skill-category-v3 { padding: 4rem 3rem; } /* Adjusted padding */
    .sc-header i { font-size: 3.5rem; } /* Adjusted icon size */
    .sc-header h3 { font-size: 2.2rem; } /* Adjusted heading size */
    .skill-list-v3 li { font-size: 1.5rem; } /* Adjusted list item font size */
    .project-container-v3 { grid-template-columns: repeat(auto-fit, minmax(32rem, 1fr)); }
    .p-img-v3 { height: 25rem; } /* Adjusted image height */
    .p-meta h3 { font-size: 2.4rem; } /* Adjusted project title size */
    .p-meta p { font-size: 1.4rem; } /* Adjusted project description size */
    .process-grid { grid-template-columns: repeat(3, 1fr); } /* Adjusted for 3 columns */
    .process-step { padding: 3.5rem; } /* Adjusted padding */
    .process-step h3 { font-size: 2rem; } /* Adjusted heading size */
    .process-step p { font-size: 1.4rem; } /* Adjusted paragraph size */
    .dual-timeline { gap: 6rem; } /* Adjusted gap */
    .t-label { font-size: 2rem; margin-bottom: 3rem; } /* Adjusted font size and margin */
    .t-item-v3 h5 { font-size: 1.8rem; } /* Adjusted heading size */
    .t-item-v3 p { font-size: 1.5rem; } /* Adjusted paragraph size */
    .extra-info-v3 { gap: 2rem; } /* Adjusted gap */
    .info-pill { padding: 2.5rem; } /* Adjusted padding */
    .info-pill h5 { font-size: 1.7rem; } /* Adjusted heading size */
    .contact-card-premium { padding: 8rem 5rem; }
    .contact-header h2 { font-size: 5rem; } /* Adjusted heading size */
    .input-grid-v3 { gap: 2rem; } /* Adjusted gap */
    .field-v3 input, .field-v3 textarea { font-size: 1.7rem; } /* Adjusted font size */
    .btn-submit-v3 { padding: 2.2rem; font-size: 1.7rem; } /* Adjusted padding and font size */
    .f-main { gap: 3rem; } /* Adjusted footer gap */
    .f-brand h3 { font-size: 2.8rem; } /* Adjusted footer brand heading */
    .f-brand p { font-size: 1.3rem; } /* Adjusted footer brand paragraph */
    .f-nav { gap: 1rem; } /* Adjusted footer nav gap */
    .f-nav a { font-size: 1.3rem; } /* Adjusted footer nav links */
    .f-social a { font-size: 2.2rem; } /* Adjusted footer social icons */
    .f-copy { font-size: 1.3rem; } /* Adjusted footer copy text */
}

@media (max-width: 991px) {
    html { font-size: 55%; } /* Further adjust base font size for tablets */
    .header {
        justify-content: flex-start;
        gap: 1.6rem;
        padding-right: 13rem;
    }
    .logo {
        max-width: calc(100vw - 20rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #menu-icon { display: block; order: -1; z-index: 1001; }
    .navbar {
        position: fixed;
        top: 0; /* Ensure it's always at the top */
        bottom: 0; /* Ensure it takes full height */
        left: -100%; /* Hidden state: off-screen to the left */
        width: min(80vw, 30rem); /* Set a width for the side menu */
        height: 100vh;
        background: rgba(5, 5, 5, 0.96);
        backdrop-filter: blur(18px);
        flex-direction: column;
        justify-content: flex-start; /* Align items to the top */
        align-items: flex-start; /* Align items to the left within the menu */
        gap: 3rem;
        padding: 7rem 4rem 4rem 4rem; /* Add padding inside the menu, increased top padding */
        transition: left 0.6s cubic-bezier(0.7, 0, 0.3, 1); /* Transition 'left' property */
        z-index: 1000;
        overflow-y: auto; /* Add scroll if content overflows vertically */
    }
    .navbar.active {
        left: 0; /* Active state: visible from left */
    }

    /* RTL adjustments */
    body.rtl .header {
        justify-content: flex-end; /* Align header content to the right */
        padding-left: 13rem; /* Adjust padding for RTL */
        padding-right: 1.6rem; /* Adjust padding for RTL */
    }
    body.rtl #menu-icon {
        order: 1; /* Move menu icon to the right */
    }
    body.rtl .navbar {
        top: 0; /* Ensure it's always at the top for RTL */
        bottom: 0; /* Ensure it takes full height for RTL */
        left: auto; /* Override left for RTL */
        right: -100%; /* Hidden state: off-screen to the right for RTL */
        align-items: flex-end; /* Align items to the right within the menu */
        padding: 7rem 4rem 4rem 4rem; /* Add padding inside the menu, increased top padding for RTL */
        transition: right 0.6s cubic-bezier(0.7, 0, 0.3, 1); /* Transition 'right' property for RTL */
        overflow-y: auto; /* Add scroll if content overflows vertically for RTL */
    }
    body.rtl .navbar.active {
        right: 0; /* Active state: visible from right for RTL */
        left: auto; /* Ensure left is auto when active in RTL */
    }

    .home { flex-direction: column; text-align: center; justify-content: center; gap: 5rem; }
    .hero-desc { margin-left: auto; margin-right: auto; }
    .hero-cta { justify-content: center; flex-direction: column; gap: 2.4rem; }
    .image-wrapper { margin: 2rem auto 0; width: 30rem; height: 40rem; }
    .floating-card.c1 { top: 5%; right: 5%; } /* Adjusted for better containment */
    .floating-card.c2 { bottom: 5%; left: 5%; } /* Adjusted for better containment */
    .dual-timeline { grid-template-columns: 1fr; }
    .input-grid-v3 { grid-template-columns: 1fr; }
    .contact-card-premium { padding: 5rem 3rem; }
    .process-grid { grid-template-columns: repeat(2, 1fr); } /* Adjusted for 2 columns */
    .f-main { grid-template-columns: 1fr; text-align: center; }
    .f-brand p { margin: 0 auto 2rem; }
    .f-nav { align-items: center; } /* Center footer nav items */
    .f-social { justify-content: center; }
    .f-copy { flex-direction: column; gap: 2rem; text-align: center; }
}

@media (max-width: 768px) {
    html { font-size: 50%; } /* Base font size for mobile */
    .header { padding: 1.5rem 13rem 1.5rem 3%; }
    .header.sticky { padding: 1rem 13rem 1rem 3%; }
    section { padding: 8rem 3% 6rem; }
    .hero-title { font-size: 4rem; letter-spacing: -2px; }
    .text-animation { font-size: 2.5rem; }
    .hero-desc { font-size: 1.6rem; }
    .btn-premium { padding: 1.5rem 3rem; font-size: 1.4rem; }
    .social-minimal { flex-direction: row; flex-wrap: nowrap; justify-content: center; gap: 1rem; }
    .social-minimal a { width: 4rem; height: 4rem; }
    .image-wrapper { width: 28rem; height: 35rem; margin-top: 5rem; }
    .floating-card { padding: 1rem 2rem; gap: 1rem; }
    .floating-card i { font-size: 2rem; }
    .floating-card span { font-size: 1.2rem; }
    .floating-card.c1 { top: 5%; right: 5%; } /* Adjusted for better containment */
    .floating-card.c2 { bottom: 5%; left: 5%; } /* Adjusted for better containment */
    .section-title { font-size: 4.5rem; }
    .skills-showcase { grid-template-columns: 1fr; }
    .skill-category-v3 { padding: 3rem 2rem; }
    .sc-header i { font-size: 3rem; }
    .sc-header h3 { font-size: 2rem; }
    .skill-list-v3 li { font-size: 1.4rem; }
    .project-container-v3 { grid-template-columns: 1fr; }
    .p-img-v3 { height: 25rem; margin: 1rem; }
    .p-meta { padding: 1.5rem 2.5rem 3rem; }
    .p-meta h3 { font-size: 2.2rem; }
    .p-meta p { font-size: 1.4rem; }
    .process-grid { grid-template-columns: 1fr; }
    .process-step { padding: 3rem; }
    .process-step h3 { font-size: 2rem; }
    .process-step p { font-size: 1.4rem; }
    .t-label { font-size: 1.8rem; }
    .t-item-v3 h5 { font-size: 1.8rem; }
    .t-item-v3 p { font-size: 1.4rem; }
    .extra-info-v3 { flex-direction: column; gap: 2rem; margin-top: 5rem; }
    .info-pill { min-width: unset; padding: 2.5rem; }
    .info-pill h5 { font-size: 1.6rem; }
    .contact-card-premium { padding: 3rem 2rem; border-radius: 4rem; }
    .contact-header h2 { font-size: 4rem; }
    .field-v3 input, .field-v3 textarea { font-size: 1.6rem; }
    .btn-submit-v3 { padding: 2rem; font-size: 1.6rem; }
    .footer-v3 { padding: 6rem 3% 3rem; }
    .f-brand h3 { font-size: 2.5rem; }
    .f-brand p { font-size: 1.4rem; }
    .f-nav a { font-size: 1.4rem; }
    .f-social a { font-size: 2rem; }
    .f-copy { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    html { font-size: 45%; } /* Smaller base font size for very small mobiles */
    .header { padding: 1rem 10rem 1rem 2%; }
    .header.sticky { padding: 0.8rem 10rem 0.8rem 2%; }
    section { padding: 6rem 2% 4rem; }
    .hero-title { font-size: 3.5rem; letter-spacing: -1px; }
    .text-animation { font-size: 2rem; min-height: 3.5rem; }
    .hero-desc { font-size: 1.4rem; }
    .btn-premium { padding: 1.2rem 2.5rem; font-size: 1.2rem; }
    .logo { font-size: 1.9rem; max-width: calc(100vw - 18rem); }
    .social-minimal a { width: 3.8rem; height: 3.8rem; }
    .social-minimal a i { font-size: 1.8rem; }
    .image-wrapper { width: 25rem; height: 30rem; margin-top: 4rem; }
    .floating-card { padding: 0.8rem 1.5rem; gap: 0.8rem; }
    .floating-card i { font-size: 1.8rem; }
    .floating-card span { font-size: 1rem; }
    .floating-card.c1 { top: 5%; right: 5%; } /* Adjusted for better containment */
    .floating-card.c2 { bottom: 5%; left: 5%; } /* Adjusted for better containment */
    .section-title { font-size: 3.5rem; }
    .pre-title { font-size: 1rem; letter-spacing: 2px; }
    .skill-category-v3 { padding: 2.5rem 1.5rem; }
    .sc-header i { font-size: 2.5rem; }
    .sc-header h3 { font-size: 1.8rem; }
    .skill-list-v3 li { font-size: 1.2rem; }
    .project-container-v3 { grid-template-columns: 1fr; }
    .p-img-v3 { height: 20rem; margin: 0.8rem; }
    .p-meta { padding: 1rem 2rem 2.5rem; }
    .p-meta h3 { font-size: 2rem; }
    .p-meta p { font-size: 1.2rem; }
    .p-tags span { font-size: 0.9rem; padding: 0.4rem 1rem; }
    .p-read-more { font-size: 1.2rem; }
    .process-step { padding: 2.5rem; }
    .process-step h3 { font-size: 1.8rem; }
    .process-step p { font-size: 1.2rem; }
    .t-label { font-size: 1.6rem; }
    .t-item-v3 h5 { font-size: 1.6rem; }
    .t-item-v3 p { font-size: 1.2rem; }
    .info-pill h5 { font-size: 1.4rem; }
    .contact-card-premium { padding: 2rem 1.5rem; border-radius: 3rem; }
    .contact-header h2 { font-size: 3.5rem; }
    .field-v3 input, .field-v3 textarea { font-size: 1.4rem; }
    .field-v3 label { font-size: 1.2rem; }
    .btn-submit-v3 { padding: 1.5rem; font-size: 1.4rem; }
    .footer-v3 { padding: 5rem 2% 2.5rem; }
    .f-brand h3 { font-size: 2rem; }
    .f-brand p { font-size: 1.2rem; }
    .f-nav a { font-size: 1.2rem; }
    .f-social a { font-size: 1.8rem; }
    .f-copy { font-size: 1.0rem; }
}

/* Landscape orientation for mobile devices */
@media screen and (max-height: 500px) and (orientation: landscape) {
    section { padding: 8rem 5% 6rem; }
    .home { flex-direction: row; text-align: left; }
    .hero-cta { flex-direction: row; }
    .image-wrapper { margin: 0; width: 30rem; height: 35rem; }
    .hero-title { font-size: 5rem; }
    .text-animation { font-size: 2.5rem; }
    .hero-desc { max-width: 40rem; }
    .floating-card.c1 { top: 5%; right: 5%; }
    .floating-card.c2 { bottom: 5%; left: 5%; }
}