/* ============================================================
   MADEMOISELLE BOBÙN — LE COMPTOIR
   Un plat = un écran. Scroll-snap natif, vidéos de bols tournants.
   ============================================================ */

:root {
  --noir: #0B0805;
  --noir2: #151009;
  --ivoire: #F4EDE0;
  --flamme: #3D8BFF;
  --caramel: #E8912D;
  --tomate: #C6402B;
  --menthe: #86B27A;
  --kraft: #8C5A2E;
  --glass-bg: rgba(11, 8, 5, .42);
  --glass-border: rgba(244, 237, 224, .14);
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Be Vietnam Pro', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1100px 600px at 80% -5%, rgba(61, 139, 255, .05), transparent 60%),
    radial-gradient(900px 520px at 10% 40%, rgba(140, 90, 46, .07), transparent 55%),
    linear-gradient(165deg, #100b07 0%, var(--noir) 45%, #080604 100%);
  color: var(--ivoire);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* veines de marbre légères */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.009' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.93 0 0 0 0 0.88 0 0 0 0.5 -0.22'/%3E%3C/filter%3E%3Crect width='900' height='900' filter='url(%23m)'/%3E%3C/svg%3E");
  background-size: 900px 900px;
}

a { color: inherit; text-decoration: none; }

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

.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  color: var(--caramel);
  text-transform: uppercase;
}

.bambou { color: var(--menthe); }

/* ============ NAV ============ */

#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 48px);
}

.nav-brand { display: inline-flex; align-items: center; gap: 12px; }
.nav-logo { height: 44px; width: 44px; object-fit: contain; }
.nav-name { font-weight: 800; font-size: .9rem; line-height: 1.12; color: #fff; }

.badge-ouvert {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .13em;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(244, 237, 224, .2);
  color: rgba(244, 237, 224, .55);
  background: rgba(11, 8, 5, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.badge-ouvert.on { color: var(--menthe); border-color: rgba(134, 178, 122, .55); }
.badge-ouvert.on::before { content: '●'; margin-right: 7px; animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ============ RAIL VERMICELLE + COMPTEUR ============ */

#rail {
  position: fixed;
  left: clamp(14px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  height: 56vh;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#rail-svg { height: 100%; width: 12px; overflow: visible; }

#rail-base { stroke: rgba(244, 237, 224, .14); stroke-width: 2; }

#rail-prog {
  stroke: var(--acc, var(--caramel));
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--acc, var(--caramel)));
  transition: stroke .5s;
}

#rail-count {
  color: rgba(244, 237, 224, .6);
  writing-mode: vertical-rl;
  letter-spacing: .22em;
}

/* ============ DOTS ============ */

#dots {
  position: fixed;
  right: clamp(14px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

#dots .gap { height: 10px; }

#dots a {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(244, 237, 224, .35);
  background: transparent;
  transition: background .3s, border-color .3s, transform .3s;
}

#dots a.on {
  background: var(--acc, var(--caramel));
  border-color: var(--acc, var(--caramel));
  transform: scale(1.35);
}

/* ============ ÉCRANS ============ */

.plat-screen {
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 90px clamp(18px, 6vw, 90px) 40px;
}

/* --- intro --- */

.intro-in {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 40em;
}

.intro-in h1 {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.intro-sub {
  font-weight: 300;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: rgba(244, 237, 224, .85);
}

.scrollhint {
  width: 22px;
  height: 36px;
  border: 1.5px solid rgba(244, 237, 224, .4);
  border-radius: 12px;
  position: relative;
  margin-top: 14px;
}

.scrollhint span {
  position: absolute;
  top: 7px; left: 50%;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--caramel);
  animation: hint 1.6s ease-in-out infinite;
}

@keyframes hint {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* --- écrans plats --- */

.plat-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(26px, 5vw, 80px);
  width: min(1150px, 100%);
}

.plat-media {
  justify-self: center;
  /* jamais plus large que sa colonne : le texte reste intouchable */
  width: min(62vh, 42vw, 100%);
  max-width: 100%;
  z-index: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  /* force le clip circulaire même sur un enfant animé (bug WebKit/Blink) */
  isolation: isolate;
  transform: translateZ(0);
  box-shadow:
    0 40px 110px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(140, 90, 46, .35),
    0 0 80px -20px var(--acc, var(--caramel));
  background: var(--noir2);
}

