:root {
  --sky: #070b14;
  --ink: #2a2118;
  --muted: #6d5844;
  --cream: #f6efe4;
  --paper: #fffaf3;
  --gold: #c9843a;
  --gold-deep: #8a5a22;
  --line: rgba(168, 122, 62, 0.28);
  --shadow: 0 22px 50px rgba(48, 28, 10, 0.12);
  --hud: rgba(12, 14, 20, 0.55);
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  color-scheme: dark;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--sky);
  color: #f4eadc;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -40px;
  z-index: 40;
  background: #fff;
  color: #1c140e;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hud {
  position: fixed;
  z-index: 30;
  top: 16px;
  inset-inline-start: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(440px, calc(100vw - 32px));
  transition: opacity 0.4s var(--ease);
}

.hud.is-dim {
  opacity: 0;
  pointer-events: none;
}

.hud button {
  border: 1px solid rgba(255, 226, 186, 0.28);
  background: var(--hud);
  color: #f8edd9;
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s;
}

.hud button[aria-pressed="true"] {
  background: rgba(201, 132, 58, 0.88);
  border-color: transparent;
  color: #1c1208;
}

.hud button:hover {
  transform: translateY(-2px);
}

.story {
  position: relative;
  height: 640vh;
  height: 640dvh;
}

.stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 148, 64, 0.18), transparent 42%),
    var(--sky);
}

.viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.camera {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  aspect-ratio: 1536 / 1024;
  translate: 0 -50%;
  transform-origin: 49.186% 57.031%;
  will-change: transform;
}

.canvas {
  position: absolute;
  inset: 0;
  direction: ltr;
  container-type: size;
}

.base,
.day-wash,
.slots,
.entrance,
.wordmark {
  position: absolute;
}

.base {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
}

.day-wash {
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 236, 206, 0.42), rgba(255, 214, 170, 0.12) 42%, rgba(90, 70, 48, 0.05));
  mix-blend-mode: soft-light;
  transition: opacity 0.45s linear;
}

.canvas.is-day .day-wash {
  opacity: 1;
}

.canvas.is-day .base,
.canvas.is-day .shutter {
  filter: brightness(1.26) saturate(0.66) sepia(0.16) contrast(0.97);
}

.wordmark {
  z-index: 4;
  left: 20.9635%;
  top: 19.9219%;
  width: 56.6406%;
  height: 11.5234%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  direction: rtl;
  text-align: center;
  pointer-events: none;
  color: #f6e2bf;
}

.wordmark h1 {
  margin: 0;
  font-family: "El Messiri", "Times New Roman", serif;
  font-weight: 700;
  font-size: 5.4cqh;
  line-height: 1;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.wordmark p {
  margin: 0.35cqh 0 0;
  font-size: 1.65cqh;
  letter-spacing: 0.14em;
  color: rgba(246, 226, 191, 0.8);
}

.slots {
  inset: 0;
  z-index: 2;
}

.slots > .slot {
  position: absolute;
  padding: 0;
  border: 1px solid rgba(255, 220, 176, 0.55);
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 220, 170, 0.28), rgba(20, 12, 8, 0.18) 72%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.45),
    0 0 12px rgba(255, 168, 72, 0.28);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.4);
  transform-origin: center;
}

.slots > .slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}

.slots > .slot:hover,
.slots > .slot:focus-visible {
  z-index: 3;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(255, 220, 170, 0.95),
    0 0 18px rgba(255, 170, 70, 0.85);
}

.entrance {
  z-index: 5;
  left: 22.395833%;
  top: 38.0859375%;
  width: 53.580729%;
  height: 37.890625%;
  overflow: hidden;
  perspective: 900px;
  pointer-events: none;
}

.door,
.shutter {
  position: absolute;
  display: block;
}

.door {
  top: 0;
  height: 100%;
  width: 25.515188%;
  backface-visibility: hidden;
}

.door-left {
  left: 24.54435%;
  transform-origin: left center;
}

.door-right {
  left: 50.060753%;
  transform-origin: right center;
}

.shutter {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: top center;
  z-index: 2;
  will-change: transform;
}

.hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 236, 214, 0.86);
  letter-spacing: 0.08em;
  font-size: 14px;
  pointer-events: none;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
  transition: opacity 0.4s linear;
}

.hint span {
  width: 22px;
  height: 22px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: bob 1.15s var(--ease) infinite alternate;
}

