/* ============================================
   Ahmed Khaled Mohamed — Personal Website
   ============================================ */

:root {
    /* Colors - Dark theme with warm accent */
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-tertiary: #1a1a1d;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #f59e0b;
    --accent-dim: #92400e;
    --border: #27272a;
    --border-light: #3f3f46;
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --section-padding: clamp(4rem, 10vw, 8rem);
    --container-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

[id] {
    scroll-margin-top: 5rem;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* Noise texture overlay */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 2rem;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s;
}

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

/* Sections */
.section {
    padding: var(--section-padding) 2rem;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-inner {
    max-width: var(--container-width);
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
    max-width: 600px;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 4rem;
}

.hero-content {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--text-secondary);
    max-width: 650px;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.hero-subtitle-secondary {
    font-size: 1.0625rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
    line-height: 1.7;
    font-style: italic;
}

.highlight {
    color: var(--text-primary);
    font-weight: 500;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: var(--bg-tertiary);
}

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

.about-text p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.about-text .lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-card {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.detail-card h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.detail-card p {
    color: var(--text-primary);
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 9px;
    height: 9px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateX(-4px);
}

.timeline-content {
    padding-left: 1.5rem;
}

.timeline-header {
    margin-bottom: 1rem;
}

.timeline-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-company {
    color: var(--accent);
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.timeline-content > p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    max-width: 700px;
}

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

.timeline-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Projects — Featured card */
.project-featured {
    padding: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.project-featured:hover {
    border-color: var(--border-light);
    border-left-color: var(--accent);
}

.project-featured-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-featured h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Projects — Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.project-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Projects — Shared */
.project-tagline {
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.project-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.project-stack span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-muted);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.project-link {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-live {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-npm {
    background: rgba(203, 56, 55, 0.12);
    color: #ef6b6b;
    border: 1px solid rgba(203, 56, 55, 0.25);
}

.badge-desktop {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-ios {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

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

/* Small buttons for featured card */
.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    border-radius: 6px;
}

/* Philosophy */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.philosophy-card {
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.philosophy-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.philosophy-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.philosophy-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.skill-category h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent);
}

.skill-category p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Contact */
#contact .section-inner {
    text-align: center;
}

#contact .section-subtitle {
    margin: 0 auto 3rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.contact-link:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.contact-icon {
    font-size: 1.25rem;
}

/* Footer */
.footer {
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

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

/* Hamburger toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive — Tablet */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive — Mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 11, 0.95);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 1.5rem 2rem;
        gap: 1.25rem;
    }

    .nav-links.open {
        display: flex;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-featured-header {
        flex-direction: column;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-inner {
    animation: fadeInUp 0.6s ease-out;
}

