/* ============================================================
   AB CYBERTECH — Portfolio (refonte)
   Objectif : vendre du site web, démontrer le niveau (design + anim)
   Bleu marine par défaut · bascule clair · GSAP/Lenis
   ============================================================ */

:root {
  --bg: #0a0f1c;
  --bg-alt: #0e1526;
  --bg-card: #121b30;
  --bg-elev: #16203a;
  --navy: #e9ecf3;
  --gold: #d4a54a;
  --gold-bright: #e8c274;
  --gold-soft: rgba(212, 165, 74, 0.12);
  --text: #e9ecf3;
  --text-dim: #9aa4ba;
  --line: #223049;
  --line-soft: rgba(255, 255, 255, 0.07);
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  --radius: 18px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Space Grotesk", var(--font);
  --maxw: 1180px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f5f6fa;
  --bg-card: #ffffff;
  --bg-elev: #ffffff;
  --navy: #16233f;
  --gold: #b8871f;
  --gold-bright: #c9962e;
  --gold-soft: rgba(184, 135, 31, 0.1);
  --text: #16233f;
  --text-dim: #5b6678;
  --line: #e6e9ef;
  --line-soft: rgba(22, 35, 63, 0.08);
  --shadow: 0 30px 80px -46px rgba(22, 35, 63, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: var(--gold); color: #0a0f1c; }

a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.accent { color: var(--gold); }
.display { font-family: var(--display); letter-spacing: -0.02em; }

/* ===== Boutons ===== */
.btn {
  --pad: 14px 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: var(--pad);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
  will-change: transform;
}
.btn--gold { background: var(--gold); color: #0a0f1c; box-shadow: 0 14px 30px -12px rgba(212,165,74,0.5); }
.btn--gold:hover { background: var(--gold-bright); transform: translateY(-3px); }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-3px); }
.btn--big { padding: 17px 40px; font-size: 1.02rem; }
.btn__arrow { transition: transform 0.25s; }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ===== Nav ===== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line-soft);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.nav__logo { height: 44px; width: auto; display: block; }
.nav__logo--dark { display: none; }
[data-theme="light"] .nav__logo--light { display: block; }
[data-theme="light"] .nav__logo--dark { display: none; }
[data-theme="dark"] .nav__logo--light,
:root:not([data-theme="light"]) .nav__logo--light { display: none; }
:root:not([data-theme="light"]) .nav__logo--dark { display: block; }

.nav__links { display: flex; gap: 30px; }
.nav__links a { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; position: relative; transition: color 0.2s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--gold); transition: width 0.3s cubic-bezier(0.16,1,0.3,1);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__tools { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--text);
  font-size: 1rem; cursor: pointer; transition: border-color 0.2s, transform 0.3s;
}
.theme-toggle:hover { border-color: var(--gold); transform: rotate(20deg); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); transition: transform 0.3s, opacity 0.3s; }

/* ===== Hero ===== */
.hero { position: relative; padding: 150px 0 90px; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero__aurora {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
}
.hero__aurora--1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, rgba(212,165,74,0.5), transparent 68%); }
.hero__aurora--2 { width: 40vw; height: 40vw; right: -10vw; top: 10vw; background: radial-gradient(circle, rgba(60,110,220,0.4), transparent 68%); }
.hero__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 78%);
}

.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 54px; align-items: center; }

.hero__kicker {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 24px;
}
.hero__kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 var(--gold); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212,165,74,0.5);} 70% { box-shadow: 0 0 0 8px rgba(212,165,74,0);} 100% { box-shadow: 0 0 0 0 rgba(212,165,74,0);} }

.hero__title { font-family: var(--display); font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.hero__title .line { display: block; overflow: hidden; }
.hero__sub { margin: 26px 0 34px; color: var(--text-dim); font-size: 1.08rem; max-width: 30em; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__trust { margin-top: 30px; display: flex; align-items: center; gap: 14px; color: var(--text-dim); font-size: 0.86rem; }
.hero__trust strong { color: var(--text); font-weight: 700; }
.hero__trust .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-dim); }

