:root {
  --overlay: rgba(0, 0, 0, 0.4);
  --text-light: #fafafa;
  --text-dark: #333;
  --bg-white: #ffffff;
  --nav-bg: #dddddd;
  --accent: #CC7357;
  --hover: #50C878;
  --spacing: 1.5rem;
  --radius: 8px;
  --font-base: 1.25rem;
  --font-xl: 2.5rem;
  --font-xxl: 3.5rem;
}

body {
  margin: 0;
  font-family: 'Lato', sans-serif;
  font-size: var(--font-base);
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.6;
}

header {
  position: relative;
  background: url('img-code/sonic.jpeg') center/cover no-repeat;
  min-height: calc(100vh - 80px);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: var(--spacing);
  text-align: center;
  color: var(--text-light);
  padding-left: 5%;
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay);
  z-index: 0;
}
header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  z-index: 1;
}

.hero-text {
  position: relative;
  z-index: 2;
  margin-top: 4rem;
}

.animated-title {
  --speed: .28s;
  --stagger: .06s;
  --pause: 1.2s;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  max-width: 600px;
  margin-left: 5%;
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-family: 'Montserrat', sans-serif;
  position: relative;
  z-index: 2;
}

.animated-title .word {
  display: inline-flex;
  white-space: nowrap;
  margin-right: .35rem;
}

.animated-title .char {
  opacity: 0;
  transform: translateY(.6em);
  will-change: transform, opacity;
}

.animated-title.animate .char {
  animation: fadeInUp var(--speed) forwards;
  animation-delay: calc(var(--i) * var(--stagger));
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .animated-title .char,
  .animated-title.animate .char {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

#overlay-contact {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 9;
}
#overlay-contact.show {
  display: block;
}

.contact-trigger {
  background-color: rgba(0, 0, 0, 0.1);
  color: #2f2f2f;
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.3s;
}
.contact-trigger:hover {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--accent);
  font-weight: bold;
}

#contact-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 9999;
  display: none;
  width: auto;
  min-width: 160px;
  max-width: 220px;
}

#contact-menu.active {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#contact-menu a {
  display: block;
  margin: 0.5rem 0;
  font-size: 1rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: 0.3s;
  font-weight: 500;
  padding: 0.5rem 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
}
#contact-menu a:hover {
  color: var(--accent);
  font-weight: bold;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10000;
  background: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

nav ul {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav ul li {
  font-size: 1.5rem;
  color: #2f2f2f;
  padding: 0.5rem 1rem;
}

nav ul li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #2f2f2f;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  text-decoration: none;
}

nav ul li a:hover {
  color: var(--accent);
  font-weight: bold;
}

nav ul li .Accueil {
  color: var(--accent);
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  display: block;
}


.responsive-container {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
}
.responsive-container iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.CVvidéo h4 {
  margin-top: 2rem;
}
.CVvidéo iframe {
  width: 100%;
  max-width: 900px;
  height: 500px;
  display: block;
  margin: 0 auto;
}

main, footer .future {
  max-width: 1000px;
  margin: var(--spacing) auto;
  padding: var(--spacing);
}
main section h3, main section h4, footer h4 {
  font-family: 'Montserrat', sans-serif;
  color: var(--accent);
  font-size: 2rem;
  margin-top: 0;
}
main section p, footer p {
  font-size: 1.1rem;
}

a[href*="grafikart"], a[href*="developer.mozilla.org"] {
  color: #b80000;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s;
}
a[href*="grafikart"]:hover, a[href*="developer.mozilla.org"]:hover {
  color: #e60000;
}

@media (max-width: 600px) {
  .hero-text h1 { font-size: 2.2rem; }
  .hero-text p { font-size: 1.2rem; }

  #contact-menu {
    width: 80%;
    left: -100%;
  }
  #contact-menu.active {
    left: 0;
  }
}
