/* =====================================================================
   Водопада — the menu book
   A hand-bound menu lying open on a walnut table: linen cover in forest
   green, aged ivory paper with grain and foxing, engraved rules, brass
   accents and a silk ribbon. Visual layer only — markup and behaviour
   come from js/script.js (renderMenu).
   Textures are tiny inline SVG noise tiles, rasterised once and cached.
   ===================================================================== */

.menu-section {
  /* Table */
  --wood: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1800' height='720'%3E%3Cfilter id='w' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0021 0.045' numOctaves='4' seed='7' stitchTiles='stitch' result='t'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0035 0.006' numOctaves='2' seed='4' result='d'/%3E%3CfeDisplacementMap in='t' in2='d' scale='70' xChannelSelector='R' yChannelSelector='G' result='g'/%3E%3CfeColorMatrix in='g' values='0.36 0 0 0 0.035 0.24 0 0 0 0.018 0.13 0 0 0 0.008 0 0 0 0 1'/%3E%3C/filter%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.6' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.03 0 0 0 0 0.015 0.9 0 0 0 -0.42'/%3E%3C/filter%3E%3Crect width='1800' height='720' filter='url(%23w)'/%3E%3Crect width='1800' height='720' filter='url(%23f)'/%3E%3Crect y='0' width='1800' height='2' fill='%230f0905' opacity='.75'/%3E%3Crect y='2' width='1800' height='1' fill='%23f0c890' opacity='.06'/%3E%3Crect y='359' width='1800' height='2' fill='%230f0905' opacity='.75'/%3E%3Crect y='361' width='1800' height='1' fill='%23f0c890' opacity='.06'/%3E%3C/svg%3E");
  /* Paper */
  --paper: #f3ead8;
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.26 0 0 0 0 0.13 0.5 0 0 0 -0.19'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  --paper-age: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='a' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0065' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.42 0 0 0 0 0.18 0.3 0 0 0 -0.14'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  --ink: #202a1c;
  --ink-brown: #5f4a32;
  --sepia: #6b4b26;
  --rule: rgba(128, 94, 50, 0.34);
  --rule-soft: rgba(128, 94, 50, 0.16);
  --frame: 18px;

  background-color: #2a1b11;
  background-image: var(--wood);
  background-size: 1800px 720px;
  background-position: 50% 0;
  color: #efe4cf;
  isolation: isolate;
  overflow: hidden;
}
/* A warm pool of light over the table, falling off into the room */
.menu-section::before {
  opacity: 1; z-index: -1;
  background:
    radial-gradient(ellipse 55% 48% at 50% 52%, rgba(255, 212, 150, 0.12), rgba(255, 212, 150, 0) 70%),
    radial-gradient(ellipse 85% 75% at 50% 50%, rgba(10, 6, 3, 0) 45%, rgba(10, 6, 3, 0.55) 100%);
}
.menu-section .section-head .eyebrow { color: var(--brass-light); }
.menu-section .section-head h2 { color: #f4ead6; }
.menu-section .section-sub { color: rgba(244, 234, 214, 0.74); }

/* ---------- Category index (tabs) — set like a printed contents line ---------- */
.menu-tabs { gap: 0 4px; margin-bottom: 52px; }
.menu-tab {
  position: relative;
  padding: 12px 16px; min-height: 44px;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  font-family: var(--font-display); font-size: 1.14rem; font-weight: 500;
  letter-spacing: 0.015em; text-transform: none;
  color: rgba(240, 228, 205, 0.66);
  transition: color 350ms ease;
}
.menu-tab::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 7px; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left center;
  transition: transform 600ms var(--ease);
}
.menu-tab:hover { color: #f4ead6; transform: none; border-color: transparent; }
.menu-tab:hover::after { transform: scaleX(0.35); }
.menu-tab[aria-selected="true"] {
  background: none; box-shadow: none; color: var(--brass-light); font-style: italic;
}
.menu-tab[aria-selected="true"]::after { transform: scaleX(1); }
.menu-tab:focus-visible { outline: 1px solid var(--brass-light); outline-offset: 2px; }

/* ---------- The book ---------- */
.menu-table { position: relative; max-width: 1120px; margin: 0 auto; isolation: isolate; }

/* Linen-bound cover, a few millimetres proud of the pages */
.menu-book {
  position: relative;
  padding: 14px 16px 20px;
  border-radius: 3px 5px 5px 3px;
  background-color: #1f2b1e;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 1px 1px rgba(0, 0, 0, 0.45),
    0 4px 8px rgba(0, 0, 0, 0.35),
    0 26px 50px -16px rgba(0, 0, 0, 0.7),
    0 70px 100px -50px rgba(0, 0, 0, 0.6);
}
/* blind-tooled brass line on the cover */
.menu-book::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid rgba(199, 162, 109, 0.3); border-radius: 2px;
}
/* silk ribbon marker slipping out from between the pages */
.menu-book::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  bottom: -46px; left: calc(50% + 30px); width: 13px; height: 80px;
  background-color: #9c7b45;
  background-image: repeating-linear-gradient(90deg, rgba(255, 240, 210, 0.14) 0 1px, transparent 1px 3px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45));
  transform: rotate(-3deg); transform-origin: top center;
}

