/* ============================================================
   Baron — digital menu styles
   Theme: the printed Baron menu — cream page, committed red,
   alternating solid / outlined rounded panels, fatface display
   headers — charged with Lil-Kitchen-style editorial energy:
   big cutout heroes, marker tags, a scrolling script marquee,
   and tap-to-peek item photos.
   ============================================================ */

:root {
  --red:        #CE2733;
  --red-deep:   #9A1F27;
  --red-hair:   rgba(206, 39, 51, 0.18);
  --red-soft:   rgba(206, 39, 51, 0.30);
  --cream:      #F7F1EB;
  --cream-hair: rgba(247, 241, 235, 0.28);
  --ink:        #35201A;
  --ink-soft:   #5A3A2E;

  /* panel-scoped roles (overridden per panel type) */
  --title-color: var(--red);
  --name-color:  var(--red);
  --desc-color:  var(--ink-soft);
  --lbl-color:   var(--ink-soft);
  --price-color: var(--red);
  --hair-color:  var(--red-hair);
  --img-shadow:  rgba(53, 32, 26, 0.24);

  --display: "Chonburi", "Georgia", serif;
  --body:    "Archivo", system-ui, -apple-system, sans-serif;
  --marker:  "Permanent Marker", "Comic Sans MS", cursive;
  /* widest average glyph width of --display, in em (Chonburi words run 0.59–0.70) */
  --title-em-per-char: 0.69;

  --radius: 26px;
  --maxw: 1140px;
  --nav-h: 58px;

  --z-nav: 40;
  --z-totop: 50;
  --z-gate: 100;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 1280px) { :root { --maxw: 1240px; } }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.page--scroll-locked { overflow: hidden; }

::selection { background: var(--red); color: var(--cream); }

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

/* Script wordmark painted from the logo's alpha, so it can bleed
   in brand red on cream exactly like the printed page. */
.wordmark {
  background-color: var(--red);
  -webkit-mask: url("images/baron-wordmark.png") center / contain no-repeat;
  mask: url("images/baron-wordmark.png") center / contain no-repeat;
  aspect-ratio: 595 / 130;
}

/* ============================================================
   GATE — the opening screen. Same printed page: cream, ribbon
   badge, the script wordmark under a thick rule, then two
   panels in the menu's own language (one solid, one outlined).
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: var(--z-gate);
  display: flex;
  flex-direction: column;
  background: var(--cream);
  /* scrolls rather than clips when a short screen can't fit both doors */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.gate[hidden] { display: none; }
.gate--dismissed {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.gate__lang-toggle {
  position: absolute;
  top: calc(env(safe-area-inset-top) + clamp(16px, 4.5vw, 24px));
  inset-inline-start: clamp(16px, 5vw, 30px);
  z-index: 3;
  margin-inline-start: 8px;
}

.gate__content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 6.5vw, 38px);
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: clamp(92px, 24vw, 132px) clamp(20px, 6vw, 30px) clamp(10px, 3vw, 20px);
}