/* Fenêtre navigateur (preuve web) */
.browser {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-card); box-shadow: var(--shadow); will-change: transform;
}
.browser__bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: var(--bg-elev); border-bottom: 1px solid var(--line-soft); }
.browser__dot { width: 11px; height: 11px; border-radius: 50%; background: #3a475f; }
.browser__dot:nth-child(1){ background:#ff5f57;} .browser__dot:nth-child(2){ background:#febc2e;} .browser__dot:nth-child(3){ background:#28c840;}
.browser__url { margin-left: 10px; flex: 1; font-size: 0.72rem; color: var(--text-dim); background: var(--bg); border-radius: 6px; padding: 5px 12px; }
.browser__shot { display: block; width: 100%; height: auto; }
.hero__stack { display: grid; }
.hero__stack .browser { grid-area: 1/1; }
.hero__stack .browser--back { transform: translate(34px, 42px) scale(0.9); opacity: 0.55; z-index: 0; }
.hero__stack .browser--front { z-index: 1; }

/* ===== Bandeau confiance / marquee ===== */
.marquee { border-block: 1px solid var(--line-soft); padding: 20px 0; overflow: hidden; }
.marquee__track { display: flex; gap: 54px; width: max-content; animation: scroll-x 26s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: var(--text-dim); display: flex; align-items: center; gap: 54px; white-space: nowrap; }
.marquee__item::after { content: "✦"; color: var(--gold); font-size: 0.7rem; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding: 100px 0; position: relative; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 640px; margin-bottom: 56px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__kicker { color: var(--gold); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.section__title { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.section__intro { margin-top: 16px; color: var(--text-dim); font-size: 1.05rem; }

/* ===== Offres (3) ===== */
.offers { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 20px; }
.offer {
  position: relative; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px; overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), border-color 0.3s, box-shadow 0.3s;
  will-change: transform;
}
.offer:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: var(--shadow); }
.offer__glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, var(--gold-soft), transparent 70%); top: -120px; right: -120px; opacity: 0; transition: opacity 0.4s; }
.offer:hover .offer__glow { opacity: 1; }
.offer--feature { grid-row: 1 / span 2; display: flex; flex-direction: column; }
.offer__badge { align-self: flex-start; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); background: var(--gold-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 20px; }
.offer__icon { width: 52px; height: 52px; border-radius: 13px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; margin-bottom: 20px; }
.offer__icon svg { width: 26px; height: 26px; }
.offer h3 { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
.offer--feature h3 { font-size: 1.7rem; }
.offer p { color: var(--text-dim); font-size: 0.96rem; }
.offer__list { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.offer__list li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--text-dim); }
.offer__list li::before { content: "→"; color: var(--gold); font-weight: 700; }
.offer__spacer { flex: 1; min-height: 20px; }
.offer--feature .btn { align-self: flex-start; }

/* ===== Réalisations ===== */
.works { display: flex; flex-direction: column; gap: 90px; }
.work { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.work:nth-child(even) .work__visual { order: 2; }
.work__visual { will-change: transform; }
.work__frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transform-style: preserve-3d; transition: transform 0.4s cubic-bezier(0.16,1,0.3,1); }
.work__frame img { display: block; width: 100%; height: auto; }
.work__tag { display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.work h3 { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.15; margin-bottom: 16px; letter-spacing: -0.02em; }
.work p { color: var(--text-dim); margin-bottom: 22px; }
.work__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.work__meta span { font-size: 0.78rem; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.work__links { display: flex; flex-wrap: wrap; gap: 22px; }
.work__links a { color: var(--gold); font-weight: 600; font-size: 0.94rem; }
.work__links a:hover { text-decoration: underline; }
.work__note { margin-top: 70px; text-align: center; color: var(--text-dim); font-style: italic; font-size: 0.9rem; }

/* labo / recherche bas niveau */
.lab { margin-top: 70px; display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.lab-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; transition: transform 0.3s, border-color 0.3s; }
.lab-card:hover { transform: translateY(-5px); border-color: var(--gold); }
.lab-card__tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); background: var(--gold-soft); border-radius: 999px; padding: 4px 12px; }
.lab-card h4 { font-family: var(--display); font-size: 1.2rem; font-weight: 700; margin: 16px 0 10px; }
.lab-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ===== Livre d'or ===== */
.testimonials { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.testimonial { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; gap: 18px; }
.testimonial__stars { color: var(--gold); letter-spacing: 3px; font-size: 0.95rem; }
.testimonial__quote { color: var(--text); font-size: 1rem; line-height: 1.65; flex: 1; }
.testimonial__author { display: flex; align-items: center; gap: 12px; }
.testimonial__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-family: var(--display); }
.testimonial__avatar--photo { object-fit: cover; border: 2px solid var(--gold); }
.testimonial__name { font-weight: 700; font-size: 0.92rem; }
.testimonial__role { color: var(--text-dim); font-size: 0.82rem; }
.testimonial--empty { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--text-dim); min-height: 200px; }
.testimonial--empty span { font-size: 2rem; color: var(--gold); }