/* Paper: the page block, with the stacked edges of the leaves beneath */
.menu-panels {
  --book-pad: clamp(34px, 5vw, 68px);
  max-width: none; margin: 0;
  border: 0; border-radius: 2px;
  background-color: var(--paper);
  background-image: var(--paper-grain), var(--paper-age);
  background-size: 240px 240px, 640px 640px;
  box-shadow:
    -1px 1px 0 #e2d6bd, 1px 1px 0 #e2d6bd,
    -2px 2px 0 #efe5d0, 2px 2px 0 #efe5d0,
    -3px 3px 0 #d9cbae, 3px 3px 0 #d9cbae,
    -4px 4px 0 #ebdfc8, 4px 4px 0 #ebdfc8,
    -5px 5px 0 #d2c2a2, 5px 5px 0 #d2c2a2,
    0 8px 7px -3px rgba(0, 0, 0, 0.4);
  color: var(--ink);
}

/* Engraved double rule framing each page */
.menu-panels::before,
.menu-panels::after,
.leaf-face::before,
.leaf-still::before {
  content: ""; position: absolute; inset: var(--frame); z-index: 1; pointer-events: none;
  border: 1px solid var(--rule);
  outline: 1px solid var(--rule-soft); outline-offset: -5px;
  background: none; width: auto; transform: none;
}
.menu-panels::after { display: none; }
.leaf-face, .leaf-still {
  background-color: var(--paper);
  background-image: var(--paper-grain), var(--paper-age);
  background-size: 240px 240px, 640px 640px;
}
.leaf-face:not(:has(.leaf-sheet))::before { display: none; }

@media (min-width: 961px) {
  /* Two facing pages: a frame on each, and the gutter where the paper curves into the binding */
  .menu-panels::before { right: calc(50% + var(--frame)); left: var(--frame); top: var(--frame); bottom: var(--frame); }
  .menu-panels::after  { display: block; left: calc(50% + var(--frame)); right: var(--frame); top: var(--frame); bottom: var(--frame); }
  .menu-panels {
    background-image:
      linear-gradient(90deg, rgba(70, 48, 20, 0) 0, rgba(70, 48, 20, 0.07) 30%, rgba(55, 37, 14, 0.24) 49.3%, rgba(255, 249, 232, 0.28) 50%, rgba(55, 37, 14, 0.2) 50.7%, rgba(70, 48, 20, 0.07) 70%, rgba(70, 48, 20, 0) 100%),
      linear-gradient(90deg, rgba(70, 48, 20, 0.08), rgba(70, 48, 20, 0) 3%, rgba(70, 48, 20, 0) 97%, rgba(70, 48, 20, 0.08)),
      var(--paper-grain), var(--paper-age);
    background-size: 150px 100%, 100% 100%, 240px 240px, 640px 640px;
    background-position: 50% 0, 0 0, 0 0, 0 0;
    background-repeat: no-repeat, no-repeat, repeat, repeat;
  }
  .menu-page-body { column-rule: none; }
}

