/* ===================================================
   Portfolio Full Stack — Noussaiba Ghallabi
   Thème sombre "violet" — formes très arrondies / curvy
   =================================================== */

:root {
  --bg:        #0c0a14;   /* nuit violette */
  --bg-soft:   #110e1c;   /* section alternée */
  --surface:   #16121f;   /* cartes */
  --surface-2: #1d1830;
  --line:      rgba(168,140,255,.14);
  --line-2:    rgba(168,140,255,.24);
  --text:      #f3f0ff;
  --muted:     #b3aacb;
  --muted-2:   #7d7597;
  --accent:    #8b5cff;   /* violet électrique */
  --accent-2:  #a985ff;
  --accent-ink:#6b3df0;
  --accent-soft: rgba(139,92,255,.14);
  --accent-glow: rgba(139,92,255,.5);
  --accent-2glow: rgba(198,120,255,.4);

  --radius:    28px;
  --radius-lg: 40px;
  --radius-xl: 56px;
  --maxw: 1180px;

  --shadow-sm: 0 6px 22px -12px rgba(0,0,0,.7);
  --shadow:    0 26px 60px -26px rgba(60,20,140,.65);
  --shadow-lg: 0 40px 90px -30px rgba(80,30,180,.7);

  --font-sans:  'Space Grotesk', system-ui, sans-serif;
  --font-serif: 'Fraunces', 'Instrument Serif', Georgia, serif;
  --font-mono:  'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration: none; }
em { font-style: italic; }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ===== Décor de fond : halos violets flous + grille ténue ===== */
.bg-glow {
  position: fixed;
  top: -14%; right: -10%;
  width: 72vw; height: 72vw;
  max-width: 900px; max-height: 900px;
  background:
    radial-gradient(circle at 32% 30%, var(--accent-glow), transparent 60%),
    radial-gradient(circle at 78% 74%, var(--accent-2glow), transparent 60%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
  opacity: .6;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(168,140,255,.10) 1px, transparent 1.4px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 68% 14%, #000 0%, transparent 72%);
}

header, section, footer { position: relative; z-index: 1; }

/* ===================================================
   Header / Nav — pilule flottante arrondie
   =================================================== */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: padding .3s;
}
.header .nav {
  background: rgba(22,18,31,.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px 12px 22px;
  backdrop-filter: blur(14px) saturate(1.3);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.header.scrolled { padding: 12px 0; }
.header.scrolled .nav {
  background: rgba(18,14,26,.82);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark {
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(139,92,255,.35);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: .85rem;
}
.logo-text { letter-spacing: .5px; font-size: 1.05rem; }
.logo-text strong { color: var(--accent); }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--accent); border-radius: 2px; transition: width .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 16px; }

.lang-switch { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.lang-btn {
  background: none; border: none; color: var(--muted-2);
  font-family: var(--font-sans); font-size: .9rem; cursor: pointer;
  font-weight: 600; transition: color .2s;
}
.lang-btn.active { color: var(--text); }
.lang-btn:hover { color: var(--accent); }
.lang-sep { color: var(--muted-2); }

/* ===== Boutons — pilules ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-weight: 600; font-size: 1rem;
  padding: 15px 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn svg { transition: transform .2s; }
.btn:hover svg { transform: translateX(4px); }
.btn-sm { padding: 11px 22px; font-size: .92rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: #fff;
  box-shadow: 0 14px 34px -12px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 46px -12px var(--accent-glow); }

.btn-ghost {
  background: rgba(255,255,255,.04);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(139,92,255,.10); border-color: var(--accent); transform: translateY(-2px); }

.burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  z-index: 110; position: relative;
}
.burger span { width: 24px; height: 2px; background: var(--text); transition: transform .3s, opacity .3s; border-radius: 2px; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop { display: none; }

/* ===================================================
   Hero
   =================================================== */
.hero { padding: 210px 0 120px; }
.eyebrow, .section-eyebrow {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: 2px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  text-transform: uppercase;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  padding: 7px 16px;
  border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent); }

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -3px;
  margin-bottom: 32px;
}
.hero-title em {
  font-style: normal;
  font-weight: 500;
  letter-spacing: -3px;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 25%, #ecdcff 45%, var(--accent-2) 65%, var(--accent) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s linear infinite;
}

.hero-lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.18rem;
  margin-bottom: 40px;
}

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 80px; }

