/* Restaurant Aria by Arena — digital menu */
:root {
  --ink: #111;
  --muted: #666;
  --line: #e4e4e4;
  --paper: #fff;
  --soft: #f5f5f5;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Landing page ---------- */
.home {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.home main {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 40px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo {
  display: block;
  width: min(58vw, 230px);
  height: auto;
  aspect-ratio: 1 / 1;
}

.home h1 {
  margin: 28px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.home .by {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
}

.lang-list {
  list-style: none;
  margin: 36px 0 0;
  padding: 36px 0 0;
  width: 100%;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  text-align: left;
  text-decoration: none;
  transition: border-color .2s, background-color .2s;
}

.lang-card .flag {
  flex: none;
  width: 44px;
  height: 33px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .14);
  object-fit: cover;
}

.lang-card .label { flex: 1; min-width: 0; display: block; }
.lang-card .name { display: block; font-size: 1.08rem; font-weight: 600; line-height: 1.25; }
.lang-card .native { display: block; font-size: .875rem; color: var(--muted); line-height: 1.3; }

.lang-card .arrow {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--ink);
  transition: transform .2s;
}

.lang-card:active { background: var(--soft); }

@media (hover: hover) {
  .lang-card:hover { border-color: var(--ink); background: var(--soft); }
  .lang-card:hover .arrow { transform: translateX(4px); }
}

.home footer {
  padding: 20px 20px 28px;
  text-align: center;
  font-size: .95rem;
  color: var(--muted);
}

.contact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
}

.contact svg { width: 18px; height: 18px; color: var(--ink); flex: none; }

.contact a {
  display: inline-block;
  padding: 10px 4px;
  color: var(--ink);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.contact a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Menu pages ---------- */
.menu-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--soft);
}

.bar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 10px 0 4px;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.back svg { width: 20px; height: 20px; flex: none; }

.bar .brand { display: block; line-height: 0; }
.bar .brand img { width: 44px; height: 44px; display: block; }

.lang-badge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
}

.lang-badge img {
  width: 22px;
  height: 16.5px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .14);
  object-fit: cover;
}

.viewer { position: relative; flex: 1; min-height: 0; }

.scroller {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 8px calc(72px + env(safe-area-inset-bottom));
}

.pages { position: relative; margin: 0 auto; }

.page {
  position: relative;
  margin: 0 0 8px;
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.page canvas { display: block; width: 100%; height: 100%; }

.status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.status a, .status button { pointer-events: auto; }
.status a { color: var(--ink); font-weight: 600; }
.status p { margin: 0; max-width: 28ch; }

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.controls {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.controls button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.controls button:disabled { color: #bbb; cursor: default; }
.controls button:not(:disabled):active { background: var(--soft); }

.page-indicator {
  min-width: 56px;
  text-align: center;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 700px) {
  .bar { height: 64px; padding-left: 20px; padding-right: 20px; }
  .bar .brand img { width: 52px; height: 52px; }
  .scroller { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 2s !important; }
}
