:root {
  --blue-300: #7AAEFF;
  --blue-400: #5587E6;
  --blue-500: #3B6BE0;
  --blue-600: #2C57C5;
  --indigo:   #6B5CE7;
  --slate:    #4A7FA5;
  --sky:      #38AACC;
  --black-600: #282838;
  --black-700: #1E1E2E;
  --black-800: #171722;
  --black-900: #111119;
  --white-50:  #FAFAFA;
  --white-400: #C5C6CE;
  --white-500: #9899A6;
  --white-600: #6A6B7A;
  --font-display: -apple-system,'SF Pro Display',BlinkMacSystemFont,'DM Sans',sans-serif;
  --font-sans: 'DM Sans',sans-serif;
  --border: 1px solid #1E1E2E;
  --radius-pill: 9999px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --max-w: 1100px;
  --px: 48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Loader ─────────────────────────────────────────────── */
#site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black-900);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#site-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid rgba(59,107,224,.18);
  border-top-color: var(--blue-500);
  animation: loaderSpin 0.75s linear infinite;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

body {
  background: var(--black-900);
  color: var(--white-50);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(17,17,25,0.72);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.navbar {
  max-width: var(--max-w); margin: 0 auto;
  padding: 32px var(--px);
  display: flex; align-items: center;
  position: relative;
}
.nav-logo { font-size: 16px; font-weight: 700; color: var(--white-50); letter-spacing: .06em; cursor: pointer; text-decoration: none; }
.nav-divider { display: none; }
.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
}
.nav-link {
  font-size: 16px; font-weight: 400; color: var(--white-500);
  padding: 6px 16px; border-radius: var(--radius-pill);
  cursor: pointer; text-decoration: none;
  transition: background 150ms, color 150ms;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: var(--white-50); }
.nav-link.active { color: var(--white-50); background: rgba(255,255,255,.06); }
.nav-cta {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 20px; border-radius: var(--radius-pill);
  background: var(--white-50); color: var(--black-900);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: transform 150ms, opacity 150ms;
}
.nav-cta:hover { transform: translateY(-2px); opacity: .9; }

/* ── Section wrapper ──────────────────────────────────── */
.section { max-width: var(--max-w); margin: 0 auto; padding: 80px var(--px); }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--white-500); margin-bottom: 32px; }
.section-divider { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--px); }
.section-divider hr { border: none; border-top: var(--border); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  min-height: 84vh; display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; max-width: var(--max-w); margin: 0 auto;
  padding: 120px var(--px) 10px; gap: 0;
}
.hero-eyebrow { font-size: 13px; font-weight: 400; color: var(--white-500); letter-spacing: .03em; margin-bottom: 28px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 700; line-height: 1.07; letter-spacing: -0.015em; color: var(--white-50);
}
.hero-title .accent { color: var(--blue-400); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-pill);
  background: var(--blue-500); color: #fff;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
  transition: opacity 150ms, transform 150ms;
}
.btn-primary:hover { opacity: .85; transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-pill);
  background: transparent; color: var(--white-400);
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  border: var(--border); cursor: pointer; text-decoration: none;
  transition: background 150ms, color 150ms;
}
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--white-50); }

/* ── Badge cloud ──────────────────────────────────────── */
.hero-right { position: relative; height: 480px; }
.badge-cloud { position: relative; width: 100%; height: 100%; }
.badge {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-weight: 600; white-space: nowrap;
  border: 1px solid; backdrop-filter: blur(8px);
  transition: scale 200ms ease, translate 200ms ease, box-shadow 300ms ease;
  cursor: default;
  opacity: 0;
  scale: 0.5;
}
.badge:hover {
  scale: 1.06 !important;
  translate: 0 -8px !important;
}

@keyframes badgePop {
  0%   { opacity: 0; scale: 0.4; }
  60%  { opacity: 1; scale: 1.14; }
  100% { opacity: 1; scale: 1; }
}

@keyframes badgeFloat {
  0%, 100% { translate: 0 0px; }
  50%       { translate: 0 -10px; }
}