/* Gutter shading on the turning sheet */
.leaf-right .leaf-front, .leaf-left .leaf-back, .leaf-still.leaf-right { box-shadow: inset 26px 0 26px -22px rgba(55, 37, 14, 0.3); }
.leaf-left .leaf-front, .leaf-right .leaf-back, .leaf-still.leaf-left { box-shadow: inset -26px 0 26px -22px rgba(55, 37, 14, 0.3); }
.leaf-full .leaf-front { box-shadow: inset 18px 0 22px -20px rgba(55, 37, 14, 0.25), 6px 0 18px -10px rgba(0, 0, 0, 0.25); }
.leaf-full .leaf-back { background-image: var(--paper-grain), var(--paper-age); }
.leaf-shade { background: rgba(48, 32, 12, 0.5); }
.leaf-right .leaf-front .leaf-shade, .leaf-left .leaf-back .leaf-shade, .leaf-full .leaf-shade {
  background: linear-gradient(90deg, rgba(48, 32, 12, 0.55), rgba(48, 32, 12, 0.08));
}
.leaf-left .leaf-front .leaf-shade, .leaf-right .leaf-back .leaf-shade {
  background: linear-gradient(270deg, rgba(48, 32, 12, 0.55), rgba(48, 32, 12, 0.08));
}

/* Shadow of the lifted sheet on the page beneath */
.leaf-cast { position: absolute; top: 0; bottom: 0; opacity: 0; pointer-events: none; will-change: transform, opacity; }
.leaf-cast.leaf-right, .leaf-cast.leaf-full { background: linear-gradient(90deg, rgba(40, 26, 10, 0.5), rgba(40, 26, 10, 0.12) 40%, rgba(40, 26, 10, 0) 80%); }
.leaf-cast.leaf-left { background: linear-gradient(270deg, rgba(40, 26, 10, 0.5), rgba(40, 26, 10, 0.12) 40%, rgba(40, 26, 10, 0) 80%); }

