/* ==============================================
   style.css — Jean Gorin Theme (Fusion Ultra Complet)
   Responsive, Moderne, Futuriste, Performant, Justifié, Burger Animé
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Space+Grotesk:wght@400;500;700&display=swap');

/* Variables */
:root {
  --color-bg-light: #ffffff;
  --color-text-light: #111111;
  --color-bg-dark: #0a0a0a;
  --color-text-dark: #f5f5f5;
  --color-accent: #ff6600;
  --color-accent-2: #2986f5;

  --bg: var(--color-bg-dark);
  --text: var(--color-text-dark);
  --card-bg: var(--color-bg-dark);

  --font-main: 'Inter', sans-serif;
  --font-alt: 'Space Grotesk', sans-serif;

  --font-size-base: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 28px;

  --line-height-base: 1.6;
  --line-height-tight: 1.3;

  --container-max: 1200px;
  --header-height: 74px;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: auto; }
body {
  font-family: var(--font-main, 'Inter', sans-serif);
  font-size: 1rem;
  line-height: var(--line-height-base);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.4s, color 0.4s;
  -webkit-font-smoothing: antialiased;
  word-wrap: break-word;
  overflow-x: hidden;
}
body.light-mode {
  --bg: var(--color-bg-light);
  --text: var(--color-text-light);
  --card-bg: var(--color-bg-light);
  font-family: var(--font-alt);
}
body.dark-mode { font-family: var(--font-main); }

/* Header */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(12px);
  z-index: 1000;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s, top 0.3s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
header h1 {
  font-size: 0.82rem;
  opacity: 0.44;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-style: italic;
}
body.light-mode header { background: rgba(255,255,255,0.6); }
header .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Décalage sous le header */
main, .container.content-grid:first-of-type { padding-top: var(--header-height); }

/* Burger menu animé */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: 0.7rem;
  z-index: 2002;
}
.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  gap: 0.32rem;
  position: relative;
}
.burger span {
  display: block;
  height: 2.7px;
  width: 100%;
  border-radius: 2px;
  background: var(--color-accent, #ff6600);
  transition: all 0.37s cubic-bezier(.45,1.8,.6,1);
}
#nav-toggle.open .burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#nav-toggle.open .burger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.15);
}
#nav-toggle.open .burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Navigation stylée & responsive */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}
nav a {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.91rem;
  padding: 0.27rem 0.74rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.16s;
  letter-spacing: 0.045em;
  background: transparent;
  outline: none;
  white-space: nowrap;
}
nav a:hover, nav a.active {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  color: #fff;
  box-shadow: 0 2px 12px rgba(41,134,245,0.10);
}

/* Burger menu: mobile < 900px */
@media (max-width: 900px) {
  #nav-toggle { display: block; }
  nav {
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    background: rgba(20,20,20,0.97);
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 1.2rem 1.1rem;
    display: none;
    border-bottom-left-radius: 1.4rem;
    border-bottom-right-radius: 1.4rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.09);
    z-index: 2001;
  }
  nav.open { display: flex; }
  header { padding: 0.7rem; }
  nav a { font-size: 0.98rem; padding: 0.38rem 1rem;}
}

/* Containers */
.container {
  width: 92%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* Typographie ultra claire, justifiée */
h1, h2, h3, h4 { font-family: var(--font-alt); }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.1; margin-bottom: 0.7em; color: var(--text);}
h2 { font-size: clamp(1.5rem, 5vw, 2.5rem); margin-bottom: 0.6em; color: var(--text);}
h3 { font-size: clamp(1.2rem, 4vw, 1.6rem); margin-bottom: 0.45em;}
h4 { font-size: 1.09rem; margin-bottom: 0.3em;}
p, li {
  font-size: 1rem;
  margin-bottom: 1.07rem;
  text-align: justify;
  text-justify: inter-word;
  letter-spacing: 0.01em;
  line-height: 1.65;
}
a { color: var(--color-accent); transition: color 0.19s; }
a:hover { color: #ff884d; }

/* Images adaptatives */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.06);
}

