/* =========================================================================
   Mosquée Al-Nour — Démonstration Porcelaine Pixels
   Palette « Pierre Calcaire, Or Doux & Nuit Émeraude »
   Polices système uniquement (aucun téléchargement de police : éco-conception)
   ========================================================================= */

:root {
  --stone: #F5EFE6;
  --night: #132A26;
  --gold: #C59B47;
  --gold-soft: rgba(197, 155, 71, .45);
  --ink: #181A19;
  --ink-soft: #4A4D49;
  --cream-ink: #F5EFE6;
  --glass-light: rgba(247, 242, 234, .74);
  --glass-dark: rgba(19, 42, 38, .66);
  --radius: 22px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 72px;
  --bar-h: 34px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
html.is-calm { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--stone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -.01em; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--stone); padding: 10px 16px; border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Scène 3D ---------- */
#scene-3d {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none; /* les sections restent cliquables */
}
html.no-webgl #scene-3d { display: none; }
html.no-webgl body {
  background:
    radial-gradient(120% 80% at 50% 0%, #FFF6E3 0%, transparent 60%),
    linear-gradient(180deg, var(--stone) 0%, #D9C9AE 45%, var(--night) 100%) fixed;
}

/* ---------- Bandeau démo ---------- */
.demo-bar {
  position: relative; z-index: 30;
  min-height: var(--bar-h);
  display: flex; align-items: center; justify-content: center; gap: .35em; flex-wrap: wrap;
  padding: 6px 16px;
  font-size: .8125rem; letter-spacing: .01em;
  color: var(--ink-soft);
  background: rgba(245, 239, 230, .9);
  text-align: center;
}
.demo-bar a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 239, 230, .62);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}
.site-header::after { /* filet or champagne */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.header-inner {
  max-width: 1320px; margin: 0 auto;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 10px clamp(16px, 3vw, 40px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { color: var(--gold); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--serif); font-weight: 600; letter-spacing: .14em; font-size: .98rem; }
.brand-text small { font-size: .72rem; color: var(--ink-soft); letter-spacing: .04em; }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(12px, 2vw, 28px); }
.main-nav a {
  text-decoration: none; font-size: .9rem; color: var(--ink-soft);
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ink); border-color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-calm, .btn-cta {
  font: inherit; font-size: .85rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 0;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: background-color .2s, color .2s;
}
.brand { min-width: 0; }
.btn-calm { background: rgba(24, 26, 25, .06); color: var(--ink); }
.btn-calm:hover { background: rgba(24, 26, 25, .11); }
.btn-calm[aria-pressed="true"] { background: var(--night); color: var(--stone); }
.btn-cta { background: var(--ink); color: var(--stone); }
.btn-cta:hover { background: var(--night); }

/* ---------- Sections narratives ---------- */
main { position: relative; z-index: 1; }

.step {
  min-height: 120vh;
  min-height: 120svh;
  display: flex; align-items: center;
  padding: 12vh clamp(16px, 5vw, 72px);
  max-width: 1440px; margin: 0 auto;
}
.step--left { justify-content: flex-start; }
.step--right { justify-content: flex-end; }
.step--contact { justify-content: center; align-items: flex-end; padding-top: 72vh; min-height: 110vh; }

.step--hero {
  min-height: calc(100vh - var(--bar-h) - var(--header-h));
  min-height: calc(100svh - var(--bar-h) - var(--header-h));
  flex-direction: column; justify-content: flex-end; align-items: flex-start;
  gap: 4vh;
  padding-top: 8vh; padding-bottom: 6vh;
}
.step--hero .scroll-hint { align-self: center; }

/* Cartes : verre dépoli, à plat, sans bordure ni ombre */
.panel {
  width: 100%; max-width: 540px;
  padding: clamp(26px, 3.2vw, 44px);
  border-radius: var(--radius);
  background: var(--glass-light);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  color: var(--ink);
}
.panel--dark { background: var(--glass-dark); color: var(--cream-ink); }
.panel--hero {
  max-width: 440px;
  padding: clamp(22px, 2.4vw, 32px);
  background: rgba(247, 242, 234, .56);
  border: 1px solid rgba(255, 255, 255, .55); /* filet fin, la perspective reste visible */
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
}
.panel--hero h1 { font-size: clamp(1.7rem, 2.9vw, 2.45rem); margin-bottom: 12px; }
.panel--hero .eyebrow { margin-bottom: 10px; font-size: .72rem; }
.panel--wide { max-width: 1080px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: #8A6A2A;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); flex: none; }
.panel--dark .eyebrow { color: #E2C482; }

h1 { font-size: clamp(2.1rem, 4.2vw, 3.5rem); margin-bottom: 18px; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 16px; }
h3 { font-size: 1.2rem; margin-bottom: 4px; }

.lead { margin: 0 0 8px; color: var(--ink-soft); font-size: 1.08rem; }
.panel--hero .lead { font-size: clamp(.95rem, 1.15vw, 1.02rem); line-height: 1.6; margin: 0; }
.panel--dark .lead { color: rgba(245, 239, 230, .82); }

/* Indicateur de défilement */
.scroll-hint {
  display: inline-flex; flex-direction: column; align-items: center; gap: 10px;
  text-decoration: none; font-size: .85rem; letter-spacing: .04em; color: var(--ink);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(247, 242, 234, .55);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.scroll-hint__mouse {
  width: 22px; height: 34px; border-radius: 12px;
  border: 1.5px solid var(--ink); position: relative;
}
.scroll-hint__mouse span {
  position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: var(--gold);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

/* Listes à filets fins */
.feature-list, .activity-list { list-style: none; margin: 22px 0 0; padding: 0; }
.feature-list li, .activity-list li { padding: 16px 0; border-top: 1px solid var(--gold-soft); }
.feature-list li:last-child, .activity-list li:last-child { padding-bottom: 0; }
.feature-list p, .activity-list p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.panel--dark .activity-list p, .panel--dark .feature-list p { color: rgba(245, 239, 230, .8); }
.activity-list .meta { margin-top: 6px; font-size: .82rem; letter-spacing: .04em; color: #E2C482; }

/* Tableau des horaires */
.today { margin: 18px 0 6px; font-size: .9rem; color: var(--ink-soft); text-transform: capitalize; }
.schedule { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.schedule th, .schedule td { text-align: left; padding: 13px 8px; border-top: 1px solid var(--gold-soft); vertical-align: middle; }
.schedule thead th {
  border-top: 0; padding-top: 4px; padding-bottom: 8px;
  font-family: var(--sans); font-weight: 500; font-size: .74rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.schedule tbody th { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; white-space: nowrap; }
.schedule td { font-size: .94rem; color: var(--ink-soft); }
.schedule .time { text-align: right; font-weight: 600; color: var(--ink); white-space: nowrap; }
.schedule thead th:last-child { text-align: right; }
.schedule .tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-family: var(--sans); font-size: .7rem; font-weight: 500; letter-spacing: .05em;
  background: rgba(197, 155, 71, .16); color: #7A5C22; vertical-align: middle;
}
.schedule tr.is-muted th, .schedule tr.is-muted td { opacity: .55; }
.schedule tr.is-next th, .schedule tr.is-next td { background: rgba(197, 155, 71, .16); color: var(--ink); }
.schedule tr.is-next th { border-radius: 12px 0 0 12px; }
.schedule tr.is-next td:last-child { border-radius: 0 12px 12px 0; }
.next-badge {
  display: block; margin-top: 2px;
  font-size: .72rem; font-weight: 500; letter-spacing: .04em; color: #7A5C22;
}
.note { margin: 16px 0 0; font-size: .82rem; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(24px, 4vw, 56px); margin-top: 26px;
}
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: .85rem; letter-spacing: .03em; color: rgba(245, 239, 230, .85); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--cream-ink);
  background: rgba(245, 239, 230, .08);
  border: 0; border-bottom: 1px solid rgba(226, 196, 130, .55);
  border-radius: 10px 10px 4px 4px;
  padding: 11px 14px;
  transition: background-color .2s, border-color .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #E2C482 50%), linear-gradient(135deg, #E2C482 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field select option { color: var(--ink); }
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(245, 239, 230, .45); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: rgba(245, 239, 230, .14); border-color: var(--gold); }
.field [aria-invalid="true"] { border-color: #E89A7E; }

.btn-submit {
  font: inherit; font-weight: 500; cursor: pointer;
  min-height: 48px; padding: 12px 26px; border: 0; border-radius: 999px;
  background: var(--gold); color: var(--ink);
  transition: background-color .2s;
}
.btn-submit:hover { background: #D6B067; }

.form-status { margin: 16px 0 0; font-size: .95rem; min-height: 1.4em; }
.form-status.is-success strong { display: block; font-weight: 500; color: #F0DCAE; }
.form-status.is-success span { display: block; margin-top: 4px; font-size: .82rem; color: rgba(245, 239, 230, .65); }
.form-status.is-error { color: #F2B7A2; }

.contact-info .map { width: 100%; height: auto; margin-bottom: 22px; }
.info-list { margin: 0; }
.info-list dt {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(226, 196, 130, .35);
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: #E2C482;
}
.info-list dt:first-child { margin-top: 0; }
.info-list dd { margin: 4px 0 0; color: rgba(245, 239, 230, .88); font-size: .96rem; }
.info-list dd.fictive { margin-top: 18px; font-size: .78rem; color: rgba(245, 239, 230, .55); font-style: italic; }

/* ---------- Pied de page ---------- */
.site-footer {
  position: relative; z-index: 1;
  padding: 36px clamp(16px, 5vw, 72px) 44px;
  text-align: center; font-size: .85rem;
  color: rgba(245, 239, 230, .78);
  background: rgba(19, 42, 38, .82);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.site-footer p { margin: 0 auto 8px; max-width: 720px; }
.site-footer a { color: #E2C482; text-underline-offset: 3px; }

.noscript { position: relative; z-index: 2; text-align: center; padding: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .main-nav { display: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 760px) {
  :root { --header-h: 62px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: .86rem; letter-spacing: .1em; }
  .btn-calm span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .btn-calm { padding: 8px 12px; }
  .btn-cta { padding: 8px 14px; font-size: .8rem; }
  .step, .step--left, .step--right { justify-content: center; align-items: flex-end; padding-bottom: 8vh; }
  .step--hero { align-items: stretch; }
  .panel { max-width: none; }
  .panel--hero { padding: 20px 22px; }
  .contact-grid { grid-template-columns: 1fr; }
  .schedule th, .schedule td { padding: 11px 6px; }
  .schedule td:nth-child(2) { font-size: .85rem; }
}
/* Téléphone : le tableau des horaires tient toujours dans la carte */
@media (max-width: 760px) {
  .schedule { table-layout: fixed; }
  .schedule thead th:nth-child(2), .schedule td:nth-child(2) { display: none; }
  .schedule thead th:last-child, .schedule .time { width: 42%; }
  .schedule tbody th { white-space: normal; overflow-wrap: anywhere; font-size: 1.02rem; }
  .schedule .tag { display: table; margin: 5px 0 0; }
  .schedule .time { white-space: normal; }
  .schedule .time time { white-space: nowrap; }
  .next-badge { white-space: normal; line-height: 1.3; }
  .header-inner { gap: 10px; }
  .brand { min-width: 0; flex: 1 1 auto; }
  .brand-text strong { overflow-wrap: anywhere; }
  .header-actions { flex: 0 0 auto; gap: 8px; }
  .btn-cta .cta-more { display: none; }
}
@media (max-width: 400px) {
  .brand-mark { display: none; }
  .brand-text strong { font-size: .76rem; letter-spacing: .06em; }
  .btn-cta { padding: 8px 12px; }
  .schedule thead th:nth-child(2), .schedule td:nth-child(2) { display: none; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
html.is-calm .scroll-hint__mouse span { animation: none; opacity: 1; }

/* Indicateur de préparation de la scène 3D */
/* ===================== Page de chargement ===================== */
html.is-loading { overflow: hidden; }
.intro {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 32px 24px;
  color: #F3E6CC;
  background: radial-gradient(ellipse at 50% 42%, #1E4740 0%, #12302B 45%, #0A1D1A 100%);
  overflow: hidden;
  transition: opacity 1.1s ease, visibility 1.1s ease;
}
.intro.is-done { opacity: 0; visibility: hidden; }
.intro__pattern {
  position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px);
  color: #C59B47; opacity: .09;
  animation: introDrift 40s linear infinite;
}
.intro__glow {
  position: absolute; left: 50%; top: 34%;
  width: min(90vw, 720px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 214, 150, .28) 0%, rgba(255, 196, 120, .08) 38%, transparent 68%);
  animation: introBreathe 6s ease-in-out infinite;
}
.intro__center {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  max-width: 560px; text-align: center;
}
.intro__star { width: clamp(108px, 18vh, 168px); height: auto; color: #D8B26A; margin-bottom: clamp(14px, 3vh, 28px); }
.intro__star g, .intro__core { transform-box: view-box; transform-origin: 50% 50%; }
.intro__star-outer { animation: introTurn 60s linear infinite; }
.intro__star-inner { animation: introTurn 40s linear infinite reverse; }
.intro__star rect, .intro__star circle[pathLength], .intro__star path {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: introDraw 2.4s cubic-bezier(.6, .1, .2, 1) forwards;
}
.intro__star-outer rect:nth-of-type(2) { animation-delay: .25s; }
.intro__star-outer circle[pathLength] { animation-delay: .5s; }
.intro__star-inner path { animation-delay: .7s; }
.intro__star-inner circle { animation-delay: 1s; }
.intro__core { fill: #FFE2A6; filter: drop-shadow(0 0 6px rgba(255, 220, 150, .9)); animation: introBreathe 4s ease-in-out infinite; }
.intro__basmala, .intro__verse {
  margin: 0;
  font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", "Arabic Typesetting", "Times New Roman", serif;
  font-weight: 400; line-height: 1.9;
}
.intro__basmala { font-size: clamp(1.35rem, 3.6vw, 1.9rem); color: #F6E7C6; opacity: 0; animation: introRise 1.4s .4s ease forwards; }
.intro__rule {
  display: block; width: 72px; height: 1px; margin: 10px 0 14px;
  background: linear-gradient(90deg, transparent, #C59B47, transparent);
  opacity: 0; animation: introRise 1.2s .9s ease forwards;
}
.intro__verse {
  font-size: clamp(1.7rem, 5.2vw, 2.7rem); color: #FFE7B8;
  text-shadow: 0 0 28px rgba(255, 200, 120, .35);
  opacity: 0; animation: introRise 1.6s 1.1s ease forwards;
}
.intro__basmala:not([lang="ar"]), .intro__verse:not([lang="ar"]) {
  font-family: var(--serif); font-style: italic; line-height: 1.45; letter-spacing: .01em;
}
.intro__basmala:not([lang="ar"]) { letter-spacing: .18em; font-style: normal; text-transform: uppercase; font-size: clamp(.95rem, 2.4vw, 1.2rem); }
.intro__verse:not([lang="ar"]) { font-size: clamp(1.3rem, 3.6vw, 2rem); max-width: 30ch; }
[data-arch="church"] .intro { background: radial-gradient(ellipse at 50% 42%, #5A2430 0%, #3A1820 48%, #1E0D12 100%); }
.intro__translation {
  margin: 10px 0 0; font-family: var(--serif); font-style: italic;
  font-size: clamp(1rem, 2.3vw, 1.18rem); color: #EADBBE;
  opacity: 0; animation: introRise 1.4s 1.6s ease forwards;
}
.intro__ref {
  margin: 6px 0 0; font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: #C59B47; opacity: 0; animation: introRise 1.2s 1.9s ease forwards;
}
.intro__bar {
  width: min(240px, 60vw); height: 2px; margin-top: clamp(26px, 5vh, 44px);
  background: rgba(197, 155, 71, .2); border-radius: 2px; overflow: hidden;
}
.intro__bar span {
  display: block; height: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, #A9813A, #FFE2A6);
  transition: transform .6s ease;
}
.intro__status { margin: 12px 0 0; font-family: var(--sans); font-size: .82rem; color: rgba(243, 230, 204, .7); min-height: 1.3em; }
@keyframes introDraw { to { stroke-dashoffset: 0; } }
@keyframes introTurn { to { transform: rotate(360deg); } }
@keyframes introRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes introBreathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes introDrift { to { transform: translate(120px, 120px); } }
@media (max-height: 560px) {
  .intro__star { width: 84px; margin-bottom: 8px; }
  .intro__bar { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro *, .intro__pattern, .intro__glow { animation: none !important; }
  .intro__star rect, .intro__star circle[pathLength], .intro__star path { stroke-dashoffset: 0; }
  .intro__basmala, .intro__rule, .intro__verse, .intro__translation, .intro__ref { opacity: 1; }
}
