/* ============================================
   Modern Portfolio - Omar Soliman
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-primary: #0b0b0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a28;
  --bg-card-hover: #22223a;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1100px;
  --nav-height: 64px;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

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

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

ul { list-style: none; }

::selection {
  background: var(--accent);
  color: #fff;
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 48px;
  line-height: 1.2;
}

/* --- Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.nav-logo span {
  color: var(--accent-light);
}

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

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-light);
  transition: width var(--transition);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  padding: 8px 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 14px;
  color: var(--accent-light) !important;
  font-weight: 500;
}

.nav-cta:hover {
  background: var(--accent-glow);
}

.nav-cta::after { display: none !important; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

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

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

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

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent-light);
  margin-bottom: 16px;
  display: block;
}

.hero-name {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.hero-title {
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 24px;
}

.hero-description {
  max-width: 540px;
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 40px;
  color: var(--text-secondary);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--accent-light);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-glow);
  color: var(--accent-light);
  transform: translateY(-2px);
}

.hero-social {
  display: flex;
  gap: 20px;
  margin-top: 48px;
}

.hero-social a {
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
}

.hero-social a:hover {
  color: var(--accent-light);
  transform: translateY(-2px);
}

.hero-social svg {
  width: 22px;
  height: 22px;
}

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

.about-text p {
  margin-bottom: 20px;
  font-size: 16px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.stat-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Skills --- */
.skills-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
}

.skill-group:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.skill-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}

.skill-tag:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* --- Experience --- */
.timeline {
  position: relative;
  padding-left: 32px;
}

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

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline-item:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.timeline-company {
  font-size: 15px;
  color: var(--accent-light);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-desc {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.timeline-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-project-tag {
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 6px;
  font-size: 12px;
  color: var(--accent-light);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

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

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-light);
}

.project-icon svg {
  width: 22px;
  height: 22px;
}

.project-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.project-company {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.project-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tags span {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --- Project Store Links --- */
.project-store-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.store-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.store-link:hover {
  color: var(--accent-light);
  background: var(--accent-glow);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.store-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Freelance Section --- */
.freelance-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.freelance-content {
  text-align: center;
}

.freelance-intro {
  font-size: 17px;
  max-width: 680px;
  margin: 0 auto 48px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.freelance-services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.freelance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: left;
  transition: all var(--transition);
}

.freelance-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.freelance-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-light);
}

.freelance-card-icon svg {
  width: 24px;
  height: 24px;
}

.freelance-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.freelance-card p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.freelance-cta {
  padding: 16px 40px;
  font-size: 16px;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: start;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
  resize: vertical;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-submit {
  align-self: flex-start;
  cursor: pointer;
}

.form-status {
  font-size: 14px;
  margin-top: 4px;
  min-height: 20px;
}

.form-status.success {
  color: #34d399;
}

.form-status.error {
  color: #f87171;
}

/* Info sidebar */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-info-block h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.contact-info-block h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.contact-info-block p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.contact-detail {
  font-size: 15px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.contact-detail:hover {
  color: var(--accent-light);
}

.contact-socials {
  display: flex;
  gap: 16px;
  padding-top: 8px;
}

.contact-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.contact-socials a:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
  transform: translateY(-3px);
}

.contact-socials svg {
  width: 18px;
  height: 18px;
}

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

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

/* --- Mobile Menu Overlay --- */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(11, 11, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

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

.mobile-menu a {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mobile-menu a:hover {
  color: var(--text-primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .section {
    padding: 72px 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

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

  .freelance-services {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .form-submit {
    align-self: stretch;
  }

  .hero-name {
    letter-spacing: -1px;
  }

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

  .btn {
    justify-content: center;
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .section-title {
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .about-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 20px 16px;
  }

  .stat-number {
    font-size: 28px;
  }

  .container {
    padding: 0 16px;
  }
}