/* ===== Stats ===== */
.stats {
  display: flex; gap: 20px; flex-wrap: wrap;
  max-width: 780px;
}
.stat {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 3rem;
  letter-spacing: -2px;
  line-height: 1;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 25%, #ecdcff 45%, var(--accent-2) 65%, var(--accent) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s linear infinite;
}
.stat-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1.5px; color: var(--muted-2); text-transform: uppercase; }

/* ===================================================
   Sections
   =================================================== */
.section { padding: 112px 0; }
.section-alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-xl);
  margin: 0 12px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -1.5px;
  line-height: 1.08;
  margin-bottom: 24px;
  max-width: 16ch;
}
.section-title.big { max-width: none; }
.section-title em {
  font-style: normal;
  font-weight: 500;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 25%, #ecdcff 45%, var(--accent-2) 65%, var(--accent) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s linear infinite;
}

.lead { color: var(--muted); font-size: 1.12rem; max-width: 560px; }
.lead.center { margin: 0 auto; text-align: center; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 16px; }
.about-text strong { color: var(--text); }
.about-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.skill-card:hover { border-color: rgba(139,92,255,.5); transform: translateY(-4px); box-shadow: var(--shadow); }
.skill-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.skill-card p { color: var(--muted); font-size: .92rem; }

/* ===== Services ===== */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 50px; }
.service-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 40px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.service-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 62%);
  opacity: 0; transition: opacity .3s;
}
.service-card:hover { border-color: rgba(139,92,255,.5); transform: translateY(-5px); box-shadow: var(--shadow); }
.service-card:hover::before { opacity: 1; }
.service-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid rgba(139,92,255,.35);
  font-family: var(--font-serif); font-style: italic; font-weight: 500;
  color: var(--accent); font-size: 1.3rem;
}
.service-card h3 { font-size: 1.42rem; margin: 16px 0 10px; position: relative; }
.service-card p { color: var(--muted); position: relative; }

/* ===== Projects ===== */
.project-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.filter-btn {
  font-family: var(--font-sans); font-weight: 600; font-size: .9rem;
  color: var(--muted); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  padding: 9px 20px; border-radius: 999px;
  transition: color .2s, background .2s, border-color .2s;
}
.filter-btn:hover { color: var(--text); border-color: rgba(139,92,255,.5); }
.filter-btn.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-ink)); border-color: transparent; box-shadow: 0 12px 26px -12px var(--accent-glow); }

