/* CSS Reset & Variables */
:root {
    /* Color Palette */
    --bg-color: #050505;
    --text-color: #E2E8F0;
    --text-muted: #94A3B8;
    --accent-red: #E11D48;
    --accent-blue: #3B82F6;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Layout */
    --section-padding: 8rem 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Minimal Top Logo */
.top-logo {
    position: fixed;
    top: 2.5rem;
    left: 2.5rem;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: #fff;
    z-index: 1000;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

html[dir="rtl"] .top-logo {
    left: auto;
    right: 2.5rem;
}

body.no-scroll {
    overflow: hidden;
}

/* Splash Screen Setup */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1), opacity 0.8s ease;
}

.splash-screen.hide-splash {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

::selection {
    background-color: var(--accent-red);
    color: #fff;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: var(--section-padding);
}

.section-heading {
    font-size: 3rem;
    margin-bottom: 4rem;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-blue));
    border-radius: 3px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-outline:hover {
    border-color: #fff;
    background: #fff;
    color: #000;
}

/* Floating Dock Nav */
.dock-nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.dock-content {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.dock-item {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.dock-item:hover, .dock-item.active {
    color: #fff;
    transform: translateY(-3px);
}

.dock-lang {
    position: relative;
    padding-left: 1.5rem;
}

.dock-lang::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    height: 20px;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.lang-selector-floating {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 6rem; /* Account for navbar */
    background: url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5,5,5,0.7) 0%, rgba(5,5,5,1) 100%);
    z-index: -1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex: 0 0 320px;
    height: 420px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.greeting-container {
    height: 160px; /* increased to prevent layout shift and clipping of characters */
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 300px;
}

.greeting {
    font-size: 6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, #fff, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    transform: translateY(0);
}

.greeting.fade-out {
    opacity: 0;
    transform: translateY(-70%);
}

.greeting.fade-in {
    opacity: 0;
    transform: translateY(-30%);
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0.5;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #fff, transparent);
    animation: scroll-line 2s infinite ease-in-out;
    transform-origin: top;
}

@keyframes scroll-line {
    0% { transform: scaleY(0); }
    50% { transform: scaleY(1); }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.super-text {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: #fff;
}

.about-text p:not(.super-text) {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-image {
    width: 100%;
    height: 250px;
}

.project-info {
    padding: 2rem;
}

.project-info h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Contact Section */
.contact {
    text-align: center;
}

.contact .section-heading::after {
    left: 50%;
    transform: translateX(-50%);
}

.contact-text {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    font-family: var(--font-heading);
    font-weight: 400;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.social-btn svg {
    color: var(--primary-color);
}

.social-btn .platform {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex: 1;
    text-align: left;
}

html[dir="rtl"] .social-btn .platform {
    text-align: right;
}

.social-btn .handle {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    transition: all 0.3s ease;
}

.filter-blur {
    filter: blur(5px);
    user-select: none;
}

.whatsapp-action.revealed .filter-blur {
    filter: blur(0);
}

/* Footer */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--card-border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Animations */
.reveal, .reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active, .reveal-text.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .greeting { font-size: 3.5rem; }
    .hero-title { font-size: 2.5rem; }
    .super-text { font-size: 2rem; }
    .about-grid { grid-template-columns: 1fr; }
    
    .nav-links { display: none; } /* Simple approach for mobile logic */
    
    .hero-content {
        flex-direction: column-reverse; /* Image above text = column-reverse since text is first in HTML? No, text is first, so column-reverse puts text AT BOTTOM. Let's use column to put text top, image bottom. Wait, user usually wants image top on mobile. So column-reverse is good! */
        text-align: center;
        gap: 3rem;
    }
    .hero-cta {
        justify-content: center;
    }
    .hero-image {
        flex: 0 0 280px;
        height: 380px;
        margin: 0 auto;
    }
}

/* RTL Support via JS (Arabic) */
html[dir="rtl"] {
    text-align: right;
}
html[dir="rtl"] .section-heading::after {
    left: auto;
    right: 0;
}
html[dir="rtl"] .contact .section-heading::after {
    right: 50%;
    transform: translateX(50%);
}
html[dir="rtl"] .hero-greeting, html[dir="rtl"] .hero-title, html[dir="rtl"] .hero-subtitle {
    margin-left: 0;
}

/* Currently Doing Section */
.currently-doing, .tech-marquee-section {
    margin-top: 4rem;
}

.currently-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.5rem;
}

.currently-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.currently-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    transition: border-color 0.3s, transform 0.3s;
}

.currently-list li:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateX(5px);
    color: #fff;
}

.cdot {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Tech Marquee */
.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.marquee-track {
    display: flex;
    gap: 1.5rem;
    animation: marquee-scroll 25s linear infinite;
    width: max-content;
}

.marquee-container:hover .marquee-track {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.marquee-item {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.marquee-item:hover {
    transform: translateY(-5px) scale(1.1);
}

.marquee-item img {
    width: 48px;
    height: 48px;
    display: block;
}

.marquee-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,30,30,0.95);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.marquee-item:hover::after {
    opacity: 1;
}

/* Social Icons Grid */
.social-icons-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 600px;
}

.social-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 100px;
}

.social-icon-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-5px);
}

.social-icon-card img {
    width: 48px;
    height: 48px;
}

.social-icon-card span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    word-break: break-word;
    max-width: 100px;
}

/* Top Circular Navigation */
.top-nav-pill {
    position: fixed;
    top: 2.5rem;
    right: 2.5rem;
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    padding: 0.5rem;
    gap: 0.5rem;
    z-index: 1001; /* Ensure above splash if hidden, but splash is 9999 so splash still stays on top initially */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-pill-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-pill-item:hover, .nav-pill-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Blog Layout */
.blog-header {
    text-align: center;
    padding-top: 10rem;
    padding-bottom: 4rem;
}
.blog-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 6rem;
}
.blog-post {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.blog-post:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.15);
}
.post-date {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}
.post-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}
.post-content {
    color: var(--text-muted);
    line-height: 1.8;
}
