/* ============================================================
   CAP GRILL — Marina de Monastir
   Aesthetic: marina gastronomique at dusk.
   Deep espresso wood, cream inscriptional capitals, brass gold,
   a single breath of marina teal. Quiet luxury, warm ember light.
   ============================================================ */

:root {
  --bg: #151011;
  --bg-deep: #0d0a0b;
  --surface: #211a19;
  --surface-2: #2b2220;
  --wood: #4a3527;
  --wood-light: #6b4c35;
  --cream: #f2e8d5;
  --cream-dim: #c9bda6;
  --gold: #c9973f;
  --gold-bright: #e3b563;
  --gold-deep: #8f6a2a;
  --marine: #3d6b68;
  --ember: #b4552d;

  --font-display: "Marcellus", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", "Segoe UI", -apple-system, sans-serif;
  --font-ar: "Amiri", "Traditional Arabic", serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  --container: min(1180px, 92vw);
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }
::selection { background: var(--gold); color: var(--bg-deep); }

/* grain + warm glows over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(52vw 40vh at 82% -6%, rgba(201, 151, 63, 0.08), transparent 60%),
    radial-gradient(60vw 50vh at -10% 108%, rgba(61, 107, 104, 0.07), transparent 60%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 1; }

/* Arabic mode */
body.lang-ar { font-family: var(--font-ar); font-size: 18px; }
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3,
body.lang-ar .sig-num, body.lang-ar .mi-price, body.lang-ar .resa-phone { font-family: var(--font-ar); }
body.lang-ar .eyebrow { letter-spacing: 0; }
body.lang-ar #drawer a, body.lang-ar .resa-card a.link, body.lang-ar .sig-note { letter-spacing: 0; }

/* ---------- shared atoms ---------- */
.container { width: var(--container); margin-inline: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: ""; width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
[dir="rtl"] .eyebrow::before { background: linear-gradient(-90deg, transparent, var(--gold)); }

.section-head { max-width: 640px; margin-bottom: clamp(36px, 6vw, 64px); }
.section-title {
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.12;
  letter-spacing: 0.015em;
  margin-top: 14px;
  color: var(--cream);
}
section { padding-block: clamp(72px, 11vw, 140px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 34px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  border: 1px solid var(--gold);
  border-radius: 4px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
              background-color 0.35s, color 0.35s;
}
.btn--solid {
  background: linear-gradient(140deg, var(--gold-bright), var(--gold) 75%, var(--gold-deep) 130%);
  color: #241708;
  border-color: transparent;
  box-shadow: 0 14px 34px -14px rgba(201, 151, 63, 0.55);
}
.btn--solid:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px rgba(201, 151, 63, 0.7); }
.btn--ghost { color: var(--cream); border-color: rgba(242, 232, 213, 0.35); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-bright); transform: translateY(-2px); }
body.lang-ar .btn { letter-spacing: 0; font-size: 16px; }

.stars { color: var(--gold); letter-spacing: 0.45em; font-size: 13px; }

/* ---------- header ---------- */
#siteHeader {
  position: fixed; inset-inline: 0; top: 0; z-index: 40;
  transition: background-color 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}
