/* =========================================================================
   ONYX digital menu
   Design system: black and gold, Arabic first (RTL), mobile first.

   Shape rule: interactive controls are pills, category art sits in circular
   seals (the "O" of the logo), everything else is square and hairline.
   ========================================================================= */

/* ---------- Fonts (self-hosted subsets, see README > Fonts) ---------- */
@font-face {
  font-family: "Amiri";
  src: url("/assets/fonts/amiri-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/assets/fonts/plex-ar-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("/assets/fonts/plex-lat-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* surfaces: warm black, like polished onyx */
  --ink: #0b0a08;
  --ink-raised: #13110e;
  --line: #2a241c;
  --line-strong: #3b3227;

  /* gold, sampled from the logo and quietened for type */
  --gold: #c9a66b;
  --gold-bright: #e3c78f;
  --gold-muted: #9a845d;
  --gold-rgb: 201 166 107;

  /* text */
  --ivory: #f2ede3;
  --stone: #aaa396;

  --font-display: "Amiri", "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
  --font-text: "IBM Plex Sans Arabic", "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --font-latin: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;

  --gutter: 20px;
  --measure: 620px;
  --nav-h: 58px;
  --ease: cubic-bezier(0.22, 0.7, 0.18, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --measure: 660px; }
}
@media (min-width: 1024px) {
  :root { --measure: 1040px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* fine grain, like the surface of stone; sits behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .75 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg { display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

[lang="en"] { font-family: var(--font-latin); }

.skip {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

/* line-art icons and illustrations: one family, stroke set here */
.ico,
.art {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  isolation: isolate;
  padding: 18px var(--gutter) 22px;
  text-align: center;
}
.masthead::before {
  /* warm light behind the wordmark, continuing the logo's own glow */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(52% 46% at 50% 38%, rgb(var(--gold-rgb) / 0.12), transparent 72%);
}
.masthead__brand { margin: 0; }
.masthead__brand img {
  width: min(78vw, 340px);
  height: auto;
  margin-inline: auto;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
  color: var(--gold);
}
.ornament::before,
.ornament::after {
  content: "";
  width: 64px;
  height: 1px;
  background: linear-gradient(to left, rgb(var(--gold-rgb) / 0.7), transparent);
}
.ornament::after { background: linear-gradient(to right, rgb(var(--gold-rgb) / 0.7), transparent); }
.ornament svg { width: 11px; height: 11px; fill: currentColor; }

.masthead__title {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  line-height: 1.3;
  color: var(--gold);
}
.masthead__title span {
  display: block;
  margin-top: 1px;
  padding-inline-start: 0.42em; /* balances the letter-spacing */
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- Category navigation ---------- */
.catnav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  border-block: 1px solid var(--line);
  background: rgb(11 10 8 / 0.97);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .catnav {
    background: rgb(11 10 8 / 0.84);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
  }
}

/* no categories to jump between when the menu could not be loaded */
.is-unavailable .catnav { display: none; }

.catnav__scroller {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.catnav__scroller::-webkit-scrollbar { display: none; }

.catnav__track {
  position: relative;
  display: flex;
  width: max-content;
  height: 100%;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) - 8px);
  list-style: none;
}

.catnav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 12px;
  color: var(--stone);
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.35s var(--ease);
}
.catnav__link .ico {
  width: 21px;
  height: 21px;
  stroke-width: 1.45;
  color: var(--gold-muted);
  transition: color 0.35s var(--ease);
}
.catnav__link[aria-current="true"] { color: var(--gold-bright); }
.catnav__link[aria-current="true"] .ico { color: var(--gold); }
.catnav__link:focus-visible { outline-offset: -6px; border-radius: 10px; }
@media (hover: hover) {
  .catnav__link:hover { color: var(--ivory); }
}

.catnav__indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  pointer-events: none;
}
.catnav__indicator.is-ready {
  transition: transform 0.5s var(--ease), width 0.5s var(--ease);
}

/* ---------- Menu body ---------- */
.menu {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 8px;
  outline: none;
}

/* "prices in Saudi Riyal": stated once, quietly, above the first category */
.price-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 -4px;
  font-size: 13px;
  color: var(--stone);
}
.price-note::before,
.price-note::after {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}

.cat {
  padding-top: 26px;
  scroll-margin-top: calc(var(--nav-h) - 10px);
}

/* section break: hairline with the logo's sparkle */
.cat__break {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 0 24px;
  color: var(--gold-muted);
}
.cat__break::before,
.cat__break::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--line-strong) 30%);
}
.cat__break::after { background: linear-gradient(to right, transparent, var(--line-strong) 30%); }
.cat__break .ico { width: 9px; height: 9px; fill: currentColor; stroke: none; }

.cat__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.cat__titles { flex: 1; min-width: 0; }
/* a gold hairline runs from the title toward the seal, tying the two together */
.cat__titles::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 12px;
  margin-inline-end: -16px;
  background: linear-gradient(to left, rgb(var(--gold-rgb) / 0.55), rgb(var(--gold-rgb) / 0.12) 70%, transparent);
}

