/* ================================================================
   Ayiti Restaurant — scroll-driven site
   Two worlds: flag-indigo hero → warm candlelit espresso table
   ================================================================ */

:root {
  --indigo: #101c45;        /* dark Haitian-flag blue — hero world */
  --indigo-deep: #0b1330;
  --ink: #171009;           /* espresso — table world */
  --cream: #f4ead9;
  --cream-dim: #cdbda4;
  --gold: #e9a83b;          /* plantain / joumou gold */
  --flag-red: #d21034;
  --muted: #a89478;
  --font-display: 'Fraunces', serif;
  --font-body: 'Archivo', sans-serif;
}

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

html { scrollbar-width: thin; scrollbar-color: var(--gold) var(--ink); }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

a { color: inherit; }

/* ----------------------------------------------------------------
   Loader
---------------------------------------------------------------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--indigo-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-brand {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(3rem, 8vw, 5rem); letter-spacing: 0.08em;
  color: var(--cream);
}
.loader-track {
  width: min(280px, 60vw); height: 2px;
  background: rgba(244, 234, 217, 0.18);
}
#loader-bar { width: 0%; height: 100%; background: var(--gold); transition: width 0.2s ease; }
#loader-percent { font-size: 0.8rem; letter-spacing: 0.2em; color: var(--muted); }
.loader-note { font-family: var(--font-display); font-style: italic; font-size: 0.95rem; color: var(--cream-dim); }

/* ----------------------------------------------------------------
   Header
---------------------------------------------------------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2.2rem;
  mix-blend-mode: normal;
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 1.45rem; letter-spacing: 0.1em; }
.brand-sub { font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--cream-dim); }
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { text-decoration: none; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.site-nav a:hover { color: var(--gold); }
.site-nav a:focus-visible, .cta-button:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 4px;
}
.nav-phone { color: var(--cream-dim); }
.nav-order {
  border: 1px solid var(--gold); color: var(--gold);
  padding: 0.55rem 1.2rem; border-radius: 999px;
  transition: background 0.25s, color 0.25s;
}
.nav-order:hover { background: var(--gold); color: var(--ink) !important; }

/* ----------------------------------------------------------------
   Hero — the indigo world
---------------------------------------------------------------- */
.hero-standalone {
  position: fixed; inset: 0; z-index: 20;
  background: radial-gradient(120% 90% at 50% 10%, var(--indigo) 0%, var(--indigo-deep) 78%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 5vw;
}
.hero-label { color: var(--gold); }
.hero-heading {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(5.5rem, 22vw, 15rem);
  line-height: 0.92; letter-spacing: 0.02em;
  color: var(--cream);
  margin: 1.4rem 0 1.8rem;
}
.hero-word { display: inline-block; }
.hero-word:nth-child(3) { color: var(--gold); }
.hero-tagline {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  color: var(--cream-dim); max-width: 34ch;
}
.hero-address { margin-top: 0.9rem; font-size: 0.78rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.scroll-indicator {
  position: absolute; bottom: 2.4rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--cream-dim);
}
.scroll-arrow { animation: bob 1.8s ease-in-out infinite; color: var(--gold); font-size: 1rem; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ----------------------------------------------------------------
   Canvas + overlay + marquee (fixed layers)
---------------------------------------------------------------- */
.canvas-wrap {
  position: fixed; inset: 0; z-index: 1;
  clip-path: circle(0% at 50% 50%);
}
#canvas { width: 100vw; height: 100vh; display: block; }

#dark-overlay {
  position: fixed; inset: 0; z-index: 5;
  background: #0c0805; opacity: 0; pointer-events: none;
}

.marquee-wrap {
  position: fixed; top: 50%; left: 0; right: 0; z-index: 6;
  transform: translateY(-50%);
  overflow: hidden; white-space: nowrap;
  opacity: 0; pointer-events: none;
}
.marquee-text {
  display: inline-block;
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: 12vw; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 234, 217, 0.34);
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   Scroll container + sections
---------------------------------------------------------------- */
#scroll-container { position: relative; height: 850vh; z-index: 10; pointer-events: none; }

.scroll-section {
  position: absolute; left: 0; right: 0;
  transform: translateY(-50%);
  opacity: 0; visibility: hidden;
  pointer-events: none;
}
.scroll-section.active { pointer-events: auto; }

.section-label {
  display: block;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
  text-shadow: 0 1px 10px rgba(12, 8, 5, 0.9);
}
.section-label::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 26px; height: 2px; background: var(--flag-red);
  margin-right: 0.7rem;
}
.section-heading {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.6rem, 5.4vw, 4.8rem);
  line-height: 0.98; color: var(--cream);
  display: block;
  text-shadow: 0 2px 28px rgba(12, 8, 5, 0.75);
}
.section-heading em { font-style: italic; color: var(--gold); display: block; }
.heading-en {
  display: block;
  font-family: var(--font-body); font-weight: 600;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--cream-dim); margin-top: 0.9rem;
}
.section-body {
  margin-top: 1.4rem;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.65; color: var(--cream);
  max-width: 44ch;
  text-shadow: 0 1px 14px rgba(12, 8, 5, 0.7);
}
.section-note {
  margin-top: 1.1rem;
  font-family: var(--font-display); font-style: italic;
  font-size: 1.02rem; color: var(--gold);
  text-shadow: 0 1px 3px rgba(12, 8, 5, 0.95), 0 1px 12px rgba(12, 8, 5, 0.95), 0 0 26px rgba(12, 8, 5, 0.8);
}

