/* Home page — shared layout, themed via tokens */

.view-home {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--theme-home-bg);
  color: var(--color-text);
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity var(--motion-screen) var(--ease-premium),
    transform var(--motion-screen) var(--ease-premium),
    visibility var(--motion-screen);
}

.view-home::-webkit-scrollbar {
  display: none;
}

.app.is-home .view-home {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.app.is-home .app__stage,
.app.is-events .app__stage,
.app.is-event .app__stage {
  visibility: hidden;
  pointer-events: none;
}

.app.is-video .view-home,
.app.is-video .view-events,
.app.is-video .view-event {
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}

.app.is-video .app__stage {
  visibility: visible;
  pointer-events: auto;
}

.view-catalog {
  position: absolute;
  inset: 0;
  z-index: 31;
  overflow-y: auto;
  scrollbar-width: none; /* same as .view-home — classic scrollbar shifts the 1344 grid */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--motion-screen) var(--ease-premium), transform var(--motion-screen) var(--ease-premium), visibility var(--motion-screen);
}

.view-catalog::-webkit-scrollbar {
  display: none;
}

.app.is-catalog .view-catalog {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.app.is-catalog .view-home,
.app.is-catalog .view-events,
.app.is-catalog .view-event,
.app.is-catalog .app__stage {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


.home-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px;
  transition:
    background var(--motion-base) var(--ease-premium),
    backdrop-filter var(--motion-base) var(--ease-premium),
    box-shadow var(--motion-base) var(--ease-premium);
}

.home-topbar.is-solid {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px) saturate(1.2);
  -webkit-backdrop-filter: blur(5px) saturate(1.2);
  box-shadow: 0 1px 0 var(--color-border);
}

[data-restaurant-theme="premium-dark"] .home-topbar.is-solid {
  background: rgba(12, 10, 9, 0.6);
}

.home-topbar .brand__text {
  color: var(--color-text-light);
  transition: font-size var(--motion-base) var(--ease-premium), color var(--motion-base);
}

.home-topbar.is-solid .brand__text {
  color: var(--color-text);
  /* keep size/position stable — no shrink on scroll (avoids logo jump into menu) */
}

/* Keep logo readable when burger menu opens over home */
.app.is-home.is-menu-open .home-topbar {
  /* fs-menu has its own header; home bar stays hidden under overlay */
  visibility: hidden;
  pointer-events: none;
}

.app.is-home.is-menu-open .home-topbar .brand,
.app.is-home.is-menu-open .home-topbar .icon-btn {
  pointer-events: none;
}

.app.is-home.is-menu-open .home-topbar .brand__text {
  color: #fff9f3;
}

.app.is-home.is-menu-open .home-topbar .icon-btn {
  color: #fff9f3;
}

.home-topbar .topbar__actions {
  overflow: visible;
  padding: 6px 4px 2px;
  margin: -6px -4px -2px;
}

.home-topbar .icon-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  overflow: visible;
}

.home-topbar.is-solid .icon-btn {
  color: var(--color-navy-900);
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

[data-restaurant-theme="premium-dark"] .home-topbar.is-solid .icon-btn {
  color: var(--color-text-light);
  background: rgba(30, 26, 22, 0.6);
}

/* Hero */
.home-hero {
  position: relative;
  margin-top: calc(-1 * (env(safe-area-inset-top, 0px) + 68px));
  min-height: 92dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 28px);
  color: var(--color-text-light);
  overflow: hidden;
}

.home-hero__media {
  position: absolute;
  inset: 0;
  background:
    var(--hero-scrim),
    center / cover no-repeat
      url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1400&q=80");
}

.home-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-scrim);
}

.home-hero__content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.home-hero__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--color-sand-400);
}

.home-hero__title {
  margin: 0 0 10px;
  font-size: clamp(38px, 11vw, 44px);
  font-weight: 700;
  line-height: 1.05;
}

.home-hero__place {
  margin: 0 0 12px;
  font-size: 14px;
  color: rgba(249, 252, 253, 0.78);
}

.home-hero__lead {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.home-hero__cuisine {
  margin: 0 0 22px;
  font-size: 13px;
  color: rgba(249, 252, 253, 0.7);
  line-height: 1.45;
}

.home-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-sand,
.btn-ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 27px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--motion-instant), filter var(--motion-fast), opacity var(--motion-fast);
}

.btn-sand {
  border: 0;
  background: linear-gradient(135deg, var(--color-sand-500), var(--color-sand-400));
  color: var(--color-text-on-sand);
  box-shadow: 0 10px 28px rgba(6, 36, 58, 0.28);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-light);
  backdrop-filter: blur(10px);
}

.btn-sand:active,
.btn-ghost:active {
  transform: scale(0.98);
}

.home-scroll-hint {
  position: relative;
  z-index: 1;
  margin: 22px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(249, 252, 253, 0.65);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.home-scroll-hint__chevron {
  width: 18px;
  height: 18px;
  animation: homeHintBob 1.6s var(--ease-premium) infinite;
}

@keyframes homeHintBob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(5px);
    opacity: 1;
  }
}