.gate__header { text-align: center; }
.gate__wordmark { width: min(78%, 320px); margin: 0 auto; }
.gate__rule {
  width: 100%;
  height: clamp(4px, 1.2vw, 6px);
  border-radius: 4px;
  background: var(--red);
  margin: clamp(14px, 4vw, 20px) auto 0;
}
.gate__tagline {
  margin: clamp(9px, 2.4vw, 12px) 0 0;
  font-size: clamp(0.74rem, 2.8vw, 0.88rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
}

.gate__view { display: grid; gap: clamp(11px, 3vw, 15px); }
.gate__view[hidden] { display: none; }

.gate__prompt {
  font-family: var(--marker);
  font-size: clamp(1rem, 3.4vw, 1.15rem);
  color: var(--red);
  margin: 0 0 2px;
  transform: rotate(-2deg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 7px;
}
.gate__prompt-arrow { width: 22px; height: auto; margin-top: 7px; flex: none; transform: rotate(22deg); }
[dir="rtl"] .gate__prompt-arrow { transform: scaleX(-1) rotate(22deg); }

/* ---- the two doors ---- */
.gate-option {
  display: flex;
  align-items: center;
  gap: clamp(13px, 3.6vw, 18px);
  width: 100%;
  font-family: var(--body);
  text-align: start;
  color: var(--red);
  background: transparent;
  border: 2.5px solid var(--red);
  border-radius: 22px;
  padding: clamp(14px, 4vw, 18px) clamp(15px, 4.2vw, 20px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--ease-out), background 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease;
}
.gate-option--primary {
  background: var(--red);
  color: var(--cream);
  box-shadow: 0 12px 26px rgba(206, 39, 51, 0.28);
}
.gate-option:active { transform: scale(0.975); }
@media (hover: hover) {
  .gate-option:hover { background: rgba(206, 39, 51, 0.07); }
  .gate-option--primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
}
.gate-option__icon { flex: none; width: clamp(32px, 8.5vw, 38px); height: auto; }
.gate-option__text { flex: 1 1 auto; min-width: 0; }
.gate-option__label {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 5.8vw, 1.85rem);
  line-height: 1.1;
}
.gate-option__description {
  display: block;
  margin-top: 4px;
  font-size: clamp(0.71rem, 2.6vw, 0.8rem);
  font-weight: 600;
  line-height: 1.35;
  opacity: 0.82;
}
.gate-option__arrow { flex: none; width: 21px; height: auto; opacity: 0.9; }
[dir="rtl"] .gate-option__arrow { transform: scaleX(-1); }

/* ---- the accounts ---- */
.social__header {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 14px);
  margin-bottom: 2px;
}
.social__back {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  color: var(--red);
  background: transparent;
  border: 2.5px solid var(--red);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}
.social__back-icon { width: 21px; height: 21px; }
.social__back:active { transform: scale(0.94); }
@media (hover: hover) { .social__back:hover { background: rgba(206, 39, 51, 0.08); } }
[dir="rtl"] .social__back-icon { transform: scaleX(-1); }

.social__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 5.8vw, 1.85rem);
  line-height: 1.1;
  color: var(--red);
  margin: 0;
}

.social__list {
  display: grid;
  gap: clamp(9px, 2.6vw, 12px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.social__link {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3.4vw, 16px);
  color: var(--red);
  text-decoration: none;
  border: 2.5px solid var(--red);
  border-radius: 20px;
  padding: clamp(11px, 3.2vw, 14px) clamp(14px, 4vw, 18px);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.16s var(--ease-out);
}
.social__link:active { transform: scale(0.975); }
@media (hover: hover) {
  .social__link:hover { background: var(--red); color: var(--cream); }
}
.social__icon { flex: none; display: block; width: 26px; height: 26px; }
.social__text { flex: 1 1 auto; min-width: 0; }
.social__name {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  line-height: 1.1;
}
.social__handle {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social__external-icon { flex: none; width: 17px; height: 17px; opacity: 0.75; }
[dir="rtl"] .social__external-icon { transform: scaleX(-1); }

/* ---- storefront line art anchoring the bottom ---- */
.gate__art {
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  place-items: end center;
  padding-bottom: clamp(6px, 2.5vw, 16px);
}
.gate__illustration {
  display: block;
  width: min(94vw, 480px);
  max-height: 20svh;
  height: auto;
  object-fit: contain;
  object-position: bottom;
}
@media (max-height: 680px) { .gate__art { display: none; } }

/* phone on its side: brand beside the doors instead of above them,
   so both doors are on screen without scrolling */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 600px) {
  .gate__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    column-gap: clamp(28px, 6vw, 64px);
    max-width: 900px;
    padding: 72px clamp(24px, 5vw, 44px) 20px;
  }
  .gate__header { grid-column: 2; grid-row: 1; padding-top: 24px; }
  .gate__view { grid-column: 1; grid-row: 1; }
  .gate .ribbon { width: 76px; padding: 14px 0 22px; }
}

/* ============================================================
   COVER — page 1 of the print menu: ribbon badge, "The Menu",
   thick rule, storefront line art, script marquee rolling by.
   ============================================================ */
.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
}

.ribbon {
  position: absolute;
  top: 0;
  inset-inline-end: clamp(18px, 7vw, 64px);
  z-index: 2;
  width: clamp(86px, 22vw, 116px);
  padding: clamp(20px, 5vw, 28px) 0 clamp(26px, 7vw, 36px);
  display: grid;
  place-items: center;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 15px), 0 100%);
}
.ribbon__badge { width: 64%; height: auto; display: block; }
/* on wide screens the cover's ribbon lines up with the content edge, not the window edge */
.cover .ribbon {
  inset-inline-end: max(clamp(18px, 7vw, 64px), calc((100% - var(--maxw)) / 2 + 40px));
}

