/* sc'Arabe — site vitrine. Thème du jeu : vert forêt, or, ivoire, orange C4M. */
:root {
  --bg-dark: #0b120a;
  --bg-mid: #1f2c19;
  --gold: #d9a82e;
  --gold-light: #f3cf6b;
  --gold-dark: #8a6512;
  --ivory: #f4ead0;
  --ivory-dim: #cfc6ad;
  --orange: #e2762a;
  --radius: 18px;
  --serif: Georgia, "Noto Serif", "DejaVu Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ivory);
  font-family: var(--sans);
  line-height: 1.55;
  background: radial-gradient(ellipse at 50% 20%, var(--bg-mid), var(--bg-dark) 70%) fixed, var(--bg-dark);
}
img { max-width: 100%; display: block; }
a { color: var(--gold-light); }

/* Frise lamba : croisillons et points dorés. */
.lamba {
  height: 34px;
  border-top: 2px solid var(--gold-dark);
  border-bottom: 2px solid var(--gold-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='30'%3E%3Cg stroke='%23b8902a' stroke-width='1.4' fill='none'%3E%3Cpath d='M0 4 L36 26 M36 4 L0 26'/%3E%3C/g%3E%3Ccircle cx='0' cy='15' r='2' fill='%23b8902a'/%3E%3Ccircle cx='36' cy='15' r='2' fill='%23b8902a'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.9;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--gold-light);
  font-family: var(--serif); font-weight: 700; font-size: 1.4rem; }
.brand img { border-radius: 10px; }
.langs { display: flex; gap: 6px; }
.langs button {
  font: 600 0.85rem var(--sans); letter-spacing: 0.08em; color: var(--ivory);
  background: transparent; border: 1.5px solid var(--gold-dark); border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--gold); color: #1b2414; border-color: var(--gold); }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
section { padding: 36px 0; }
h2 {
  font-family: var(--serif); color: var(--gold-light); font-size: 1.9rem; margin: 0 0 20px;
  text-align: center;
}

/* Héros */
.hero { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 36px; align-items: center; }
.hero-art { border-radius: var(--radius); border: 2px solid var(--gold-dark); box-shadow: 0 20px 60px rgba(0,0,0,0.5); width: 100%; height: auto; }
.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: #1b2414; background: var(--orange); border-radius: 999px; padding: 4px 12px;
}
.title {
  font-family: var(--serif); font-size: clamp(3.2rem, 11vw, 5.6rem); line-height: 1; margin: 14px 0 6px;
  background: linear-gradient(180deg, #fff0a8 0%, #f0c24a 45%, #c38512 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.55)) drop-shadow(0 0 22px rgba(217,168,46,0.35));
}
.tagline { margin: 0 0 18px; letter-spacing: 0.35em; text-transform: uppercase; color: var(--ivory-dim); font-size: 0.95rem; }
.lead { font-size: 1.1rem; margin: 0 0 26px; max-width: 34em; }
.download {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1b2414; text-decoration: none; font-weight: 800; font-size: 1.2rem;
  padding: 16px 34px; border-radius: var(--radius); border-bottom: 5px solid var(--gold-dark);
  box-shadow: 0 10px 30px rgba(217,168,46,0.25);
}
.download:active { transform: translateY(2px); border-bottom-width: 2px; }
.download small { font-weight: 600; font-size: 0.8rem; opacity: 0.8; }
.download[aria-disabled="true"] { filter: grayscale(0.8); opacity: 0.6; pointer-events: none; }
.free { color: var(--ivory-dim); font-size: 0.9rem; margin-top: 14px; }
.count { margin: 14px 0 0; font-weight: 700; color: var(--gold-light); letter-spacing: 0.02em; }
.count b { font-size: 1.15em; }

/* Cartes */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: rgba(10, 16, 9, 0.75); border: 1.5px solid var(--gold-dark); border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 8px; color: var(--gold-light); font-family: var(--serif); }
.card p { margin: 0; color: var(--ivory-dim); }