/* Info strip */
.home-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border-block: 1px solid var(--color-border);
}

.home-strip__item {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 16px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.home-strip__item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.home-strip__item span {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

/* Sections */
.home-section {
  padding: 36px 16px 8px;
}

.home-section--navy {
  margin-top: 28px;
  padding: 36px 0 40px;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(36, 139, 163, 0.18), transparent 55%),
    var(--color-navy-950);
  color: var(--color-text-light);
}

.home-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-inline: 4px;
}

.home-section--navy .home-section__head {
  padding-inline: 20px;
}

.home-section__title {
  margin: 0;
  font-size: clamp(26px, 7vw, 30px);
  font-weight: 700;
  color: var(--color-text);
}

.home-section--navy .home-section__title {
  color: var(--color-text-light);
}

.home-section__link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-sea-600);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.home-section--navy .home-section__link {
  color: var(--color-sand-400);
}

.home-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 12px;
  margin-inline: -4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.home-rail::-webkit-scrollbar {
  display: none;
}

.home-section--navy .home-rail {
  padding-inline: 20px;
}

/* Category cards */
.cat-card {
  position: relative;
  flex: 0 0 154px;
  height: 198px;
  border-radius: 16px;
  overflow: hidden;
  border: 0;
  padding: 0;
  scroll-snap-align: start;
  background: #123 center / cover no-repeat;
  cursor: pointer;
  color: #fff;
  text-align: left;
  font-family: inherit;
}

.cat-card--feature {
  flex-basis: 178px;
  height: 210px;
}

.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(4, 29, 48, 0.88) 100%);
}

.cat-card span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

/* Popular dish cards */
.dish-card {
  flex: 0 0 min(268px, 78vw);
  scroll-snap-align: start;
  border-radius: 18px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.dish-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--color-surface-soft);
}

.dish-card__body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 14px;
}

.dish-card__name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.25;
}

.dish-card__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.dish-card__price {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 650;
  color: var(--color-text);
}

.dish-card__actions {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
}

.dish-card__add,
.dish-card__qty {
  grid-area: 1 / 1;
}

.dish-card__add {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--color-navy-800);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.dish-card__add[hidden] {
  display: none !important;
}

.dish-card__qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 4px;
  border-radius: 999px;
  background: var(--color-success);
  color: #fff;
}

.dish-card__qty[hidden] {
  display: none !important;
}

.dish-card__qty button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

.dish-card__qty span {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Lunch banner */
.lunch-banner {
  display: grid;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-floating);
  background: var(--color-navy-900);
  color: var(--color-text-light);
}

.lunch-banner__media {
  min-height: 160px;
  background: center / cover no-repeat
    url("https://images.unsplash.com/photo-1414235077428-3388164d870e?auto=format&fit=crop&w=1200&q=80");
}

.lunch-banner__body {
  padding: 22px 18px 20px;
}

.lunch-banner__script {
  margin: 0 0 6px;
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--color-sand-400);
}

.lunch-banner__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.lunch-banner__meta {
  margin: 0 0 14px;
  font-size: 14px;
  color: rgba(249, 252, 253, 0.72);
}

/* Events cards on home */
.event-card {
  flex: 0 0 min(86vw, 340px);
  scroll-snap-align: start;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-text-light);
  text-align: left;
}

.event-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #0a3b59;
}

.event-card__body {
  padding: 16px;
}

.event-card__when {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-sand-400);
  text-transform: uppercase;
}

.event-card__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.event-card__text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(249, 252, 253, 0.72);
}

.event-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
}

.event-card__actions--status {
  gap: 10px;
}

.event-card .btn-sand {
  min-height: 44px;
  font-size: 14px;
  padding-inline: 16px;
  width: auto;
}

.event-card__status {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: rgba(249, 252, 253, 0.62);
  white-space: nowrap;
}

.event-card .btn-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-sand-300);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-empty {
  margin: 8px 20px 0;
  padding: 28px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  text-align: center;
}

.home-empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.home-empty p {
  margin: 0;
  font-size: 14px;
  color: rgba(249, 252, 253, 0.65);
}

.home-footer {
  padding: 28px 20px calc(env(safe-area-inset-bottom, 0px) + 28px);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.theme-switch {
  display: inline-flex;
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
}

.theme-switch button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.theme-switch button.is-active {
  background: var(--color-navy-800);
  color: var(--color-text-light);
}

[data-restaurant-theme="sea"] .theme-switch button.is-active {
  background: var(--color-sand-500);
  color: var(--color-navy-950);
}

.app.is-intro .home-hero__content > * {
  animation: homeHeroIn 420ms var(--ease-enter) both;
}

.app.is-intro .home-hero__eyebrow { animation-delay: 80ms; }
.app.is-intro .home-hero__title { animation-delay: 140ms; }
.app.is-intro .home-hero__actions { animation-delay: 240ms; }

@keyframes homeHeroIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-scroll-hint__chevron,
  .app.is-intro .home-hero__content > *,
  .view-home {
    animation: none !important;
    transition: none !important;
  }
}