.cover__intro {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(clamp(76px, 18vw, 116px)) clamp(20px, 5vw, 40px) 0;
}
.cover__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.1rem, 16.5vw, 5.9rem);
  line-height: 1.06;
  letter-spacing: 0;
  color: var(--red);
  margin: 0;
  max-width: 8ch;
  text-wrap: balance;
}
.cover__rule {
  height: clamp(5px, 1.4vw, 7px);
  border-radius: 4px;
  background: var(--red);
  margin-top: clamp(18px, 4.5vw, 30px);
}
.cover__tagline {
  margin: clamp(10px, 2.5vw, 14px) 0 0;
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
  font-weight: 700;
  color: var(--red);
}

.cover__art { margin-top: auto; padding-top: 20px; }
.cover__illustration {
  display: block;
  width: min(96vw, 660px);
  height: auto;
  margin-block: 0 clamp(10px, 3vw, 26px);
  margin-inline: auto 2vw;
}
.cover__marquee {
  width: 108vw;
  margin-block: 0 -1.5vw;
  margin-inline-start: -4vw;
  transform: rotate(-2deg);
}

/* tablet + desktop: a poster-sized title and a storefront bounded by the
   screen height, so the cover fills the first screen instead of leaving a void */
@media (min-width: 768px) {
  .cover__title { font-size: clamp(5.9rem, min(15vw, 17svh), 9.5rem); }
  .cover__illustration {
    width: min(92vw, 800px);
    max-height: 46svh;
    object-fit: contain;
    object-position: right bottom;
  }
  [dir="rtl"] .cover__illustration { object-position: left bottom; }
}

