@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --pink: #E8457A;
  --pink-light: #FFB3D0;
  --purple: #A033DD;
  --purple-light: #C77DFF;
  --blue: #3B8FE3;
  --blue-light: #7AB8FF;
  --yellow: #F0C020;
  --green: #4CAF50;
  --green-light: #81C784;
  --orange: #F07830;
  --red: #E53935;
  --bg: #F8F6FF;
  --bg-card: #FFFFFF;
  --bg-elevated: #F0EDFA;
  --text: #2D2040;
  --text-muted: #6B5F80;
  --text-dim: #9890A8;
  --border: #E0D8F0;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(100,60,150,0.10);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%; height: 200%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(196,77,255,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,107,157,0.10) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(77,166,255,0.10) 0%, transparent 50%);
  animation: bgFloat 25s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-2%, 2%) rotate(1deg); }
  66% { transform: translate(2%, -1%) rotate(-1deg); }
}

/* ===== FLOATING PARTICLES ===== */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.25;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.25; }
  90% { opacity: 0.25; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 16px;
  background: var(--purple);
  color: #fff;
  z-index: 200;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

.skip-link:focus {
  left: 0;
}

/* ===== LAYOUT ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ===== TOP NAV BAR ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,246,255,0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}

.topnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.topnav-brand span { font-size: 24px; }

.topnav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.topnav-link {
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
}

.topnav-link:hover, .topnav-link.active {
  background: rgba(196,77,255,0.15);
  color: white;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  .topnav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(248,246,255,0.97);
    backdrop-filter: blur(20px);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
  }
  .topnav-links.open { display: flex; }
  .topnav-link { padding: 10px 16px; font-size: 15px; }
}

/* ===== HERO SECTION ===== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero-emoji {
  font-size: 80px;
  display: block;
  margin-bottom: 20px;
  animation: heroBounce 3s ease-in-out infinite;
}

@keyframes heroBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.05); }
}

.hero h1 {
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== PAGE HEADER (sub-pages) ===== */
.page-header {
  text-align: center;
  padding: 40px 0 30px;
}

.page-header .emoji { font-size: 56px; display: block; margin-bottom: 16px; }

.page-header h1 {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
}

/* ===== SECTION ===== */
.section {
  margin-bottom: 50px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 800;
}

.section-title .emoji { font-size: 32px; }

.section-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: -16px;
  margin-bottom: 24px;
}

/* ===== CARDS GRID ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  border-color: #444;
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.card:hover::before { opacity: 1; }

/* Card color variants */
.card-pink::before { background: linear-gradient(90deg, var(--pink), var(--purple)); }
.card-blue::before { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.card-green::before { background: linear-gradient(90deg, var(--green), var(--blue)); }
.card-orange::before { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.card-yellow::before { background: linear-gradient(90deg, var(--yellow), var(--green)); }

.card-visual {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-emoji { font-size: 48px; display: block; margin-bottom: 14px; }

.card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }

.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ===== TAGS ===== */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.tag-easy { background: rgba(107,203,119,0.15); color: var(--green); }
.tag-medium { background: rgba(255,217,61,0.15); color: var(--yellow); }
.tag-hard { background: rgba(255,107,157,0.15); color: var(--pink); }
.tag-fun { background: rgba(255,140,66,0.15); color: var(--orange); }
.tag-useful { background: rgba(77,166,255,0.15); color: var(--blue); }
.tag-kawaii { background: rgba(255,107,157,0.15); color: var(--pink); }
.tag-deco { background: rgba(196,77,255,0.15); color: var(--purple); }
.tag-stem { background: rgba(107,203,119,0.15); color: var(--green); }
.tag-price { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* ===== INFO BOXES ===== */
.info-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.info-box.highlight {
  background: linear-gradient(135deg, rgba(255,107,157,0.08), rgba(77,166,255,0.08));
  border-color: rgba(196,77,255,0.3);
}

.info-box.success {
  border-color: rgba(107,203,119,0.3);
  background: linear-gradient(135deg, rgba(107,203,119,0.08), rgba(77,166,255,0.05));
}

.info-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.info-box p { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }
.info-box p:last-child { margin-bottom: 0; }

/* ===== STEPS ===== */
.steps { display: flex; flex-direction: column; gap: 16px; }

.step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.step:hover { border-color: #444; transform: translateX(6px); }

.step-num {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: white;
}

.step:nth-child(1) .step-num { background: linear-gradient(135deg, var(--pink), var(--purple)); }
.step:nth-child(2) .step-num { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.step:nth-child(3) .step-num { background: linear-gradient(135deg, var(--blue), var(--green)); }
.step:nth-child(4) .step-num { background: linear-gradient(135deg, var(--green), var(--yellow)); }
.step:nth-child(5) .step-num { background: linear-gradient(135deg, var(--yellow), var(--orange)); }
.step:nth-child(6) .step-num { background: linear-gradient(135deg, var(--orange), var(--pink)); }

.step-body h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.step-body p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ===== COMPARISON TABLE ===== */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  position: relative;
}

.compare-card.best {
  border-color: var(--green);
  box-shadow: 0 0 40px rgba(107,203,119,0.1);
}

.compare-card.best::after {
  content: '⭐ RECOMMANDÉE';
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(107,203,119,0.2);
  color: var(--green);
  padding: 5px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.compare-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.compare-card .price { font-size: 32px; font-weight: 900; color: var(--green); margin-bottom: 20px; }

.spec-list { list-style: none; }
.spec-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.spec-list li::before { content: '✓'; color: var(--green); font-weight: 800; font-size: 16px; }

/* ===== DIAGRAM BOX ===== */
.diagram {
  background: #EDE8F8;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ===== LINK CARDS ===== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.link-card:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.link-card .link-emoji { font-size: 36px; flex-shrink: 0; }
.link-card h4 { font-size: 16px; font-weight: 700; }
.link-card p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== HOME PAGE GRID ===== */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  transition: opacity 0.3s;
  opacity: 0;
}

.home-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: #444;
}

.home-card:hover::before { opacity: 1; }

.home-card .card-visual {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.home-card .card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-card:hover .card-visual img {
  transform: scale(1.05);
}

.home-card .hc-emoji { font-size: 56px; display: block; margin-bottom: 16px; }
.home-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.home-card p { font-size: 14px; color: var(--text-muted); }
.home-card .hc-count { font-size: 12px; color: var(--text-dim); margin-top: 12px; font-weight: 700; }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer a { color: var(--purple); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 50;
  box-shadow: 0 4px 20px rgba(196,77,255,0.3);
}

.back-top.show { opacity: 1; transform: translateY(0); }
.back-top:hover { transform: translateY(-4px); }

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(9) { transition-delay: 0.45s; }
.stagger.visible > * { opacity: 1; transform: translateY(0); }

/* Pulse glow */
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196,77,255,0.4); } 50% { box-shadow: 0 0 20px 10px rgba(196,77,255,0); } }
.pulse { animation: pulse 2s infinite; }

/* Sparkle */
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(180deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .hero h1 { font-size: 32px; }
  .hero-emoji { font-size: 56px; }
  .hero p { font-size: 16px; }
  .page-header h1 { font-size: 28px; }
  .page-header .emoji { font-size: 44px; }
  .cards { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .container { padding: 20px 14px 40px; }
  .step { flex-direction: column; gap: 12px; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-emoji { animation: none; }
  .particles { display: none; }
  body::before { animation: none; }
}