#siteHeader.scrolled {
  background: rgba(13, 10, 11, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(201, 151, 63, 0.18);
}
.header-in {
  width: var(--container); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 18px;
}
.wordmark {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 21px; letter-spacing: 0.24em;
  color: var(--cream); white-space: nowrap;
  direction: ltr; /* Latin brand wordmark never flips in RTL */
}
.wordmark:has(.brand-logo) { gap: 0; }
.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
  transition: transform 0.35s var(--ease-out), filter 0.35s;
}
.wordmark:hover .brand-logo {
  transform: translateY(-1px) scale(1.025);
  filter: drop-shadow(0 10px 22px rgba(201, 151, 63, 0.2));
}
.wordmark--footer .brand-logo { width: 82px; height: 82px; }
.brand-name-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.wordmark .glyph { color: var(--gold); font-size: 15px; transform: translateY(-1px); }
.wordmark small {
  display: block; font-family: var(--font-body);
  font-size: 8.5px; letter-spacing: 0.4em; color: var(--gold);
  margin-top: 2px;
}
.nav-desktop { display: flex; gap: 34px; }
.nav-desktop a {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cream-dim);
  padding-block: 6px;
  position: relative;
  transition: color 0.3s;
}
.nav-desktop a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.35s var(--ease-out);
}
.nav-desktop a:hover { color: var(--gold-bright); }
.nav-desktop a:hover::after { transform: scaleX(1); }
body.lang-ar .nav-desktop a { letter-spacing: 0; font-size: 15px; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.lang-switch {
  display: flex; border: 1px solid rgba(201, 151, 63, 0.4); border-radius: 4px; overflow: hidden;
}
.lang-switch button {
  padding: 7px 12px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--cream-dim);
  transition: background-color 0.3s, color 0.3s;
}
.lang-switch button[aria-pressed="true"] { background: var(--gold); color: #241708; }
.lang-switch button:not([aria-pressed="true"]):hover { color: var(--gold-bright); }

#burger {
  display: none;
  width: 42px; height: 42px;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
#burger span {
  width: 22px; height: 1.5px; background: var(--cream);
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}
#burger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
#burger.active span:nth-child(2) { opacity: 0; }
#burger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

#drawer {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(13, 10, 11, 0.97);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}
#drawer.open { opacity: 1; pointer-events: auto; visibility: visible; }
#drawer a {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 38px);
  letter-spacing: 0.08em;
  color: var(--cream);
  transition: color 0.3s;
}
#drawer a:hover { color: var(--gold-bright); }

@media (max-width: 720px) {
  .brand-logo { width: 56px; height: 56px; }
  .header-in { padding-block: 10px; }
  .wordmark--footer .brand-logo { width: 74px; height: 74px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding-block: 0;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  color: var(--gold);
  opacity: 0.24;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: kenburns 26s var(--ease-out) both;
  opacity: 0.85;
}
.hero-media.is-ph {
  background:
    radial-gradient(120% 90% at 75% 12%, rgba(201, 151, 63, 0.16), transparent 55%),
    radial-gradient(90% 70% at 15% 100%, rgba(61, 107, 104, 0.2), transparent 60%),
    linear-gradient(155deg, #241a15 0%, #151011 55%, #0d0a0b 100%);
}
.hero-media .ph-mark { display: none; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(13, 10, 11, 0.55) 0%, rgba(13, 10, 11, 0.18) 38%,
    rgba(13, 10, 11, 0.62) 72%, var(--bg) 98%);
}
.hero-in {
  position: relative; z-index: 2;
  width: var(--container); margin-inline: auto;
  padding-bottom: clamp(90px, 14vh, 150px);
}
.hero .stars { margin-bottom: 22px; }
.hero-title {
  font-size: clamp(44px, 8.2vw, 104px);
  line-height: 1.04;
  letter-spacing: 0.01em;
  color: var(--cream);
  max-width: 13ch;
  text-wrap: balance;
}
.hero-sub {
  max-width: 46ch;
  margin-top: 26px;
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--cream-dim);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; }

