/* ============================================
   AZZOUZ Portfolio — Main Stylesheet
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #7C3AED;
  --purple-light: #A78BFA;
  --purple-dark: #4C1D95;
  --cyan: #06B6D4;
  --bg: #070711;
  --surface: #0F0F1A;
  --surface2: #16162A;
  --border: rgba(255,255,255,0.08);
  --text: #F1F0FF;
  --muted: #9091A8;
  --gold: #F59E0B;
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(7, 7, 17, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: white;
}

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

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 2px;
  transition: width var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  background: linear-gradient(135deg, var(--purple), #9333EA);
  color: white !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 600;
}

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

.nav-cta:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

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

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

/* ============================================
   Hero Section
   ============================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.2) 0%, rgba(6, 182, 212, 0.05) 40%, transparent 70%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 740px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--purple-light);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 28px;
  animation: fadeDown 0.6s ease both;
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeDown 0.7s 0.1s ease both;
}

.typed-text {
  position: relative;
  color: var(--cyan);
}

.typed-text::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--cyan);
  margin-left: 2px;
}

.hero-sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 36px;
  font-weight: 300;
  animation: fadeDown 0.7s 0.2s ease both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 56px;
  animation: fadeUp 0.7s 0.3s ease both;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #9333EA);
  color: white;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-outline:hover {
  border-color: var(--purple-light);
  background: rgba(124, 58, 237, 0.08);
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  animation: fadeUp 0.7s 0.4s ease both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ============================================
   Sections (shared)
   ============================================ */

.section {
  padding: 100px 0;
  position: relative;
}

.section-alt {
  background: var(--surface);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   About Section
   ============================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-text p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-text strong {
  color: var(--text);
}

.about-links {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

.about-link:hover {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(-2px);
}

.about-link svg {
  color: var(--purple-light);
}

.about-skills {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.skill-cat-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

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

.skill-tag {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  transition: var(--transition);
}

.skill-tag:hover {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--purple);
}

/* ============================================
   Services Section
   ============================================ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card:hover {
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.08);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--purple-light);
}

.service-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

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

.service-tags span {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
}

/* ============================================
   Projects Section
   ============================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.1);
}

.project-featured {
  grid-column: span 2;
  flex-direction: row;
}

.project-visual {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.06));
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 180px;
}

.project-featured .project-visual {
  min-width: 280px;
  min-height: auto;
}

.project-icon-lg {
  width: 80px;
  height: 80px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
}

.project-badge-type {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(7, 7, 17, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-info {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.project-info p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.project-tech span {
  font-size: 11px;
  color: var(--muted);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  padding: 4px 10px;
  border-radius: 100px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-light);
  transition: var(--transition);
}

.project-link:hover {
  color: var(--cyan);
  gap: 10px;
}

/* ============================================
   Resources Section
   ============================================ */

.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .resources-grid { grid-template-columns: 1fr; }
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}

.resource-card:hover {
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.08);
}

.resource-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
  flex-shrink: 0;
}

.resource-info h3 {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.resource-info p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.resource-cta {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-light);
}

/* ============================================
   Contact Section
   ============================================ */

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 48px;
  position: relative;
  overflow: hidden;
}

.contact-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--purple));
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: var(--transition);
}

.contact-item:hover {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-2px);
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
  flex-shrink: 0;
}

.contact-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 2px;
}

.contact-value {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}

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

.footer-brand p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

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

.footer-links a {
  font-size: 13px;
  color: var(--muted);
  transition: color var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
}

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

/* ============================================
   Animations
   ============================================ */

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

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

  .project-featured {
    grid-column: span 1;
    flex-direction: column;
  }

  .project-featured .project-visual {
    min-width: auto;
  }

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

  .contact-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 40px;
    transition: right var(--transition);
    z-index: 999;
  }

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

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

  .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);
  }

  .hero {
    padding: 100px 0 60px;
    min-height: auto;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stat-num {
    font-size: 22px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

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

  .section {
    padding: 72px 0;
  }

  .contact-box {
    padding: 40px 24px;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 32px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }

  .hero-stat-divider {
    width: 40px;
    height: 1px;
  }

  .about-links {
    flex-direction: column;
  }
}