.plat-media video,
.plat-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* scale ≥ √2 : le carré couvre toujours le cercle pendant la rotation */
.plat-media img.spin { animation: spin 46s linear infinite; }

@keyframes spin {
  from { transform: rotate(0deg) scale(1.42); }
  to { transform: rotate(360deg) scale(1.42); }
}

.plat-txt {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 30em;
  position: relative;
  z-index: 2;
}

.plat-txt .eyebrow { color: var(--acc, var(--caramel)); }

.plat-txt h2 {
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  font-weight: 900;
  line-height: 1.04;
  color: var(--ivoire);
}

.plat-desc {
  font-weight: 300;
  font-size: .96rem;
  line-height: 1.65;
  color: rgba(244, 237, 224, .8);
}

.plat-prix {
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--acc, var(--caramel));
  font-variant-numeric: tabular-nums;
}

.plat-cta {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  font-weight: 500;
  background: var(--acc, var(--caramel));
  color: var(--noir);
  padding: 16px 32px;
  border-radius: 999px;
  transition: transform .25s, filter .25s;
}

.plat-cta:hover { transform: translateY(-2px); filter: brightness(1.12); }

/* accents par catégorie */
.plat-screen[data-cat="bobun"] { --acc: var(--caramel); }
.plat-screen[data-cat="loclac"] { --acc: var(--tomate); }
.plat-screen[data-cat="rolls"] { --acc: var(--menthe); }
.plat-screen[data-cat="rolls"] .plat-cta { color: var(--noir); }

/* apparitions */
.plat-txt > * { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
.plat-screen.seen .plat-txt > * { opacity: 1; transform: none; }
.plat-screen.seen .plat-txt > *:nth-child(2) { transition-delay: .07s; }
.plat-screen.seen .plat-txt > *:nth-child(3) { transition-delay: .14s; }
.plat-screen.seen .plat-txt > *:nth-child(4) { transition-delay: .21s; }
.plat-screen.seen .plat-txt > *:nth-child(5) { transition-delay: .28s; }

/* ============ FIN ============ */

.fin-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  width: 100%;
}

.fin-in h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); font-weight: 900; }

.platform-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform .25s, filter .25s;
}

.btn-brand:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn-uber { background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, .22); gap: 5px; }
.btn-uber .eats { color: #06C167; }
.btn-deliveroo { background: #00CCBC; color: #fff; font-weight: 800; }

.ratings-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

.rating-card {
  min-width: 220px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 18px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rating-logo { font-weight: 800; font-size: 1.05rem; color: #fff; }
.rl-uber .eats { color: #06C167; margin-left: 5px; }
.rl-deliveroo { color: #00CCBC; }
.rating-note { font-weight: 900; font-size: 1.4rem; color: var(--caramel); }
.rating-txt { font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; color: rgba(244, 237, 224, .6); }

.foot-films { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; }
.foot-films a { color: var(--caramel); }
.foot-films a:hover { text-decoration: underline; }

.foot-infos, .foot-base {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .12em;
  line-height: 2;
  color: rgba(244, 237, 224, .45);
}

.foot-infos a:hover { color: var(--caramel); }

/* ============ EFFETS ============ */

#grain, #vignette { position: fixed; inset: 0; pointer-events: none; }

#grain {
  z-index: 62;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

#vignette {
  z-index: 61;
  background: radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, .5) 100%);
}

/* ============ MOBILE ≤ 820px ============ */

@media (max-width: 820px) {

  #rail { display: none; }

  #dots { right: 10px; gap: 7px; }
  #dots a { width: 7px; height: 7px; }

  .plat-screen { padding: 86px 6vw 30px; }

  .plat-in {
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
    text-align: center;
  }

  .plat-media { width: min(64vw, 42vh); }

  .plat-txt { align-items: center; max-width: none; }

  .plat-txt h2 { font-size: 1.6rem; }

  .plat-desc {
    font-size: .87rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .plat-cta { align-self: stretch; text-align: center; }

  .intro-in h1 { font-size: 2.3rem; }
}

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .plat-media img.spin, .scrollhint span, .badge-ouvert.on::before { animation: none; }
  .plat-txt > * { opacity: 1; transform: none; transition: none; }
  .plat-screen { min-height: auto; padding-top: 40px; padding-bottom: 40px; }
  .plat-screen.intro { padding-top: 110px; }
}
