/* KAFE !N — menu screen. Colors come from tokens.css (light / dark). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root { --bar-h: 112px; }

html {
  -webkit-text-size-adjust: 100%; overflow-x: clip;
  scrollbar-color: var(--surface-2) var(--bg);
  scroll-padding-top: calc(var(--bar-h) + 8px);
}
body {
  margin: 0; min-height: 100svh;
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  color: var(--text);
  background: radial-gradient(70vmax 40vmax at 50% -8%, var(--glow-top), transparent 70%) no-repeat, var(--bg);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
html[lang="ar"] body { font-family: var(--arabic); }
::selection { background: var(--accent-fill); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html[dir="rtl"] .flip { transform: scaleX(-1); }

.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: var(--grain, none); }

/* theme switch grows out of the toggle */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal .6s cubic-bezier(.7, 0, .2, 1); }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--tx, 50%) var(--ty, 0)); }
  to { clip-path: circle(var(--tr, 150vmax) at var(--tx, 50%) var(--ty, 0)); }
}

/* ---------- pour: continues the transition from the home screen ---------- */

.pour {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: var(--pour); transform: translateY(-115%);
}
.pour__wave {
  position: absolute; left: 0; right: 0; top: 100%; height: 34px; margin-top: -1px;
  background: var(--pour);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0h160v12c-20 0-20 14-40 14S100 12 80 12 60 26 40 26 20 12 0 12z'/%3E%3C/svg%3E") repeat-x 0 0 / 160px 34px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0h160v12c-20 0-20 14-40 14S100 12 80 12 60 26 40 26 20 12 0 12z'/%3E%3C/svg%3E") repeat-x 0 0 / 160px 34px;
  animation: wave .9s linear infinite;
}
@keyframes wave { to { -webkit-mask-position: 160px 0; mask-position: 160px 0; } }
.is-arriving .pour { animation: pour-up .8s cubic-bezier(.7, 0, .3, 1) .05s both; }
@keyframes pour-up { from { transform: translateY(0); } to { transform: translateY(-115%); } }
.is-leaving .pour { animation: pour-down .5s cubic-bezier(.6, 0, .4, 1) both; }
@keyframes pour-down { from { transform: translateY(-115%); } to { transform: translateY(0); } }

/* ---------- sticky bar: controls + category rail ---------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  transition: box-shadow .3s;
}
.bar.is-stuck { box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px var(--shadow); }
.bar__row {
  max-width: 1080px; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px 8px;
  direction: ltr; /* controls keep their places in Arabic too */
}
.bar__group { display: flex; gap: 8px; }
@media (max-width: 359px) { .bar__mark { display: none; } }
.bar__mark {
  font-family: var(--sans); font-weight: 900; font-stretch: 122%; font-size: 18px; letter-spacing: -.01em;
  white-space: nowrap;
}

.chip-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s var(--ease), background-color .2s;
}
.chip-btn:active { transform: scale(.9); }
.chip-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn svg { grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .3s; }
.theme-btn .moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-kafein-theme="light"] .theme-btn .sun { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-kafein-theme="light"] .theme-btn .moon { opacity: 1; transform: none; }

.lang {
  display: inline-flex; gap: 2px; padding: 3px; min-height: 44px; align-items: center; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.lang__opt { min-width: 38px; padding: 6px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; text-align: center; font-family: var(--sans); transition: background-color .25s var(--ease), color .25s; }
.lang__opt[data-lang="ar"] { font-family: var(--arabic); }
.lang__opt.is-active { background: var(--text); color: var(--bg); }

.rail {
  max-width: 1080px; margin-inline: auto;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 16px 10px; scroll-padding-inline: 16px;
}
.rail::-webkit-scrollbar { display: none; }
.rail__chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 7px 14px 7px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
html[dir="rtl"] .rail__chip { padding: 7px 11px 7px 14px; }
.rail__chip svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail__chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.rail__chip[hidden] { display: none; }

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

.page { max-width: 1080px; margin-inline: auto; padding: 0 16px; }

.intro { padding: 18px 0 6px; }
.intro__title {
  margin: 0; font-size: clamp(60px, 19vw, 112px); font-weight: 900; font-stretch: 125%;
  letter-spacing: -.035em; line-height: .88;
}
html[lang="ar"] .intro__title { font-weight: 700; letter-spacing: 0; line-height: 1.15; }
.intro__note { margin: 12px 0 18px; color: var(--text-dim); max-width: 42ch; }

.search { position: relative; display: flex; align-items: center; max-width: 560px; }
.search > svg {
  position: absolute; inset-inline-start: 16px; width: 19px; height: 19px; pointer-events: none;
  fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round;
}
.search input {
  width: 100%; min-height: 52px; padding: 12px 48px; border-radius: 16px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line);
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--text-faint); }
.search input:focus { outline: none; border-color: var(--accent); }
.search__clear {
  position: absolute; inset-inline-end: 6px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-dim);
}
.search__clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search__clear[hidden] { display: none; }

