/* ========================================
   HAMZA RIAHI - Portfolio v2
   Premium Dark Design System
   ======================================== */

/* ---- CSS Variables ---- */
:root {
    --bg: #0f0f0f;
    --bg-alt: #1a1a1a;
    --bg-card: #161616;
    --bg-card-hover: #1e1e1e;
    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.35);
    --accent-soft: rgba(79, 70, 229, 0.08);
    --gold: #d4a853;
    --gold-glow: rgba(212, 168, 83, 0.3);
    --text: #f5f5f5;
    --text-sec: #a3a3a3;
    --text-muted: #6b6b6b;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --nav-h: 72px;
    --max-w: 1200px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.3s var(--ease);
}

/* ---- Light Theme Override ---- */
[data-theme="light"] {
    --bg: #f8f8f8;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --text: #111111;
    --text-sec: #555555;
    --text-muted: #999999;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.16);
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
}
[data-theme="light"] .nav.scrolled {
    background: rgba(248, 248, 248, 0.85);
}
[data-theme="light"] .mobile-menu {
    background: rgba(248, 248, 248, 0.97);
}
[data-theme="light"] .cursor-dot { mix-blend-mode: normal; }

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

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

::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ---- Cursor Follower ---- */
.cursor-dot {
    width: 8px; height: 8px;
    background: var(--gold);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s var(--ease), opacity 0.15s;
    mix-blend-mode: difference;
}
.cursor-ring {
    width: 36px; height: 36px;
    border: 1.5px solid rgba(212, 168, 83, 0.4);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.4s var(--ease), width 0.3s, height 0.3s, opacity 0.15s;
}
.cursor-ring.hover {
    width: 56px; height: 56px;
    border-color: var(--gold);
}
@media (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ---- Container ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }

/* ---- Navigation ---- */
.nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 1000;
    transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--border);
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto; height: 100%; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem; font-weight: 700;
    letter-spacing: -0.5px;
}
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-controls { display: flex; align-items: center; gap: 0.75rem; margin-left: 1rem; }
.nav-link {
    font-size: 0.875rem; font-weight: 500;
    color: var(--text-sec);
    transition: color var(--transition);
    position: relative;
}
.nav-link::after {
    content: ''; position: absolute;
    bottom: -4px; left: 0; width: 0; height: 1.5px;
    background: var(--gold);
    transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-cta {
    padding: 10px 24px;
    background: var(--gold);
    color: #0f0f0f;
    font-weight: 600; font-size: 0.85rem;
    border-radius: 6px;
    transition: all var(--transition);
    border: none; cursor: pointer;
}
.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--gold-glow);
}

/* Theme toggle */
.theme-toggle {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; padding: 6px;
    color: var(--text-sec);
    transition: color 0.2s;
    line-height: 1;
}
.theme-toggle:hover { color: var(--text); }

/* Language switcher */
.lang-switcher { display: flex; gap: 4px; margin-left: 0.5rem; }
.lang-btn {
    background: none; border: 1px solid transparent;
    color: var(--text-muted); cursor: pointer;
    font-family: var(--font-body); font-size: 0.7rem; font-weight: 600;
    padding: 3px 8px; border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
}
.lang-btn:hover { color: var(--text-sec); }
.lang-btn.active {
    color: var(--gold); border-color: var(--gold);
}

/* Mobile toggle */
.nav-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 5px;
}
.nav-toggle span {
    width: 22px; height: 2px;
    background: var(--text);
    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); }

/* Mobile menu */
.mobile-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(15, 15, 15, 0.97);
    backdrop-filter: blur(20px);
    padding: 2rem;
    display: none; flex-direction: column; gap: 0.25rem;
    z-index: 999;
    transform: translateY(-10px); opacity: 0;
    transition: all 0.3s var(--ease);
}
.mobile-menu.active { transform: translateY(0); opacity: 1; }
.mobile-link {
    font-size: 1.1rem; font-weight: 500;
    color: var(--text-sec);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
}
.mobile-link:hover, .mobile-link.active { color: var(--gold); }