/* Galerie */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.gallery figure { margin: 0; scroll-snap-align: center; }
.gallery img { border-radius: 16px; border: 2px solid var(--gold-dark); width: 100%; height: auto; }

/* Installation */
.install ol { max-width: 640px; margin: 0 auto 16px; padding-left: 1.3em; }
.install li { margin-bottom: 10px; }
.note, .checksum, .contact { max-width: 640px; margin: 8px auto; color: var(--ivory-dim); font-size: 0.92rem; }
.checksum code { word-break: break-all; color: var(--ivory); font-size: 0.8rem; }

.legal { text-align: center; }
.legal p { max-width: 680px; margin: 0 auto; color: var(--ivory-dim); }

footer { text-align: center; padding: 24px 20px 30px; color: var(--ivory-dim); font-size: 0.9rem; }
footer strong { color: var(--orange); letter-spacing: 0.12em; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-art { max-width: 300px; margin: 0 auto; }
  .lead { margin-left: auto; margin-right: auto; }
}

/* ═══ Splash d'ouverture (plein écran) ═════════════════════════════════════════
   Version d'origine (visuel C4M Studio, puis visuel sc'Arabe avec ses textes traduits),
   affichée en plein écran : le visuel reste entier et une copie floutée remplit l'écran.
   Les scènes se succèdent sans jamais se superposer. */
