/* Hamudy's menu. A light cream page with Hamudy's navy as the ink (both from
   site.json's theme, written in as #f7f3ec / 20 32 58). Photos sit on the page
   as crisp rounded frames — never faded into it. */

:root {
  --bg: #f7f3ec;
  --bg-2: #ffffff;
  --ink-rgb: 20 32 58;
  --ink: rgb(var(--ink-rgb));
  --muted: rgb(var(--ink-rgb) / 0.66);
  --faint: rgb(var(--ink-rgb) / 0.46);
  --line: rgb(var(--ink-rgb) / 0.11);
  --gold: #8f560d;
  --glass: rgb(255 255 255 / 0.74);
  --glass-edge: rgb(var(--ink-rgb) / 0.09);
  --shadow: 0 10px 28px rgb(var(--ink-rgb) / 0.13), 0 2px 6px rgb(var(--ink-rgb) / 0.06);
  --latin: "Outfit", system-ui, sans-serif;
  --arabic: "Noto Kufi Arabic", "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--arabic);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html[lang="en"] body, [lang="en"] { font-family: var(--latin); }
html.lock, html.lock body { overflow: hidden; }
html.lock #bar { display: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip svg { transform: scaleX(-1); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.num { font-family: var(--latin); font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }

/* ---------------------------------------------------------- glass */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), var(--shadow);
}
.round {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
}

/* ---------------------------------------------------------- photos */

/* The blur preview sits behind the real image until it arrives. */
.ph {
  position: relative; display: block;
  background-size: cover; background-position: center;
}
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s var(--ease); }
.ph img.in { opacity: 1; }
.ph::before {
  content: ""; position: absolute; inset: 0;
  background: inherit; filter: blur(14px); transform: scale(1.1);
}
.ph.done::before { display: none; }
.ph.framed {
  border-radius: 24px; overflow: hidden;
  background-color: var(--bg-2);
  box-shadow: var(--shadow);
}
.tile .ph.framed { border-radius: 18px; }

/* ---------------------------------------------------------- landing */

.land {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}
.land-logo { width: min(58vw, 250px); height: auto; }

/* Three signature dishes, the first in the middle and largest. */
.land-photos { display: flex; align-items: center; justify-content: center; margin: 6px 0 10px; }
.land-photo {
  position: relative; flex: none;
  width: min(30vw, 150px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background-size: cover; background-position: center;
  border: 4px solid var(--bg-2);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite alternate;
}
.land-photo img { width: 100%; height: 100%; object-fit: cover; }
.land-photo.n0 { order: 2; width: min(44vw, 220px); z-index: 1; margin-inline: -5vw; animation-delay: -2s; }
.land-photo.n1 { order: 1; }
.land-photo.n2 { order: 3; animation-delay: -4s; }
@keyframes float { to { transform: translateY(-8px); } }

.land-ask { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; }
.land-ask span + span::before { content: "·"; margin-inline-end: 10px; color: var(--faint); }
.land-langs { display: grid; gap: 12px; width: min(100%, 360px); }
.pill {
  display: flex; align-items: center; justify-content: center;
  height: 58px; border-radius: 999px; font-size: 19px; font-weight: 500;
  transition: transform 0.2s var(--ease), background-color 0.2s;
}
.pill:active { transform: scale(0.97); }
.land-social { display: flex; gap: 12px; margin-top: 6px; }
.land-social .round { background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
.land-social .round:hover, .foot .round:hover { color: var(--ink); }

/* The same page, laid over the menu on opening it (app.js `welcome`). */
.gate { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.gate.out { opacity: 0; transform: scale(1.03); pointer-events: none; }
.gate .pill { width: 100%; }

/* ---------------------------------------------------------- menu page */

#main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

.top {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: calc(34px + env(safe-area-inset-top)) 20px 10px;
}

/* Two round buttons in the corner: the sections (navy), the language beside. */
.fab {
  position: fixed; z-index: 30;
  inset-inline-end: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
}
.fab button {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  transition: transform 0.15s var(--ease);
}
.fab button:active { transform: scale(0.94); }
.fab .go { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.fab svg { width: 24px; height: 24px; }
.top img { width: 150px; height: auto; }
.top a { display: block; }

.h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 34px 20px 14px;
}
.h h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.h small { color: var(--faint); font-size: 13px; }

/* Signatures: big swipeable cards, the best dishes first. */
.sig {
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding: 4px 20px 20px; scroll-padding-inline: 20px;
  scrollbar-width: none;
}
.sig::-webkit-scrollbar, .rail::-webkit-scrollbar, .col::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 min(76vw, 340px);
  scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 4 / 5;
  border-radius: 26px;
  padding: 18px;
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  color: #fff;
  text-align: start;
}
.card .ph { position: absolute; inset: 0; z-index: -2; }
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, transparent 50%, rgb(0 0 0 / 0.68));
}
.card b { font-size: 21px; font-weight: 600; line-height: 1.3; }
.card .price { margin-top: 4px; color: #f3d39c; }

.price { color: var(--gold); font-size: 15px; font-weight: 600; }

/* Sections: a hairline grid. */
.grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0 20px; border-top: 1px solid var(--line); }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px 18px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  transition: background-color 0.2s;
}
.tile:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.tile:active { background: rgb(var(--ink-rgb) / 0.04); }
.tile .ph { width: 100%; aspect-ratio: 1; }
.tile b { font-size: 18px; font-weight: 600; margin-top: 4px; }
.tile small { color: var(--faint); font-size: 12.5px; margin-top: -6px; }