/* ---- Page Layout ---- */
.page { padding-top: var(--nav-h); }

/* ---- Section ---- */
.section { padding: 120px 0; }
.section-sm { padding: 80px 0; }

/* ---- Scroll reveal ---- */
.reveal {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---- Typography ---- */
.heading-xl {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700; line-height: 1.05;
    letter-spacing: -2px;
}
.heading-lg {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700; line-height: 1.1;
    letter-spacing: -1px;
}
.heading-md {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600; line-height: 1.2;
}
.heading-sm {
    font-family: var(--font-heading);
    font-size: 0.8rem; font-weight: 600;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--gold);
}
.text-lg { font-size: 1.2rem; color: var(--text-sec); line-height: 1.7; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px;
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
    border-radius: 6px; border: none; cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--gold); color: #0f0f0f;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--gold-glow);
}
.btn-outline {
    background: transparent; color: var(--text);
    border: 1.5px solid var(--border-hover);
}
.btn-outline:hover {
    border-color: var(--gold); color: var(--gold);
    transform: translateY(-2px);
}
.btn-accent {
    background: var(--accent); color: #fff;
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-sm { padding: 10px 20px; font-size: 0.8rem; }

/* ---- Hero ---- */
.hero {
    min-height: calc(100vh - var(--nav-h));
    display: flex; align-items: center;
    position: relative; overflow: hidden;
    padding: 4rem 0;
}
.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 70, 229, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(212, 168, 83, 0.08), transparent);
    pointer-events: none;
}
.hero-grid-lines {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    pointer-events: none;
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: center;
    position: relative; z-index: 2;
}
.hero-text { max-width: 560px; }
.hero-tag { margin-bottom: 1.5rem; }
.hero-title { margin-bottom: 1.5rem; }
.hero-title .highlight {
    background: linear-gradient(135deg, var(--gold), #e8c876);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Apply gradient to nested text in highlight */
.hero-title .highlight .hero-line-text {
    background: linear-gradient(135deg, var(--gold), #e8c876);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Hero Day/Night Animation ---- */
.hero-line {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}
.hero-line-text {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: heroTextReveal 0.8s var(--ease) forwards;
}
.hero-line-day .hero-line-text {
    animation-delay: 0.3s;
}
.hero-line-night .hero-line-text {
    animation-delay: 1s;
}
@keyframes heroTextReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Hero Icons */
.hero-icon {
    display: inline-block;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    opacity: 0;
    transform: scale(0) rotate(-180deg);
}
.hero-sun {
    animation: sunRise 0.8s var(--ease) 0.8s forwards;
}
.hero-moon {
    animation: moonRise 0.8s var(--ease) 1.5s forwards;
}
@keyframes sunRise {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    50% { opacity: 1; transform: scale(1.3) rotate(0deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes moonRise {
    0% { opacity: 0; transform: scale(0) rotate(180deg); }
    50% { opacity: 1; transform: scale(1.3) rotate(0deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Continuous subtle animations after initial reveal */
.hero-sun {
    animation: sunRise 0.8s var(--ease) 0.8s forwards, sunPulse 3s ease-in-out 2s infinite;
}
.hero-moon {
    animation: moonRise 0.8s var(--ease) 1.5s forwards, moonFloat 4s ease-in-out 2.5s infinite;
}
@keyframes sunPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255, 200, 50, 0.5)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255, 200, 50, 0.8)); }
}
@keyframes moonFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.4)); }
    50% { transform: translateY(-5px) rotate(5deg); filter: drop-shadow(0 0 15px rgba(212, 168, 83, 0.7)); }
}

/* Scan line effect */
.hero-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--gold), transparent);
    opacity: 0;
    animation: scanLine 0.6s var(--ease) forwards;
}
.hero-line-day::after {
    animation-delay: 0.3s;
}
.hero-line-night::after {
    animation-delay: 1s;
}
@keyframes scanLine {
    0% { left: 0; opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-icon {
        font-size: 1.2rem;
    }
}

.hero-desc { margin-bottom: 2.5rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero photo placeholder */
.hero-photo {
    width: 100%; max-width: 420px;
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    gap: 1rem;
    justify-self: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.5s;
}
.hero-photo::before {
    content: '';
    position: absolute; inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    opacity: 0.15;
    z-index: 0;
    animation: photoGlow 4s ease-in-out infinite alternate;
}
@keyframes photoGlow {
    0% { opacity: 0.1; }
    100% { opacity: 0.25; }
}
.hero-photo-inner {
    position: relative; z-index: 1;
    text-align: center; color: var(--text-muted);
    font-size: 0.85rem;
}
.hero-photo-icon { font-size: 3rem; opacity: 0.3; margin-bottom: 0.5rem; }
.hero-photo-img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 16px; position: relative; z-index: 1;
}

/* ---- Logo Band ---- */
.logo-band {
    padding: 60px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.logo-band-label {
    text-align: center; margin-bottom: 2rem;
    font-size: 0.75rem; letter-spacing: 3px; text-transform: uppercase;
    color: var(--text-muted);
}
.logo-band-grid {
    display: flex; justify-content: center; align-items: center;
    gap: 3rem; flex-wrap: wrap;
}
.logo-band-item {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.1rem; font-weight: 600;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity var(--transition);
}
.logo-band-item:hover { opacity: 1; }
.logo-band-item .logo-icon {
    width: 40px; height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.logo-band-img {
    width: 40px; height: 40px; object-fit: contain;
    border-radius: 8px; background: #fff; padding: 4px;
}

/* ---- Services / 2 Cards ---- */
.services-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem;
    transition: all var(--transition);
    position: relative; overflow: hidden;
}
.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.service-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    opacity: 0; transition: opacity 0.4s;
}
.service-card:hover::before { opacity: 1; }
.service-icon {
    width: 56px; height: 56px;
    background: var(--accent-soft);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.service-title {
    font-family: var(--font-heading);
    font-size: 1.35rem; font-weight: 600;
    margin-bottom: 0.75rem;
}
.service-desc {
    color: var(--text-sec); font-size: 0.95rem;
    line-height: 1.7; margin-bottom: 1.5rem;
}
.service-picto-zone {
    width: 100%; height: 160px;
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.8rem;
    margin-bottom: 1.5rem;
}
.service-link {
    color: var(--gold); font-weight: 600; font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: 6px;
    transition: gap var(--transition);
}
.service-link:hover { gap: 10px; }

/* ---- Stats Row ---- */
.stats {
    padding: 80px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 2rem; text-align: center;
}
.stat-number {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 700; color: var(--text);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- About / Timeline ---- */
.about-header {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: start;
    margin-bottom: 5rem;
}
.timeline {
    position: relative; max-width: 800px;
    margin: 0 auto; padding-left: 48px;
}
.timeline::before {
    content: ''; position: absolute;
    left: 18px; top: 0; bottom: 0;
    width: 1px; background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -36px; top: 4px;
    width: 10px; height: 10px;
    background: var(--gold);
    border-radius: 50%;
}
.timeline-date {
    font-size: 0.8rem; color: var(--gold);
    letter-spacing: 1px; font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}
.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all var(--transition);
}
.timeline-card:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}
.timeline-company {
    font-family: var(--font-heading);
    font-size: 1.1rem; font-weight: 600;
    margin-bottom: 0.25rem;
}
.timeline-role {
    color: var(--accent); font-size: 0.9rem;
    font-weight: 500; margin-bottom: 0.5rem;
}
.timeline-desc {
    color: var(--text-sec); font-size: 0.9rem;
    line-height: 1.6;
}
.timeline-desc ul { margin-left: 1.2rem; list-style: disc; }
.timeline-desc li { margin-bottom: 0.3rem; }

/* Timeline picto zone */
.timeline-picto {
    width: 48px; height: 48px;
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: var(--text-muted);
    float: right; margin-left: 1rem;
}
.timeline-logo {
    width: 48px; height: 48px; object-fit: contain;
    border-radius: 8px; background: #fff; padding: 4px;
    float: right; margin-left: 1rem;
}

/* ---- Skills ---- */
.skills-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.skill-group-title {
    font-family: var(--font-heading);
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.skill-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-pill {
    background: var(--accent-soft);
    border: 1px solid rgba(79, 70, 229, 0.2);
    padding: 4px 12px; border-radius: 5px;
    font-size: 0.78rem; color: var(--accent);
    font-weight: 500;
    display: inline-flex; align-items: center; gap: 5px;
}
.skill-logo {
    width: 16px; height: 16px; object-fit: contain;
    border-radius: 3px;
}

/* ---- Skill Constellation ---- */
.constellation-section {
    background: linear-gradient(180deg, #0a0a12 0%, #0f0f1a 50%, #0a0a12 100%);
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}
.constellation-stars {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 250px 150px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 300px 20px, rgba(255,255,255,0.4), transparent);
    background-size: 350px 200px;
    animation: twinkle 8s ease-in-out infinite;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.constellation {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 550px;
    margin: 3rem auto 0;
}
.constellation-lines {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.constellation-line {
    stroke: var(--gold);
    stroke-width: 1.5;
    opacity: 0.3;
    filter: drop-shadow(0 0 4px var(--gold));
}
.constellation-line.sub {
    stroke-width: 1;
    opacity: 0.2;
}

/* Center Core */
.constellation-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.3) 0%, transparent 70%);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: corePulse 3s ease-in-out infinite;
    box-shadow:
        0 0 30px rgba(212, 168, 83, 0.4),
        0 0 60px rgba(212, 168, 83, 0.2),
        inset 0 0 30px rgba(212, 168, 83, 0.1);
    z-index: 10;
}
@keyframes corePulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(212, 168, 83, 0.4),
            0 0 60px rgba(212, 168, 83, 0.2),
            inset 0 0 30px rgba(212, 168, 83, 0.1);
    }
    50% {
        box-shadow:
            0 0 50px rgba(212, 168, 83, 0.6),
            0 0 100px rgba(212, 168, 83, 0.3),
            inset 0 0 40px rgba(212, 168, 83, 0.2);
    }
}
.core-icon {
    font-size: 2rem;
}
.core-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: 0.25rem;
}

