/* =========================================================================
   VARIABLES & THEMING
   ========================================================================= */
:root {
    /* Colors */
    --bg-color: #050507;
    --text-primary: #f0f0f5;
    --text-secondary: #9ea3b0;
    
    /* Accents */
    --accent-blue: #00d2ff;
    --accent-violet: #7a22ff;
    --accent-teal: #00f0b5;
    
    /* UI Elements */
    --glass-bg: rgba(20, 20, 25, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    
    /* Typography */
    --font-main: 'Outfit', system-ui, -apple-system, sans-serif;
    
    /* Dimensions */
    --container-width: 1100px;
    --section-spacing: 120px;
    
    /* Animation */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   RESET & BASE
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* Deep gradient background for extra depth */
    background: radial-gradient(circle at 50% 0%, #101018 0%, var(--bg-color) 70%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

/* =========================================================================
   BACKGROUND EFFECTS
   ========================================================================= */
.bg-fx {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: drift 20s infinite alternate ease-in-out;
}

.glow-1 {
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-violet), transparent 70%);
}

.glow-2 {
    bottom: -20%;
    left: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-blue), transparent 70%);
    animation-delay: -5s;
}

.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse at top center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at top center, black 40%, transparent 100%);
}

/* =========================================================================
   HEADER & NAV
   ========================================================================= */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 24px 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: var(--transition-smooth);
}

.header.scrolled {
    padding: 16px 0;
    background: rgba(5, 5, 7, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* =========================================================================
   REUSABLE UI COMPONENTS
   ========================================================================= */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-teal);
    background: rgba(0, 240, 181, 0.05);
    border: 1px solid rgba(0, 240, 181, 0.2);
    border-radius: 100px;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 20px rgba(0, 240, 181, 0.05);
    transition: var(--transition-smooth);
}

.badge:hover {
    background: rgba(0, 240, 181, 0.1);
    box-shadow: 0 0 30px rgba(0, 240, 181, 0.15);
}

/* Buttons */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn-primary .btn-text {
    position: relative;
    z-index: 2;
}

.btn-primary .btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 50%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.btn-primary:hover .btn-glow {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
}

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

.btn-secondary:hover {
    background: var(--glass-highlight);
    border-color: rgba(255, 255, 255, 0.3);
}

.cta-group {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

/* =========================================================================
   SECTIONS
   ========================================================================= */
section {
    padding: var(--section-spacing) 0;
}

.section-header {
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-header h2 .highlight {
    font-weight: 600;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.hero-title {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.text-glow {
    position: relative;
    display: inline-block;
}

.text-glow::after {
    content: 'Omar Rezk';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(28px);
    opacity: 0.5;
    z-index: -1;
    animation: pulse-glow 4s infinite alternate;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    font-weight: 300;
    line-height: 1.7;
}

/* Abstract Hero Visual (Orb) */
.hero-visual {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    z-index: 1;
    pointer-events: none;
}

.orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.8), rgba(122, 34, 255, 0.8));
    filter: blur(60px);
    opacity: 0.6;
    animation: float 8s infinite ease-in-out;
}

.orb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-teal);
    animation: spin 20s linear infinite;
}

.orb-ring-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 460px;
    height: 460px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-right-color: var(--accent-violet);
    animation: spin reverse 30s linear infinite;
}

/* About Section */
.about-content {
    padding: 48px;
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.8;
}

/* Expertise Section */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    position: relative;
    /* This group class keeps track of mouse pos to share glow */
}

.card {
    padding: 32px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Soft glow follow cursor */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(255, 255, 255, 0.06), transparent 40%);
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.cards-grid:hover .card::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(30, 30, 40, 0.6);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 24px;
    color: var(--accent-blue);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover .card-icon {
    background: rgba(0, 210, 255, 0.1);
    border-color: rgba(0, 210, 255, 0.3);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
    padding: 80px 0 40px;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 64px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.footer-brand p {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-blue);
    transition: width 0.3s ease;
}

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

.footer-links a:hover::after {
    width: 100%;
}

.footer-bottom {
    text-align: center;
    color: #4a4e59;
    font-size: 0.85rem;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -40px) scale(1.1); }
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, -55%); }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse-glow {
    0% { opacity: 0.4; filter: blur(20px); }
    100% { opacity: 0.7; filter: blur(32px); }
}

/* Scroll Animations */
[data-observe] {
    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);
}

[data-observe].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for cards */
.cards-grid .card:nth-child(1) { transition-delay: 0.1s; }
.cards-grid .card:nth-child(2) { transition-delay: 0.2s; }
.cards-grid .card:nth-child(3) { transition-delay: 0.3s; }
.cards-grid .card:nth-child(4) { transition-delay: 0.4s; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 992px) {
    .hero-title { font-size: 4rem; }
    .hero-visual { opacity: 0.3; right: -15%; }
}

@media (max-width: 768px) {
    .hero { text-align: center; }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { margin: 0 auto; }
    .hero-visual { display: none; }
    
    .cta-group { 
        flex-direction: column; 
        width: 100%; 
        max-width: 300px; 
        margin: 40px auto 0;
    }
    
    .nav-links { display: none; }
    
    .about-content { padding: 32px; font-size: 1.15rem; }
    
    .section-header h2 { font-size: 2rem; justify-content: center; }
    
    .footer-content { flex-direction: column; gap: 32px; align-items: center; text-align: center; }
}
