:root {
    --bg: #020617;
    --bg-alt: rgba(15, 23, 42, 0.9);
    --primary: #4f46e5;
    --primary2: #06b6d4;
    --text: #f9fafb;
    --muted: #cbd5f5;
    --border: rgba(148, 163, 184, 0.4);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #0f172a, #020617 60%);
    color: var(--text);
    line-height: 1.6;
}

.container {
    width: min(1120px, 100% - 3rem);
    margin: 0 auto;
}

.section {
    padding: 4.5rem 0;
}

.section-head {
    text-align: center;
    margin-bottom: 3rem;
}

.section-head h2 {
    font-size: 2rem;
}

.section-head p {
    color: var(--muted);
}

/* ================ Header ================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.9),
    rgba(30, 64, 175, 0.75)
  );
  border-bottom: 1px solid var(--border);
}

/* لوجو لاصق في الحافة الشمال تماماً */
.site-header .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0; /* شيل أي padding نهائي */
  box-sizing: border-box;
}

/* اللوجو */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0;
  padding-left: 0;
}

.brand-logo {
  width: 280px;
  height: 70px;
  display: block;
  margin: 0;
  padding: 0;
}

/* الـ Navbar */
.main-nav {
  margin-left: auto;
  padding-right: 100px; /* دخل البار شوية من اليمين */
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.3rem;
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
}

.main-nav a:hover {
  color: #e5e7eb;
}

/* Active link */
.main-nav a.active {
  color: var(--text);
  font-weight: 600;
  position: relative;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  border-radius: 999px;
}

/* زرار المنيو للموبايل */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.5rem;
}


/* ================ Hero ================ */

.hero {
    padding: 4.5rem 0 5rem;
    background: radial-gradient(circle at top, #1d4ed8, transparent 60%);
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 2.7rem;
    margin-bottom: 0.8rem;
}

.hero-text p {
    color: var(--muted);
    max-width: 34rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.8rem 0 1rem;
}

.btn {
    border-radius: 999px;
    padding: 0.65rem 1.7rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background: linear-gradient(120deg, var(--primary), var(--primary2));
    color: #f9fafb;
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.5);
}

.btn.ghost {
    border-color: var(--border);
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.hero-meta span {
    padding: 0.25rem 1rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Hero visual */

.hero-visual {
    display: flex;
    justify-content: flex-end;
}

.hero-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), #1e293b);
    border-radius: 1.5rem;
    padding: 1.8rem 1.6rem;
    border: 1px solid var(--border);
    max-width: 320px;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top, rgba(6, 182, 212, 0.4), transparent);
    opacity: 0.8;
}

/* ================ About ================ */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 3rem;
}

.about h2 {
    margin-bottom: 1rem;
}

.about h3 {
    margin-top: 1.4rem;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.about p {
    font-size: 0.95rem;
    color: var(--muted);
}

.about-visual {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.about-image-placeholder {
    min-height: 220px;
    border-radius: 1.2rem;
    background:
        radial-gradient(circle at top left, rgba(129, 140, 248, 0.6), transparent 55%),
        radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.5), transparent 55%),
        #020617;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    color: var(--text);
}

.about-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat {
    flex: 1 1 30%;
    border-radius: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.85);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary2);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ================ Cards ================ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}

.card {
    border-radius: 1.1rem;
    padding: 1.5rem 1.6rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.9);
    font-size: 0.95rem;
}

.card h3 {
    margin-bottom: 0.4rem;
}

.card p {
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.card ul {
    list-style: disc;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.project-card .tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: linear-gradient(120deg, var(--primary), var(--primary2));
}

/* ================ Contact ================ */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
}

.contact-text p {
    color: var(--muted);
    margin-bottom: 1rem;
}

.contact-info {
    list-style: none;
    font-size: 0.95rem;
    color: var(--muted);
}

.contact-info li + li {
    margin-top: 0.5rem;
}

.contact-form {
    border-radius: 1.2rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.9);
    padding: 1.8rem;
}

.field-group {
    margin-bottom: 1rem;
}

.field-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.field-group input,
.field-group textarea {
    width: 100%;
    border-radius: 0.65rem;
    border: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    background: #020617;
    color: var(--text);
}

.field-group input:focus,
.field-group textarea:focus {
    border-color: var(--primary2);
    outline: none;
}

/* ================ Footer ================ */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.3rem 0;
    background: #020617;
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

/* ================ Responsive ================ */

@media (max-width: 900px) {
    .hero-content,
    .about-grid,
    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .site-header .nav-container {
        padding: 0 16px;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        right: 1.5rem;
        top: 60px;
        background: #020617;
        border-radius: 0.8rem;
        border: 1px solid var(--border);
        padding: 0.75rem 1rem;
        display: none;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.7rem;
    }

    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .section {
        padding: 3.5rem 0;
    }
}