/* ---------- Typography on the page ---------- */
.menu-page-head { margin-bottom: 30px; }
.menu-page-kicker {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.34em; color: #8c6a3a; margin-bottom: 4px;
}
.menu-page-title {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(2.5rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -0.012em;
  color: var(--ink); margin: 0 0 10px;
}
.menu-page-ornament { color: #94733f; opacity: 0.9; }
.menu-page-ornament svg { width: 160px; height: 24px; }
@media (min-width: 961px) { .menu-page-head .menu-page-ornament { width: 160px; } }

.menu-group-title {
  gap: 14px;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.62rem; letter-spacing: 0.005em; color: var(--sepia);
  margin: 38px 0 6px;
}
/* a small engraved sprig before each heading */
.menu-group-title::before {
  content: ""; flex: 0 0 18px; height: 18px; background: #a3814d; opacity: 0.85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M4 20C9 15 14 10 20 4'/%3E%3Cpath d='M8 16c-2.5-.2-4-1.4-4.5-3.6 2.4-.2 4 .9 4.5 3.6zM11 13c-.5-2.4.2-4.3 2-5.6.9 2.2.2 4.1-2 5.6zM12 12c2.5.2 4 1.4 4.5 3.6-2.4.2-4-.9-4.5-3.6zM15 9c-.4-2.2.3-3.9 2-5 .8 2 .1 3.7-2 5z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M4 20C9 15 14 10 20 4'/%3E%3Cpath d='M8 16c-2.5-.2-4-1.4-4.5-3.6 2.4-.2 4 .9 4.5 3.6zM11 13c-.5-2.4.2-4.3 2-5.6.9 2.2.2 4.1-2 5.6zM12 12c2.5.2 4 1.4 4.5 3.6-2.4.2-4-.9-4.5-3.6zM15 9c-.4-2.2.3-3.9 2-5 .8 2 .1 3.7-2 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.menu-group-title::after { height: 1px; background: var(--rule); }
.menu-group-title:first-child { margin-top: 0; }

.menu-item {
  align-items: baseline; gap: 0;
  padding: 13px 0 14px; border-bottom: 0;
}
.menu-item > div:first-child { flex: 0 1 auto; min-width: 0; }
.menu-item-price { flex: 0 0 auto; padding-left: 18px; }
/* Dotted leaders for the simple lines (no description), as on a printed card */
.menu-item:not(:has(.menu-item-desc)):not(:has(.menu-item-price:empty))::after {
  content: ""; order: 1; flex: 1 1 28px; min-width: 28px; margin: 0 0 0.32em 14px;
  border-bottom: 1px dotted rgba(107, 75, 38, 0.5);
}
.menu-item:not(:has(.menu-item-desc)):not(:has(.menu-item-price:empty)) .menu-item-price { order: 2; padding-left: 12px; }
.menu-item:has(.menu-item-desc) { justify-content: space-between; }

.menu-item-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.36rem; line-height: 1.22;
  letter-spacing: 0.004em; color: var(--ink);
  background: none;
}
.menu-item:hover .menu-item-name { color: var(--ink); background-size: 0 0; }
.menu-item-desc {
  font-family: 'EB Garamond', var(--font-display); font-style: italic; font-size: 1.02rem; line-height: 1.45;
  color: var(--ink-brown); margin-top: 3px; max-width: 34em;
}
.menu-item-price {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--sepia);
  font-variant-numeric: lining-nums tabular-nums;
}
.menu-item-price small {
  display: inline; margin: 0 0.55em 0 0;
  font-family: 'EB Garamond', var(--font-display); font-style: italic; font-weight: 400;
  font-size: 0.92rem; letter-spacing: 0.01em; color: #8a7457;
}
.signature-badge {
  margin-left: 10px; padding: 2px 9px 1px; border-radius: 1px;
  font-family: var(--font-body); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.2em;
  color: #7a5a2c; background: none; border: 1px solid rgba(156, 123, 69, 0.7);
  position: relative; top: -2px;
}

.menu-page-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule); }
.menu-page-turn {
  font-family: var(--font-display); font-style: italic; font-size: 1.08rem; font-weight: 500;
  letter-spacing: 0.01em; text-transform: none; color: var(--sepia);
  min-height: 44px; padding: 8px 0;
}
.menu-page-turn:hover { color: var(--ink); }
.menu-page-turn:focus-visible { outline: 1px solid #a3814d; outline-offset: 4px; }
.menu-page-num { color: #8a7457; font-size: 1rem; letter-spacing: 0.08em; }

/* Ink settling into the paper after the turn */
@keyframes ink-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- Smaller screens: a single page ---------- */
@media (max-width: 768px) {
  .menu-section { --frame: 10px; background-size: 1200px 480px; }
  .menu-tabs { margin-bottom: 30px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .menu-tab { padding: 10px 12px; font-size: 1.08rem; }
  .menu-tab::after { left: 12px; right: 12px; }
  .menu-book { padding: 8px 9px 13px; margin: 0 -6px; }
  .menu-book::before { inset: 3px; }
  .menu-book::after { left: auto; right: 16%; bottom: -40px; height: 70px; width: 11px; }
  .menu-panels { --book-pad: 26px; }
  .menu-page-title { font-size: 2.35rem; }
  .menu-group-title { font-size: 1.45rem; margin-top: 30px; }
  .menu-item { padding: 11px 0 12px; }
  .menu-item-name { font-size: 1.2rem; }
  .menu-item-desc { font-size: 0.98rem; }
  .menu-item-price { font-size: 1.14rem; padding-left: 12px; }
  .menu-item-price small { display: block; margin: 0 0 1px; font-size: 0.82rem; }
  .menu-item:not(:has(.menu-item-desc)):not(:has(.menu-item-price:empty))::after { margin-left: 10px; min-width: 18px; }
  .menu-page-turn { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-tab::after { transition: none; }
}
