:root {
  --night: #1B2459;
  --night-2: #26337A;
  --night-3: #33408F;
  --gold: #E8B04A;
  --gold-soft: #F6D98F;
  --bougain: #CF4677;
  --sand: #F8EEE2;
  --sand-2: #F1E1CE;
  --paper: #FFFBF5;
  --ink: #2A1E3F;
  --ink-soft: #5E5070;
  --line: #E4D3BF;
  --wood: #4A2A12;
  --display: 'El Messiri', Georgia, serif;
  --body: 'Figtree', system-ui, sans-serif;
  /* Étoile à huit branches du zellige, en filet doré */
  --zellige: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23E8B04A' stroke-width='1.1'%3E%3Crect x='16' y='16' width='24' height='24'/%3E%3Crect x='16' y='16' width='24' height='24' transform='rotate(45 28 28)'/%3E%3Cpath d='M0 0l10 10M56 0L46 10M0 56l10-10M56 56L46 46'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.sub { color: var(--ink-soft); max-width: 56ch; margin-top: 12px; font-size: 1.1rem; }

/* En-tête */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  background: rgba(27, 36, 89, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--paper);
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 700 1.45rem/1 var(--display); color: var(--gold); margin: 0; }
.logo svg { width: 24px; height: 24px; }
.nav { display: flex; gap: 22px; font-weight: 600; font-size: .98rem; }
.nav a { text-decoration: none; opacity: .85; }
.nav a:hover { opacity: 1; color: var(--gold-soft); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang { font-weight: 600; font-size: .95rem; text-decoration: none; opacity: .85; }
.lang:hover { opacity: 1; color: var(--gold-soft); }

.btn {
  display: inline-block; padding: 15px 30px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #F3C567, var(--gold)); color: var(--night);
  font: 700 1.1rem var(--body); text-decoration: none; text-align: center;
  box-shadow: 0 5px 0 #B9842A, 0 10px 24px -8px rgba(232, 176, 74, .6);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 #B9842A, 0 8px 20px -8px rgba(232, 176, 74, .6); }
.btn-sm { padding: 9px 18px; font-size: .95rem; box-shadow: 0 3px 0 #B9842A; }
.btn-sm:hover { box-shadow: 0 1px 0 #B9842A; }

/* Héros : la nuit du Ramadan */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px;
  padding: 64px max(24px, calc((100vw - 1180px) / 2)) 110px;
  background: radial-gradient(900px 520px at 72% 40%, #3C4AA3 0%, transparent 65%), linear-gradient(180deg, var(--night) 0%, #232E73 70%, #2C2F72 100%);
  color: var(--paper);
}
.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 28% 42%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 44% 12%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 8% 70%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 52% 78%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 92% 14%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 66% 8%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 62%, #FFF3D6 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 85% 88%, #FFF3D6 50%, transparent 51%);
}
.hero::after { /* bande de zellige qui ferme la nuit */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; z-index: -1;
  background: var(--zellige) center / 44px 44px, linear-gradient(var(--night), var(--night));
  border-top: 2px solid var(--gold); opacity: .9;
}
.kicker { color: var(--gold); font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.kicker::before { content: ''; width: 28px; height: 2px; background: var(--gold); }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.5rem); margin-top: 16px; max-width: 14ch; }
.lead { margin-top: 20px; max-width: 46ch; font-size: 1.17rem; color: #DADDF6; }

.perso { margin-top: 32px; max-width: 500px; }
.perso > label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--gold-soft); }
.perso-row { display: flex; gap: 10px; flex-wrap: wrap; }
#childName {
  flex: 1 1 220px; min-width: 0;
  font: 700 1.7rem var(--display); color: var(--night);
  padding: 10px 20px; border: 2px solid var(--gold); border-radius: 16px; background: var(--paper);
}
#childName::placeholder { color: #B9A587; }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 20px; }
.price-line { color: #C9CCF0; font-size: .98rem; }

.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.12); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 11px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.seg input:checked + label { background: var(--gold); color: var(--night); }
.seg input:focus-visible + label { outline: 3px solid var(--gold-soft); }
.seg-light { background: var(--sand-2); justify-self: start; }
.seg-light input:checked + label { background: var(--night); color: var(--paper); }

/* Le livre en 3D, avec le prénom sur la banderole */
.stage { display: grid; place-items: center; perspective: 1800px; }
.book {
  position: relative; width: min(500px, 86vw); aspect-ratio: 1;
  transform: rotateY(-20deg) rotateX(5deg); transform-style: preserve-3d;
  animation: arrive 1.2s cubic-bezier(.2,.8,.2,1) both;
}
.cover {
  position: absolute; inset: 0; overflow: hidden; container-type: inline-size;
  border-radius: 4px 14px 14px 4px; background: var(--night-2);
  box-shadow: 34px 44px 70px -24px rgba(6, 8, 36, .85), 0 0 0 1px rgba(255,255,255,.08);
}
.cover::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4%; z-index: 3;
  background: linear-gradient(90deg, rgba(0,0,0,.4), rgba(255,255,255,.18) 55%, transparent); }
