/* =============================================================
   SQUID GAME RESTAURANT — minimal custom CSS
   Only rules that Tailwind utilities cannot reasonably express:
   keyframes, the preloader, app chrome (top bar + bottom nav),
   the food modal, scroll-reveal base state, scrollbar and
   reduced-motion handling. Everything else = Tailwind classes.
   ============================================================= */

/* ---------- Base niceties ---------- */
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clear the fixed bottom navigation */
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
}
@media (min-width: 1024px) { body { padding-bottom: 6rem; } }

::selection { background: #ff2e88; color: #050505; }

/* Alpine: hide templated nodes until the framework hydrates */
[x-cloak] { display: none !important; }

/* Thin cinematic scrollbar (progressive enhancement only) */
* { scrollbar-width: thin; scrollbar-color: #ff2e88 #0a0a0a; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #ff2e88; }

/* Focus visibility — consistent across interactive elements */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid #ff2e88;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  transition: opacity .6s ease, visibility .6s ease;
}
#preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#preloader .pl-bar {
  width: 0%;
  animation: plfill 1.4s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes plfill { to { width: 100%; } }

/* ---------- Top app bar (slim title bar, not primary nav) ---------- */
#app-bar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 75;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 1.25rem;
  background: rgba(5, 5, 5, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: background-color .3s ease, border-color .3s ease;
}
#app-bar.is-scrolled {
  background: rgba(5, 5, 5, .92);
  border-bottom-color: rgba(255, 46, 136, .18);
}

/* ---------- Bottom navigation (Android-app style) ---------- */
.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  background: rgba(5, 5, 5, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-height: 3.5rem;
  padding: .6rem .15rem .55rem;
  font-size: .56rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6b6b6b;
  text-align: center;
  transition: color .2s ease;
}
.bn-item i { font-size: 1.05rem; line-height: 1; }
.bn-item:hover, .bn-item:focus-visible { color: #ff5ba3; }
.bn-item[aria-current="page"] { color: #ff2e88; }
.bn-ind {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  width: 0;
  background: #ff2e88;
  border-radius: 0 0 4px 4px;
  transition: width .25s ease;
}
.bn-item[aria-current="page"] .bn-ind { width: 42%; }

@media (min-width: 1024px) {
  .bottom-nav {
    inset-inline: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.25rem;
    width: min(600px, 92vw);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1rem;
    box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .75);
  }
  .bn-item { font-size: .6rem; }
}

/* ---------- Food detail modal ---------- */
#food-modal { display: none; }
#food-modal.is-open { display: flex; }
.modal-panel { animation: lbin .3s ease; }

/* Anchor offset for sticky category tabs / app bar */
.cat-anchor { scroll-margin-top: 7rem; }
html { scroll-padding-top: 7rem; }

/* ---------- Scroll reveal (only active when JS present) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.4, 0, .2, 1), transform .7s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-reveal-delay="1"] { transition-delay: .08s; }
.js .reveal[data-reveal-delay="2"] { transition-delay: .16s; }
.js .reveal[data-reveal-delay="3"] { transition-delay: .24s; }
.js .reveal[data-reveal-delay="4"] { transition-delay: .32s; }

/* ---------- Decorative geometry animations ---------- */
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-22px) rotate(8deg); }
}
@keyframes floaty-rev {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(18px) rotate(-10deg); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes glow-pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: .8; }
}
@keyframes hero-pan {
  0%   { transform: scale(1.08) translate3d(0, 0, 0); }
  100% { transform: scale(1.16) translate3d(-1.5%, -1.5%, 0); }
}

.anim-float      { animation: floaty 9s ease-in-out infinite; }
.anim-float-rev  { animation: floaty-rev 11s ease-in-out infinite; }
.anim-spin-slow  { animation: spin-slow 26s linear infinite; }
.anim-glow       { animation: glow-pulse 5s ease-in-out infinite; }
.anim-hero-pan   { animation: hero-pan 22s ease-in-out infinite alternate; }

/* Filter grid transition */
.menu-card { transition: opacity .45s ease, transform .45s ease; }

/* Lightbox / modal image entrance */
.lb-img { animation: lbin .35s ease; }
@keyframes lbin { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- PWA install popup ---------- */
#pwa-install-banner { display: none; }
#pwa-install-banner.is-open { display: flex; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal,
  .js .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .anim-float,
  .anim-float-rev,
  .anim-spin-slow,
  .anim-glow,
  .anim-hero-pan,
  #preloader .pl-bar,
  .lb-img,
  .modal-panel,
  .menu-card { animation: none !important; }
  #preloader .pl-bar { width: 100% !important; }
}