/* Branch positioning */
.constellation-branch {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.branch-ai { top: 5%; left: 15%; }
.branch-crm { top: 5%; right: 15%; }
.branch-presales { bottom: 5%; left: 15%; }
.branch-dev { bottom: 5%; right: 15%; }

.branch-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.2) 0%, transparent 70%);
    border: 2px solid var(--accent);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(79, 70, 229, 0.3),
        0 0 40px rgba(79, 70, 229, 0.1);
    cursor: pointer;
}
.branch-main:hover {
    transform: scale(1.1);
    box-shadow:
        0 0 30px rgba(79, 70, 229, 0.5),
        0 0 60px rgba(79, 70, 229, 0.2);
}
.star-icon {
    font-size: 1.5rem;
}
.star-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-top: 0.25rem;
}

/* Skill nodes around branches */
.star-node {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.15) 0%, transparent 70%);
    border: 2px solid rgba(212, 168, 83, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: nodeFloat 4s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    box-shadow: 0 0 15px rgba(212, 168, 83, 0.2);
}
@keyframes nodeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.star-node:hover {
    transform: scale(1.2) !important;
    border-color: var(--gold);
    box-shadow: 0 0 25px rgba(212, 168, 83, 0.5);
}
.star-node.master {
    width: 55px;
    height: 55px;
    border-color: var(--gold);
    background: radial-gradient(circle, rgba(212, 168, 83, 0.25) 0%, transparent 70%);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.4);
}
.star-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* Position nodes around each branch */
.branch-ai .star-node:nth-of-type(1) { top: -30px; left: -60px; }
.branch-ai .star-node:nth-of-type(2) { top: 60px; left: -50px; }
.branch-ai .star-node:nth-of-type(3) { top: 20px; right: -70px; }

