/* ===========================================================
   MathTricks — site vitrine
   Thème : indigo cosmique + accents cyan / or / magenta
   =========================================================== */

:root {
  --bg:        #120B2E;
  --bg-2:      #1B1147;
  --panel:     rgba(255, 255, 255, 0.05);
  --panel-2:   rgba(255, 255, 255, 0.08);
  --border:    rgba(255, 255, 255, 0.12);
  --text:      #ECE9FF;
  --muted:     #ADA3D8;
  --cyan:      #4FC8FF;
  --gold:      #FFC94D;
  --magenta:   #C77BFF;
  --grad:      linear-gradient(135deg, #6A3DF5 0%, #C24BFF 100%);
  --grad-soft: linear-gradient(135deg, rgba(106,61,245,.18), rgba(194,75,255,.14));
  --radius:    18px;
  --maxw:      1080px;
  --shadow:    0 18px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0; }

/* ----------------------- Fond animé ----------------------- */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 70% -10%, #34206e 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 10%, #2a1a5e 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 45%, #0C0820 100%);
}
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 65% 15%, #cfe9ff, transparent),
    radial-gradient(1.6px 1.6px at 80% 60%, #fff, transparent),
    radial-gradient(1px 1px at 40% 80%, #e7d6ff, transparent),
    radial-gradient(1.3px 1.3px at 90% 35%, #fff, transparent),
    radial-gradient(1px 1px at 12% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 50% 50%, #d9ecff, transparent);
  background-repeat: repeat;
  background-size: 100% 100%;
  opacity: .55;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .7; } }

.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.glow-1 { width: 420px; height: 420px; top: -120px; right: -80px;
  background: radial-gradient(circle, #7a3df5, transparent 70%); }
.glow-2 { width: 360px; height: 360px; bottom: 5%; left: -120px;
  background: radial-gradient(circle, #2f8fff, transparent 70%); }

.floaters { position: absolute; inset: 0; overflow: hidden; }
.floaters span {
  position: absolute;
  top: 110%;
  left: var(--x);
  font-size: clamp(20px, 3vw, 38px);
  font-weight: 700;
  color: rgba(199, 123, 255, .35);
  text-shadow: 0 0 18px rgba(120, 80, 255, .5);
  animation: rise var(--t, 24s) linear var(--d, 0s) infinite;
}
@keyframes rise {
  to { transform: translateY(-130vh) rotate(220deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stars, .floaters span { animation: none; }
  .floaters span { display: none; }
}

/* ----------------------- Navigation ----------------------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  backdrop-filter: blur(14px);
  background: rgba(18, 11, 46, .55);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.brand img { border-radius: 10px; }
.nav-links { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.nav-links > a { color: var(--muted); font-weight: 600; transition: color .2s; }
.nav-links > a:hover { color: var(--text); }

.lang-select {
  border: 1px solid var(--border);
  background-color: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: .85rem;
  padding: 8px 30px 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ADA3D8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  transition: border-color .2s;
}
.lang-select:hover { border-color: var(--magenta); }
.lang-select:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.lang-select option { background: #1B1147; color: var(--text); }

/* ----------------------- Boutons ----------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-ghost {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel-2); border-color: var(--magenta); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px rgba(150, 70, 255, .45);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(150, 70, 255, .6); transform: translateY(-2px); }

.btn-play {
  background: #0d0a22;
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 22px;
}
.btn-play:hover { border-color: var(--cyan); transform: translateY(-2px); }
.btn-play-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.btn-play-text small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.btn-play-text strong { font-size: 1.05rem; }
.btn-play-lg { padding: 14px 28px; }

/* ----------------------- HERO ----------------------- */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) 20px 40px;
  text-align: center;
}
.hero-icon {
  width: 128px; height: 128px;
  border-radius: 28px;
  margin: 0 auto 22px;
  box-shadow: var(--shadow), 0 0 60px rgba(120, 80, 255, .5);
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero-title {
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fff 20%, var(--magenta) 60%, var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tag { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700; margin: 14px 0 8px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }
.hero-cta {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin: 30px 0 26px;
}
.badges {
  display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center;
  list-style: none; padding: 0; margin: 8px 0 0;
  color: var(--muted); font-weight: 600; font-size: .95rem;
}
.badges li { display: inline-flex; align-items: center; gap: 7px; }

/* ----------------------- Sections ----------------------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 90px) 20px;
}
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  text-align: center;
}
.section-lead {
  text-align: center; color: var(--muted);
  max-width: 620px; margin: 12px auto 0; font-size: 1.05rem;
}

/* ----------------------- Grille fonctionnalités ----------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 42px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform .2s ease, border-color .2s, background .2s;
}
.card:hover { transform: translateY(-5px); border-color: var(--magenta); background: var(--panel-2); }
.card-ico {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  font-size: 28px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--muted); margin: 0; font-size: .98rem; }

/* ----------------------- Aperçu (showcase) ----------------------- */
.showcase {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(30px, 6vw, 70px);
  align-items: center;
}
.phone {
  justify-self: center;
  padding: 12px;
  border-radius: 38px;
  background: linear-gradient(160deg, #2a1d5c, #160f38);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 60px rgba(80, 50, 200, .35);
}
.phone-screen {
  width: 240px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.phone-screen img { width: 100%; display: block; }
.showcase-text .section-title { text-align: left; }
.showcase-text p { color: var(--muted); margin: 16px 0 0; }
.check-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff; font-size: .75rem; font-weight: 900;
}

/* ----------------------- Vos idées ----------------------- */
.ideas-inner {
  text-align: center;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(34px, 6vw, 60px) 24px;
  box-shadow: var(--shadow);
}
.ideas-cta { margin: 28px 0 16px; }
.ideas-note { color: var(--muted); font-size: .95rem; max-width: 520px; margin: 0 auto; }

/* ----------------------- Aide & support (FAQ) ----------------------- */
.support .section-title, .support .section-lead { text-align: center; }
.faq {
  max-width: 720px;
  margin: 40px auto 0;
  display: grid;
  gap: 12px;
}
.faq details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s, background .2s;
}
.faq details[open] { border-color: var(--magenta); background: var(--panel-2); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem; font-weight: 700; color: var(--magenta);
  transition: transform .2s;
  line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--muted);
}
.support-cta { text-align: center; margin-top: 32px; }

/* Formulaire de contact support */
.support-form {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
  text-align: left;
}
.form-title {
  margin: 0 0 4px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}
.support-form input[type="text"],
.support-form input[type="email"],
.support-form textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  font: inherit;
  resize: vertical;
  transition: border-color .2s, background .2s;
}
.support-form input:focus,
.support-form textarea:focus {
  outline: none;
  border-color: var(--magenta);
  background: var(--panel-2);
}
.support-form .botcheck { display: none !important; }
.support-form .btn { justify-self: center; min-width: 200px; margin-top: 4px; }
.form-status { min-height: 22px; margin: 4px 0 0; text-align: center; font-weight: 600; }
.form-status.ok { color: var(--cyan); }
.form-status.err { color: #ff6b6b; }
.support-alt {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: .92rem;
  text-decoration: underline;
}
.support-alt:hover { color: var(--magenta); }

/* ----------------------- Téléchargement ----------------------- */
.download { text-align: center; }
.download .btn-play { margin-top: 30px; }

/* ----------------------- Footer ----------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 34px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.footer-brand img { border-radius: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: .88rem; margin: 0; }

/* ----------------------- Responsive ----------------------- */
@media (max-width: 760px) {
  .showcase { grid-template-columns: 1fr; text-align: center; }
  .showcase-text .section-title { text-align: center; }
  .check-list { display: inline-grid; text-align: left; }
  .nav-links > a:not(.btn) { display: none; }
}