.badge.badge-floating {
  animation: badgeFloat var(--float-dur, 3.8s) ease-in-out var(--float-delay, 0s) infinite;
}
.badge::before { content: '◆'; font-size: 8px; }
.badge-xl { font-size: 20px; padding: 15px 28px; }
.badge-xl::before { font-size: 11px; }
.badge-lg { font-size: 16px; padding: 12px 22px; }
.badge-md { font-size: 13px; }
.badge-sm { font-size: 11px; padding: 8px 14px; }

.b-cobalt  { background:rgba(59,107,224,.18); border-color:rgba(85,135,230,.35); color:#7AAEFF; }
.b-cobalt::before  { color:var(--blue-400); }
.b-indigo  { background:rgba(107,92,231,.15); border-color:rgba(107,92,231,.3); color:#A99EF5; }
.b-indigo::before  { color:#8B7FEF; }
.b-slate   { background:rgba(74,127,165,.14); border-color:rgba(74,127,165,.3); color:#7AB8D8; }
.b-slate::before   { color:var(--slate); }
.b-sky     { background:rgba(56,170,204,.12); border-color:rgba(56,170,204,.28); color:#6DCCE6; }
.b-sky::before     { color:var(--sky); }
.b-dim     { background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.1); color:var(--white-400); }
.b-dim::before     { color:var(--white-600); }

/* ── Projects card ────────────────────────────────────── */
.projects-card {
  background: var(--black-800); border: var(--border);
  box-shadow: 0 2px 40px rgba(0,0,0,.5);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}
.tabs-bar {
  display: flex; gap: 8px; align-items: flex-end;
  background: transparent;
  border-bottom: none;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px 11px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--white-600);
  background: rgba(17,17,25,.7);
  border: 1px solid rgba(255,255,255,.07);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer; white-space: nowrap;
  transition: color 200ms, background 200ms;
  position: relative; margin-bottom: -1px; z-index: 1;
}
.tab-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--black-600); transition: background 200ms; flex-shrink: 0; }
.tab-btn:hover { color: var(--white-400); background: rgba(23,23,34,.9); }
.tab-btn.active {
  color: var(--white-50); font-weight: 600;
  background: var(--black-800);
  border-color: #1E1E2E;
  border-bottom: 1px solid var(--black-800);
  font-size: 14px;
  padding: 13px 24px 14px;
  z-index: 3;
}
.tab-btn.active .dot { background: var(--blue-500); box-shadow: 0 0 6px rgba(59,107,224,.6); }

.tab-panel { display: none; }
.tab-panel.active {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  height: 400px;
  border-top: var(--border);
}

/* Panel image */
.panel-image {
  grid-column: 2;
  border-left: var(--border);
  display: flex;
  align-items: stretch;
  background: var(--black-700);
}
.panel-img-inner {
  flex: 1;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  min-height: 0;
}

/* Gradient placeholders — remplacez par background-image: url(...) */
.panel-image--attjariwafa .panel-img-inner {
  background-image: url('Assets/attijarimockup.png');
  background-size: 100%;
  background-position: center 30%;
  box-shadow: inset 0 0 60px rgba(59,107,224,.12);
}
.panel-image--startici .panel-img-inner {
  background-image: url('Assets/starticimockup.png');
  background-size: 120%;
  background-position: center 30%;
  box-shadow: inset 0 0 60px rgba(59,107,224,.12);
}
.panel-image--domus .panel-img-inner {
  background-image: url('Assets/domusmockup.png');
  background-size: 120%;
  background-position: center 30%;
  box-shadow: inset 0 0 60px rgba(56,170,204,.1);
}

/* Panel content */
.panel-content {
  padding: 36px 36px; display: flex; flex-direction: column;
  justify-content: flex-start; gap: 14px;
  grid-column: 1;
  background: linear-gradient(135deg, rgba(59,107,224,.04) 0%, transparent 60%);
  overflow: hidden;
}
.panel-year { font-size: 11px; font-weight: 700; color: var(--blue-500); letter-spacing: .08em; text-transform: uppercase; }
.panel-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.12; color: var(--white-50); }
.panel-desc { font-size: 14px; line-height: 1.65; color: var(--white-500); }
.panel-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid rgba(59,107,224,.3); font-size: 12px; font-weight: 500;
  color: var(--blue-300); background: rgba(59,107,224,.08); white-space: nowrap;
  transition: background 150ms, border-color 150ms;
}
.tag::before { content: '◆'; color: var(--blue-500); font-size: 7px; }
.tag:hover { background: rgba(59,107,224,.15); border-color: rgba(59,107,224,.45); }
.panel-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: auto;
  padding: 10px 20px; border-radius: var(--radius-pill);
  background: var(--blue-500); color: #fff;
  font-size: 13px; font-weight: 600; text-decoration: none;
  border: none; cursor: pointer; align-self: flex-start;
  transition: background 150ms, transform 150ms;
  box-shadow: 0 4px 16px rgba(59,107,224,.3);
}
.panel-cta:hover { background: var(--blue-600); transform: translateY(-1px); }

