/* ═══════════════════════════════════════════════════
   SECTIONS — Layout for each page section
   ═══════════════════════════════════════════════════ */

/* ══════════════ NAVBAR ══════════════ */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: var(--z-nav);
  padding: var(--space-md) 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.navbar.scrolled {
  background: rgba(6, 6, 9, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  padding: var(--space-sm) 0;
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  transition: color var(--duration-fast) var(--ease-out);
}

.logo-dot {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

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

.nav-link.active {
  background: var(--primary-subtle);
  color: var(--primary-light);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  z-index: calc(var(--z-nav) + 10);
}

.hamburger .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration-fast) var(--ease-out);
}

.hamburger.open .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ══════════════ HERO ══════════════ */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-5xl) var(--space-xl);
}

.hero-calligraphy {
  position: absolute;
  inset: 0;
  background-image: url('../assets/omar-kayyali-calligraphy-hero.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  mix-blend-mode: screen;
  filter: brightness(1.2) contrast(1.1);
  transition: transform 0.1s linear;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(122, 16, 34, 0.5) 0%, rgba(30, 58, 138, 0.5) 100%),
    linear-gradient(to bottom, rgba(6, 6, 9, 0.7) 0%, rgba(6, 6, 9, 0.95) 100%);
  z-index: 1;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.hero-glow--primary {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: 20%;
  right: 10%;
  animation: float-glow 8s ease-in-out infinite;
}

.hero-glow--secondary {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: 20%;
  left: 10%;
  animation: float-glow 8s ease-in-out infinite reverse;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.hero-description {
  font-size: var(--fs-body);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: var(--lh-relaxed);
}

.hero-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0.5;
  animation: fade-bounce 3s ease-in-out infinite;
}

.scroll-mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 14px;
  position: relative;
}

.scroll-wheel {
  width: 3px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-down 2s ease-in-out infinite;
}

/* ══════════════ ABOUT ══════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-4xl);
  align-items: start;
}

.about-image-wrapper {
  position: sticky;
  top: 120px;
}

.about-image {
  position: relative;
  width: 280px;
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.about-image-border {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 1px solid var(--glass-border);
  pointer-events: none;
}

.about-bio {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-2xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

/* ══════════════ SKILLS ══════════════ */
.skill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.skill-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  background: transparent;
  transition: all var(--duration-fast) var(--ease-out);
}

.skill-tab:hover {
  border-color: rgba(122, 16, 34, 0.2);
  color: var(--text-primary);
}

.skill-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  min-height: 100px;
}

/* ══════════════ PROJECTS ══════════════ */
.project-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  margin-bottom: var(--space-2xl);
  min-height: 400px;
}

.project-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.project-image-placeholder {
  color: var(--text-muted);
}

.project-info {
  padding: var(--space-lg) 0;
}

.project-tag {
  display: inline-block;
  font-family: var(--font-latin);
  font-size: var(--fs-tag);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: var(--space-md);
}

.project-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-md);
  line-height: var(--lh-tight);
}

.project-desc {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-lg);
}

.project-challenge {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-lg);
  padding-right: var(--space-md);
  border-right: 2px solid var(--primary);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.tech-badge {
  font-family: var(--font-latin);
  font-size: var(--fs-tag);
  font-weight: var(--fw-medium);
  padding: var(--space-xs) var(--space-md);
  background: var(--secondary-subtle);
  color: var(--secondary-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(30, 58, 138, 0.15);
}

.project-links {
  display: flex;
  gap: var(--space-md);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-latin);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.project-link:hover {
  color: var(--primary-light);
}

/* Project Nav */
.project-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
}

.project-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.project-nav-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: var(--primary-subtle);
}

.project-dots {
  display: flex;
  gap: var(--space-sm);
}

.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.project-dot.active {
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  width: 28px;
  border-radius: 5px;
}

/* ══════════════ EXPERIENCE TIMELINE ══════════════ */
.timeline {
  position: relative;
  padding: var(--space-xl) 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 50%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--glass-border) 10%, var(--glass-border) 90%, transparent);
  transform: translateX(50%);
}

.timeline-item {
  position: relative;
  display: flex;
  margin-bottom: var(--space-3xl);
  width: 50%;
}

.timeline-item:nth-child(even) {
  margin-right: 0;
  margin-left: auto;
  padding-right: var(--space-3xl);
}

.timeline-item:nth-child(odd) {
  padding-left: var(--space-3xl);
  direction: ltr;
  text-align: left;
}

.timeline-item:nth-child(odd) .timeline-card {
  direction: rtl;
  text-align: right;
}

.timeline-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 20px var(--primary-glow);
  z-index: 2;
}

.timeline-item:nth-child(even) .timeline-dot {
  right: -7px;
}

.timeline-item:nth-child(odd) .timeline-dot {
  left: -7px;
}

/* ══════════════ CERTIFICATIONS ══════════════ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
}

/* ══════════════ CONTACT ══════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-lg) 0 var(--space-sm);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: var(--fs-body);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--primary-light);
  outline: none;
}

.form-group label {
  position: absolute;
  top: var(--space-lg);
  right: 0;
  font-size: var(--fs-body);
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: -4px;
  font-size: var(--fs-tag);
  color: var(--primary-light);
}

/* Trick: use placeholder=" " for :not(:placeholder-shown) */
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: transparent;
}

.form-line {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient-h);
  transition: width var(--duration-normal) var(--ease-out);
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line {
  width: 100%;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.contact-card h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-md);
}

.contact-card p {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ══════════════ FOOTER ══════════════ */
.footer {
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.footer-text {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .about-image-wrapper {
    position: static;
    display: flex;
    justify-content: center;
  }

  .project-showcase {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .timeline-line {
    right: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    padding-right: var(--space-3xl) !important;
    padding-left: 0 !important;
    margin-right: 0;
    direction: rtl;
    text-align: right;
  }

  .timeline-item:nth-child(odd) .timeline-card {
    direction: rtl;
    text-align: right;
  }

  .timeline-item .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot,
  .timeline-item:nth-child(odd) .timeline-dot {
    right: 13px;
    left: auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(6, 6, 9, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    transition: right var(--duration-normal) var(--ease-out);
    border-left: 1px solid var(--glass-border);
  }

  .nav-links.open {
    right: 0;
  }

  .hamburger {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

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

  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .hero-glow--primary,
  .hero-glow--secondary {
    width: 250px;
    height: 250px;
  }
}

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

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

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

  .btn {
    width: 100%;
    justify-content: center;
  }

  .skill-tabs {
    justify-content: center;
  }
}
