@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #F7F5F0;
  --text: #171717;
  --accent: #B88A44;
  --accent-dark: #96702f;
  --white: #FFFFFF;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(23, 23, 23, 0.08);
  --shadow-sm: 0 2px 8px rgba(23, 23, 23, 0.06);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

button, a {
  touch-action: manipulation;
}

h1, h2, .brand-name {
  font-family: 'Playfair Display', Georgia, serif;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

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

.landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 40px;
  text-align: center;
}

.landing__logo {
  max-width: min(280px, 80vw);
  max-height: 110px;
  width: auto;
  height: auto;
  margin-bottom: 26px;
}

.landing__tagline {
  color: var(--accent-dark);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0 0 36px;
}

.landing__divider {
  width: 56px;
  height: 2px;
  background: var(--accent);
  border: none;
  margin: 0 0 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: var(--white);
  border: none;
  padding: 18px 34px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.landing__qr {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.landing__qr img {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--white);
  padding: 8px;
}

.landing__qr span {
  font-size: 12px;
  color: #6b6b6b;
  letter-spacing: 0.5px;
}

/* ---------- Menu viewer page ---------- */

.menu-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.menu-header {
  text-align: center;
  padding: 8px 16px 6px;
  background: var(--bg);
  flex-shrink: 0;
}

.menu-header__logo {
  max-width: min(180px, 60vw);
  max-height: 32px;
  width: auto;
  height: auto;
}

.menu-header__subtitle {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 4px 0 0;
}

.viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  padding: 0 0 8px;
}

.viewer__canvas-wrap {
  flex: 1;
  min-height: 0;
  /* This is a fixed-size pan/zoom stage, not a scroll container — the page
     never grows to fit an enlarged canvas. script.js owns panning/zooming
     entirely via a CSS transform on the canvas, so nothing here scrolls. */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 10px 8px;
  touch-action: none;
  position: relative;
}

#pdf-canvas {
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  max-width: 100%;
  height: auto;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.viewer__status {
  text-align: center;
  padding: 60px 20px;
  color: #6b6b6b;
  font-size: 14px;
}

.viewer__status.hidden {
  display: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--white);
  margin: 0 12px 6px;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
  user-select: none;
}

.icon-btn:hover {
  background: var(--bg);
}

.icon-btn:active {
  background: #ece8de;
  transform: scale(0.9);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-collapse {
  display: none;
}

.menu-page.is-fullscreen .icon-expand {
  display: none;
}

.menu-page.is-fullscreen .icon-collapse {
  display: block;
}

.zoom-level {
  min-width: 42px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.toolbar__divider {
  width: 1px;
  height: 20px;
  background: #e6e2d8;
  margin: 0 3px;
  flex-shrink: 0;
}

.pagebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px 12px;
}

.pagebar__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.pagebar__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1.5px solid var(--accent);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.1s ease;
  min-width: 96px;
  justify-content: center;
  user-select: none;
}

.btn-nav:active:not(:disabled) {
  transform: scale(0.94);
}

.btn-nav:hover:not(:disabled) {
  background: var(--accent);
  color: var(--white);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-nav svg {
  width: 14px;
  height: 14px;
}

/* Fullscreen mode */
.menu-page.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
}

/* The header is hidden (not just shrunk) so fullscreen has a real, visible
   effect even on browsers where the native Fullscreen API is unavailable
   for arbitrary elements (notably iOS Safari) — reclaiming that space is
   what actually makes "fullscreen" mean something there. */
.menu-page.is-fullscreen .menu-header {
  display: none;
}

@media (min-width: 640px) {
  .btn-nav {
    min-width: 120px;
  }
}