/* side alignment — canvas owns the middle */
.align-left { padding-left: 6vw; padding-right: 55vw; }
.align-right { padding-left: 55vw; padding-right: 6vw; }
.align-left .section-inner, .align-right .section-inner { max-width: 39vw; }

/* photo chips — small proof-of-food from the real kitchen */
.photo-chip {
  margin-top: 1.6rem; width: min(215px, 22vw);
  background: var(--cream); padding: 8px 8px 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.photo-chip img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.photo-chip figcaption {
  font-size: 0.68rem; letter-spacing: 0.08em; color: #6b5a3f;
  padding-top: 7px; text-align: center; font-style: italic;
}
.chip-tilt-l { transform: rotate(-2.5deg); }
.chip-tilt-r { transform: rotate(2.2deg); }

/* ----------------------------------------------------------------
   Stats — over the full dark overlay
---------------------------------------------------------------- */
.section-stats { text-align: center; padding: 0 8vw; }
.stats-label { margin-bottom: 3rem; }
.stats-label::before { display: none; }
.stats-grid {
  display: flex; justify-content: center; gap: clamp(2.5rem, 7vw, 7rem);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; max-width: 240px; }
.stat-number, .stat-suffix {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(3.4rem, 7vw, 6rem); line-height: 1; color: var(--gold);
}
.stat .stat-suffix { display: inline; }
.stat-number { display: inline-block; }
.stat-label { margin-top: 0.9rem; font-size: 0.82rem; line-height: 1.5; letter-spacing: 0.06em; color: var(--cream-dim); }

/* stat number + suffix on one line */
.stat { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 0.1em; }
.stat .stat-label { flex-basis: 100%; }

/* ----------------------------------------------------------------
   CTA — persists over the finished table
---------------------------------------------------------------- */
.section-cta { text-align: center; padding: 0 6vw; }
.cta-inner { max-width: 780px; margin: 0 auto; }
.cta-heading { display: block; font-size: clamp(3rem, 7vw, 5.6rem); }
.cta-body { max-width: none; margin-left: auto; margin-right: auto; }
.section-cta .section-label::before { display: none; }

.cta-buttons {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 0.8rem; margin-top: 1.8rem;
}
.cta-button {
  text-decoration: none; font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); background: var(--gold);
  padding: 0.95rem 1.7rem; border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.cta-button:hover { transform: translateY(-2px); background: var(--cream); }
.cta-call { background: transparent; color: var(--cream); border: 1px solid var(--cream-dim); }
.cta-call:hover { background: var(--cream); color: var(--ink); }

.cta-menu {
  display: flex; justify-content: center; gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 2.4rem; text-align: left;
}
.menu-col { flex: 1; max-width: 330px; }
.menu-item {
  display: flex; align-items: baseline; gap: 0.55rem;
  font-size: 0.92rem; padding: 0.42rem 0;
  border-bottom: 1px solid rgba(244, 234, 217, 0.12);
}
.menu-item span:first-child { white-space: nowrap; }
.menu-item span:last-child { font-family: var(--font-display); font-style: italic; color: var(--gold); }
.menu-dots { flex: 1; border-bottom: 1px dotted rgba(244, 234, 217, 0.28); transform: translateY(-4px); }

.cta-note { margin-top: 1.6rem; color: var(--cream-dim); }

.cta-footer {
  margin-top: 2.6rem; padding-top: 1.4rem;
  border-top: 1px solid rgba(244, 234, 217, 0.16);
  display: flex; flex-direction: column; gap: 0.45rem;
  font-size: 0.8rem; letter-spacing: 0.05em; color: var(--cream-dim);
}
.cta-footer a { color: var(--cream); text-decoration-color: var(--gold); }
.footer-kreyol { font-family: var(--font-display); font-style: italic; color: var(--gold); margin-top: 0.4rem; }

/* ----------------------------------------------------------------
   Closed-day popup — above the header, below the loader
---------------------------------------------------------------- */
#closed-popup[hidden] { display: none; }
#closed-popup {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 19, 48, 0.82);
  padding: 1.2rem;
  opacity: 0; transition: opacity 0.45s ease;
}
#closed-popup.show { opacity: 1; }
.closed-card {
  width: min(520px, 100%);
  background: var(--indigo-deep);
  border: 1px solid rgba(244, 234, 217, 0.18);
  border-top: 4px solid var(--gold);
  padding: 2.6rem 2.4rem 2.4rem;
  text-align: center;
  transform: translateY(14px); transition: transform 0.45s ease;
}
#closed-popup.show .closed-card { transform: translateY(0); }
.closed-label { margin-bottom: 0.9rem; }
.closed-label::before { display: none; }
.closed-heading {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(2rem, 5.5vw, 3rem); line-height: 1.02;
  color: var(--cream); margin-bottom: 1rem;
}
.closed-today { font-size: 1rem; color: var(--cream); }
.closed-next {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.05rem; color: var(--gold); margin-top: 0.5rem;
}
.closed-actions {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 0.7rem; margin-top: 1.8rem;
}
.closed-dismiss { border: none; cursor: pointer; font-family: var(--font-body); }

