/* ============================================================
   ATELIER PERF — global styles
   Inspired by cyberscope.fr (cosmic / spatial), grounded in the
   existing brand palette (deep blue + electric blue + yellow).
   ============================================================ */

:root {
  /* Brand */
  --ink:        #ffffff;
  --ink-2:      #f6f6f9;
  --ink-3:      #ececf2;
  --deep:       #101e8e;
  --electric:   #3e2dd6;
  --electric-2: #5e4cff;
  --yellow:     #fbdc74;
  --paper:      #ffffff;
  --paper-2:    #f4f4f7;
  --line:       rgba(16,30,142,0.08);
  --line-2:     rgba(16,30,142,0.16);
  --muted:      rgba(6,6,26,0.62);
  --muted-2:    rgba(6,6,26,0.42);
  --text:       #06061a;

  /* Type */
  --f-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --gutter: clamp(16px, 4vw, 64px);
  --container: 1320px;
  --radius: 24px;
  --radius-lg: 36px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--ink);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ====== Scroll progress bar ====== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--electric-2), var(--yellow));
  z-index: 200;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  transition: transform 80ms linear;
  box-shadow: 0 0 12px rgba(251,220,116,0.5);
  width: 100%;
}

::selection { background: var(--yellow); color: var(--ink); }

/* ====== Custom cursor (cyberscope-style) ====== */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, input, [role="button"], [data-cursor="hover"] { cursor: none; }
  .cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--electric);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--electric-2);
    transition: width 200ms, height 200ms, background 200ms;
  }
  .cursor-ring {
    width: 36px; height: 36px;
    border: 1.5px solid var(--deep);
    border-radius: 50%;
    transition: width 240ms cubic-bezier(0.2,0.7,0.2,1), height 240ms cubic-bezier(0.2,0.7,0.2,1), border-color 200ms, background 200ms;
  }
  body.cursor-hover .cursor-ring {
    width: 56px; height: 56px;
    border-color: var(--yellow);
    border-width: 2px;
    background: rgba(251,220,116,0.12);
    mix-blend-mode: multiply;
  }
  body.cursor-hover .cursor-dot {
    width: 8px; height: 8px;
    background: var(--yellow);
    box-shadow: 0 0 20px rgba(251,220,116,0.9);
  }
}