/* ---- marquee ---- */
.marquee { overflow: hidden; direction: ltr; }
.marquee__track {
  display: flex;
  direction: ltr;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee__item {
  flex: none;
  width: clamp(210px, 56vw, 300px);
  margin-right: clamp(30px, 8vw, 52px);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   STICKY MENU BAR — home badge, category nav, language toggle
   ============================================================ */
.menu-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  /* full-bleed bar, content capped at --maxw and centred */
  padding-inline: max(0px, calc((100% - var(--maxw)) / 2));
  background: var(--cream);
  border-bottom: 2.5px solid var(--red);
  transition: box-shadow 0.25s ease;
}
.menu-bar--stuck { box-shadow: 0 10px 26px rgba(53, 32, 26, 0.12); }

.category-nav { flex: 1; min-width: 0; }
.category-nav__list {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 10px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.category-nav__list::-webkit-scrollbar { display: none; }
/* when every chip fits, centre the row; `safe` falls back to start the moment it would overflow */
@media (min-width: 1024px) { .category-nav__list { justify-content: safe center; } }
.category-nav__item {
  flex: 0 0 auto;
  display: flex;
  scroll-snap-align: start;
}

/* badge button — back to the opening screen */
.menu-bar__home {
  flex: none;
  display: grid;
  place-items: center;
  margin-inline-start: clamp(12px, 3.5vw, 22px);
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.menu-bar__home-icon { display: block; width: 58%; height: auto; }
.menu-bar__home:active { transform: scale(0.94); }

.lang-toggle {
  flex: none;
  font-family: var(--body);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  color: var(--cream);
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 999px;
  min-width: 44px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.lang-toggle:active { transform: scale(0.94); }
.menu-bar__lang-toggle {
  margin-inline-end: clamp(14px, 4vw, 24px);
  margin-inline-start: 8px;
}

.category-nav__button {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--red);
  background: transparent;
  border: 2px solid var(--red-soft);
  border-radius: 999px;
  padding: 8px 15px;
  min-height: 38px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
@media (hover: hover) { .category-nav__button:hover { border-color: var(--red); } }
.category-nav__button:active { transform: scale(0.96); }
.category-nav__button--active {
  background: var(--red);
  border-color: var(--red);
  color: var(--cream);
  box-shadow: 0 4px 12px rgba(206, 39, 51, 0.30);
}

/* ---- tap hint ---- */
.menu__hint {
  font-family: var(--marker);
  font-size: clamp(1rem, 3.4vw, 1.15rem);
  color: var(--red);
  text-align: center;
  margin: clamp(20px, 5vw, 28px) auto 0;
  transform: rotate(-2deg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 7px;
}
.menu__hint-arrow { width: 24px; height: auto; margin-top: 8px; flex: none; }

/* ============================================================
   MENU CATEGORIES — the print menu's rounded panels, alternating
   red-outlined on cream and solid red with cream type.
   ============================================================ */
.menu__categories {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 15vw, 76px) clamp(14px, 4vw, 24px) 8px;
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 17vw, 92px);
}

.menu-category {
  position: relative;
  border-radius: var(--radius);
  padding: clamp(18px, 5vw, 32px) clamp(16px, 4.5vw, 30px) clamp(10px, 3vw, 22px);
  scroll-margin-top: calc(var(--nav-h) + clamp(70px, 17vw, 88px));
}
.menu-category--outlined { border: 2.5px solid var(--red); }
.menu-category--filled {
  background: var(--red);
  --title-color: var(--cream);
  --name-color: var(--cream);
  --desc-color: var(--cream);
  --lbl-color: var(--cream);
  --price-color: var(--cream);
  --hair-color: var(--cream-hair);
  --img-shadow: rgba(70, 8, 12, 0.42);
}

.menu-category__header {
  --photo-size: clamp(132px, 36vw, 208px);
  /* the strip of header the sticker covers, which the title must stay clear of */
  --photo-reserve: calc(var(--photo-size) - 2px);
  position: relative;
  container-type: inline-size;
  margin-bottom: clamp(6px, 2vw, 14px);
  min-height: clamp(96px, 25vw, 142px);
}
.menu-category__title {
  font-family: var(--display);
  font-weight: 400;
  /* shrinks just enough that the longest word (--title-chars, set by script.js)
     fits beside the sticker — a word is never hidden behind the photo */
  font-size: clamp(1.35rem,
                   min(7.6vw, (100cqi - var(--photo-reserve)) / (var(--title-chars, 8) * var(--title-em-per-char))),
                   3.1rem);
  line-height: 1.06;
  color: var(--title-color);
  margin: 4px 0 0;
  max-width: calc(100% - var(--photo-reserve));
  text-wrap: balance;
}
.menu-category__photo {
  position: absolute;
  top: clamp(-60px, -15vw, -40px);
  inset-inline-end: clamp(-10px, -2vw, -6px);
  width: var(--photo-size);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  padding: clamp(10px, 2.6vw, 18px);
  background: var(--cream);
  border: 2.5px solid var(--red);
  border-radius: 50%;
  transform: rotate(5deg);
  box-shadow: 0 14px 24px var(--img-shadow);
  pointer-events: none;
}
.menu-category__figure { margin: 0; }
.menu-category__tag {
  position: absolute;
  top: clamp(-60px, -13.5vw, -32px);
  inset-inline-end: clamp(130px, 37.5vw, 230px);
  font-family: var(--marker);
  font-size: clamp(1.02rem, 3.6vw, 1.3rem);
  line-height: 1;
  color: var(--red);
  white-space: nowrap;
  transform: rotate(-7deg);
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
  pointer-events: none;
}
.menu-category__tag-arrow { width: 27px; height: auto; margin-top: 9px; flex: none; }

/* ---- items (print-style: text + price, tap to see the photo) ---- */
.menu-category__items {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 0 -10px;
  padding: clamp(13px, 3.4vw, 17px) 10px;
  /* hairline drawn as a straight top stroke, inset to the text, so the rounded
     hover shape doesn't bend its ends */
  background: linear-gradient(var(--hair-color), var(--hair-color)) top center / calc(100% - 20px) 1px no-repeat;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-item:first-child { background-image: none; }
.menu-item:active { transform: scale(0.985); }
@media (hover: hover) {
  .menu-category--outlined .menu-item:hover { background-color: rgba(206, 39, 51, 0.06); }
  .menu-category--filled .menu-item:hover { background-color: rgba(247, 241, 235, 0.09); }
}

.menu-item__details { min-width: 0; }
.menu-item__name {
  font-size: clamp(0.98rem, 3.3vw, 1.12rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.14;
  letter-spacing: 0.015em;
  margin: 0;
  color: var(--name-color);
}
/* the item's name is its button: looks like the printed name, acts as the control */
.menu-item__button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-item__description {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.42;
  color: var(--desc-color);
  margin: 4px 0 0;
  max-width: 46ch;
}
.menu-item__price { flex: none; text-align: end; }

/* single price — like the print: bold number, small LE */
.price { display: inline-flex; align-items: baseline; gap: 4px; line-height: 1; }
.price__amount {
  font-weight: 900;
  font-size: clamp(1.3rem, 4.3vw, 1.5rem);
  letter-spacing: 0.01em;
  color: var(--price-color);
}
.price__currency,
.price-sizes__currency {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--price-color);
}

/* single / double sizes — a label/amount list stacked in the price column */
.price-sizes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  margin: 0;
}
.price-sizes__option,
.price-sizes__value { display: inline-flex; align-items: baseline; gap: 5px; line-height: 1; }
.price-sizes__value { margin: 0; }
.price-sizes__label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lbl-color);
}
.price-sizes__amount {
  font-weight: 900;
  font-size: clamp(1.05rem, 3.5vw, 1.2rem);
  color: var(--price-color);
}

/* tablet: two columns of items, and a bigger sticker hanging higher over the
   panel's edge so the header doesn't leave a gap under a one-line title */
@media (min-width: 768px) {
  .menu-category__header { min-height: 116px; }
  .menu-category__photo { top: -86px; }
  .menu-category__tag { top: -74px; }
}
@media (min-width: 768px) and (max-width: 1023.98px), (min-width: 1280px) {
  .menu-category__items { grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 4vw, 48px); }
  .menu-item:nth-child(2) { background-image: none; }
}