.branch-crm .star-node:nth-of-type(1) { top: -30px; right: -60px; }
.branch-crm .star-node:nth-of-type(2) { top: 60px; right: -50px; }
.branch-crm .star-node:nth-of-type(3) { top: 20px; left: -70px; }

.branch-presales .star-node:nth-of-type(1) { bottom: -30px; left: -60px; }
.branch-presales .star-node:nth-of-type(2) { bottom: 60px; left: -50px; }
.branch-presales .star-node:nth-of-type(3) { bottom: 20px; right: -70px; }

.branch-dev .star-node:nth-of-type(1) { bottom: -30px; right: -60px; }
.branch-dev .star-node:nth-of-type(2) { bottom: 60px; right: -50px; }
.branch-dev .star-node:nth-of-type(3) { bottom: 20px; left: -70px; }

/* Skill tooltip */
.skill-tooltip {
    position: fixed;
    padding: 0.5rem 1rem;
    background: rgba(15, 15, 26, 0.95);
    border: 1px solid var(--gold);
    border-radius: 8px;
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.3);
}
.skill-tooltip.visible {
    opacity: 1;
}

/* Constellation Responsive */
@media (max-width: 768px) {
    .constellation {
        height: 450px;
        transform: scale(0.85);
        transform-origin: center top;
    }
    .branch-ai { top: 3%; left: 10%; }
    .branch-crm { top: 3%; right: 10%; }
    .branch-presales { bottom: 3%; left: 10%; }
    .branch-dev { bottom: 3%; right: 10%; }
    .branch-main {
        width: 65px;
        height: 65px;
    }
    .star-node {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .constellation-core {
        width: 80px;
        height: 80px;
    }
}
@media (max-width: 500px) {
    .constellation {
        height: 380px;
        transform: scale(0.7);
    }
}

/* ---- Hobbies row ---- */
.hobbies-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.hobby-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
}
.hobby-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}
.hobby-icon { font-size: 2rem; margin-bottom: 1rem; }
.hobby-name {
    font-family: var(--font-heading);
    font-size: 1rem; font-weight: 600;
    margin-bottom: 0.25rem;
}
.hobby-detail { font-size: 0.8rem; color: var(--text-muted); }
.hobby-thumb-placeholder {
    background: var(--accent-soft); border-radius: 8px; padding: 2rem;
    text-align: center; color: var(--text-muted); font-size: 0.75rem;
}