@keyframes bob {
  from { transform: translateY(0) rotate(45deg); }
  to { transform: translateY(8px) rotate(45deg); }
}

#fade {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: var(--cream);
  opacity: 0;
}

.menu {
  position: relative;
  z-index: 4;
  margin-top: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 214, 160, 0.45), transparent 36%),
    var(--cream);
  color: var(--ink);
  color-scheme: light;
  padding: 72px clamp(16px, 3vw, 40px) 48px;
}

.menu-head {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-deep);
  letter-spacing: 0.18em;
  font-size: 13px;
}

.menu-head h2 {
  margin: 0;
  font-family: "El Messiri", "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.15;
}

.menu-head p:last-child {
  margin: 12px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.grid {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.card {
  position: relative;
}

.card:hover,
.card:focus-within {
  z-index: 2;
}

.card-hit {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  padding: 18px 18px 20px;
  border: 0;
  border-radius: 28px;
  text-align: center;
  color: inherit;
  cursor: pointer;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 228, 186, 0.95), transparent 58%),
    linear-gradient(180deg, #fffdf9 0%, #f3e4cf 100%);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px var(--line);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.card-hit::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 34px rgba(255, 190, 110, 0.18);
  pointer-events: none;
  z-index: 2;
}

.card .slot {
  position: relative;
  width: min(168px, 78%);
  aspect-ratio: 1;
  margin: 8px auto 14px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, #fff 0%, #ffe3b8 46%, #f0c48a 78%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 16px 30px rgba(176, 112, 42, 0.16);
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}

.card .slot img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(80, 40, 10, 0.18));
  transition: transform 0.6s var(--ease);
}

/* The flyer is the picture while it flies and after it lands. */
html.flight .card .slot img {
  opacity: 0;
}

.card.is-landed .slot {
  box-shadow:
    0 0 0 6px rgba(255, 220, 170, 0.72),
    0 16px 32px rgba(176, 112, 42, 0.28),
    0 0 28px rgba(255, 196, 120, 0.85);
}

.sheen {
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.75) 48%, transparent 60%);
  transform: translateX(-130%);
  pointer-events: none;
  z-index: 1;
}

.card-name {
  font-family: "El Messiri", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.card-price {
  display: inline-flex;
  align-self: center;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(201, 132, 58, 0.14);
  color: var(--gold-deep);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-details {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.card-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.add-btn {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: linear-gradient(180deg, #e7b56a, #b8742e);
  color: #1c1208;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(140, 80, 20, 0.22);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.add-btn:hover,
.add-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(140, 80, 20, 0.32);
}

.cart-toggle {
  position: fixed;
  z-index: 50;
  top: 16px;
  inset-inline-end: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 226, 186, 0.28);
  background: var(--hud);
  color: #f8edd9;
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding-block: 8px;
  padding-inline: 14px 10px;
  cursor: pointer;
}

.cart-icon {
  width: 22px;
  height: 22px;
}

.cart-count {
  min-width: 1.7em;
  height: 1.7em;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e0a45a;
  color: #1c1208;
  font-weight: 700;
  font-size: 14px;
}

.cart-count.is-bump {
  animation: bump 0.4s var(--ease);
}

.cart-toggle.is-pop {
  animation: bump 0.4s var(--ease);
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.cart-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 14px 16px rgba(40, 18, 6, 0.35));
}

.glass {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.glass[hidden] {
  display: none;
}

.glass-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 12, 8, 0.28);
  backdrop-filter: blur(9px);
  cursor: pointer;
}

.glass-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 28px 24px 24px;
  border-radius: 32px;
  text-align: center;
  color: var(--ink);
  color-scheme: light;
  background:
    radial-gradient(90% 46% at 50% 0%, rgba(255, 226, 186, 0.95), transparent 62%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(243, 228, 207, 0.94));
  box-shadow:
    0 30px 80px rgba(20, 10, 4, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 0 1px rgba(201, 132, 58, 0.28);
  animation: card-in 0.4s var(--ease);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.glass-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  cursor: pointer;
}

.glass-card > img {
  width: min(168px, 42vw);
  height: min(168px, 42vw);
  object-fit: contain;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 42%, #fff 0%, #ffe3b8 58%, #f0c48a 82%);
  padding: 14px;
}

.glass-card h2 {
  margin: 10px 0 0;
  font-family: "El Messiri", serif;
  font-size: clamp(32px, 5vw, 40px);
}

.glass-price {
  display: inline-block;
  margin: 8px 0 0;
  color: var(--gold-deep);
  font-weight: 700;
  font-size: 20px;
}

.glass-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.glass-card .add-btn {
  margin-top: 18px;
}

.cart-card {
  width: min(520px, 100%);
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  text-align: start;
}

.bag-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(201, 132, 58, 0.18);
}

