/* ========================================
   KHALID ISMAIL — DEVELOPER PORTFOLIO
   Premium Dark Theme
   ======================================== */

:root {
    --bg: #0a0a0b;
    --bg-card: #111113;
    --bg-elevated: #1a1a1d;
    --border: rgba(255, 255, 255, 0.06);
    --text: #e4e4e7;
    --text-secondary: #71717a;
    --text-muted: #52525b;
    --accent: #818cf8; /* Indigo accent */
    --accent-glow: rgba(129, 140, 248, 0.15);
    --gradient-start: #818cf8;
    --gradient-end: #c084fc;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --radius: 16px;
    --radius-sm: 8px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Ambient Background Glow */
.ambient-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* ========== NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 0;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.logo-bracket {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    letter-spacing: 0.01em;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    background: var(--accent-glow);
    border: 1px solid rgba(129, 140, 248, 0.3);
    padding: 0.5rem 1.2rem !important;
    border-radius: 30px;
    color: var(--accent) !important;
    transition: all 0.3s ease !important;
}

.nav-cta:hover {
    background: var(--accent) !important;
    color: var(--bg) !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
}

/* ========== HERO ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    position: relative;
    z-index: 1;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(129, 140, 248, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    grid-column: 1 / -1;
    width: fit-content;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-name {
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1.5rem;
    grid-column: 1;
}

.hero-accent {
    color: var(--accent);
}

.hero-role {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    grid-column: 1;
}

.role-prefix {
    color: var(--accent);
    font-weight: 500;
}

.cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    grid-column: 1;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    grid-column: 1;
}

.hero-decoration {
    grid-column: 2;
    grid-row: 2 / 6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Code Block Decoration */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.code-dot.red { background: #ef4444; }
.code-dot.yellow { background: #eab308; }
.code-dot.green { background: #22c55e; }

.code-filename {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-content {
    padding: 1.2rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--text-secondary);
    overflow-x: auto;
}

.code-content .kw { color: #c084fc; font-weight: 500; }
.code-content .type { color: #818cf8; }
.code-content .str { color: #34d399; }

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    background: var(--accent);
    color: #0a0a0b;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-sans);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(129, 140, 248, 0.3);
}

.btn-primary i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateY(3px);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 1.8rem;
    background: transparent;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-ghost:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

/* ========== SECTIONS ========== */
.section {
    padding: 8rem 0;
    position: relative;
    z-index: 1;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}



/* ========== ABOUT ========== */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 0.5rem;
}

.stat {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.stat:hover {
    border-color: rgba(129, 140, 248, 0.2);
    background: var(--bg-elevated);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== SKILLS ========== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.skill-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-item:hover {
    transform: translateY(-4px);
    border-color: rgba(129, 140, 248, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.skill-header i {
    font-size: 1.2rem;
    color: var(--accent);
}

.skill-header h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.skill-item p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}



/* ========== WORK ========== */
.work-content h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.work-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

/* ========== CONTACT ========== */
.section-contact {
    border-top: 1px solid var(--border);
}

.contact-content {
    margin-bottom: 3rem;
}

.contact-content h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.contact-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.contact-form {
    max-width: 700px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-row .form-field {
    margin-bottom: 0;
}

.form-field label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-field input,
.form-field textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--text-muted);
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field textarea {
    resize: vertical;
    min-height: 140px;
}

.btn-submit {
    width: auto;
}

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

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

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

.stagger-child {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-child.active {
    opacity: 1;
    transform: translateY(0);
}

/* Safety fallback */
@media (scripting: none) {
    .reveal, .stagger-child {
        opacity: 1;
        transform: none;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-decoration {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
    }

    .code-block {
        max-width: 100%;
    }

    .hero-name {
        grid-column: 1;
    }

    .hero-role,
    .hero-desc,
    .hero-actions {
        grid-column: 1;
    }

    .hero-badge {
        grid-column: 1;
    }

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

    .about-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .stat {
        flex: 1;
        min-width: 120px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .project {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 0;
    }

    .project-number {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .section {
        padding: 5rem 0;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 2.8rem;
    }

    .about-stats {
        flex-direction: column;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn-primary, .btn-ghost {
        justify-content: center;
        width: 100%;
    }
}