/* ---- Portfolio ---- */
.portfolio-filters {
    display: flex; gap: 0.5rem;
    margin-bottom: 3rem; flex-wrap: wrap;
}
.filter-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-sec);
    font-family: var(--font-body);
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #0f0f0f;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}
.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition);
}
.portfolio-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}
.portfolio-thumb {
    width: 100%; height: 220px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(212,168,83,0.08));
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.portfolio-img {
    width: 100%; height: 100%; object-fit: cover;
}
.portfolio-thumb-placeholder {
    text-align: center; color: var(--text-muted); font-size: 0.8rem;
}
.portfolio-thumb-icon { font-size: 2.5rem; opacity: 0.3; margin-bottom: 0.5rem; display: block; }
.portfolio-status {
    position: absolute; top: 0.75rem; right: 0.75rem;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; padding: 0.25rem 0.75rem; border-radius: 20px;
}
.portfolio-status.building {
    background: rgba(234,179,8,0.15); color: #eab308; border: 1px solid rgba(234,179,8,0.3);
}
.portfolio-status.live {
    background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3);
}
.portfolio-body { padding: 1.5rem; }
.portfolio-tag {
    font-size: 0.7rem; color: var(--gold);
    text-transform: uppercase; letter-spacing: 1px;
    font-weight: 600; margin-bottom: 0.5rem;
}
.portfolio-title {
    font-family: var(--font-heading);
    font-size: 1.1rem; font-weight: 600;
    margin-bottom: 0.5rem;
}
.portfolio-desc {
    color: var(--text-muted); font-size: 0.9rem;
    margin-bottom: 1rem; line-height: 1.5;
}