.bag-card img {
  width: 72px;
  height: 72px;
  padding: 6px;
  border-radius: 16px;
}

.bag-card h3 {
  margin: 0;
  font-family: "El Messiri", serif;
  font-size: 22px;
}

.bag-card p {
  margin: 2px 0 0;
  color: var(--gold-deep);
  font-weight: 700;
}

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(201, 132, 58, 0.16);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.qty span {
  min-width: 1.2em;
  text-align: center;
  font-weight: 700;
}

.cart-total {
  margin: 16px 0 0;
  font-weight: 700;
  font-size: 18px;
}

.card-hit:hover,
.card-hit:focus-visible {
  transform: translateY(-12px);
  box-shadow:
    0 30px 60px rgba(48, 28, 10, 0.16),
    0 0 42px rgba(255, 176, 90, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(201, 132, 58, 0.45);
}

.card-hit:hover .slot,
.card-hit:focus-visible .slot {
  transform: translateY(-4px) scale(1.04);
  box-shadow:
    0 0 0 8px rgba(255, 248, 236, 0.8),
    0 18px 36px rgba(176, 112, 42, 0.22),
    0 0 28px rgba(255, 196, 120, 0.85);
}

.card-hit:hover .slot img,
.card-hit:focus-visible .slot img {
  transform: scale(1.08) rotate(-3deg);
}

.card-hit:hover .sheen,
.card-hit:focus-visible .sheen {
  transform: translateX(130%);
  transition: transform 0.85s var(--ease);
}

.card-hit:active {
  transform: translateY(-6px);
}

.menu-foot {
  max-width: 720px;
  margin: 42px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

#fly {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

#fly img {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  max-width: none;
  object-fit: contain;
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
}

html.scroll-lock,
html.scroll-lock body {
  overflow: hidden;
}

:focus-visible {
  outline: 3px solid #e7b267;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Portrait phones are taller than the facade. Enlarge it to the largest
   size that still keeps every shelf circle on screen, then center it.
   Anything left around the photo continues the sky and the pavement. */
@media (max-width: 900px) and (orientation: portrait) {
  .camera {
    top: 50%;
    left: 50%;
    width: min(205%, calc(100dvh * 1536 / 1024));
    translate: -50% -50%;
  }

  .stage {
    background:
      radial-gradient(ellipse at 50% 82%, rgba(180, 96, 32, 0.38), transparent 36%),
      linear-gradient(180deg, #060c1e 0%, #060c1e 18%, #2a1c14 78%, #100c0a 100%);
  }

  .stage:has(.is-day) {
    background:
      radial-gradient(ellipse at 50% 82%, rgba(255, 186, 110, 0.4), transparent 36%),
      linear-gradient(180deg, #101c36 0%, #101c36 18%, #8d6848 78%, #3a2a1e 100%);
  }
}

@media (max-width: 640px) {
  .menu {
    padding-top: 48px;
  }

  .hud button {
    padding: 8px 12px;
    font-size: 14px;
  }

  .hint {
    bottom: 16px;
    font-size: 13px;
  }
}

html.reduce .menu {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .story {
    height: auto;
  }

  .stage {
    position: relative;
    height: 100vh;
    height: 100dvh;
  }

  .menu {
    margin-top: 0;
  }

  .shutter {
    transform: translateY(-100%);
  }

  .door-left {
    transform: rotateY(-64deg);
  }

  .door-right {
    transform: rotateY(64deg);
  }

  .slots > .slot {
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  .hint span,
  .card-hit,
  .card-hit .slot,
  .card-hit .slot img,
  .card-hit .sheen,
  .hud button,
  .add-btn,
  .glass-card,
  .cart-count.is-bump,
  .cart-toggle.is-pop {
    animation: none;
    transition: none;
  }

  .card-hit:hover,
  .card-hit:focus-visible {
    transform: none;
    box-shadow:
      0 0 0 2px rgba(201, 132, 58, 0.7),
      var(--shadow);
  }
}