.splash {
  position: fixed; inset: 0; z-index: 100; background: var(--bg-dark); overflow: hidden;
  cursor: pointer; transition: opacity 0.6s ease, visibility 0.6s;
}
.splash.done { opacity: 0; visibility: hidden; }
.splash-scene { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; }
.splash-fill {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(28px) brightness(0.55) saturate(1.1); transform: scale(1.15);
}
.splash-art {
  position: relative; container-type: inline-size;
  width: min(100vw, 56.25vh); aspect-ratio: 9 / 16;
}
.splash-art > img { width: 100%; height: 100%; object-fit: contain; }
.splash-title, .splash-tagline, .splash-credit {
  position: absolute; left: 0; right: 0; margin: 0; text-align: center; opacity: 0;
}
.splash-title {
  top: 69%; font: 700 19cqw/1 var(--serif);
  background: linear-gradient(180deg, #fff0a8 0%, #f0c24a 45%, #c38512 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0.8cqw 0 rgba(0,0,0,0.6)) drop-shadow(0 0 3cqw rgba(217,168,46,0.4));
}
.splash-tagline { top: 82.5%; font-size: 3.8cqw; letter-spacing: 1.6cqw; text-transform: uppercase; color: var(--ivory-dim); }
.splash-credit { top: 90.4%; font-size: 3.1cqw; letter-spacing: 1.1cqw; color: var(--ivory-dim); }
.splash-credit b { color: var(--orange); }

/* Scène 1, puis scène 2 seulement une fois la scène 1 effacée. */
.splash.studio .splash-studio { animation: splash-in 0.5s ease forwards; }
.splash.studio .splash-studio .splash-art { animation: slow-zoom 2s ease-out forwards; }
.splash.game .splash-studio { animation: splash-out 0.35s ease forwards; }
.splash.game .splash-game { animation: splash-in 0.5s 0.35s ease both; }
.splash.game .splash-game .splash-art { animation: slow-zoom 3s 0.35s ease-out both; }
.splash.game .splash-title { animation: title-drop 0.8s 0.65s cubic-bezier(.2,1.4,.4,1) both; }
.splash.game .splash-tagline { animation: splash-in 0.5s 1.15s ease both; }
.splash.game .splash-credit { animation: splash-in 0.5s 1.45s ease both; }

/* Mode figé (#splash-studio / #splash-game) : état final des animations, pour les contrôles visuels. */
.splash.pinned *, .splash.pinned { animation-duration: 1ms !important; animation-delay: 0s !important; }

@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes slow-zoom { from { transform: scale(1); } to { transform: scale(1.04); } }
@keyframes title-drop {
  from { opacity: 0; transform: scale(1.35) translateY(-4%); }
  to { opacity: 1; transform: none; }
}

/* ═══ Animations du site ═══════════════════════════════════════════════════ */
.lamba { animation: lamba-slide 30s linear infinite; }
@keyframes lamba-slide { to { background-position-x: 360px; } }

.hero-visual { position: relative; }
.hero-art { animation: float 6s ease-in-out infinite, glow 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes glow {
  0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 rgba(217,168,46,0); }
  50% { box-shadow: 0 30px 70px rgba(0,0,0,0.55), 0 0 40px rgba(217,168,46,0.18); }
}

/* Titre : reflet doré qui balaie les lettres. */
.title {
  background: linear-gradient(100deg, #f0c24a 0%, #f0c24a 40%, #fff6c8 50%, #f0c24a 60%, #c38512 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: shimmer 5s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }

/* Bouton : éclat lumineux périodique. */
.download { position: relative; overflow: hidden; }
.download::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg); animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.badge { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* Apparition au défilement. */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.cards .card:nth-child(2) { transition-delay: 0.1s; }
.cards .card:nth-child(3) { transition-delay: 0.2s; }
.cards .card:nth-child(4) { transition-delay: 0.3s; }
.card { transition: border-color 0.3s, transform 0.3s; }
.card:hover { border-color: var(--gold); transform: translateY(-4px); }
.gallery img { transition: transform 0.4s ease, border-color 0.4s; }
.gallery img:hover { transform: scale(1.03) rotate(-0.5deg); border-color: var(--gold); }

/* ═══ Dé 3D (touchez-le pour le lancer) ════════════════════════════════════ */
.die {
  --s: 64px;
  position: absolute; right: -18px; bottom: 9%; width: var(--s); height: var(--s);
  padding: 0; border: 0; background: none; cursor: pointer; perspective: 500px;
  filter: drop-shadow(0 14px 12px rgba(0,0,0,0.55));
}
.cube {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d; transform: rotateX(-25deg) rotateY(35deg);
  transition: transform 1.1s cubic-bezier(.2,.9,.25,1.15);
}
.die.idle .cube { animation: tumble 7s ease-in-out infinite; }
@keyframes tumble {
  0%, 100% { transform: rotateX(-25deg) rotateY(35deg); }
  50% { transform: rotateX(-35deg) rotateY(80deg) translateY(-6px); }
}
.face {
  position: absolute; inset: 0; border-radius: 14px;
  background: radial-gradient(circle at 30% 25%, #fffaf0, #efe3c4 70%, #d9c79b);
  box-shadow: inset 0 0 0 2px rgba(138,101,18,0.35);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 10px;
}
.face i { width: 11px; height: 11px; border-radius: 50%; background: #120e0b; place-self: center;
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.15); }
.f1 { transform: rotateY(0deg) translateZ(calc(var(--s) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
/* Placement des points (grille 3 × 3). */
.f1 i { grid-area: 2 / 2; }
.f2 i:nth-child(1), .f3 i:nth-child(1), .f4 i:nth-child(1), .f5 i:nth-child(1), .f6 i:nth-child(1) { grid-area: 1 / 1; }
.f2 i:nth-child(2), .f3 i:nth-child(3), .f4 i:nth-child(4), .f5 i:nth-child(5), .f6 i:nth-child(6) { grid-area: 3 / 3; }
.f3 i:nth-child(2), .f5 i:nth-child(3) { grid-area: 2 / 2; }
.f4 i:nth-child(2), .f5 i:nth-child(2), .f6 i:nth-child(2) { grid-area: 1 / 3; }
.f4 i:nth-child(3), .f5 i:nth-child(4), .f6 i:nth-child(5) { grid-area: 3 / 1; }
.f6 i:nth-child(3) { grid-area: 2 / 1; }
.f6 i:nth-child(4) { grid-area: 2 / 3; }

@media (max-width: 760px) {
  .die { --s: 52px; right: 8%; }
  .face { padding: 8px; }
  .face i { width: 9px; height: 9px; }
}

/* Moins d'animations si l'utilisateur le demande. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
