:root {
  --bg: #120e22;
  --bg-2: #1b1533;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f1edff;
  --muted: #a79fc4;
  --orange: #ff7a3d;
  --orange-2: #ffb15c;
  --cyan: #3be3e8;
  --red: #ff3355;
  --radius: 20px;
  --font-title: "Bebas Neue", "Impact", sans-serif;
  --font-body: "Outfit", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(60rem 40rem at 50% -10%, rgba(255, 122, 61, 0.10), transparent 60%),
    radial-gradient(50rem 30rem at 100% 60%, rgba(59, 227, 232, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main { overflow-x: clip; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

em { font-style: normal; color: var(--orange); }

/* Grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* Topbar */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  padding-top: max(14px, env(safe-area-inset-top));
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: rgba(18, 14, 34, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.brand {
  font-family: var(--font-title);
  font-size: 28px;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff, #b9f6f8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(59, 227, 232, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 700;
  color: #1a0d05;
  background: linear-gradient(135deg, var(--orange-2), var(--orange) 55%, #ff5a2a);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 10px 30px -8px rgba(255, 122, 61, 0.65);
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1), box-shadow 0.2s ease;
  user-select: none;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn .android { fill: currentColor; stroke: none; width: 30px; height: 30px; }
.btn:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,0.2) inset, 0 18px 40px -8px rgba(255, 122, 61, 0.85); }
}
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

.btn-small { padding: 9px 16px; font-size: 14px; }
.btn-small svg { width: 16px; height: 16px; }

.btn-big {
  position: relative;
  padding: 16px 30px 16px 22px;
  font-size: 19px;
  isolation: isolate;
}
.btn-big span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.btn-big small { font-weight: 500; font-size: 13px; opacity: 0.75; }
.btn-big::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(255, 122, 61, 0.55);
  z-index: -1;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.96); opacity: 0.9; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Hero */
.hero {
  position: relative;
  padding: 72px clamp(16px, 4vw, 40px) 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-frame {
  position: relative;
  max-width: max(560px, calc((100svh - 400px) * 1.79));
  margin: 0 auto;
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  box-shadow: 0 40px 120px -30px rgba(255, 122, 61, 0.35), 0 0 0 1px var(--border);
  animation: rise 1.1s cubic-bezier(.2,.8,.2,1) both;
}
.hero-frame img {
  width: 100%;
  height: auto;
  transform: scale(1.04);
  animation: settle 2.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(18, 14, 34, 0.55) 100%);
  pointer-events: none;
}
/* Lampe torche : assombrit autour du pointeur */
.spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 260px at var(--x, 50%) var(--y, 50%), transparent 0%, rgba(8, 6, 18, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.hero-frame.lit .spotlight { opacity: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes settle { to { transform: scale(1); } }

.hero-content {
  position: relative;
  text-align: center;
  margin-top: clamp(24px, 3.5vh, 44px);
  animation: rise 1s 0.25s cubic-bezier(.2,.8,.2,1) both;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

h1, h2, h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: 0.02em; line-height: 0.95; margin: 0; }

h1 { font-size: clamp(54px, min(9vw, 9vh), 112px); }
@media (min-width: 900px) {
  h1 br { display: none; }
  .lead { margin: 12px auto 24px; }
}
.glitch {
  position: relative;
  display: inline-block;
  color: var(--orange);
  text-shadow: 0 0 40px rgba(255, 122, 61, 0.45);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch::before { color: var(--cyan); }
.glitch::after  { color: var(--red); }
.glitch.on::before { animation: glitch-a 0.35s steps(2) both; }
.glitch.on::after  { animation: glitch-b 0.35s steps(2) both; }
@keyframes glitch-a {
  0%   { opacity: .9; transform: translate(-4px, 2px); clip-path: inset(10% 0 55% 0); }
  50%  { opacity: .9; transform: translate(3px, -2px); clip-path: inset(60% 0 8% 0); }
  100% { opacity: 0; transform: none; }
}
@keyframes glitch-b {
  0%   { opacity: .9; transform: translate(4px, -1px); clip-path: inset(45% 0 30% 0); }
  50%  { opacity: .9; transform: translate(-3px, 2px); clip-path: inset(5% 0 70% 0); }
  100% { opacity: 0; transform: none; }
}

.lead {
  max-width: 560px;
  margin: 18px auto 32px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

/* Sections */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) clamp(16px, 4vw, 40px);
}
h2 {
  font-size: clamp(42px, 6vw, 72px);
  text-align: center;
  margin-bottom: clamp(36px, 5vw, 56px);
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  padding: 30px 26px 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), border-color 0.3s ease;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.18); }
}
.num {
  position: absolute;
  top: 14px; right: 20px;
  font-family: var(--font-title);
  font-size: 64px;
  line-height: 1;
  color: rgba(255,255,255,0.05);
}
.icon {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  margin-bottom: 20px;
}
.icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-cyan   { color: var(--cyan);   background: rgba(59,227,232,0.10); box-shadow: 0 0 30px -6px rgba(59,227,232,0.5); }
.icon-orange { color: var(--orange); background: rgba(255,122,61,0.12); box-shadow: 0 0 30px -6px rgba(255,122,61,0.55); }
.icon-red    { color: var(--red);    background: rgba(255,51,85,0.12);  box-shadow: 0 0 30px -6px rgba(255,51,85,0.55); }
.card h3 { font-size: 36px; margin-bottom: 8px; }
.card p  { margin: 0; color: var(--muted); }

/* Roles */
.roles {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-top: 0;
}
.role {
  position: relative;
  padding: clamp(32px, 5vw, 52px);
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.role-glow {
  position: absolute;
  width: 340px; height: 340px;
  top: -140px; right: -120px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.role-crew .role-glow    { background: var(--cyan); }
.role-traitor .role-glow { background: var(--red); left: -120px; right: auto; }
.role-traitor { text-align: right; }
.role .tag { position: relative; margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.role h3 { position: relative; font-size: clamp(56px, 7vw, 84px); }
.role-crew h3    { color: var(--cyan); text-shadow: 0 0 30px rgba(59,227,232,0.4); }
.role-traitor h3 { color: var(--red);  text-shadow: 0 0 30px rgba(255,51,85,0.45); }
.role p:last-child { position: relative; margin: 10px 0 0; color: var(--text); opacity: 0.85; max-width: 32ch; }
.role-traitor p:last-child { margin-left: auto; }
.versus {
  font-family: var(--font-title);
  font-size: 40px;
  color: var(--muted);
  opacity: 0.6;
}

/* Final */
.final { text-align: center; }
.final h2 { margin-bottom: 36px; }
.install {
  list-style: none;
  padding: 0;
  margin: 0 auto 44px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.install li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
}
.install span {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,122,61,0.15);
  color: var(--orange);
  font-weight: 700;
  font-size: 14px;
}

.footer {
  padding: 40px 16px calc(40px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  opacity: 0.7;
  border-top: 1px solid var(--border);
}
.footer p { margin: 0; letter-spacing: 0.08em; }

/* Sticky mobile */
.sticky-dl {
  display: none;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(27, 21, 51, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(.2,.8,.2,1) var(--d, 0ms), transform 0.8s cubic-bezier(.2,.8,.2,1) var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .card { display: grid; grid-template-columns: 56px 1fr; column-gap: 18px; padding: 22px; align-items: start; }
  .card .icon { grid-row: span 2; margin: 0; }
  .card h3 { font-size: 30px; margin: 2px 0 4px; }
  .num { font-size: 48px; }

  .roles { grid-template-columns: 1fr; gap: 12px; }
  .role { min-height: 210px; }
  .versus { text-align: center; font-size: 32px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar .btn-small { display: none; }
  .hero { padding-top: 64px; }
  .hero-frame { border-radius: 16px; }
  .hide-sm { display: none; }
  .btn-big { width: 100%; justify-content: center; }
  .install { flex-direction: column; align-items: stretch; }
  .install li { justify-content: flex-start; }

  .sticky-dl {
    position: fixed;
    left: 16px; right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 16px;
    font-weight: 700;
    color: #1a0d05;
    background: linear-gradient(135deg, var(--orange-2), var(--orange) 55%, #ff5a2a);
    box-shadow: 0 14px 40px -10px rgba(255, 122, 61, 0.8);
    transform: translateY(140%);
    transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  }
  .sticky-dl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .sticky-dl.show { transform: none; }
  .footer { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-frame img { transform: none; }
  html { scroll-behavior: auto; }
}