/* Carousel stylé */
.carousel {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1.3rem 0;
  scroll-behavior: smooth;
  max-width: 100%;
}
.carousel-item {
  flex: 0 0 80%;
  max-width: 400px;
  scroll-snap-align: start;
  background: var(--card-bg);
  color: var(--text);
  border-radius: 1.1rem;
  padding: 1.1rem;
  box-shadow: 0 7px 24px rgba(0,0,0,0.13);
  transition: transform 0.27s, box-shadow 0.28s;
}
.carousel-item img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 0.6rem;
}
.carousel-item p { margin-top: 0.65rem; font-size: 0.98rem; text-align: center; }

/* Parallax */
.parallax {
  position: relative;
  min-height: 100vh;
  background: center/cover no-repeat url("assets/img/gorin-parallax.jpg");
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
@media (max-width: 768px) { .parallax { background-attachment: scroll; } }
.parallax::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,rgba(0,0,0,0.32),rgba(41,134,245,0.10));
  z-index: 1;
}
body.light-mode .parallax::before { background: linear-gradient(120deg,rgba(255,255,255,0.4),rgba(41,134,245,0.07)); }
.parallax-content {
  position: relative;
  z-index: 2;
  padding: 2.1rem;
  max-width: 800px;
  color: var(--text);
  text-align: center;
  transition: transform 0.4s;
}
.parallax-content h2 {
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  text-shadow: 0 2px 6px rgba(0,0,0,0.09);
  margin-bottom: 1.15rem;
}

/* Footer et contact */
footer, #contact {
  text-align: center;
  padding: 2.3rem 1.1rem;
}
#contact .container ul {
  list-style: none;
  padding: 0;
  margin: 1rem auto 0;
  display: inline-block;
}
#contact .container ul li {
  margin: 0.57rem 0;
}

/* Theme toggle stylé */
.theme-toggle-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 1001;
}
#theme-toggle {
  width: 2.7rem;
  height: 2.7rem;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  font-size: 1.27rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.13);
  transition: all 0.24s;
}
#theme-toggle[data-theme="dark"]::before { content: "🌙"; }
#theme-toggle[data-theme="light"]::before { content: "☀️"; }
#theme-toggle:hover { transform: scale(1.1); }
@media (max-width: 480px) { .theme-toggle-container { bottom: 1rem; left: 1rem; } }

/* Animations Reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s, transform 1s; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .container { width: 99%; }
  nav a { font-size: 0.90rem; }
}
@media (max-width: 1024px) {
  nav { justify-content: flex-start; overflow-x: auto; }
  .carousel-item { flex: 0 0 85%; }
}
@media (max-width: 900px) {
  nav { font-size: 0.91rem; }
}
@media (max-width: 768px) {
  :root { --header-height: 104px; }
  header { flex-direction: column; align-items: flex-start; height: var(--header-height); min-height: var(--header-height);}
  main, .container.content-grid:first-of-type { padding-top: var(--header-height); }
  h1, h2, h3 { text-align: center; }
  #theme-toggle { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
  .carousel-item { flex: 0 0 92%; max-width: 100%; }
  nav { gap: 0.37rem; }
  nav a { font-size: 0.98rem; padding: 0.34rem 0.9rem;}
}
@media (max-width: 600px) {
  .carousel-item { flex: 0 0 99%; }
}
@media (max-width: 480px) {
  .carousel-item { flex: 0 0 100%; }
  nav a { font-size: 0.81rem; padding: 0.18rem 0.41rem; }
  .parallax-content h2 { font-size: 1.12rem; }
  .container { padding: 1rem 0.6rem; }
}

/* Optionnel : Scroll-lock quand menu ouvert sur mobile */
body.scroll-lock { overflow: hidden !important; touch-action: none; }