/* ===== Parcours ===== */
.journey { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 54px; align-items: start; }
.journey__logo { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px; position: sticky; top: 110px; }
.journey__logo img { width: 100%; height: auto; display: block; }
.journey__logo .logo-dark { display: none; }
[data-theme="light"] .journey__logo .logo-dark { display: none; }
[data-theme="light"] .journey__logo .logo-light { display: block; }
:root:not([data-theme="light"]) .journey__logo { background: #000; }
:root:not([data-theme="light"]) .journey__logo .logo-light { display: none; }
:root:not([data-theme="light"]) .journey__logo .logo-dark { display: block; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline__item { position: relative; padding-bottom: 34px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ""; position: absolute; left: -30px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--bg); }
.timeline__year { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 0.92rem; }
.timeline__item h4 { font-size: 1.05rem; font-weight: 700; margin: 4px 0 6px; }
.timeline__item p { color: var(--text-dim); font-size: 0.92rem; }
.journey__intro { color: var(--text-dim); margin-bottom: 30px; }
.journey__intro strong { color: var(--text); }

/* ===== CTA ===== */
.cta { position: relative; overflow: hidden; border-radius: 26px; padding: clamp(50px,8vw,96px) 6vw; text-align: center; background: linear-gradient(135deg,#101a30,#1c2f54 60%,#28406e); }
.cta::before { content:""; position:absolute; width:60%; height:160%; top:-30%; right:-10%; background: radial-gradient(circle, rgba(212,165,74,0.28), transparent 65%); }
.cta__title { position: relative; font-family: var(--display); font-size: clamp(2rem,5vw,3.2rem); font-weight: 700; color: #fff; letter-spacing: -0.02em; margin-bottom: 18px; }
.cta__sub { position: relative; color: rgba(255,255,255,0.75); max-width: 540px; margin: 0 auto 34px; }
.cta .btn--gold { position: relative; }
.cta__meta { position: relative; margin-top: 28px; color: rgba(255,255,255,0.55); font-size: 0.82rem; }

/* ===== Footer ===== */
.footer { background: var(--bg-alt); border-top: 1px solid var(--line-soft); padding: 30px 0; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; color: var(--text-dim); }

/* ===== Animations (révélées seulement si JS actif) ===== */
html.anim-ready .reveal { opacity: 0; transform: translateY(30px); }
.reveal-char { display: inline-block; will-change: transform; }
html.anim-ready .reveal-char { opacity: 0; }
.word-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word-mask > span { display: inline-block; will-change: transform; }

/* ===== Grain (texture globale) ===== */
.grain {
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .grain { opacity: 0.035; mix-blend-mode: multiply; }

/* ===== Barre de progression du scroll ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2001;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}

/* ===== Anneau doré qui suit le curseur (desktop uniquement) ===== */
.cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 2002; pointer-events: none; border-radius: 50%;
  width: 36px; height: 36px; border: 1.5px solid var(--gold);
  margin: -18px 0 0 -18px; opacity: 0.55;
  transition: width 0.25s, height 0.25s, margin 0.25s, opacity 0.25s, background 0.25s;
}
.cursor-ring.is-hover { width: 58px; height: 58px; margin: -29px 0 0 -29px; opacity: 1; background: rgba(212, 165, 74, 0.1); }
@media (pointer: coarse) { .cursor-ring { display: none; } }

/* ===== Shine au survol des fenêtres navigateur ===== */
.browser { position: relative; }
.browser::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.14) 48%, rgba(255,255,255,0.02) 52%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.browser:hover::after { transform: translateX(120%); }
.work__frame img, .hero__stack .browser img { transition: transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.work__frame:hover img { transform: scale(1.04); }

/* Boutons magnétiques : transform pris en charge par GSAP */
[data-magnetic] { will-change: transform; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { order: -1; max-width: 520px; }
  .offers { grid-template-columns: 1fr; }
  .offer--feature { grid-row: auto; }
  .work { grid-template-columns: 1fr; gap: 26px; }
  .work:nth-child(even) .work__visual { order: -1; }
  .lab, .testimonials { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr; }
  .journey__logo { position: static; max-width: 360px; }
}
@media (max-width: 640px) {
  .nav__links {
    position: fixed; inset: 76px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px; display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
  .nav__burger { display: flex; }
  .nav__burger.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }
  .nav__cta { display: none; }
  .testimonials { grid-template-columns: 1fr; }
  .lab { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html.anim-ready .reveal, html.anim-ready .reveal-char { opacity: 1 !important; transform: none !important; }
}