/* staggered entrance */
.hero .stars, .hero .eyebrow, .hero-title, .hero-sub, .hero-ctas {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
body.loaded .hero .eyebrow { transition-delay: 0.1s; }
body.loaded .hero .stars { transition-delay: 0.25s; }
body.loaded .hero-title { transition-delay: 0.4s; }
body.loaded .hero-sub { transition-delay: 0.6s; }
body.loaded .hero-ctas { transition-delay: 0.78s; }
body.loaded .hero :is(.stars, .eyebrow, .hero-sub, .hero-ctas),
body.loaded .hero-title { opacity: 1; transform: none; }

@keyframes kenburns {
  from { transform: scale(1.12) translateY(-1.5%); }
  to { transform: scale(1) translateY(0); }
}

/* ---------- ribbon marquee ---------- */
.ribbon {
  position: relative; z-index: 3;
  border-block: 1px solid rgba(201, 151, 63, 0.35);
  background: linear-gradient(180deg, rgba(43, 34, 32, 0.9), rgba(21, 16, 17, 0.9));
  overflow: hidden;
  padding-block: 15px;
}
#ribbonTrack { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.ribbon:hover #ribbonTrack { animation-play-state: paused; }
.ribbon-seq { display: flex; align-items: center; flex-shrink: 0; }
.ribbon-seq span {
  font-family: var(--font-display);
  font-size: 14.5px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--cream-dim);
  padding-inline: 28px;
  white-space: nowrap;
}
body.lang-ar .ribbon-seq span { letter-spacing: 0.04em; font-size: 17px; }
.ribbon-seq i { color: var(--gold); font-style: normal; font-size: 11px; }
@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] #ribbonTrack { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ---------- reveal utility ---------- */
.reveal {
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 90ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .hero .stars, .hero .eyebrow, .hero-title, .hero-sub, .hero-ctas { opacity: 1; transform: none; }
  .sig-card:nth-child(2).reveal { transform: translateY(42px); }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Couche motion GSAP — html.gsap-on est posé par js/motion.js
   (vitrine) et js/motion-menu.js (carte) quand GSAP est chargé
   et que l'utilisateur n'a pas demandé moins d'animations.
   Règle du jeu : pendant qu'un élément est animé par GSAP, ses
   transitions/animations CSS concurrentes sont coupées (sinon
   double easing) ; l'état FINAL reste décrit en CSS (.in) pour
   que la page survive à un échec du CDN ou à un revert.
   ============================================================ */

/* reveals : GSAP anime, la classe .in fige l'état final en CSS */
html.gsap-on .reveal:not(.in) { transition: none !important; }
html.gsap-on :where(.reveal.in) { animation: none !important; opacity: 1; transform: none; }

/* héro : piloté à vie par la timeline d'entrée + la parallaxe */
html.gsap-on .hero :is(.eyebrow, .stars, .hero-title, .hero-sub, .hero-ctas) { transition: none !important; }
html.gsap-on .hero-media img { animation: none; will-change: transform; }

/* titre en lignes masquées (motion.js découpe sur le <br> du texte i18n).
   Le padding compense la line-height serrée : sans lui, les descentes
   (g, p, virgules) seraient rognées par l'overflow du masque. */
.hl-mask { display: block; overflow: hidden; padding-block: 0.06em 0.14em; margin-block: -0.06em -0.14em; }
.hl-line { display: block; will-change: transform; }
.stars .st { display: inline-block; }

/* ruban : le marquee CSS laisse place à la boucle GSAP sensible à la vélocité */
html.gsap-on #ribbonTrack { animation: none; }

/* boutons : le magnétisme GSAP remplace le translateY du hover */
html.gsap-on .btn { transition: box-shadow 0.35s var(--ease-out), background-color 0.35s, color 0.35s, border-color 0.35s; }
html.gsap-on .btn--solid:hover, html.gsap-on .btn--ghost:hover { transform: none; }

/* moments : le tilt GSAP remplace le lift CSS (desktop pointeur fin) */
html.gsap-on .mo-card { transition: border-color 0.45s, box-shadow 0.45s; }
html.gsap-on .mo-card:hover { transform: none; }

/* signature n°2 : son décalage design passe en marge pour que GSAP
   soit seul maître du transform pendant le reveal */
html.gsap-on .sig-card:nth-child(2) { margin-top: 42px; }
html.gsap-on .sig-card:nth-child(2).reveal { transform: translateY(34px); }
html.gsap-on .sig-card:nth-child(2).reveal.in { transform: none; }
@media (max-width: 1024px) {
  html.gsap-on .sig-card:nth-child(2) { margin-top: 0; }
}

/* coche dessinée au succès du formulaire (DrawSVG) */
.rf-check { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-inline-end: 0.45em; }