/* desktop: each panel becomes a spread. Title and a large sticker hold a side
   column that stays in view while that category's items scroll past. */
@media (min-width: 1024px) {
  .menu__categories { gap: clamp(56px, 6vw, 80px); }
  .menu-category {
    display: grid;
    grid-template-columns: clamp(250px, 24vw, 300px) minmax(0, 1fr);
    column-gap: clamp(36px, 4vw, 60px);
    align-items: start;
    padding: 36px clamp(32px, 3.4vw, 44px) 26px;
    scroll-margin-top: calc(var(--nav-h) + 28px);
  }
  .menu-category__header {
    --photo-size: 100%;
    --photo-reserve: 0px;
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    min-height: 0;
    margin: 0;
    padding-bottom: 10px;
  }
  .menu-category__title { max-width: none; font-size: clamp(1.35rem, min(3.4vw, 100cqi / (var(--title-chars, 8) * var(--title-em-per-char))), 3.1rem); }
  .menu-category__figure { position: relative; margin-top: 64px; }
  .menu-category__photo {
    position: static;
    display: block;
    max-width: 260px;
    margin-inline: auto;
  }
  .menu-category__tag { top: -46px; inset-inline-end: auto; inset-inline-start: 0; }
  /* the tag now sits inside the panel, so on a red panel it's written in cream */
  .menu-category--filled .menu-category__tag { color: var(--cream); }
  .menu-category__items { align-self: center; }
}

/* ============================================================
   ITEM PREVIEW — tap an item, the dish pops up as a sticker
   ============================================================ */
.item-preview {
  border: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  background: transparent;
  margin: auto 0 0;
  overflow: visible;
}
.item-preview::backdrop { background: rgba(53, 32, 26, 0.5); }
/* the dialog takes focus on open; the card itself is the visible frame, not a square ring */
.item-preview:focus-visible { outline: none; }

.item-preview__card {
  position: relative;
  background: var(--cream);
  border: 2.5px solid var(--red);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  padding: 0 24px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
}
.item-preview__image {
  display: block;
  width: min(62vw, 280px);
  height: auto;
  margin: -18% auto 0;
  transform: rotate(-4deg);
  filter: drop-shadow(0 18px 22px rgba(53, 32, 26, 0.30));
}
.item-preview__name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.55rem, 6.4vw, 2rem);
  line-height: 1.05;
  color: var(--red);
  margin: 10px 0 0;
  text-wrap: balance;
}
.item-preview__description {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 8px auto 0;
}
.item-preview__price { margin-top: 14px; }
.item-preview__price .price-sizes { flex-direction: row; justify-content: center; gap: 6px 24px; }
.item-preview__price .price__amount,
.item-preview__price .price-sizes__amount { font-size: 1.5rem; }
.item-preview__close {
  position: absolute;
  top: -16px;
  inset-inline-end: 18px;
  z-index: 1;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: var(--cream);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(53, 32, 26, 0.25);
}
.item-preview__close:active { transform: scale(0.92); }

