/* --- HEADER --- */
header, .topbar {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 30px;
  padding-bottom: 30px;
  padding-left: 0;
  padding-right: 0;
  background-color: #012095;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100'%3E%3Cg fill='%23fff681'%3E%3Cpath d='M80 18l3 9 9 3-9 3-3 9-3-9-9-3 9-3z'/%3E%3Cpath d='M330 76l3 9 9 3-9 3-3 9-3-9-9-3 9-3z'/%3E%3Cpath d='M820 28l4 11 11 4-11 4-4 11-4-11-11-4 11-4z'/%3E%3C/g%3E%3Cg fill='white'%3E%3Cpath d='M205 65l3 8 8 3-8 3-3 8-3-8-8-3 8-3z'/%3E%3Cpath d='M570 18l3 8 8 3-8 3-3 8-3-8-8-3 8-3z'/%3E%3Cpath d='M940 72l3 8 8 3-8 3-3 8-3-8-8-3 8-3z'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 8% 28%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 21% 72%, rgba(255, 246, 129, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 38% 22%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 57% 68%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 27%, rgba(255, 246, 129, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 91% 70%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 14% 58%, rgba(255, 255, 255, 0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 31% 84%, #fff681 0 2px, transparent 3px),
    radial-gradient(circle at 48% 45%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 86%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 55%, #fff681 0 3px, transparent 4px),
    radial-gradient(circle at 97% 16%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    linear-gradient(180deg, #012095 0%, #012cc9 100%);
  background-size: 100% 100%, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat;
}

/* Ligne dégradée sur toute la largeur */
header::after, .topbar::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, #72a9ff, #012095);
  position: absolute;
  bottom: 0;
  left: calc(-50vw + 50%);
  right: calc(-50vw + 50%);
}

/* Étoile dorée sous le header */
header::before, .topbar::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fff681 0%, #efbf04 100%);
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 2px rgba(255, 255, 255, 1));
  z-index: 2;
}

/* Structure Header Index */
.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-brand img {
  max-height: 50px;
  width: auto;
}

header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

header nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 20px);
  flex-wrap: wrap;
}

header nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
}

header nav > a,
header nav > .nav-dropdown > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, filter 0.2s ease;
}

header nav > a:hover,
header nav > a:focus-visible,
header nav > .nav-dropdown > summary:hover,
header nav > .nav-dropdown > summary:focus-visible {
  filter: brightness(1.12);
  text-decoration: none;
  transform: translateY(-1px);
}

header nav > .site-cv-button,
header nav > .site-contact-button {
  border-color: rgba(255, 255, 255, 0.8);
  background: linear-gradient(135deg, #ffdb70 0%, #ffefb4 100%);
  color: #012095 !important;
}

header nav > .site-cv-button:hover,
header nav > .site-cv-button:focus-visible,
header nav > .site-contact-button:hover,
header nav > .site-contact-button:focus-visible {
  color: #012095 !important;
}

header nav .nav-dropdown,
.nav-links .nav-dropdown {
  position: relative;
}

header nav .nav-dropdown summary,
.nav-links .nav-dropdown summary {
  color: #fff;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

header nav .nav-dropdown summary::-webkit-details-marker,
.nav-links .nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: " ▾";
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 10;
  display: grid;
  min-width: min(320px, calc(100vw - 32px));
  padding: 8px;
  transform: translateX(-50%);
  background: #fffcf9;
  border: 1px solid rgba(1, 32, 149, 0.2);
  border-radius: 8px;
  box-shadow: 0 12px 25px rgba(26, 11, 91, 0.15);
  color: #1a0b5b;
}

.dropdown-menu a {
  display: block;
  min-height: 44px;
  padding: 10px;
  color: #1a0b5b !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.header nav .dropdown-menu a:hover,
.header nav .dropdown-menu a:focus-visible,
.topbar .dropdown-menu a:hover,
.topbar .dropdown-menu a:focus-visible {
  background: rgba(114, 169, 255, 0.12);
  color: #012095 !important;
  text-decoration: none;
}

/* Structure Topbar Projets */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 30px;
  padding-bottom: 30px;
  padding-left: max(16px, calc((100vw - 1200px) / 2 + 20px));
  padding-right: max(16px, calc((100vw - 1200px) / 2 + 20px));
}

.site-contact-button,
.site-cv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: #fff681;
  color: #012095 !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-contact-button:hover,
.site-contact-button:focus-visible,
.site-cv-button:hover,
.site-cv-button:focus-visible {
  background: #fff;
  color: #012095 !important;
  text-decoration: none;
}

.topbar .brand {
  margin-right: auto;
}

.topbar .nav-links {
  align-items: center;
}

.topbar .nav-links .site-cv-button {
  margin-left: 4px;
}

.header-container .header-brand {
  margin: 0;
}

.header-container nav {
  margin-left: auto;
  justify-content: flex-end;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
}

.brand-mark img {
  height: 45px;
  width: auto;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark::after {
  content: "Lisa Bruno";
}

.topbar .brand-mark {
  min-height: 0;
  line-height: 1.3;
}

.nav-links {
  display: flex;
  gap: clamp(8px, 1.4vw, 20px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.nav-links > a.active,
.nav-links > .nav-dropdown[open] > summary {
  box-shadow: 0 0 0 2px var(--color-gold-light);
}

.nav-links > a,
.nav-links > .nav-dropdown > summary {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.nav-links .dropdown-menu a {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    text-align: center;
  }

  .header-brand {
    flex-direction: column;
  }

  header nav,
  .topbar {
    flex-direction: column;
    text-align: center;
    padding-top: 22px;
    padding-bottom: 22px;
  }

  header nav,
  .topbar .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 14px 18px;
  }

  .header-container {
    padding: 0 16px;
  }

  .dropdown-menu {
    white-space: normal;
  }

  .dropdown-menu a {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .topbar {
    gap: 15px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar .brand {
    margin-right: 0;
  }

  .nav-links {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .dropdown-menu {
    left: 0;
    transform: none;
  }

  .nav-dropdown summary {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 116px;
    min-height: 44px;
    padding: 9px 14px !important;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 999px;
    background: #012095 !important;
    color: #fff !important;
    font-size: 1rem !important;
  }

  .nav-dropdown summary::before {
    content: "";
    display: block;
    width: 18px;
    height: 14px;
    flex: 0 0 18px;
    background:
      linear-gradient(#fff681, #fff681) 0 0 / 18px 2px no-repeat,
      linear-gradient(#fff681, #fff681) 0 6px / 18px 2px no-repeat,
      linear-gradient(#fff681, #fff681) 0 12px / 18px 2px no-repeat;
  }

  .nav-dropdown summary::after {
    content: "▾";
    position: static;
    display: inline;
    color: #fff681;
    font-size: 0.9rem;
  }

  .nav-dropdown summary:hover,
  .nav-dropdown summary:focus-visible,
  .nav-dropdown[open] summary {
    background: #012cc9 !important;
    color: #fff !important;
  }

  .nav-dropdown[open] .dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
    width: min(320px, calc(100vw - 32px));
    max-height: min(70vh, 420px);
    overflow-y: auto;
  }

  .nav-dropdown[open] .dropdown-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: #1a0b5b !important;
    text-align: left;
  }

  .header-container nav {
    margin: 0;
  }
}