/* ----------------------------------------------------------------
   Mobile
---------------------------------------------------------------- */
@media (max-width: 768px) {
  #scroll-container { height: 600vh; }
  .site-header { padding: 0.9rem 1.2rem; }
  .nav-phone, .brand-sub { display: none; }
  .site-nav { gap: 0.9rem; }

  .align-left, .align-right { padding: 0 6vw; text-align: center; }
  .align-left .section-inner, .align-right .section-inner {
    max-width: none;
    background: rgba(12, 8, 5, 0.72);
    padding: 1.6rem 1.3rem; border-radius: 4px;
  }
  .section-body { margin-left: auto; margin-right: auto; }
  .photo-chip { display: none; }

  .marquee-text { font-size: 19vw; }
  .stats-grid { gap: 2rem; }

  /* CTA must fit one small viewport: order actions + contact only */
  .cta-menu, .cta-note { display: none; }
  .cta-heading { font-size: 2.5rem; }
  .cta-body { font-size: 0.95rem; margin-top: 0.9rem; }
  .cta-buttons { margin-top: 1.2rem; gap: 0.55rem; }
  .cta-button { padding: 0.75rem 1.3rem; font-size: 0.78rem; }
  .cta-footer { margin-top: 1.5rem; padding-top: 1.1rem; font-size: 0.74rem; }
  .cta-inner {
    background: rgba(12, 8, 5, 0.72);
    padding: 1.5rem 1.2rem; border-radius: 4px;
  }
  .hero-tagline { font-size: 1rem; }
}

/* ----------------------------------------------------------------
   Reduced motion
---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-arrow { animation: none; }
}