/* ── About ────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: center; }
.about-photo-wrap { position: relative; }
.about-photo { width: 260px; height: 300px; border-radius: var(--radius-lg); background: var(--black-700); overflow: hidden; border: var(--border); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-badge-float {
  position: absolute; top: -14px; left: -14px;
  background: var(--blue-500); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 9px 14px; border-radius: var(--radius-pill);
  white-space: nowrap; box-shadow: 0 4px 20px rgba(59,107,224,.45);
}
.about-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-500); margin-bottom: 16px;
}
.about-tag::before { content: ''; display: block; width: 20px; height: 2px; background: var(--blue-500); border-radius: 2px; }
.about-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.12; color: var(--white-50); margin-bottom: 18px; }
.about-title em { font-style: normal; color: var(--blue-400); }
.about-body { font-size: 15px; line-height: 1.7; color: var(--white-500); margin-bottom: 28px; }
.about-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.about-stat { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 2px solid var(--black-600); }
.about-stat-num { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--white-50); }
.about-stat-label { font-size: 11px; color: var(--white-600); }

/* ── Footer ───────────────────────────────────────────── */
.footer { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--px) 60px; }
.footer-cta-card {
  background: linear-gradient(135deg, rgba(59,107,224,.1) 0%, rgba(23,23,34,1) 55%);
  border: 1px solid rgba(59,107,224,.22);
  border-radius: var(--radius-xl);
  padding: 48px 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  margin-bottom: 32px; position: relative; overflow: hidden;
}
.footer-cta-card::before {
  content: ''; position: absolute; top: -80px; left: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(59,107,224,.12) 0%, transparent 70%);
  pointer-events: none;
}
.footer-cta-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-500); margin-bottom: 10px; }
.footer-cta-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--white-50); margin-bottom: 6px; }
.footer-cta-sub { font-size: 14px; color: var(--white-500); }
.footer-cta-actions { display: flex; flex-direction: row; gap: 10px; align-items: center; flex-shrink: 0; }
.cta-icon-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none;
  transition: transform 150ms, opacity 150ms; white-space: nowrap;
}
.cta-icon-btn:hover { transform: translateY(-2px); opacity: .9; }
.cta-btn-primary { background: var(--white-50); color: var(--black-900); }
.cta-btn-secondary { background: rgba(255,255,255,.07); color: var(--white-400); border: var(--border); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: var(--border); }
.footer-copy { font-size: 12px; color: var(--white-600); }
.footer-links { display: flex; gap: 20px; }
.footer-link { font-size: 12px; color: var(--white-600); text-decoration: none; transition: color 150ms; }
.footer-link:hover { color: var(--white-400); }