@media (min-width: 640px) {
  /* fit-content, not auto: a fixed dialog with auto width stretches edge to edge
     and the card ends up pinned to one side instead of centred */
  .item-preview { margin: auto; width: fit-content; }
  .item-preview__card {
    border-bottom: 2.5px solid var(--red);
    border-radius: 30px;
    width: min(92vw, 430px);
    padding-bottom: 30px;
  }
}

/* short landscape screens: photo beside the text so name and price both fit */
@media (min-width: 640px) and (max-height: 560px) {
  .item-preview__card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    /* the empty first and last rows soak up the photo's extra height, keeping the text together */
    grid-template-areas: "image ." "image name" "image description" "image price" "image .";
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 22px;
    width: min(92vw, 620px);
    padding: 26px 30px 26px 22px;
    text-align: start;
  }
  [dir="rtl"] .item-preview__card { padding: 26px 22px 26px 30px; }
  .item-preview__image {
    grid-area: image;
    align-self: center;
    width: min(32vw, 220px, 58svh);
    margin: -14px 0;
  }
  .item-preview__name { grid-area: name; margin-top: 0; }
  .item-preview__description { grid-area: description; margin-inline: 0; }
  .item-preview__price { grid-area: price; }
  .item-preview__price .price-sizes { justify-content: flex-start; }
}

/* ============================================================
   SCRIPT BLEED — the giant red "baron" running off the page
   ============================================================ */
.wordmark-bleed { overflow: hidden; margin-top: clamp(26px, 6vw, 40px); }
.wordmark-bleed__wordmark {
  width: 124vw;
  margin-inline-start: -9vw;
  transform: translateY(16%) rotate(-1.5deg);
}

/* ============================================================
   ARABIC — Lalezar display + Rubik body, RTL-aware flourishes
   ============================================================ */
html[lang="ar"] {
  --display: "Lalezar", system-ui, sans-serif;
  --body: "Rubik", system-ui, -apple-system, sans-serif;
  --marker: "Lalezar", system-ui, sans-serif;
  --title-em-per-char: 0.58;
}
html[lang="ar"] .cover__title { line-height: 1.2; }
html[lang="ar"] .menu-category__title { line-height: 1.25; }
html[lang="ar"] .item-preview__name { line-height: 1.3; }
html[lang="ar"] .menu-item__name,
html[lang="ar"] .category-nav__button,
html[lang="ar"] .price-sizes__label,
html[lang="ar"] .price__currency,
html[lang="ar"] .price-sizes__currency { letter-spacing: 0; }
html[lang="ar"] .menu-item__description { font-size: 0.86rem; }
html[lang="ar"] .gate__tagline { letter-spacing: 0; font-size: clamp(0.82rem, 3vw, 0.95rem); }
html[lang="ar"] .gate-option__label,
html[lang="ar"] .social__title { line-height: 1.35; }
html[lang="ar"] .gate-option__description { font-size: clamp(0.76rem, 2.8vw, 0.85rem); }
html[lang="ar"] .social__name { letter-spacing: 0; font-size: 1rem; }
/* handles stay latin (dir=ltr) but hug the same edge as the name */
[dir="rtl"] .social__handle { text-align: right; }
html[lang="ar"] .gate__prompt { font-size: clamp(1.08rem, 3.6vw, 1.25rem); }
html[lang="ar"] .price__currency,
html[lang="ar"] .price-sizes__currency { font-size: 0.72rem; }
html[lang="ar"] .menu-category__tag { font-size: clamp(1.1rem, 4vw, 1.4rem); }
html[lang="ar"] .menu__hint { font-size: clamp(1.08rem, 3.6vw, 1.25rem); }
[dir="rtl"] .menu-category__tag-arrow,
[dir="rtl"] .menu__hint-arrow { transform: scaleX(-1); }