/* ---------- categories ---------- */

.cat { padding-top: 38px; scroll-margin-top: calc(var(--bar-h) + 6px); }

/* section title: brush-stroke label + a long rule with a crossing tick, from the printed menu */
.cat__head { display: flex; align-items: center; gap: 0; margin-bottom: 4px; }
.cat__title {
  position: relative; isolation: isolate; flex: none; margin: 0;
  padding: 9px 24px 11px;
  font-size: 25px; font-weight: 900; font-stretch: 118%; letter-spacing: -.015em; line-height: 1.1;
  color: var(--accent-ink);
}
html[lang="ar"] .cat__title { font-weight: 700; letter-spacing: 0; line-height: 1.4; padding: 6px 24px 8px; }
.cat__brush { position: absolute; inset: -2px -6px; width: calc(100% + 12px); height: calc(100% + 4px); z-index: -1; transform: rotate(-1.4deg); }
.cat__brush path:first-child { fill: var(--accent-fill); }
.cat__brush path + path { stroke: var(--accent-ink); }
.cat__rule { position: relative; flex: 1; height: 1.5px; margin-inline-start: 10px; background: var(--text); opacity: .75; }
.cat__rule::after { content: ""; position: absolute; inset-inline-end: 14%; top: -22px; width: 1.5px; height: 44px; background: var(--text); }
.cat__note { margin: 8px 2px 0; font-size: 14px; color: var(--text-dim); }
.cat__each {
  display: inline-block; margin: 12px 2px 0; padding: 4px 12px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
}

/* drawings: outlines follow the theme, liquids keep their colours */
.ka { display: block; width: 100%; height: 100%; overflow: visible; color: var(--text); }
.ka-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* rows: drawing · name … price */
.rows { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; column-gap: 48px; }
@media (min-width: 760px) { .rows { grid-template-columns: 1fr 1fr; } }
.row { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.row__art { flex: none; width: 46px; height: 46px; transition: transform .35s var(--ease); }
@media (hover: hover) { .row:hover .row__art { transform: rotate(-6deg) scale(1.08); } }
.row__name { font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.row__lead { flex: 1; min-width: 14px; align-self: center; border-bottom: 1.5px dotted var(--text-faint); opacity: .55; margin-top: 6px; }
.row__price { font-weight: 800; font-size: 16.5px; font-variant-numeric: tabular-nums; font-family: var(--sans); }

/* house drinks: each card takes the colour of its drink */
.cards { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  --tint: var(--accent-fill);
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 0 14px 14px; border-radius: 18px; overflow: hidden;
  background: color-mix(in srgb, var(--tint) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--tint) 30%, var(--line));
}
.card__art {
  display: block; height: 104px; margin: 0 -14px 8px; padding: 14px 0 6px;
  background: color-mix(in srgb, var(--tint) 26%, var(--surface));
}
.card__art .ka { width: auto; height: 100%; margin-inline: auto; transition: transform .45s var(--ease); }
@media (hover: hover) { .card:hover .card__art .ka { transform: translateY(-3px) rotate(-4deg); } }
.card__name { font-weight: 800; font-size: 16.5px; line-height: 1.2; font-stretch: 108%; }
html[lang="ar"] .card__name { font-weight: 700; }
.card__desc { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-dim); }
.card__price {
  margin-top: auto; align-self: flex-start; position: relative; top: 6px;
  padding: 3px 11px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; font-family: var(--sans);
}

/* one price for the whole category: little glasses with names */
.chips { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.chip {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 12px 8px 10px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; font-size: 14.5px; line-height: 1.25;
}
.chip .ka { width: 44px; height: 44px; }

mark { background: var(--accent-fill); color: var(--accent-ink); border-radius: 4px; padding: 0 2px; }

/* ---------- empty + outro ---------- */

.empty { padding: 48px 0 8px; text-align: center; }
.empty__title { margin: 0; font-size: 22px; font-weight: 800; font-stretch: 112%; }
.empty__text { margin: 6px 0 18px; color: var(--text-dim); }
.pill-btn {
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 700;
}

.outro { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 48px 0 8px; }
.outro__card {
  display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: 16px;
  background: var(--invert-bg); color: var(--invert-text);
  transition: transform .25s var(--ease);
}
.outro__card + .outro__card { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.outro__card:active { transform: scale(.97); }
@media (hover: hover) { .outro__card:hover { transform: translateY(-2px); } }
.outro__title { font-size: 18px; font-weight: 900; font-stretch: 115%; line-height: 1.15; }
html[lang="ar"] .outro__title { font-weight: 700; }
.outro__text { font-size: 13.5px; opacity: .75; }

.foot { padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--text-faint); }

/* ---------- one entrance: sections settle in as the page appears ---------- */

@media (prefers-reduced-motion: no-preference) {
  .intro, .cat { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .1s); }
  .is-arriving .intro, .is-arriving .cat { animation-delay: calc(var(--i, 0) * 50ms + .55s); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .pour { display: none; }
  ::view-transition-new(root) { animation: none; }
}