/* ── Burger button ────────────────────────────────────── */
.nav-burger {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--white-50);
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  transition: border-color 150ms, background 150ms;
}
.nav-burger:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); }
.nav-burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 280ms ease, opacity 200ms ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile menu dropdown ─────────────────────────────── */
.nav-mobile-menu {
  display: none; /* visible only below 768px */
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  background: var(--black-800);
  transition: max-height 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-mobile-menu.open { max-height: 260px; border-top: var(--border); }
.nav-mobile-link {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--white-500);
  text-decoration: none;
  padding: 16px 20px;
  border-bottom: var(--border);
  transition: color 150ms, background 150ms;
}
.nav-mobile-link:last-child { border-bottom: none; }
.nav-mobile-link:hover { color: var(--white-50); background: rgba(255,255,255,.04); }
.nav-mobile-link.active { color: var(--white-50); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 96px var(--px) 52px;
    gap: 40px;
  }
  .hero-right {
    height: auto;
  }
  .badge-cloud {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .badge {
    position: static !important;
    transform: none !important;
  }
  .badge:hover {
    transform: translateY(-4px) scale(1.04) !important;
  }
}

@media (max-width: 768px) {
  :root { --px: 20px; }
  /* Navbar mobile */
  .navbar { padding: 16px 20px; }
  .nav-links { display: none; }
  .nav-cta  { display: none; }
  .nav-burger { display: flex; margin-left: auto; }
  /* Hide desktop mobile menu on larger screens */
  .nav-mobile-menu { display: flex; }

  .tabs-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs-bar::-webkit-scrollbar { display: none; }
  .tab-panel.active {
    grid-template-columns: 1fr;
  }
  .panel-image {
    min-height: 220px;
  }
  .panel-content {
    padding: 24px 20px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-photo-wrap {
    display: flex;
    justify-content: center;
    padding-top: 18px;
  }
  .about-photo {
    width: 200px;
    height: 240px;
  }
  .about-photo img {
    object-position: center 15%;
  }
  .about-badge-float {
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
  }
  .footer-cta-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px;
  }
  .footer-cta-actions {
    flex-wrap: wrap;
  }
  .footer-cta-title {
    font-size: 22px;
  }
  .panel-title {
    font-size: 22px;
  }
}

/* ── 404 ──────────────────────────────────────────────── */
.notfound-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 140px var(--px) 80px;
  gap: 0;
}
.notfound-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.notfound-ghost {
  margin-bottom: 32px;
}
.notfound-code {
  font-family: var(--font-display);
  font-size: clamp(96px, 14vw, 180px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--blue-400) 0%, var(--indigo) 60%, rgba(59,107,224,.25) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: notfoundPulse 3.5s ease-in-out infinite;
  user-select: none;
}
@keyframes notfoundPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}
.notfound-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--white-50);
  margin-bottom: 18px;
}
.notfound-title .accent { color: var(--blue-400); }
.notfound-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--white-500);
  margin-bottom: 36px;
}

/* Badge positions */
.notfound-badges {
  position: relative;
  height: 480px;
}
.notfound-badges .badge {
  position: absolute;
  opacity: 0;
  scale: 0.5;
}
.nf-b1 { top: 6%;  left: 8%;   transform: rotate(-4deg); }
.nf-b2 { top: 30%; right: 4%;  transform: rotate(6deg);  }
.nf-b3 { top: 14%; right: 20%; transform: rotate(9deg);  }
.nf-b4 { top: 50%; left: 20%;  transform: rotate(-2deg); }
.nf-b5 { bottom: 38%; right: 6%;  transform: rotate(-6deg); }
.nf-b6 { bottom: 18%; left: 2%;   transform: rotate(-4deg); }

@media (max-width: 768px) {
  .notfound-section {
    grid-template-columns: 1fr;
    padding-top: 110px;
    gap: 40px;
  }
  .notfound-badges {
    height: auto;
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .notfound-badges .badge {
    position: static !important;
    transform: none !important;
  }
}

/* ── Scroll animations ───────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-stagger > *:nth-child(1) { transition-delay:   0ms; }
.fade-stagger > *:nth-child(2) { transition-delay:  90ms; }
.fade-stagger > *:nth-child(3) { transition-delay: 180ms; }
.fade-stagger > *:nth-child(4) { transition-delay: 270ms; }
.fade-stagger > *:nth-child(5) { transition-delay: 360ms; }
.fade-stagger > *:nth-child(6) { transition-delay: 450ms; }
.fade-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}