/* ====== Reusable starfield / grid bg layers ====== */
/* bg-stars / bg-grid : fonds CLAIRS (dots bleu foncé) */
.bg-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 20% 30%, rgba(62,45,214,0.6), transparent 50%),
    radial-gradient(1px 1px at 70% 60%, rgba(16,30,142,0.5), transparent 50%),
    radial-gradient(1px 1px at 40% 80%, rgba(62,45,214,0.4), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(251,220,116,0.9), transparent 50%),
    radial-gradient(1.2px 1.2px at 10% 70%, rgba(94,76,255,0.7), transparent 50%),
    radial-gradient(1px 1px at 60% 10%, rgba(16,30,142,0.4), transparent 50%),
    radial-gradient(1px 1px at 90% 90%, rgba(62,45,214,0.5), transparent 50%),
    radial-gradient(1px 1px at 35% 50%, rgba(16,30,142,0.3), transparent 50%);
  background-size: 600px 600px, 800px 800px, 700px 700px, 900px 900px, 500px 500px, 750px 750px, 650px 650px, 550px 550px;
  pointer-events: none;
  opacity: 0.8;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16,30,142,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,30,142,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
  pointer-events: none;
}
/* bg-stars-light / bg-grid-light : fonds SOMBRES (dots blancs/jaunes) */
.bg-stars-light {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 20% 30%, rgba(255,255,255,0.55), transparent 50%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.35), transparent 50%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.3), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(251,220,116,0.9), transparent 50%),
    radial-gradient(1.2px 1.2px at 10% 70%, rgba(255,255,255,0.45), transparent 50%),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,0.3), transparent 50%),
    radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(1px 1px at 35% 50%, rgba(255,255,255,0.25), transparent 50%);
  background-size: 600px 600px, 800px 800px, 700px 700px, 900px 900px, 500px 500px, 750px 750px, 650px 650px, 550px 550px;
  pointer-events: none;
  opacity: 0.7;
}
.bg-grid-light {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
  pointer-events: none;
}
.bg-glow {
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(94,76,255,0.25), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* ====== Container ====== */
.container {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

/* ====== Top Nav ====== */
.nav {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 1380px);
  z-index: 100;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: top 200ms ease, transform 200ms ease;
  box-shadow: 0 8px 32px rgba(16,30,142,0.08);
}
.nav.is-hidden { top: -90px; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 16px;
  flex-shrink: 0;
}
.nav-brand .brand-mark {
  width: 32px; height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(251,220,116,0.35));
}
.nav-brand {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 18px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}
.nav-link {
  position: relative;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 200ms, background 200ms;
}
.nav-link:hover { color: var(--deep); background: rgba(16,30,142,0.06); }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 14px; right: 14px;
  height: 1px;
  background: var(--deep);
  clip-path: inset(0 100% 0 0);
}
.nav-link:hover::after {
  animation: souligne 280ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.nav-link.is-active {
  color: var(--text);
  background: var(--yellow);
}
.nav-link.is-active::before {
  content: "●";
  margin-right: 6px;
  color: var(--electric);
}

.nav-cta {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms;
}
.nav-cta:hover {
  background: var(--yellow);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(251,220,116,0.5);
}
.nav-cta .arrow { transition: transform 200ms ease; }
.nav-cta:hover .arrow { transform: translateX(3px); }

.nav-burger { display: flex; padding: 8px; border-radius: 999px; color: var(--text); }
.nav-burger:hover { background: rgba(16,30,142,0.08); }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  top: 70px; left: 12px; right: 12px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 16px;
  z-index: 99;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 16px 40px rgba(16,30,142,0.12);
}
.nav-drawer.is-open { display: flex; }
.nav-drawer .nav-link { padding: 14px 18px; font-size: 14px; text-align: left; }
.nav-drawer .nav-cta { margin-top: 8px; justify-content: center; padding: 14px; font-size: 14px; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease;
  position: relative;
  overflow: hidden;
}
.btn .arrow { transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--deep);
  color: #fff;
}
.btn-primary:hover {
  background: var(--yellow);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(251,220,116,0.5);
}
.btn-ghost {
  background: rgba(16,30,142,0.04);
  border: 1px solid var(--line-2);
  color: var(--text);
}
.btn-ghost:hover {
  background: rgba(16,30,142,0.08);
  transform: translateY(-2px);
}
.btn-electric {
  background: var(--electric);
  color: #fff;
}
.btn-electric:hover {
  background: var(--electric-2);
  box-shadow: 0 12px 30px rgba(94,76,255,0.5);
  transform: translateY(-2px);
}

/* ====== Mono tag (cyberscope-style bracket label) ====== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "[";
  color: var(--electric);
  font-weight: 700;
}
.eyebrow::after {
  content: "]";
  color: var(--electric);
  font-weight: 700;
}
.eyebrow .pulse {
  width: 8px; height: 8px;
  background: var(--electric);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--electric-2);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ====== Display type ====== */
.display {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-wrap: balance;
}
.display-xl { font-size: clamp(48px, 9vw, 144px); }
.display-l  { font-size: clamp(40px, 6.5vw, 96px); }
.display-m  { font-size: clamp(32px, 4.5vw, 64px); }
.display-s  { font-size: clamp(24px, 3vw, 40px); }

.italic-accent {
  font-family: "Space Grotesk", serif;
  font-style: italic;
  font-weight: 500;
  color: var(--electric);
}

/* ====== Sections ====== */
section { position: relative; }