.cover::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.14), transparent 35%); }
.pages { position: absolute; top: 1.5%; bottom: 1.5%; right: -14px; width: 16px;
  background: repeating-linear-gradient(90deg, #FFFBF5 0 1px, #E9DCC9 1px 2px);
  transform: rotateY(90deg) translateZ(7px); transform-origin: left; border-radius: 0 3px 3px 0; }

.ribbon-name {
  position: absolute; z-index: 2; left: 50%; transform: translate(-50%, -50%);
  font: 700 7.4cqi/1 var(--display); color: #5A3214; text-align: center; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .6);
}
.ribbon-name.long { font-size: 5.4cqi; }
body[data-g="b"] .ribbon-name { top: 21.6%; }
body[data-g="g"] .ribbon-name { top: 10.2%; font-size: 8.4cqi; }
body[data-g="g"] .ribbon-name.long { font-size: 6.2cqi; }

@keyframes arrive { from { opacity: 0; transform: rotateY(-48deg) rotateX(10deg) translateY(28px); } }

/* Scènes illustrées garçon / fille */
.scene { position: relative; aspect-ratio: 1; container-type: inline-size; }
.scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease; }
body[data-g="b"] .scene .v-g, body[data-g="g"] .scene .v-b { opacity: 0; }
.plaque {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  font: 700 4.4cqi/1 var(--display); color: var(--wood); white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 230, 190, .5);
}
.plaque.long { font-size: 3.1cqi; }
body[data-g="b"] .plaque-window { left: 83.4%; top: 40.2%; }
body[data-g="g"] .plaque-window { left: 86.2%; top: 34.8%; }
body[data-g="b"] .plaque-eid { left: 87.2%; top: 21.6%; }
body[data-g="g"] .plaque-eid { left: 86.2%; top: 23.2%; }

.countdown {
  text-align: center; font: 700 1.25rem var(--display); color: var(--night);
  padding: 30px 24px 0;
}

/* Galerie en arcs */
.gallery { padding: 64px 0 40px; }
.arches {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(340px, 78vw); gap: 28px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 24px;
  padding: 34px max(24px, calc((100vw - 1120px) / 2 + 24px)) 26px;
  scrollbar-width: thin; scrollbar-color: var(--gold) transparent;
}
.arch { margin: 0; scroll-snap-align: start; }
.arch .scene {
  border-radius: 50% 50% 18px 18px / 30% 30% 18px 18px; overflow: hidden;
  box-shadow: 0 0 0 7px var(--paper), 0 0 0 9px var(--gold), 0 24px 40px -20px rgba(42, 30, 63, .45);
}
.arch figcaption { margin-top: 22px; display: grid; gap: 4px; }
.g-night { color: var(--bougain); font-weight: 700; font-size: .95rem; }
.g-title { font: 700 1.35rem/1.25 var(--display); }

/* Choix du héros */
.heroes { padding: 56px 0; }
.heroes-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pick-card {
  display: grid; gap: 0; padding: 0 0 16px; border: 2px solid var(--line); border-radius: 22px; background: var(--paper);
  cursor: pointer; overflow: hidden; font: 700 1.2rem var(--display); color: var(--ink); transition: border-color .2s, transform .2s;
}
.pick-card .crop { aspect-ratio: 610 / 645; overflow: hidden; }
.pick-card img { width: 200%; max-width: none; }
.pick-card span { padding-top: 10px; }
.pick-card:hover { transform: translateY(-3px); }
.pick-card[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232, 176, 74, .35); }