.project-card.hide { display: none; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
.project-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.project-card:hover { border-color: rgba(139,92,255,.5); transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.project-thumb {
  height: 220px;
  background: #0e0b18;
  display: flex; flex-direction: column;
  position: relative;
  padding: 12px 12px 0;
}
.browser-bar {
  height: 34px; flex: 0 0 34px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  background: #1a1528;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
}
.browser-dots { display: flex; gap: 6px; }
.browser-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.browser-dots .r { background: #ff5f57; }
.browser-dots .y { background: #febc2e; }
.browser-dots .g { background: #28c840; }
.browser-url {
  flex: 1; height: 18px; border-radius: 999px;
  background: #0e0b18; border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .62rem; color: var(--muted-2);
  display: flex; align-items: center; padding: 0 10px;
  overflow: hidden; white-space: nowrap;
}
.browser-shot {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1d1830, #0e0b18);
  border: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
}
.browser-shot::after {
  content: attr(data-initials);
  font-family: var(--font-serif); font-style: italic; font-size: 3.2rem;
  color: var(--accent); opacity: .35;
}
.browser-shot img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block; background: #0e0b18;
  transition: transform .5s ease;
}
.project-card:hover .browser-shot img { transform: scale(1.04); }
.project-body { padding: 26px 28px 30px; }
.project-tag { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1px; color: var(--muted-2); text-transform: uppercase; }
.project-body h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.4rem; margin: 10px 0 8px; }
.project-body p { color: var(--muted); font-size: .95rem; margin-bottom: 16px; }
.project-link { color: var(--accent); font-weight: 600; font-size: .95rem; transition: color .2s; }
.project-link:hover { color: var(--accent-2); }

/* ===== Articles ===== */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 50px; }
.article-card {
  display: block; padding: 34px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.article-card:hover { border-color: rgba(139,92,255,.5); transform: translateY(-4px); box-shadow: var(--shadow); }
.article-date {
  display: inline-block;
  font-family: var(--font-mono); font-size: .72rem; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(139,92,255,.3);
  padding: 4px 12px; border-radius: 999px;
}
.article-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.25rem; margin: 14px 0 8px; }
.article-card p { color: var(--muted); font-size: .92rem; }

/* ===== Contact ===== */
.contact-inner { text-align: center; }
.contact .section-eyebrow { justify-content: center; }
.contact-methods {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-top: 34px;
}
.contact-method {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 14px 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.contact-method:hover { border-color: rgba(139,92,255,.55); transform: translateY(-3px); box-shadow: var(--shadow); }
.contact-method-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 1.1rem;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(139,92,255,.35);
}
.contact-method span { display: flex; flex-direction: column; text-align: left; font-weight: 600; }
.contact-method small {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted-2); font-weight: 400;
}

.contact-form {
  max-width: 620px; margin: 32px auto 0;
  display: flex; flex-direction: column; gap: 16px; text-align: left;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input, .contact-form textarea {
  width: 100%;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 16px 20px;
  color: var(--text); font-family: var(--font-sans); font-size: 1rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
  resize: vertical;
}
.contact-form textarea { border-radius: 26px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted-2); }
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.contact-form .btn { align-self: center; margin-top: 8px; }
.form-status { text-align: center; color: var(--accent); font-size: .95rem; min-height: 1.2em; }

/* ===== Footer ===== */
.footer { padding: 56px 0; margin-top: 12px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 34px 40px;
}
.footer p { color: var(--muted-2); font-size: .9rem; }
.socials { display: flex; gap: 24px; }
.socials a { color: var(--muted); font-size: .9rem; transition: color .2s; }
.socials a:hover { color: var(--accent); }

/* ===== Floating button ===== */
.float-btn {
  position: fixed; bottom: 26px; right: 26px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(29,24,48,.85); border: 1px solid var(--line-2);
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.float-btn:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.float-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Dégradé brillant animé sur les mots accentués */
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-title em, .section-title em, .stat-num, .float-dot { animation: none; }
}

/* ===== Reveal on scroll ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 900px) {
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: 78%;
    max-width: 340px;
    flex-direction: column; justify-content: center; gap: 28px;
    background: var(--bg-soft); border-left: 1px solid var(--line-2);
    border-radius: 40px 0 0 40px;
    padding: 40px; transform: translateX(100%); transition: transform .35s;
    z-index: 90;
  }
  .nav-links.open { transform: translateX(0); box-shadow: -20px 0 60px rgba(0,0,0,.6); }
  .nav-links a { font-size: 1.3rem; }
  .burger { display: flex; }
  .nav-actions .btn-sm { display: none; }

  .nav-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 80;
    background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav-backdrop.open { opacity: 1; visibility: visible; }

  .about-grid, .services-grid, .projects-grid, .articles-grid { grid-template-columns: 1fr; }
  .about-skills { grid-template-columns: 1fr 1fr; }
  .stats { gap: 14px; }
  .stat-num { font-size: 2.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 150px 0 90px; }
  .section-alt { margin: 0 8px; border-radius: 40px; }
}

@media (max-width: 520px) {
  .about-skills { grid-template-columns: 1fr; }
  .stats { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; padding: 30px 24px; }
}