.section-pad {
  padding: clamp(80px, 10vw, 160px) 0;
  position: relative;
}
.section-pad-sm {
  padding: clamp(80px, 7vw, 100px) 0;
}

/* ====== Card pattern ====== */
.card {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 300ms ease, border-color 300ms ease, background 300ms ease, box-shadow 300ms ease;
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--electric);
  box-shadow: 0 18px 40px rgba(62,45,214,0.18);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(94,76,255,0.12), transparent 50%);
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
}
.card:hover::after { opacity: 1; }

/* ====== Scroll reveal — clip-path + translateY (Cyberscope-style) ====== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 900ms cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Variante clip-path pour les titres héros */
.reveal-line {
  overflow: hidden;
  display: block;
}
.reveal-line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal-line.is-in > span {
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal-stagger.is-in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 270ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 360ms; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 450ms; }
.reveal-stagger.is-in > *:nth-child(7) { transition-delay: 540ms; }
.reveal-stagger.is-in > *:nth-child(8) { transition-delay: 630ms; }

/* ====== Footer ====== */
.footer {
  background: var(--deep);
  color: #fff;
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 1200px; height: 400px;
  background: radial-gradient(ellipse, rgba(94,76,255,0.4), transparent 60%);
  pointer-events: none;
}
.footer-inner {
  padding-top: 40px;
  padding-bottom: 20px;
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 28px;
}
.footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a { color: rgba(255,255,255,0.7); transition: color 200ms; font-size: 14px; }
.footer a:hover { color: var(--yellow); }
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.footer-bigtype {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 80px);
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  padding: 12px 24px 10px;
  user-select: none;
  pointer-events: none;
  width: 100%;
  display: block;
  white-space: nowrap;
}

/* ====== Grain / noise overlay — Cyberscope texture ====== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grainShift 0.55s steps(2) infinite;
}
@keyframes grainShift {
  0%   { background-position: 0 0; }
  25%  { background-position: -12% 8%; }
  50%  { background-position: 8% -12%; }
  75%  { background-position: -6% 6%; }
  100% { background-position: 0 0; }
}

/* ====== Shimmer on primary CTA — sweep de lumière ====== */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  pointer-events: none;
  z-index: 1;
  transition: left 650ms ease;
}
.btn-primary:hover::before { left: 170%; }
.btn-primary > * { position: relative; z-index: 2; }

/* ====== Wordtoggle — entrée verticale Cyberscope ====== */
@keyframes wordEnter {
  0%   { transform: translateY(112%); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}
.hero-rotator {
  animation: wordEnter 520ms cubic-bezier(0.5, 0.06, 0.01, 0.99) both !important;
}

/* ====== Souligne — trait clip-path de gauche à droite ====== */
@keyframes souligne {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0%   0 0); }
}
.souligne {
  position: relative;
  display: inline-block;
}
.souligne::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: var(--yellow);
  clip-path: inset(0 100% 0 0);
}
.souligne:hover::after,
.souligne.is-active::after {
  animation: souligne 380ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

/* ====== Page transition — blur + scale (Cyberscope) ====== */
.page-enter {
  animation: pageIn 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.995);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ====== Card pillars responsive ====== */
@media (max-width: 860px) { .card-pillars { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 540px) { .card-pillars { grid-template-columns: 1fr !important; } }

/* ====== Modal animations ====== */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 640px) { .modal-pillars { grid-template-columns: 1fr !important; } }
@media (max-width: 860px) { .modal-pillars { grid-template-columns: repeat(2, 1fr) !important; } }

/* ====== Responsive ====== */
@media (max-width: 980px) {
  .nav-cta span { display: none; }
  .nav-cta { padding: 10px 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mega-grid { grid-template-columns: 1fr !important; }
  .mega-exp-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-meta { flex-direction: column; gap: 12px; text-align: center; }
  .nav { padding: 8px 8px 8px 16px; }
  .nav-brand { font-size: 14px; }
  .nav-brand .dot { width: 24px; height: 24px; }
  .card { padding: 24px; }
}