/* Les 30 nuits */
.nights { padding: 64px 0; background: var(--night); color: var(--paper); position: relative; }
.nights::before { content: ''; position: absolute; inset: 0; background: var(--zellige) 0 0 / 56px 56px; opacity: .07; pointer-events: none; }
.nights .sub { color: #C9CCF0; }
.moons { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(15, 1fr); gap: 10px 6px; position: relative; }
.moon {
  width: 100%; display: grid; justify-items: center; gap: 4px; background: none; border: 0; padding: 7px 0; cursor: pointer;
  color: #AEB2E2; font: 600 .8rem var(--body); border-radius: 12px;
}
.moon svg { width: 100%; max-width: 38px; }
.m-dark { fill: #343F8C; }
.m-lit { fill: var(--gold); }
.moon:hover { background: rgba(255,255,255,.06); }
.moon[aria-pressed="true"] { background: var(--gold); color: var(--night); }
.moon[aria-pressed="true"] .m-dark { fill: #C8902E; }
.moon[aria-pressed="true"] .m-lit { fill: var(--paper); }
.night-card {
  position: relative; margin-top: 22px; padding: 26px 30px; border-radius: 20px;
  background: var(--paper); color: var(--ink); display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap;
}
.nc-num { color: var(--bougain); font-weight: 700; }
.nc-title { font: 700 clamp(1.4rem, 3vw, 2rem)/1.2 var(--display); }

/* Étapes : une vraie séquence */
.steps { padding: 72px 0 40px; }
.steps ol { list-style: none; counter-reset: s; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.steps li { counter-increment: s; position: relative; padding-top: 64px; }
.steps li::before {
  content: counter(s); position: absolute; top: 0; left: 0; width: 50px; height: 50px; display: grid; place-items: center;
  font: 700 1.5rem var(--display); color: var(--night); background: var(--gold);
  clip-path: polygon(50% 0, 64% 14%, 85% 15%, 86% 36%, 100% 50%, 86% 64%, 85% 85%, 64% 86%, 50% 100%, 36% 86%, 15% 85%, 14% 64%, 0 50%, 14% 36%, 15% 15%, 36% 14%);
}
.steps h3 { font-size: 1.45rem; }
.steps p { margin-top: 8px; color: var(--ink-soft); }

/* Commande */
.order { padding: 64px 0 80px; }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.specs { margin: 26px 0 0; }
.specs div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-weight: 700; }
.specs dd { margin: 0; color: var(--ink-soft); }
.deadline { margin-top: 24px; padding: 14px 18px; border-left: 4px solid var(--bougain); background: var(--paper); border-radius: 0 12px 12px 0; font-weight: 600; max-width: 46ch; }
.order-form {
  position: relative; background: var(--paper); padding: 32px; border-radius: 28px; display: grid; gap: 10px;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -36px rgba(42, 30, 63, .45);
}
.order-form::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 10px; border-radius: 28px 28px 0 0; background: var(--zellige) 0 0 / 20px 20px, var(--night); }
.order-form > label { font-weight: 600; margin-top: 8px; }
.order-form input:not([type="radio"]):not([type="checkbox"]), .order-form textarea {
  font: inherit; color: var(--ink); padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; width: 100%;
}
.order-form #oName { font: 700 1.45rem var(--display); }
.order-form textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; color: var(--ink-soft); margin-top: 10px; }
.check input { margin-top: 4px; accent-color: var(--night); width: 18px; height: 18px; flex: none; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.total strong { font: 700 2rem var(--display); color: var(--night); }
.form-err { color: #B3261E; font-weight: 600; }
.form-err:empty { display: none; }
.btn-card { width: 100%; background: var(--night); color: var(--paper); box-shadow: 0 5px 0 #0F1540; }
.btn-card:hover { box-shadow: 0 3px 0 #0F1540; }
.pay-later { padding: 14px; border-radius: 12px; background: var(--sand); text-align: center; font-weight: 600; }
.pay-note { font-size: .9rem; color: var(--ink-soft); }
.thanks { padding: 16px 18px; border-radius: 14px; background: var(--night); color: var(--paper); font-weight: 600; }

/* FAQ */
.faq { padding: 10px 0 90px; }
.faq h2 { margin-bottom: 18px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; max-width: 780px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.12rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 700 1.6rem/1 var(--display); color: var(--gold); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 10px; color: var(--ink-soft); max-width: 66ch; }

/* Pages d'aide et légales */
.doc-main { padding: 64px 0 90px; }
.doc-body { max-width: 760px; }
.doc-body h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.updated { color: var(--ink-soft); margin-top: 8px; font-size: .95rem; }
.doc-body h2 { font-size: 1.5rem; margin-top: 36px; }
.doc-body p { margin-top: 12px; line-height: 1.7; max-width: 68ch; }
.doc-body a { color: var(--night-3); }

/* Pied de page */
.foot { background: var(--night); color: #C9CCF0; }
.zellige-band { height: 40px; background: var(--zellige) center / 40px 40px, var(--night-2); border-bottom: 2px solid var(--gold); }
.foot-inner { max-width: 1120px; margin: 0 auto; padding: 48px 24px 28px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.foot-brand { display: grid; gap: 10px; align-content: start; }
.foot h3 { font: 700 1.1rem var(--display); color: var(--gold-soft); margin-bottom: 12px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--gold-soft); text-decoration: underline; }
.pay { font-size: .9rem; opacity: .85; }
.copy { max-width: 1120px; margin: 0 auto; padding: 18px 24px 30px; border-top: 1px solid rgba(255,255,255,.1); font-size: .9rem; }

/* Mobile */
@media (max-width: 900px) {
  .top { gap: 14px; padding: 12px 16px; }
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; padding: 28px 16px 96px; gap: 24px; }
  .stage { order: -1; }
  .book { width: min(340px, 82vw); }
  .hero h1 { max-width: none; }
  .wrap { padding: 0 16px; }
  .arches { padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
  .heroes-grid, .order-grid { grid-template-columns: 1fr; gap: 28px; }
  .moons { grid-template-columns: repeat(6, 1fr); }
  .steps ol { grid-template-columns: 1fr; gap: 28px; }
  .order-form { padding: 26px 18px; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .lang { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .book { animation: none; }
  .scene img, .pick-card { transition: none; }
  html { scroll-behavior: auto; }
}
