/* EP2V — Palette couleur basée sur le logo */
:root {
  --blue-primary: #0066cc;    /* Bleu océan du logo */
  --blue-light: #4fb0ff;      /* Bleu très clair */
  --gray-light: #4a4a4a;      /* Gris foncé */
  --gray-medium: #3a3a3a;     /* Gris très foncé */
  --dark: #001a4d;            /* Bleu très foncé/noir */
  --text: #e0e0e0;
  --muted: #b0b0b0;
  --panel: #2a2a2a; /* gris très foncé */
  --bg: #1a1a1a; /* fond général en gris très foncé */
  --line: #444444;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 102, 204, 0.1);
  
  /* motion tokens */
  --ease-in-out: cubic-bezier(0.22, 0.85, 0.18, 1);
  --fast: 0.22s;
  --medium: 0.72s; /* all reveal/fade timings softened (more gentle) */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  line-height: 1.6;
}

/* Global site fade-in (uses JS which adds `is-ready` to <body>) */
body {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--medium) var(--ease-in-out), transform var(--medium) var(--ease-in-out);
}

body.is-ready {
  opacity: 1;
  transform: none;
}

/* === Animations au chargement === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popScale {
  from { opacity: 0; transform: scale(0.98) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes floaty {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* Ensure content is immediately visible for reduced-motion preference */
  body { opacity: 1 !important; transform: none !important; }
}

/* Entrées animées */
.hero-text, .hero-side, .card, .nav a, .brand, .panel, .benefit-item {
  animation: fadeUp var(--medium) var(--ease-in-out) both;
}

.hero-text { animation-delay: 0.08s; }
.hero-side { animation-delay: 0.16s; }
.nav a { animation-duration: var(--fast); animation-delay: 0.05s; }
.brand { animation-delay: 0.02s; }
.card { animation-delay: 0.18s; }
.benefit-item { animation-delay: 0.12s; }

.btn.accent { animation: floaty 4.8s ease-in-out infinite; }