.foot {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin: 44px 20px 0; color: var(--muted);
}
.foot nav { display: flex; gap: 10px; }
.foot img { width: 120px; height: auto; margin-top: 8px; }

/* The viewer's floating bar. */
.bar {
  position: fixed; z-index: 30;
  inset-inline: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 520px; margin-inline: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: 999px;
}
.bar .grow { flex: 1; min-width: 0; }
.bar .title {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 48px; overflow: hidden; line-height: 1.2;
}
.bar .title b { font-size: 15.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .title small { color: var(--muted); font-size: 12px; }
.bar .round:disabled { opacity: 0.3; }

/* ---------------------------------------------------------- viewer */

/* Sideways = sections, down = dishes. Both snap, like stories. */
.viewer { position: fixed; inset: 0; z-index: 20; background: var(--bg); }
.rail {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior: contain;
  scrollbar-width: none;
}
.col {
  --top: calc(78px + env(safe-area-inset-top));
  --foot: calc(80px + env(safe-area-inset-bottom)); /* under the glass bar */
  --peek: 110px; /* the next dish's name and the top of its photo show here, above the bar */
  flex: 0 0 100%; height: 100%; position: relative;
  padding-top: var(--top); scroll-padding-top: var(--top);
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory; scroll-snap-align: start; scroll-snap-stop: always;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.col::after { content: ""; display: block; height: calc(var(--foot) + var(--peek)); } /* lets the last dish reach the top */
.dish {
  height: calc(100% - var(--foot) - var(--peek));
  scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 4px 24px 12px;
  text-align: center;
  overflow: hidden;
}
.dish .name { margin: 0; font-size: clamp(24px, 6.4vw, 32px); font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; max-width: 520px; }
.dish .price { font-size: 19px; margin-top: -6px; }
/* Square by explicit height: with aspect-ratio alone a portrait photo
   stretched the box to its own shape and ran into the next dish's name. */
.dish .stage { --s: min(84vw, 100dvh - 78px - 80px - 110px - 150px, 520px); width: var(--s); height: var(--s); margin: 4px 0; flex: none; }
.dish .stage .ph { width: 100%; height: 100%; }
.dish .desc { margin: 0; color: var(--muted); font-size: 15px; max-width: 420px; }
.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opts li { display: flex; gap: 8px; align-items: baseline; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: 14px; }

.vtop {
  position: absolute; z-index: 2; inset-inline: 16px; top: calc(16px + env(safe-area-inset-top));
  display: flex; justify-content: space-between; pointer-events: none;
}
.vtop > * { pointer-events: auto; }

/* Progress down the section, at the inline end. */
.ticks {
  position: absolute; z-index: 2; inset-inline-end: 8px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.ticks i { display: block; width: 3px; height: 14px; border-radius: 2px; background: var(--faint); opacity: 0.5; transition: all 0.3s var(--ease); }
.ticks i.on { height: 26px; background: var(--ink); opacity: 1; }
.ticks.many { gap: 4px; }
.ticks.many i { height: 7px; }
.ticks.many i.on { height: 18px; }

.hint {
  position: absolute; z-index: 3; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; white-space: nowrap;
  animation: hint 3.2s var(--ease) forwards;
  pointer-events: none;
}
@keyframes hint { 0%, 100% { opacity: 0; } 12%, 80% { opacity: 1; } }

/* First open: the dishes lift once and settle, showing that they scroll. */
.col.nudge > .dish { animation: nudge 1.2s var(--ease) 0.5s; }
@keyframes nudge { 40% { transform: translateY(-64px); } }

/* The photo that flies from the tile into the viewer. */
::view-transition-group(hero) { animation-duration: 0.45s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }

/* ---------------------------------------------------------- sheet */

.sheet {
  width: min(100vw - 24px, 520px); max-height: min(78dvh, 640px);
  margin: auto auto calc(12px + env(safe-area-inset-bottom));
  padding: 10px; border-radius: 28px; color: var(--ink);
  background-color: rgb(255 255 255 / 0.9);
}
.sheet::backdrop { background: rgb(var(--ink-rgb) / 0.3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet[open] { animation: up 0.32s var(--ease); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet h3 { margin: 8px 12px 6px; font-size: 13px; font-weight: 500; color: var(--faint); }
.sheet ul { list-style: none; margin: 0; padding: 0; }
.sheet li button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 18px; text-align: start;
}
.sheet li button:active, .sheet li button[aria-current="true"] { background: rgb(var(--ink-rgb) / 0.07); }
.sheet li .ph { width: 46px; height: 46px; flex: none; border-radius: 12px; overflow: hidden; }
/* A section's line icon: drawn plain, no blur preview behind it — a
   transparent drawing would show that preview as a smudge round its lines. */
.sheet li .icon { width: 46px; height: 46px; flex: none; object-fit: contain; padding: 4px; }
.sheet li b { flex: 1; font-weight: 500; font-size: 16px; }
.sheet li small { color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-group(*) { animation: none !important; transition: none !important; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); max-width: 1100px; margin-inline: auto; }
  .tile:nth-child(odd) { border-inline-end: 0; }
  .tile:not(:nth-child(4n)) { border-inline-end: 1px solid var(--line); }
  .h, .sig { max-width: 1100px; margin-inline: auto; }
}
