:root {
  --bg1: #09255c;
  --bg2: #00060e;
  --accent: rgba(80,170,255,0.85);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
  background: radial-gradient(ellipse at center, var(--bg1) 0%, var(--bg2) 100%);
}

/* ---------- Canvas étoiles ---------- */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

/* ---------- Contenu central ---------- */
.container {
  position: relative;
  z-index: 2;

  /* Hauteur "fiable" iOS + fallback */
  min-height: 100svh;  /* iOS Safari */
  min-height: 100dvh;  /* Chrome/Safari récents */
  min-height: 100vh;   /* Fallback */

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 2rem;

  /* Respect des encoches/safe-area */
  padding-top: max(2rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

/* ---------- Titre + lettres interactives ---------- */
.title {
  margin: 0;
  font-size: 3rem;
  letter-spacing: 0.25rem;

  /* Anim d’apparition + halo */
  opacity: 0;
  animation: fadeIn 1.2s ease forwards, pulse 6s ease-in-out infinite;

  /* iPhone : autoriser la ligne suivante + centrage */
  white-space: normal;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
}

.title span {
  display: inline-block;
  transition: all .25s ease;
  cursor: default;
}

.title .space {
  display: inline;
  width: 0.5ch;  /* espace souple entre mots */
}

.title span:hover {
  opacity: .6;
  text-shadow:
    0 0 10px var(--accent),
    0 0 24px rgba(80,170,255,.5);
  transform: scale(1.08);
}

/* ---------- Sous-titre + contact ---------- */
.subtitle {
  margin: .9rem 0 0;
  font-size: 1.05rem;
  color: #aab7c4;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: .4s;
}

.contact {
  margin: 1.6rem 0 0;
  display: inline-block;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: .7rem 1.6rem;
  border-radius: 4px;
  font-size: .95rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: .8s;
  transition: .25s;
}

.contact:hover {
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 10px rgba(255,255,255,.25);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255,255,255,.28); }
  50%      { text-shadow: 0 0 24px rgba(255,255,255,.75); }
}

/* ---------- Orbe (curseur custom) — desktop only ---------- */
.orb {
  position: fixed;
  top: 0; left: 0;
  width: 60px; height: 60px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(80,170,255,.35) 0%, rgba(0,0,30,0) 80%);
  box-shadow:
    0 0 20px rgba(80,170,255,.3),
    0 0 40px rgba(80,170,255,.2),
    0 0 60px rgba(80,170,255,.1);
  filter: blur(2px);
  transform: translate(-50%, -50%) scale(1);
  transition: background .3s ease;
  z-index: 3;
  mix-blend-mode: screen;
}

/* On ne cache le curseur natif que si pointeur "fin" (desktop) */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
}

/* Mobile/tablette : pas d’orbe */
@media (hover: none), (pointer: coarse) {
  .orb { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container {
    justify-content: center;
    margin-top: 0;
    padding: max(2rem, env(safe-area-inset-top)) 1.2rem
             max(2rem, env(safe-area-inset-bottom)) 1.2rem;
  }

  .title {
    /* Taille fluide adaptée aux petits écrans */
    font-size: clamp(1.6rem, 8vw, 2.4rem);
    letter-spacing: 0.08rem;
    white-space: normal;
  }

  .subtitle { font-size: 1rem; }
  .contact  { font-size: 1rem; padding: .85rem 2rem; }

  /* Légère atténuation du canvas pour lisibilité */
  #stars { opacity: 0.9; }

  /* Empêche le scroll “parasite” quand on interagit au toucher */
  body { touch-action: none; overflow: hidden; }
}

/* ---------- Accessibilité : réduit les animations ---------- */
@media (prefers-reduced-motion: reduce) {
  .title { animation: none; opacity: 1; }
  .subtitle, .contact { animation: none; opacity: 1; }
}