/* === Header & Navigation === */
.topbar {
  background: linear-gradient(135deg, var(--dark) 0%, #002366 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--blue-primary);
  padding: 12px 0;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  transition: transform var(--fast), box-shadow var(--fast);
}

.brand:hover {
  transform: translateY(-2px) scale(1.02);
}

.logo {
  /* Logo sizing tuned to header: keep aspect ratio, constrain height so it fits the topbar */
  width: auto;
  max-height: 120px; /* increased so the logo is larger and more visible */
  height: auto;
  display: block;
}

.brandtxt {
  color: #fff; /* ensure readable on dark topbar */
  margin-left: 10px; /* spacing so text breathes beside the logo */
}

.brandtxt strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brandtxt span {
  font-size: 0.85rem;
  opacity: 0.95;
}

/* Emphasize the logo visually */
.brand .logo {
  /* stronger lift and halo to make the symbol pop */
  filter: drop-shadow(0 14px 36px rgba(0,24,56,0.55));
  /* bluish halo + subtle inset for contrast */
  box-shadow: 0 14px 36px rgba(0,24,56,0.28), 0 0 20px rgba(0,153,255,0.08) inset;
  transform-origin: left center;
  transition: transform var(--fast) var(--ease-in-out), filter var(--fast), box-shadow var(--fast) var(--ease-in-out);
}

.brand:hover .logo { transform: translateY(-3px) scale(1.03); }

@media (prefers-reduced-motion: reduce) {
  .brand .logo { transition: none !important; transform: none !important; }
}

/* Slightly reduce topbar padding to better fit larger logo */
.topbar { padding: 8px 0; }

.brandtxt {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brandtxt strong {
  font-size: 1.1rem;
}

.brandtxt span {
  opacity: 0.9;
  font-weight: 600;
  font-size: 0.85rem;
}

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

.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color var(--fast) var(--ease-in-out), transform var(--fast) var(--ease-in-out), box-shadow var(--fast) var(--ease-in-out);
}

.nav a.cta {
  background: var(--blue-primary);
  color: #fff;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px) translateZ(0);
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

/* === Container & Grid === */
.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* Visual frame around the main content to add volume */
.content-frame {
  position: relative;
  margin: 20px auto;
  /* start with a light gray backdrop, then blend to the light panel for depth */
  background: linear-gradient(180deg, #2a2a2a 0%, #1f1f1f 50%, #2a2a2a 100%);
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 30px 80px rgba(2,16,48,0.08), 0 6px 18px rgba(0,0,0,0.04) inset;
  border: 1px solid rgba(10,20,40,0.04);
  overflow: visible;
  max-width: min(1200px, 96vw);
}

/* Background decorative SVG container */
.bg-graphics {
  position: absolute;
  inset: 0 0 auto 0; /* place at top area of content-frame */
  height: 260px;
  width: 100%;
  pointer-events: none;
  /* bring above the parent's background so the SVG lines are visible */
  z-index: 0;
  opacity: 0.9;
}

.bg-svg { width: 100%; height: 100%; display: block; }
.bg-wave { transform-origin: center; }

/* gentle parallax float animation */
@keyframes floatSlow {
  from { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  to { transform: translateY(0px); }
}

.bg-wave.wave1 { animation: floatSlow 12s ease-in-out infinite; }
.bg-wave.wave2 { animation: floatSlow 18s ease-in-out infinite; animation-delay: 2s; }
.bg-dots { animation: floatSlow 10s ease-in-out infinite; animation-delay: 1s; }

/* Fiber-like moving lines (decorative) */
.fibers { pointer-events: none; }
.fiber-line {
  fill: none;
  stroke: url(#fiberGradient);
  stroke-width: 2.2; /* slightly thicker for visibility while remaining subtle */
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 380; /* visible dash length */
  stroke-dashoffset: 380;
  opacity: 0.85; /* more visible by default */
  filter: drop-shadow(0 8px 12px rgba(0,118,255,0.08));
  mix-blend-mode: screen;
}

@keyframes fiberMove {
  from { stroke-dashoffset: 260; }
  to { stroke-dashoffset: -260; }
}

.fiber-line.f1 { animation: fiberMove 6s linear infinite; }
.fiber-line.f2 { animation: fiberMove 8s linear infinite; animation-delay: 0.8s; }
.fiber-line.f3 { animation: fiberMove 10s linear infinite; animation-delay: 1.6s; }

/* On large screens keep them subtle; more visible on small screens */
@media (min-width: 720px) {
  /* Desktop: subtle but visible */
  .fiber-line { opacity: 0.55; stroke-width: 1.8; }
}

@media (max-width: 640px) {
  /* Mobile: slightly more visible but still tasteful */
  .fiber-line { opacity: 0.95; stroke-width: 2.2; }
}

@media (prefers-reduced-motion: reduce) {
  .fiber-line { animation: none !important; }
}

/* show background graphics mainly on small screens (mobile) and subtler on desktop */
@media (min-width: 720px) {
  .bg-graphics { opacity: 0.45; height: 180px; }
}

@media (max-width: 640px) {
  .bg-graphics { opacity: 1; height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-wave, .bg-dots { animation: none !important; }
}

/* Ensure the content sits above the decorative SVG inside the frame */
.content-frame > :not(.bg-graphics) {
  position: relative;
  z-index: 2;
}

/* Full-page decorative fiber layer */
.global-fibers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0; /* sits behind topbar (z-index:10) and content children (z-index:2) */
  opacity: 1;
}
.global-fibers svg { width: 100%; height: 100%; display: block; filter: blur(6px); }
.global-fibers .global-group { opacity: 1; transition: opacity 600ms var(--ease-in-out); }

/* Ensure main content sits above the global fibers */
main, footer, .wrap { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .global-fibers { display: none !important; }
}

/* Soft glow / decorative layer behind the frame */
.content-frame::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(0,102,204,0.06), rgba(0,0,0,0));
  filter: blur(12px);
  z-index: -2;
}

/* Thin outline for depth */
.content-frame::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  border: 1px solid rgba(255,255,255,0.4);
  z-index: -1;
  pointer-events: none;
}

/* Slightly lift cards inside the framed area on hover for more 'volume' */
.content-frame .card {
  will-change: transform, box-shadow;
  transform: translateZ(0);
  transition: transform 480ms var(--ease-in-out), box-shadow 480ms var(--ease-in-out);
}
.content-frame .card:hover {
  transform: translateY(-10px) translateZ(0);
  box-shadow: 0 30px 72px rgba(0,40,100,0.12);
}

.hero {
  padding: 48px 0 34px;
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 50%, #3a3a3a 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: stretch; /* ensure columns stretch to same height */
}

/* Make hero text column use full height so the panel can match it */
.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical centering of the copy */
  height: 100%;
}

/* === Hero Section === */
.kicker {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.3px;
  margin: 0 0 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 12px;
  color: #4fb0ff;
  line-height: 1.3;
}

.hero .accent {
  color: var(--blue-primary);
}

.sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.05rem;
}

.btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  transition: transform 360ms var(--ease-in-out), box-shadow 360ms var(--ease-in-out), background-color var(--fast);
  cursor: pointer;
}

.btn.accent {
  background: linear-gradient(135deg, var(--blue-primary) 0%, #0052a3 100%);
  color: #fff;
}

.btn.accent:hover {
  background: linear-gradient(135deg, #004b91 0%, #003d7a 100%);
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 14px 40px rgba(0, 102, 204, 0.20);
}

.btn.ghost {
  background: #333333;
  border-color: var(--blue-primary);
  color: #ffffff;
}

.btn.ghost:hover {
  background: #444444;
  transform: translateY(-3px) translateZ(0);
}

/* === Panel (Hero Side) === */
.panel {
  /* subtle panel avec dégradé */
  /* use a slightly translucent panel so backdrop-filter can blur fibers underneath */
  background: linear-gradient(135deg, rgba(42,42,42,0.86) 0%, rgba(30,30,30,0.86) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* Apply backdrop blur when supported so underlying fibers appear softly diffused under panels/cards */
@supports ((-webkit-backdrop-filter: blur(0px)) or (backdrop-filter: blur(0px))) {
  .panel, .card {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background-clip: padding-box; /* avoid bleeding of border */
  }
}

.hero-side .panel {
  background: var(--dark);
  color: #fff;
  border-color: transparent;
}

/* Ensure the panel fills the hero-side column height and is visually balanced */
.hero-side {
  display: flex;
  align-items: stretch;
}

.hero-side .panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* increase padding to avoid overlap with decorative bands */
  padding: 36px 24px;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,20,60,0.18);
  position: relative; /* needed for pseudo-band elements */
}

.hero-side .panel h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--blue-light);
}

/* Decorative mini-bandeaux (top and bottom) to highlight the panel text */
.hero-side .panel::before,
.hero-side .panel::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 10px;
  border-radius: 8px;
  z-index: 0; /* behind text */
  pointer-events: none;
}

.hero-side .panel::before {
  top: 14px;
  /* subtle, faded band that blends with the panel */
  background: linear-gradient(90deg, rgba(0,102,204,0.22), rgba(0,153,255,0.18));
  box-shadow: 0 6px 18px rgba(0,60,120,0.06);
  filter: blur(4px);
  opacity: 0.9;
}

.hero-side .panel::after {
  bottom: 14px;
  background: linear-gradient(90deg, rgba(0,153,255,0.18), rgba(0,102,204,0.16));
  box-shadow: 0 -6px 18px rgba(0,60,120,0.05);
  filter: blur(4px);
  opacity: 0.9;
}

/* Ensure panel content (text/list) sits above the decorative bands */
.hero-side .panel * { position: relative; z-index: 1; }

.ticks {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
}

.ticks li {
  margin: 8px 0;
  padding-left: 8px;
  border-left: 3px solid var(--blue-primary);
}

/* === Sections === */
.section {
  padding: 48px 0;
}