.cat__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(31px, 8.6vw, 40px);
  line-height: 1.2;
  color: var(--gold);
  outline: none;
}
.cat__en {
  margin: 2px 0 0;
  text-align: right; /* sit under the Arabic title, not at the LTR start */
  font-size: 19px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--stone);
}
.cat__note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--stone);
}

/* the seal: a double ring echoing the "O" of the wordmark */
.cat__seal {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 1px solid rgb(var(--gold-rgb) / 0.32);
  box-shadow:
    inset 0 0 0 5px var(--ink),
    inset 0 0 0 6px rgb(var(--gold-rgb) / 0.12);
  background: radial-gradient(circle at 50% 42%, rgb(var(--gold-rgb) / 0.08), transparent 66%);
}
.cat__seal .art {
  width: 96px;
  height: 96px;
  stroke-width: 1.6;
  color: var(--gold);
}

/* ---------- Product rows ---------- */
.items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
}
.item::before {
  /* quiet touch feedback while a finger rests on a row */
  content: "";
  position: absolute;
  inset: 2px -10px;
  border-radius: 10px;
  background: rgb(var(--gold-rgb) / 0.07);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.item:active::before { opacity: 1; transition-duration: 0.08s; }

.item__ico {
  flex: 0 0 auto;
  align-self: center;
  width: 30px;
  height: 30px;
  margin-inline-end: 2px;
  stroke-width: 1.3;
  color: var(--gold-muted);
  transition: color 0.4s var(--ease);
}
.item:active .item__ico { color: var(--gold-bright); }
@media (hover: hover) {
  .item:hover .item__ico { color: var(--gold); }
}

.item__body { min-width: 0; }
.item__name {
  display: block;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ivory);
  overflow-wrap: anywhere;
  text-wrap: balance; /* long names wrap into even lines, no orphaned word */
}
.item__desc {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--stone);
}

/* dotted leader from the name to the price, as on a printed menu */
.item__leader {
  flex: 1 1 auto;
  min-width: 18px;
  height: 3px;
  margin-inline: 2px 4px;
  background-image: radial-gradient(circle, rgb(var(--gold-rgb) / 0.45) 0.85px, transparent 1.15px);
  background-size: 6px 3px;
  background-repeat: repeat-x;
  background-position: left center;
}

.item__price {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--gold);
}
.item__num {
  min-width: 2.6em;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: right;
  unicode-bidi: isolate;
}
.item__dec {
  font-size: 0.68em;
  color: var(--gold-muted);
}
.item__cur {
  font-size: 12.5px;
  color: var(--stone);
}

/* ---------- States ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 72px 0 40px;
  text-align: center;
  color: var(--stone);
}
.state svg { width: 16px; height: 16px; fill: var(--gold); }
.state--loading {
  opacity: 0;
  animation: fade-in 0.6s var(--ease) 0.35s forwards;
}
.state--loading svg { animation: breathe 1.6s ease-in-out infinite; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--stone);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.15s var(--ease);
}
.pill:active { transform: scale(0.97); }
@media (hover: hover) {
  .pill:hover { color: var(--gold-bright); border-color: rgb(var(--gold-rgb) / 0.55); }
}

/* ---------- Footer ---------- */
.colophon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.colophon__ridge {
  width: 112px;
  height: 33px;
  fill: none;
  stroke: var(--gold-muted);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.colophon__mark {
  margin: 12px 0 18px;
  padding-inline-start: 0.6em;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6em;
  color: var(--gold);
}

/* ---------- Larger screens ---------- */
@media (min-width: 768px) {
  .masthead { padding-top: 30px; }
  .cat { padding-top: 46px; }
  .cat__seal { width: 132px; height: 132px; }
  .cat__seal .art { width: 110px; height: 110px; }
  .item { padding-block: 10px; }
}

@media (min-width: 1024px) {
  .catnav__link { padding-inline: 16px; }
  /* wide screens: each category opens like a chapter, centred over its spread */
  .cat { padding-top: 40px; }
  .cat__head {
    flex-direction: column-reverse;
    gap: 16px;
    margin-bottom: 30px;
    text-align: center;
  }
  .cat__titles { flex: none; }
  .cat__en { text-align: center; }
  .cat__titles::after {
    width: 240px;
    margin: 14px auto 0;
    background: linear-gradient(to left, transparent, rgb(var(--gold-rgb) / 0.5), transparent);
  }
  /* two columns read like a printed menu spread; RTL fills the right column first */
  .items {
    columns: 2;
    column-gap: 72px;
    column-rule: 1px solid var(--line);
  }
  .item { break-inside: avoid; }
}

/* ---------- Motion (only when the visitor has not asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .js .masthead__brand { animation: rise 1.1s var(--ease) both; }
  .js .ornament { animation: rise 1s var(--ease) 0.18s both; }
  .js .masthead__title { animation: rise 1s var(--ease) 0.28s both; }

  /* category art draws itself the first time its section comes into view */
  .js .cat__seal .art {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
  }
  .js .cat__seal {
    opacity: 0;
    transform: scale(0.94);
  }
  .js .cat.is-in .cat__seal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
  }
  .js .cat.is-in .cat__seal .art {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2.2s var(--ease) 0.1s;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  to { opacity: 1; }
}
@keyframes breathe {
  50% { opacity: 0.35; transform: scale(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .state--loading svg { animation: none; }
}
