/* ============================================================
   SHARED.CSS — Portfolio Bastien Comte
   Design: Dark tech / glassmorphism / clean professional
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --accent: #5b5ef4;
  --accent-light: #7b7ef8;
  --accent-glow: rgba(91, 94, 244, 0.35);
  --accent-ultra: rgba(91, 94, 244, 0.12);
  --white: #ffffff;
  --off-white: #e8e8f0;
  --muted: #9999bb;
  --dark: #0a0a12;
  --card-bg: rgba(255, 255, 255, 0.055);
  --card-border: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(10, 10, 18, 0.72);
  --nav-h: 72px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 32px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.4);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.35);
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--dark);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===== BACKGROUND ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../background.jpg') no-repeat center center / cover;
  filter: brightness(0.28) saturate(0.7);
  pointer-events: none;
}

/* Grain overlay */
.bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

/* Gradient orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}
.orb-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -100px; right: -100px;
  animation: orbFloat 10s ease-in-out infinite alternate;
}
.orb-2 {
  width: 350px; height: 350px;
  background: #8b5cf6;
  bottom: 10%; left: -80px;
  animation: orbFloat 14s ease-in-out infinite alternate-reverse;
}

@keyframes orbFloat {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(40px) scale(1.08); }
}

/* ===== HEADER / NAV ===== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  padding: 0 32px;
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

/* backdrop-filter on ::before so header doesn't create a containing block
   for fixed-position children (the mobile nav overlay). */
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  z-index: -1;
  pointer-events: none;
}

nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 42px;
  transition: transform var(--transition), filter var(--transition);
}
.nav-logo img:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 8px var(--accent));
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links li a {
  position: relative;
  color: var(--off-white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

.nav-links li a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: right;
  border-radius: 2px;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--white);
  background: var(--accent-ultra);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ===== BURGER ===== */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 1100;
  padding: 8px;
  background: transparent;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 8px;
  transition: background var(--transition);
}

.burger:hover,
.burger:focus-visible {
  background: rgba(255,255,255,0.07);
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.35s ease;
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== MOBILE NAV ===== */
@media (max-width: 768px) {
  header { padding: 0 20px; }

  .burger { display: flex; }

  /* Menu overlay — fond sombre par-dessus la page */
  .nav-links {
    position: fixed;
    inset: 0;                          /* couvre toute la page */
    background: rgba(6, 6, 14, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    /* Ouverture en fondu + légère montée */
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.35s ease,
                visibility 0.35s,
                transform 0.35s ease;
    z-index: 1050;                     /* au-dessus du header (1000) */
  }

  .nav-links.nav-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Liens apparaissent un par un avec décalage */
  .nav-links li {
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.nav-open li:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.10s; }
  .nav-links.nav-open li:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.18s; }
  .nav-links.nav-open li:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.26s; }
  .nav-links.nav-open li:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.34s; }

  .nav-links li a {
    display: block;
    font-size: 32px;
    font-weight: 800;
    padding: 16px 40px;
    border-radius: 14px;
    letter-spacing: 0.02em;
  }
}

/* ===== MAIN WRAPPER ===== */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  padding-top: var(--nav-h);
  isolation: isolate;
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 10;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--card-border);
  text-align: center;
  padding: 18px 20px;
  font-size: 13px;
  color: var(--muted);
  /* Isolate from glass card stacking contexts */
  isolation: isolate;
}

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

/* ===== MOUSE GLOW (global) ===== */
.mouse-glow {
  position: fixed;
  top: 0; left: 0;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,94,244,0.13) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 35px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid var(--card-border);
  backdrop-filter: blur(4px);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-ultra);
  transform: translateY(-2px);
}

/* ===== GLASS CARD ===== */
.glass {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
}

/* ===== SECTION HEADING ===== */
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-up { animation: fadeUp 0.7s ease-out both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