/* ============================================================
   FOOTER — red island panel with the cream badge
   ============================================================ */
.footer {
  width: min(var(--maxw), calc(100% - clamp(28px, 8vw, 48px)));
  margin: clamp(18px, 4vw, 28px) auto calc(18px + env(safe-area-inset-bottom));
  border-radius: calc(var(--radius) + 4px);
  background: var(--red);
  color: var(--cream);
  text-align: center;
  padding: clamp(38px, 9vw, 52px) 22px clamp(30px, 7vw, 40px);
}
.footer__logo {
  display: block;
  margin: 0 auto;
  width: clamp(148px, 40vw, 196px);
  height: auto;
}
.footer__contact { margin: 20px 0 0; font-style: normal; }
.footer__contact-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__contact-item { display: flex; }
.footer__contact-link,
.footer__contact-text {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.footer__contact-link {
  border: 1.5px solid rgba(247, 241, 235, 0.4);
  border-radius: 999px;
  padding: 8px 16px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.footer__contact-link:hover { background: rgba(247, 241, 235, 0.14); border-color: var(--cream); }
.footer__contact-icon { width: 15px; height: 15px; flex: none; }
.footer__note {
  margin: 20px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cream);
}
.footer__credit {
  margin: 8px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(247, 241, 235, 0.72);
}
.footer__credit a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: rgba(247, 241, 235, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s ease;
}
.footer__credit a:hover { text-decoration-color: var(--cream); }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: var(--z-totop);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: var(--cream);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(206, 39, 51, 0.40);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.back-to-top--visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:active { transform: scale(0.92); }

/* ============================================================
   FOCUS + MOTION
   ============================================================ */
:focus-visible { outline: 3px solid var(--red-deep); outline-offset: 2px; }
.menu-category--filled :focus-visible,
.footer :focus-visible { outline-color: var(--cream); }

/* a focused item button rings the whole item, as the tap target is the whole item */
@supports selector(:has(*)) {
  .menu-item__button:focus-visible { outline: none; }
  .menu-item:has(.menu-item__button:focus-visible) { outline: 3px solid var(--red-deep); outline-offset: 2px; }
  .menu-category--filled .menu-item:has(.menu-item__button:focus-visible) { outline-color: var(--cream); }
}

@media (prefers-reduced-motion: no-preference) {
  .gate__wordmark      { animation: rise 0.7s var(--ease-out) 0.05s both; }
  .gate__rule          { transform-origin: center; animation: grow 0.8s var(--ease-out) 0.28s both; }
  .gate__tagline       { animation: rise 0.6s var(--ease-out) 0.42s both; }
  /* backwards, not both — so the press/tilt transforms survive the intro */
  .gate__prompt        { animation: rise-tilt 0.6s var(--ease-out) 0.5s backwards; }
  .gate .ribbon        { animation: drop 0.7s var(--ease-out) 0.45s both; }
  .gate__illustration  { animation: rise 0.8s var(--ease-out) 0.55s backwards; }
  .gate-option         { animation: rise 0.6s var(--ease-out) 0.55s backwards; }
  .gate-option + .gate-option { animation-delay: 0.64s; }
  .gate__view--social:not([hidden]) { animation: rise 0.45s var(--ease-out) backwards; }

  .cover__title        { animation: rise 0.8s var(--ease-out) 0.05s both; }
  .cover__rule         { transform-origin: left center; animation: grow 0.9s var(--ease-out) 0.3s both; }
  .cover__tagline      { animation: rise 0.7s var(--ease-out) 0.45s both; }
  .ribbon              { animation: drop 0.7s var(--ease-out) 0.5s both; }
  .cover__illustration { animation: rise 0.9s var(--ease-out) 0.4s both; }
  .item-preview[open]  { animation: sheet-in 0.55s var(--ease-out); }
  .item-preview[open]::backdrop { animation: fade-in 0.3s ease both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise-tilt {
  from { opacity: 0; transform: translateY(20px) rotate(-2deg); }
  to   { opacity: 1; transform: rotate(-2deg); }
}
@keyframes grow { from { transform: scaleX(0); } }
@keyframes drop { from { transform: translateY(-110%); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(48px); } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