/* ---- Services Detail Page ---- */
.service-hero {
    padding: 100px 0 60px;
    text-align: center;
}
.process-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.process-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
}
.process-number {
    font-family: var(--font-heading);
    font-size: 3rem; font-weight: 700;
    color: var(--accent);
    opacity: 0.2;
    margin-bottom: 1rem;
}
.process-title {
    font-family: var(--font-heading);
    font-size: 1.1rem; font-weight: 600;
    margin-bottom: 0.5rem;
}
.process-desc {
    color: var(--text-sec); font-size: 0.9rem; line-height: 1.6;
}

/* Pricing / CTA */
.cta-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 4rem;
    text-align: center;
}

/* ---- Contact ---- */
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: start;
}
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    display: flex; align-items: center; gap: 1rem;
    transition: all var(--transition);
}
.contact-card:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}
.contact-icon {
    width: 48px; height: 48px;
    background: var(--accent-soft);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.contact-icon svg { width: 20px; height: 20px; fill: var(--accent); }
.contact-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.contact-value { font-weight: 600; font-size: 0.95rem; }
.contact-value a { transition: color 0.2s; }
.contact-value a:hover { color: var(--gold); }

/* Contact form */
.contact-form {
    display: flex; flex-direction: column; gap: 1.25rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-sec);
    text-transform: uppercase; letter-spacing: 1px;
}
.form-input, .form-textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
}
.form-input:focus, .form-textarea:focus {
    border-color: var(--gold);
}
.form-textarea { resize: vertical; min-height: 140px; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

/* ---- Footer ---- */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}
.footer-inner {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 2rem;
    margin-bottom: 3rem;
}
.footer-brand { max-width: 300px; }
.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem; font-weight: 700;
    margin-bottom: 0.75rem;
}
.footer-logo span { color: var(--gold); }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.footer-nav-title {
    font-family: var(--font-heading);
    font-size: 0.8rem; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.footer-nav-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-nav-links a {
    color: var(--text-sec); font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-nav-links a:hover { color: var(--gold); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-muted);
}

/* ---- 3D Tilt (cards) ---- */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* ---- Section header ---- */
.section-header { margin-bottom: 4rem; }
.section-header .heading-sm { margin-bottom: 1rem; }
.section-header .heading-lg { margin-bottom: 1rem; }
.section-header .text-lg { max-width: 560px; }

/* ---- Magnetic button ---- */
.magnetic { transition: transform 0.3s var(--ease); }

/* ---- Text reveal animation ---- */
.text-reveal-word {
    display: inline-block;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.text-reveal-word.visible { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .nav-cta { display: none; }
    .nav-toggle { display: flex; }
    .mobile-menu { display: flex; }
    .hero .container { grid-template-columns: 1fr; text-align: center; }
    .hero-text { max-width: 100%; }
    .hero-photo { max-width: 320px; justify-self: center; }
    .hero-cta { justify-content: center; }
    .services-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .about-header { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; }
    .nav-controls { display: none; }
}

@media (max-width: 768px) {
    .section { padding: 80px 0; }
    .skills-grid { grid-template-columns: 1fr 1fr; }
    .hobbies-grid { grid-template-columns: 1fr 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: 1fr; }
    .hero-photo { max-width: 260px; aspect-ratio: 1; }
    .footer-bottom { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 1.25rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .skills-grid { grid-template-columns: 1fr; }
    .hobbies-grid { grid-template-columns: 1fr 1fr; }
    .hero-cta { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 300px; justify-content: center; }
}

/* ---- RTL Support ---- */
[dir="rtl"] { font-family: 'Noto Kufi Arabic', var(--font-body); }
[dir="rtl"] .heading-xl, [dir="rtl"] .heading-lg, [dir="rtl"] .heading-md, [dir="rtl"] .heading-sm {
    font-family: 'Noto Kufi Arabic', var(--font-heading);
}

/* ---- Print ---- */
@media print {
    .nav, .footer, .cursor-dot, .cursor-ring { display: none !important; }
    body { background: #fff; color: #000; }
    .page { padding-top: 0; }
}
