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

:root {
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --purple-dark: #5b21b6;
  --bg: #0f0f13;
  --bg2: #18181f;
  --bg3: #222230;
  --text: #f1f0f5;
  --text-muted: #9d9ab0;
  --border: rgba(255,255,255,0.08);
  --radius: 16px;
}

html[data-theme="light"] {
  --bg: #f5f4ff;
  --bg2: #ffffff;
  --bg3: #ede9fb;
  --text: #1a1520;
  --text-muted: #6b6882;
  --border: rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* Hero h1 gradient — adapté au mode clair */
html[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Bouton toggle thème */
.btn-theme-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, transform 0.15s;
}
.btn-theme-toggle:hover { transform: scale(1.1); }

/* ── NAV ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.btn-github {
  background: var(--bg3);
  color: var(--text) !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: background 0.2s !important;
}

.btn-github:hover { background: var(--bg2) !important; }

/* ── HERO ── */
.hero {
  background: radial-gradient(ellipse at 60% 0%, rgba(124,58,237,0.15) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
  padding-bottom: 80px;
}

.hero-content {
  max-width: 1100px;
  margin: 60px auto 0;
  padding: 0 40px;
}

.hero-badge {
  display: inline-block;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--purple-light);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 580px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--purple-dark); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.btn-secondary:hover { background: var(--bg2); }

.hero-langs {
  display: flex;
  gap: 12px;
  font-size: 1.8rem;
}

.hero-image {
  max-width: 1100px;
  margin: 60px auto 0;
  padding: 0 40px;
}

.hero-image img {
  width: 100%;
  max-width: 800px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

/* ── SECTIONS ── */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
}

section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}

/* ── FEATURES ── */
.features { border-bottom: 1px solid var(--border); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s, transform 0.4s;
}

.feature-card.visible { opacity: 1; transform: none; }
.feature-card:hover { border-color: rgba(124,58,237,0.3); }

.feature-icon { font-size: 2rem; margin-bottom: 14px; }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ── SCREENSHOTS ── */
.screenshots {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.screenshots-sub {
  color: var(--text-muted);
  margin-top: -16px;
  margin-bottom: 48px;
  font-size: 1rem;
}

/* Carrousel wrapper */
.carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  position: relative;
}

.carousel-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 540px;
}

/* Slide hero (image plein format) */
.slide-hero {
  max-width: 620px;
  width: 100%;
}
.slide-hero img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* Flèches */
.carousel-arrow {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.carousel-arrow:hover { background: var(--purple); transform: scale(1.1); }

/* Mockup iPhone */
.iphone-mockup { position: relative; }

.iphone-frame {
  width: 260px;
  height: 520px;
  background: #1a1a1e;
  border-radius: 44px;
  border: 6px solid #3a3a3e;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px #555,
    0 30px 80px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

/* Encoche */
.iphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 26px;
  background: #1a1a1e;
  border-radius: 0 0 20px 20px;
  z-index: 10;
}

/* Barre home */
.iphone-home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  z-index: 10;
}

/* Écran */
.iphone-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 38px;
  background: #fff;
  padding: 32px 0 24px;
}

/* Slides */
.iphone-slides {
  display: flex;
  width: 600%; /* 6 slides */
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.iphone-slides img {
  width: calc(100% / 6); /* 1/6 de 600% */
  height: 100%;
  object-fit: contain;
  object-position: top;
  flex-shrink: 0;
}

/* Caption */
.carousel-caption {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.95rem;
  min-height: 1.4em;
  transition: opacity 0.3s;
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--bg3);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}

.dot.active {
  background: var(--purple-light);
  transform: scale(1.3);
}

@media (max-width: 600px) {
  .carousel-arrow { display: none; }
  .iphone-frame { width: 220px; height: 440px; }
}

/* ── HOW IT WORKS ── */
.how {
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 100%, rgba(124,58,237,0.08) 0%, transparent 70%);
}

.steps {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  flex: 1;
  min-width: 200px;
  max-width: 220px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s, transform 0.4s;
}

.step.visible { opacity: 1; transform: none; }

.step-num {
  width: 40px;
  height: 40px;
  background: var(--purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 auto 16px;
}

.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.9rem; overflow-wrap: break-word; word-break: break-word; }

.step-arrow {
  font-size: 1.5rem;
  color: var(--purple-light);
  padding-top: 50px;
  flex-shrink: 0;
}

/* ── INSTALL ── */
.install {
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.install-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.code-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: left;
  position: relative;
}

.code-block pre { font-family: 'Courier New', monospace; font-size: 0.95rem; line-height: 1.7; overflow-x: auto; }
.code-block code { color: var(--purple-light); }

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.code-copy-btn:hover { color: var(--text); border-color: var(--purple-light); }
.code-copy-btn.copied { color: #4ade80; border-color: #4ade80; }

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 48px 40px;
  color: var(--text-muted);
}

.footer-logo {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.footer p { margin-bottom: 16px; font-size: 0.9rem; }

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav { padding: 16px 20px; }
  .nav-links a:not(.btn-github) { display: none; }
  .hero-content, .hero-image { padding: 0 20px; }
  section { padding: 60px 20px; }
  .step-arrow { display: none; }
  .step { max-width: 100%; }
}