.section.alt {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: 2rem;
  margin: 0 0 32px;
  color: #4fb0ff;
  text-align: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* === Cards === */
.card {
  /* card background en gris foncé avec dégradé */
  background: linear-gradient(145deg, rgba(42,42,42,0.95) 0%, rgba(32,32,32,0.95) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  will-change: transform, box-shadow;
  transform: translateZ(0);
  transition: transform 480ms var(--ease-in-out), box-shadow 480ms var(--ease-in-out);
}

/* Canvas fibers (full-screen behind content) */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: normal;
  opacity: 1;
}

/* hide fallback global SVG fibers when canvas is used */
html.has-canvas .global-fibers { display: none !important; }

.card:hover {
  transform: translateY(-10px) translateZ(0);
  box-shadow: 0 30px 72px rgba(0, 102, 204, 0.14);
}

.card h3 {
  margin: 0 0 12px;
  color: #4fb0ff;
  font-size: 1.25rem;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.list {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  list-style: none;
}

.list li {
  margin: 6px 0;
  padding-left: 8px;
  border-left: 2px solid var(--blue-light);
  color: var(--text);
}

/* === Benefits Grid === */
.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.benefit-item {
  background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  will-change: transform, box-shadow;
  transform: translateZ(0);
  transition: transform 420ms var(--ease-in-out), box-shadow 420ms var(--ease-in-out);
}

.benefit-item:hover {
  transform: translateY(-8px) translateZ(0);
  box-shadow: 0 20px 48px rgba(0, 102, 204, 0.14);
}

.benefit-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.benefit-item h4 {
  margin: 0 0 8px;
  color: #4fb0ff;
  font-size: 1.1rem;
}

.benefit-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* === Contact Section === */
.contact {
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contact-info p {
  margin: 16px 0;
  color: var(--muted);
}

.contact-info strong {
  color: #ffffff;
  display: block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-info a {
  color: var(--blue-primary);
  text-decoration: none;
  font-weight: 600;
}

.form label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 600;
  color: var(--text);
}

.form input,
.form textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #333333;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color var(--fast), box-shadow var(--fast);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* === Footer === */
.foot {
  background: linear-gradient(135deg, var(--dark) 0%, #002366 100%);
  color: #fff;
  padding: 24px 0;
  text-align: center;
  border-top: 3px solid var(--blue-primary);
}

.foot p {
  margin: 6px 0;
  font-size: 0.9rem;
}

.legal {
  opacity: 0.7;
  font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .benefits { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .wrap { width: min(720px, 90vw); }
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
  .sub { font-size: 0.95rem; }
  .section-title { font-size: 1.7rem; margin-bottom: 24px; }
  .benefits { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .benefit-item { padding: 16px; }
  .benefit-icon { font-size: 2rem; margin-bottom: 8px; }
  .card { padding: 18px; }
  .btns { gap: 8px; }
  .nav { gap: 12px; }
}

@media (max-width: 640px) {
  .wrap { width: min(100%, 92vw); }
  .topbar .wrap { flex-direction: column; gap: 12px; }
  .brand { width: 100%; justify-content: center; }

  /* On very small screens, hide the brand text to prioritize the logo
    (keeps header compact). If you prefer to keep the text, remove this rule.) */
  .brandtxt { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
  .nav a { padding: 6px 10px; font-size: 0.9rem; }
  .hero { padding: 32px 0 24px; background: linear-gradient(90deg, var(--gray-light) 0 20%, var(--panel) 20% 80%, var(--gray-light) 80% 100%); }
  .hero h1 { font-size: 1.4rem; margin-bottom: 10px; }
  .kicker { font-size: 0.75rem; margin-bottom: 4px; }
  .sub { font-size: 0.9rem; margin-bottom: 14px; }
  .btns { flex-direction: column; gap: 8px; }
  .btn { padding: 11px 18px; font-size: 0.95rem; }
  .panel { padding: 16px; }
  .ticks { padding-left: 16px; }
  .ticks li { margin: 6px 0; }
  .section { padding: 36px 0; }
  .section-title { font-size: 1.3rem; margin-bottom: 20px; }
  .grid-2 { gap: 14px; }
  .card { padding: 16px; }
  .card h3 { font-size: 1.1rem; margin-bottom: 10px; }
  .card p { font-size: 0.9rem; }
  .list { padding-left: 16px; }
  .benefits { grid-template-columns: 1fr; gap: 12px; }
  .benefit-item { padding: 14px; }
  .benefit-icon { font-size: 1.8rem; margin-bottom: 8px; }
  .benefit-item h4 { font-size: 1rem; margin-bottom: 6px; }
  .benefit-item p { font-size: 0.85rem; }
  .contact { gap: 16px; }
  .contact-info { margin-top: 16px; }
  .contact-info p { margin: 12px 0; }
  .form { padding: 18px; }
  .form label { margin-bottom: 12px; }
  .form input, .form textarea { padding: 9px 10px; font-size: 0.9rem; }
  .foot { padding: 18px 0; }
  .foot p { font-size: 0.85rem; margin: 4px 0; }
}

@media (max-width: 480px) {
  .wrap { width: min(100%, 95vw); }
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: 1.2rem; line-height: 1.25; }
  .kicker { font-size: 0.7rem; }
  .sub { font-size: 0.85rem; }
  .nav a { padding: 6px 8px; font-size: 0.85rem; }
  .button { padding: 10px 14px; }
  .section { padding: 28px 0; }
  .section-title { font-size: 1.15rem; }
  .card { padding: 12px; }
}

@media (hover: hover) {
  .nav a.cta:hover { background: var(--blue-light); }
}
