/* ==========================================================================
   Oishii Sushi · Menú
   Mundo: la pared roja del restaurante con shinagaki (tiras de menú de izakaya)
   Tokens: primitivo → semántico → componente
   ========================================================================== */

/* ---------- 1. Primitivos ---------- */
:root {
  --shu-400: #E2392F;
  --shu-500: #D4231C;
  --shu-600: #C8161D;
  --shu-700: #A31118;
  --shu-800: #6E0B10;
  --shu-900: #3E0609;

  --sumi-950: #0D0A09;
  --sumi-900: #15100E;
  --sumi-850: #1B1512;
  --sumi-800: #231B17;
  --sumi-700: #3A2E27;
  --sumi-500: #75665B;

  --washi-50: #F8F3EA;
  --washi-100: #EFE7D7;
  --washi-200: #E3D7C2;
  --washi-300: #CDBEA6;

  --kin-300: #DDBD82;
  --kin-400: #C49A55;
  --kin-600: #8A6631;
  --kin-700: #5E4420;

  /* ---------- 2. Semánticos ---------- */
  --color-wall: var(--shu-600);
  --color-wall-deep: var(--shu-700);
  --color-night: var(--sumi-950);
  --color-night-raised: var(--sumi-900);
  --color-paper: var(--washi-50);
  --color-paper-shade: var(--washi-100);
  --color-ink: #1A1411;
  --color-ink-soft: #5B4C42;
  --color-on-wall: var(--washi-50);
  --color-on-wall-soft: #FDEBE5;
  --color-on-night: var(--washi-100);
  --color-on-night-soft: #BCAE9E;
  --color-seal: var(--shu-600);
  --color-metal: var(--kin-400);
  --color-focus: var(--kin-300);

  --font-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  --font-ui: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brush: "Yuji Boku", "Shippori Mincho B1", "Hiragino Mincho ProN", serif;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-brush: cubic-bezier(0.45, 0.05, 0.2, 1);
  --dur-press: 140ms;
  --dur-state: 220ms;
  --dur-sheet: 460ms;

  --bar-h: 56px;
  --gutter: clamp(16px, 4.6vw, 56px);
  --z-bar: 40;
  --z-tray: 50;
  --z-toast: 60;

  /* ---------- 3. Componentes ---------- */
  --slip-w-min: 132px;
  --slip-gap: 8px;
  --slip-pad: 10px;
  --rail-h: 4px;
  --cord-len: 26px;
}

@media (min-width: 600px) {
  :root { --slip-w-min: 136px; --slip-gap: 12px; --bar-h: 60px; }
}
@media (min-width: 1200px) {
  :root { --slip-w-min: 150px; --slip-gap: 14px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-night);
  color-scheme: dark;
  scroll-padding-top: calc(var(--bar-h) + env(safe-area-inset-top) + 12px);
  scrollbar-color: var(--sumi-700) var(--sumi-950);
  scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-on-night);
  background: var(--color-night);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  caret-color: var(--shu-500);
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--shu-600); color: var(--washi-50); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.tone-wall :focus-visible, .hero :focus-visible { outline-color: var(--washi-50); }

.brush { font-family: var(--font-brush); font-weight: 400; }
.num { font-variant-numeric: tabular-nums lining-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--washi-50);
  color: var(--color-ink);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform var(--dur-state) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.icon {
  width: 22px; height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--washi-50);
  --btn-fg: var(--color-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-state) ease, color var(--dur-state) ease, border-color var(--dur-state) ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { --btn-bg: var(--sumi-950); --btn-fg: var(--washi-50); }
.btn-ghost { --btn-bg: transparent; --btn-fg: currentColor; border-color: color-mix(in srgb, currentColor 45%, transparent); }
.btn-seal { --btn-bg: var(--shu-600); --btn-fg: var(--washi-50); }
.btn-paper { --btn-bg: var(--washi-50); --btn-fg: var(--color-ink); }
.btn-block { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { --btn-bg: var(--sumi-800); }
  .btn-ghost:hover { border-color: currentColor; }
  .btn-seal:hover { --btn-bg: var(--shu-500); }
  .btn-paper:hover { --btn-bg: #fff; }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-state) ease;
}
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
}

/* ---------- Sello (hanko) ---------- */
.seal {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 3px;
  background: var(--color-seal);
  color: var(--washi-50);
  font-family: var(--font-brush);
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   Barra superior
   ========================================================================== */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-bar);
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--washi-50);
  background: rgba(13, 10, 9, 0.92);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  transition: box-shadow 320ms var(--ease-out);
}
.bar.is-solid {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 26px -14px rgba(0, 0, 0, 0.75);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 6px;
  flex: none;
  text-decoration: none;
  border-radius: 2px;
}
.brand-mark { width: 40px; height: 34px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity 260ms var(--ease-out), visibility 0s linear 260ms;
}
.bar:not(.is-solid) .brand-name { opacity: 0; visibility: hidden; }
.bar.is-solid .brand-name { transition: opacity 260ms var(--ease-out), visibility 0s; }
@media (max-width: 379px) { .brand-name { display: none; } }

.tabs {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 0 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 26px), transparent 100%);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.tabs::-webkit-scrollbar { display: none; }
.bar.is-solid .tabs { opacity: 1; transform: none; pointer-events: auto; }

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  margin: auto 0;
  padding: 0 11px;
  border: 0;
  background: none;
  color: var(--color-on-night-soft);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-state) ease;
}
.tab .brush { font-size: 1.05rem; line-height: 1; color: var(--shu-400); transition: color var(--dur-state) ease; }
.tab[aria-current="true"] { color: var(--washi-50); }
.tab[aria-current="true"] .brush { color: var(--washi-50); }
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--washi-50); }
}
.tab-ink {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 0;
  width: 1px;
  height: 36px;
  margin-top: -18px;
  background: var(--shu-600);
  border-radius: 2px;
  transform-origin: 0 50%;
  opacity: 0;
  transition: transform 420ms var(--ease-out), opacity 200ms ease;
  pointer-events: none;
}

.bar-actions { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.view-switch {
  display: inline-flex;
  align-items: stretch;
  height: 40px;
  margin: 0 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}
.view-switch button {
  min-width: 52px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-on-night-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-state) ease, color var(--dur-state) ease, transform var(--dur-press) var(--ease-out);
}
.view-switch button:active { transform: scale(0.96); }
.view-switch button[aria-pressed="true"] { background: var(--washi-50); color: var(--color-ink); }
@media (hover: hover) and (pointer: fine) {
  .view-switch button[aria-pressed="false"]:hover { color: var(--washi-50); }
}

/* teléfonos: las secciones tienen su propia fila bajo la barra */
@media (max-width: 599px) {
  html { scroll-padding-top: calc(var(--bar-h) + env(safe-area-inset-top) + 58px); }
  .tabs {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 48px;
    align-items: center;
    padding: 0 12px;
    background: rgba(13, 10, 9, 0.94);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    backdrop-filter: blur(12px) saturate(1.3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.8);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .search { z-index: calc(var(--z-bar) + 1); }
}

/* ==========================================================================
   Hero · la pared
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: calc(var(--bar-h) + env(safe-area-inset-top)) minmax(330px, 1fr) auto;
  background:
    radial-gradient(120% 70% at 18% 8%, #DA2A22 0%, rgba(218, 42, 34, 0) 60%),
    radial-gradient(90% 60% at 100% 100%, #8F0F15 0%, rgba(143, 15, 21, 0) 70%),
    var(--color-wall);
  color: var(--color-on-wall);
  overflow: clip;
  --kanji-w: min(120vw, 64svh);
  --rail-at: 0.64;
  --rail: #1A1210;
  --peg: var(--kin-400);
  --cord: #1C1310;
  --hole: var(--shu-700);
  --paper-shadow: rgba(62, 6, 9, 0.62);
  --soft: var(--color-on-wall-soft);
  --rule: rgba(255, 255, 255, 0.22);
}
.hero::before {
  /* el techo negro del local */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--bar-h) + env(safe-area-inset-top) + 18px);
  background: var(--sumi-950);
  box-shadow: 0 10px 30px 4px rgba(13, 10, 9, 0.45);
  z-index: -1;
}

.hero-petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  /* los pétalos no cruzan el texto ni los botones */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 48%, transparent 62%);
  mask-image: linear-gradient(180deg, #000 0, #000 48%, transparent 62%);
}

.hero-kanji {
  position: absolute;
  z-index: 0;
  top: calc(var(--bar-h) + env(safe-area-inset-top) + 6px);
  right: calc(var(--kanji-w) * -0.2);
  width: var(--kanji-w);
  aspect-ratio: 1;
  pointer-events: none;
}
.hero-kanji svg { width: 100%; height: 100%; overflow: visible; display: block; }
.hero-kanji text { fill: var(--sumi-950); }

.hero-stage {
  position: relative;
  z-index: 2;
  grid-row: 2;
  min-height: calc(var(--kanji-w) * var(--rail-at) + 6px + 226px);
}
.hero-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--kanji-w) * var(--rail-at) + 6px);
  padding: 0 var(--gutter);
}
.hero-rail::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: var(--rail);
  box-shadow: 0 5px 8px -3px rgba(40, 0, 3, 0.6);
}
.hero-rail .slips {
  --slip-gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 372px;
}
.hero-rail .dish::before,
.hero-rail .slip-band,
.hero-rail .slip-meta,
.hero-rail .slip-tags { display: none; }

.hero-copy {
  position: relative;
  z-index: 2;
  grid-row: 3;
  padding: 0 var(--gutter) calc(var(--s-6) + env(safe-area-inset-bottom));
  max-width: 640px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 12.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero-sub {
  margin-top: var(--s-2);
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-on-wall-soft);
}
.hero-lines {
  margin-top: var(--s-3);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 4.6vw, 1.6rem);
  line-height: 1.35;
}
.hero-lines span { display: block; }
.hero-lines span + span { padding-left: 1.4em; }
.hero-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-jp {
  position: absolute;
  z-index: 2;
  left: max(12px, env(safe-area-inset-left));
  top: calc(var(--bar-h) + env(safe-area-inset-top) + 34px);
  writing-mode: vertical-rl;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: var(--color-on-wall-soft);
}

/* teléfonos bajitos (SE, mini): el kanji y la acción caben en la primera pantalla */
@media (max-width: 599px) and (max-height: 720px) {
  .hero { --kanji-w: min(100vw, 54svh); --rail-at: 0.6; }
  .hero-stage { min-height: calc(var(--kanji-w) * var(--rail-at) + 6px + 196px); }
  .hero-rail .slip-photo { width: 80%; margin: 0 auto; }
  .hero-sub { display: none; }
  .hero-title { font-size: 2.5rem; }
  .hero-lines { font-size: 1.08rem; }
  .hero-actions { margin-top: 16px; }
  .hero-copy { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(380px, 0.9fr) 1.1fr;
    grid-template-rows: calc(var(--bar-h) + env(safe-area-inset-top)) 1fr;
    align-items: end;
  }
  .hero { --kanji-w: min(62vw, 96svh); }
  .hero-kanji {
    top: calc(var(--bar-h) + 2vh);
    right: -3vw;
  }
  .hero-petals {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 40%, #000 56%);
    mask-image: linear-gradient(90deg, transparent 0, transparent 40%, #000 56%);
  }
  .hero-stage { grid-column: 2; grid-row: 2; height: 100%; min-height: 0; }
  .hero-rail { top: 50svh; padding-left: 4vw; }
  .hero-rail .slips { max-width: none; --slip-gap: 18px; grid-template-columns: repeat(3, minmax(0, 156px)); }
  .hero-rail .slip-name { font-size: 0.98rem; }
  .hero-copy { grid-column: 1; grid-row: 2; padding-bottom: 12svh; padding-left: calc(var(--gutter) + 40px); }
  .hero-jp { top: calc(var(--bar-h) + 6svh); left: var(--gutter); right: auto; font-size: 1.15rem; }
}

/* entrada del hero: parte de un estado visible y solo añade movimiento */
@media (prefers-reduced-motion: no-preference) {
  .intro .hero-copy > * {
    animation: rise 900ms var(--ease-out) both;
  }
  .intro .hero-copy > :nth-child(2) { animation-delay: 80ms; }
  .intro .hero-copy > :nth-child(3) { animation-delay: 160ms; }
  .intro .hero-copy > :nth-child(4) { animation-delay: 240ms; }
  .intro .hero-jp { animation: rise 1100ms 300ms var(--ease-out) both; }
  .intro .hero-rail::before { animation: rail-in 900ms 900ms var(--ease-out) both; transform-origin: 0 50%; }
  .intro .hero-rail .dish { animation: hang 1500ms var(--ease-out) both; animation-delay: calc(1150ms + var(--i, 0) * 140ms); transform-origin: 50% 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
}
@keyframes rail-in {
  from { transform: scaleX(0); }
}
@keyframes hang {
  0%   { opacity: 0; transform: translateY(-46px) rotate(-7deg); }
  28%  { opacity: 1; transform: translateY(0) rotate(5deg); }
  46%  { transform: rotate(-3deg); }
  64%  { transform: rotate(1.6deg); }
  82%  { transform: rotate(-0.6deg); }
  100% { transform: rotate(0deg); }
}

/* trazos del kanji */
.hero-kanji .stroke {
  fill: none;
  stroke: #fff;
  stroke-width: 17;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kanji-mask-full { opacity: 1; }
.writing .hero-kanji .stroke {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: draw var(--d, 300ms) var(--ease-brush) forwards;
  animation-delay: var(--t, 0ms);
}
.writing .kanji-mask-full { opacity: 0; animation: settle 260ms 2760ms linear forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes settle { to { opacity: 1; } }

/* ==========================================================================
   Secciones
   ========================================================================== */
.menu-root { position: relative; }

.sect {
  position: relative;
  isolation: isolate;
  padding: var(--s-9) var(--gutter) calc(var(--s-9) + 8px);
  overflow-x: clip;
}
.tone-wall {
  background: var(--color-wall);
  color: var(--color-on-wall);
  --rail: #1A1210;
  --peg: var(--kin-400);
  --cord: #1C1310;
  --hole: var(--shu-700);
  --paper-shadow: rgba(62, 6, 9, 0.62);
  --soft: var(--color-on-wall-soft);
  --rule: rgba(255, 255, 255, 0.22);
  --kanji-ink: var(--sumi-950);
}
.tone-night {
  background: var(--color-night);
  color: var(--color-on-night);
  --rail: var(--kin-600);
  --peg: var(--kin-400);
  --cord: #B9A78C;
  --hole: var(--sumi-950);
  --paper-shadow: rgba(0, 0, 0, 0.85);
  --soft: var(--color-on-night-soft);
  --rule: rgba(255, 255, 255, 0.12);
  --kanji-ink: var(--shu-600);
}
.tone-night::before {
  /* la luz del farol: solo se enciende en la sección activa */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: min(90vh, 760px);
  background: radial-gradient(60% 70% at 30% 0%, rgba(255, 176, 92, 0.19) 0%, rgba(255, 176, 92, 0) 70%);
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
  z-index: -1;
  pointer-events: none;
}
.tone-night.is-current::before { opacity: 1; }
.tone-wall + .tone-wall, .tone-night + .tone-night { padding-top: var(--s-6); }

.sect-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: var(--s-3);
  margin-bottom: var(--s-7);
}
.sect-kanji {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: start;
  margin: -0.12em -0.04em -0.08em 0;
  font-size: clamp(6.25rem, 29vw, 15rem);
  line-height: 1;
  color: var(--kanji-ink);
  user-select: none;
}
.sect-title {
  grid-column: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 6.8vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}
.sect-reading {
  grid-column: 1;
  margin-top: var(--s-2);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 0;
  color: var(--soft);
}
.sect-reading .brush { font-size: 1.15rem; color: inherit; white-space: nowrap; word-break: keep-all; }
.sect-reading .romaji { white-space: nowrap; }
.sect-reading .romaji { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.12em; }
.sect-lede {
  grid-column: 1;
  margin-top: var(--s-3);
  max-width: 40ch;
  color: var(--soft);
  font-size: 0.98rem;
  line-height: 1.6;
}
.sect-status {
  grid-column: 1;
  margin-top: var(--s-4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.sect-status .lamp {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--washi-300);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.sect-status.is-open .lamp {
  background: var(--kin-300);
  box-shadow: 0 0 0 3px rgba(221, 189, 130, 0.25), 0 0 12px 2px rgba(255, 196, 120, 0.55);
}

@media (min-width: 1000px) {
  .sect {
    display: grid;
    grid-template-columns: minmax(250px, 27%) minmax(0, 1fr);
    column-gap: clamp(32px, 5vw, 88px);
    align-items: start;
  }
  .sect-head {
    position: sticky;
    top: calc(var(--bar-h) + 40px);
    display: block;
    margin-bottom: 0;
  }
  .sect-kanji {
    display: block;
    margin: -0.1em 0 0.02em -0.06em;
    font-size: clamp(9rem, 15vw, 15rem);
  }
  .sect-title { font-size: clamp(2.2rem, 3.2vw, 3.2rem); }
}

/* entrada de tinta para el kanji de sección */
@media (prefers-reduced-motion: no-preference) {
  .js .sect-kanji {
    -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 55%);
    mask-image: linear-gradient(180deg, #000 45%, transparent 55%);
    -webkit-mask-size: 100% 260%;
    mask-size: 100% 260%;
    -webkit-mask-position: 0 100%;
    mask-position: 0 100%;
    transition: -webkit-mask-position 1100ms var(--ease-brush), mask-position 1100ms var(--ease-brush);
  }
  .js .sect-kanji.is-inked {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

/* ==========================================================================
   Tiras (shinagaki): tanzaku angostos, colgados hombro con hombro
   ========================================================================== */
.slips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--slip-gap);
  row-gap: 26px;
  align-items: start;
}
@media (min-width: 600px) {
  .slips { grid-template-columns: repeat(auto-fill, minmax(var(--slip-w-min), 1fr)); row-gap: var(--s-6); }
}

.dish {
  position: relative;
  padding-top: calc(var(--cord-len) + 6px);
}
.dish::before {
  /* el riel: una barra lisa por fila */
  content: "";
  position: absolute;
  top: 4px;
  left: calc(var(--slip-gap) / -2 - 1px);
  right: calc(var(--slip-gap) / -2 - 1px);
  height: var(--rail-h);
  background: var(--rail);
  box-shadow: 0 4px 6px -3px rgba(0, 0, 0, 0.55);
}

.slip {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  text-align: left;
  transform-origin: 50% calc(var(--cord-len) * -1);
  transform: rotate(var(--tilt, 0deg));
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.slip-cord {
  /* el cordel baja del riel y entra por el agujero de la tira */
  position: absolute;
  z-index: 2;
  top: calc(var(--cord-len) * -1 - 2px);
  left: 50%;
  width: 1.5px;
  height: calc(var(--cord-len) + 13.5px);
  margin-left: -0.75px;
  background: var(--cord);
  pointer-events: none;
}
.slip-cord::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 9px; height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--peg);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.5);
}

.slip-paper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  padding: 19px 7px 10px;
  background: url("img/washi.webp") var(--px, 0) var(--py, 0) / 256px repeat, var(--color-paper);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.16),
    0 14px 22px -14px var(--paper-shadow);
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-state) var(--ease-out);
}
@media (min-width: 600px) {
  .slip-paper { padding: 20px 9px 12px; }
}
.slip-hole {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 50%;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--hole);
  box-shadow: inset 0 1px 1.5px rgba(0, 0, 0, 0.45), 0 0.5px 0 rgba(255, 255, 255, 0.6);
}

/* el nombre a pincel, en vertical: la tira mide lo que mide el nombre */
.slip-band {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 6px 0 12px;
}
.band-text {
  writing-mode: vertical-rl;
  white-space: nowrap;
  font-size: calc(var(--bs, 22) * 1cqw);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--color-ink);
}
.has-photo .band-text { font-size: calc(var(--bs, 22) * 0.8cqw); color: #2A211C; }
.slip-band .rakkan {
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 16px; height: 16px;
  font-size: 10.5px;
  border-radius: 2px;
}

.slip-photo {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--washi-200);
}
.slip-photo img { width: 100%; height: 100%; object-fit: cover; }
.slip-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(26, 20, 17, 0.12);
  pointer-events: none;
}

.seals {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.seals .seal { width: 18px; height: 18px; font-size: 11.5px; border-radius: 2px; }

.slip-body {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}
.slip-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.2;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.slip-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-ink-soft);
}
.slip-meta, .slip-tags {
  margin-top: 3px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-ink-soft);
}
.slip-meta { display: none; }
.slip-tags { color: var(--shu-700); font-weight: 500; }
.slip-desc {
  display: none;
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
  max-width: 68ch;
}
.slip-price {
  position: relative;
  margin-top: 7px;
  padding-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums lining-nums;
}
.slip-price::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(26, 20, 17, 0.14);
}
.slip-price .vline {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.82rem;
}
.slip-price .vline span:first-child {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--color-ink-soft);
}
.slip-price .ask {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

@media (min-width: 600px) {
  .slip-name { font-size: 0.98rem; }
  .slip-meta { display: block; }
  .slip-price { font-size: 1.02rem; }
  .slip-price .vline { font-size: 0.9rem; }
  .slip-price .vline span:first-child { font-size: 0.78rem; }
}

/* sello "elegido" */
.slip-stamp {
  position: absolute;
  z-index: 2;
  right: 5px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 2px solid var(--shu-600);
  border-radius: 3px;
  color: var(--shu-600);
  font-family: var(--font-brush);
  font-size: 18px;
  line-height: 1;
  transform: rotate(-9deg);
  opacity: 0;
  pointer-events: none;
}
.slip-stamp b {
  position: absolute;
  right: -9px;
  top: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--shu-600);
  color: var(--washi-50);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  transform: rotate(9deg);
}
.slip-stamp b:empty { display: none; }
.dish.is-selected .slip-stamp { opacity: 0.92; }
.dish.just-stamped .slip-stamp { animation: stamp 420ms var(--ease-out); }
@keyframes stamp {
  0%   { opacity: 0; transform: rotate(-16deg) scale(1.9); filter: blur(3px); }
  55%  { opacity: 1; transform: rotate(-8deg) scale(0.94); filter: blur(0); }
  100% { opacity: 0.92; transform: rotate(-9deg) scale(1); }
}

/* interacción */
@media (hover: hover) and (pointer: fine) {
  .slip:hover .slip-paper {
    transform: translateY(3px);
    box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.16),
      0 20px 28px -16px var(--paper-shadow);
  }
}
.slip:active .slip-paper { transform: translateY(2px) scale(0.985); }
.slip:focus-visible { outline: none; }
.slip:focus-visible .slip-paper { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.tone-wall .slip:focus-visible .slip-paper, .hero .slip:focus-visible .slip-paper { outline-color: var(--washi-50); }

/* ---------- Vista de lista ---------- */
.menu-root[data-view="list"] .sect .slips {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0;
}
@media (min-width: 1300px) {
  .menu-root[data-view="list"] .sect .slips { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}
.menu-root[data-view="list"] .sect .dish { padding-top: 0; }
.menu-root[data-view="list"] .sect .dish::before,
.menu-root[data-view="list"] .sect .slip-cord,
.menu-root[data-view="list"] .sect .slip-hole,
.menu-root[data-view="list"] .sect .seals,
.menu-root[data-view="list"] .sect .rakkan,
.menu-root[data-view="list"] .sect .has-photo .slip-band { display: none; }
.menu-root[data-view="list"] .sect .slip { transform: none !important; color: inherit; }
.menu-root[data-view="list"] .sect .slip-paper {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 16px 0;
  background: none;
  box-shadow: none;
  border-bottom: 1px solid var(--rule);
  container-type: normal;
}
.menu-root[data-view="list"] .sect .slip-photo,
.menu-root[data-view="list"] .sect .slip-band { grid-column: 1; grid-row: 1; }
.menu-root[data-view="list"] .sect .slip-band {
  width: 72px;
  height: 72px;
  padding: 6px;
  align-items: center;
  background: url("img/washi.webp") 0 0 / 256px repeat, var(--color-paper);
}
.menu-root[data-view="list"] .sect .band-text {
  font-size: 15px;
  white-space: normal;
  max-height: 60px;
  line-break: strict;
}
.menu-root[data-view="list"] .sect .slip-body { grid-column: 2; grid-row: 1; padding-top: 0; }
.menu-root[data-view="list"] .sect .slip-name { font-size: 1.08rem; padding-right: 92px; }
.menu-root[data-view="list"] .sect .slip-sub,
.menu-root[data-view="list"] .sect .slip-meta { display: block; color: var(--soft); }
.menu-root[data-view="list"] .sect .slip-tags { color: var(--soft); }
.menu-root[data-view="list"] .sect .slip-desc { display: block; }
.menu-root[data-view="list"] .sect .slip-price {
  position: absolute;
  top: 16px;
  right: 0;
  margin: 0;
  padding: 0;
  font-size: 1.06rem;
  text-align: right;
  align-items: flex-end;
}
.menu-root[data-view="list"] .sect .slip-price::before { display: none; }
.menu-root[data-view="list"] .sect .slip-price .vline span:first-child { color: var(--soft); }
.menu-root[data-view="list"] .sect .slip-stamp { right: 0; bottom: 14px; }
@media (hover: hover) and (pointer: fine) {
  .menu-root[data-view="list"] .sect .slip:hover .slip-paper { transform: none; box-shadow: none; }
  .menu-root[data-view="list"] .sect .slip:hover .slip-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
}
.menu-root[data-view="list"] .sect .slip:active .slip-paper { transform: none; }

/* ==========================================================================
   Bebidas · la tabla de madera
   ========================================================================== */
.tone-board {
  background:
    radial-gradient(80% 60% at 70% 0%, rgba(255, 176, 92, 0.08), rgba(255, 176, 92, 0) 70%),
    var(--sumi-900);
  color: var(--color-on-night);
  --soft: var(--color-on-night-soft);
  --rule: rgba(255, 255, 255, 0.12);
  --kanji-ink: var(--shu-600);
}
.board {
  columns: 1;
  column-gap: 48px;
}
@media (min-width: 700px) { .board { columns: 2; } }
@media (min-width: 1300px) { .board { columns: 3; } }
.board-group {
  break-inside: avoid;
  margin-bottom: var(--s-7);
}
.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--kin-600);
}
.board-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
}
.board-head .brush { flex: none; font-size: 1rem; color: var(--kin-300); white-space: nowrap; word-break: keep-all; }
.drinks { list-style: none; margin: 0; padding: 0; }
.drinks li[hidden] { display: none; }
.drink {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out);
}
.drink:active { transform: scale(0.985); }
.drink-name { font-size: 1rem; line-height: 1.35; }
.drink-name small { display: block; font-size: 0.8rem; color: var(--soft); }
.drink-name .seal { width: 18px; height: 18px; font-size: 11px; margin-left: 6px; vertical-align: 2px; }
.drink-dots {
  flex: 1;
  min-width: 16px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.28);
  transform: translateY(-4px);
}
.drink-price { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }
.drink-qty {
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--shu-600);
  color: var(--washi-50);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  align-self: center;
}
.drink.is-selected .drink-qty { display: inline-block; }
.drink.just-stamped .drink-qty { animation: stamp 420ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .drink:hover .drink-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
}

/* ==========================================================================
   Búsqueda
   ========================================================================== */
.search {
  position: fixed;
  z-index: calc(var(--z-bar) - 1);
  top: calc(var(--bar-h) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  padding: 12px var(--gutter) 16px;
  background: rgba(13, 10, 9, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.9);
  transform: translateY(-110%);
  visibility: hidden;
  transition: transform 300ms var(--ease-out), visibility 0s linear 300ms;
}
.search.is-open {
  transform: none;
  visibility: visible;
  transition: transform 380ms var(--ease-drawer), visibility 0s;
}
.search-row { display: flex; gap: 8px; align-items: center; max-width: 900px; margin: 0 auto; }
.search-field {
  position: relative;
  flex: 1;
}
.search-field .icon { position: absolute; left: 14px; top: 50%; margin-top: -11px; color: var(--soft, #BCAE9E); pointer-events: none; }
.search-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: var(--sumi-850);
  color: var(--washi-50);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--dur-state) ease;
}
.search-input::placeholder { color: #9E8F80; }
.search-input:focus { border-color: var(--kin-400); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 900px; margin: 12px auto 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--washi-100);
  font-size: 0.875rem;
  transition: background-color var(--dur-state) ease, border-color var(--dur-state) ease, transform var(--dur-press) var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip .seal { width: 18px; height: 18px; font-size: 11px; }
.chip[aria-pressed="true"] { background: var(--shu-600); border-color: var(--shu-600); color: var(--washi-50); }
.search-count { max-width: 900px; margin: 10px auto 0; font-size: 0.875rem; color: #BCAE9E; min-height: 1.4em; }

.empty {
  padding: var(--s-9) var(--gutter);
  text-align: center;
  background: var(--color-night);
}
.empty .brush { display: block; font-size: 4rem; color: var(--shu-600); line-height: 1; }
.empty h2 { margin-top: var(--s-4); font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.empty p { margin: var(--s-2) auto 0; max-width: 40ch; color: var(--color-on-night-soft); }
.empty .btn { margin-top: var(--s-5); }

/* ==========================================================================
   Cierre
   ========================================================================== */
.closing {
  position: relative;
  padding: 0 var(--gutter) calc(var(--s-10) + env(safe-area-inset-bottom));
  background: var(--sumi-950);
  color: var(--color-on-night);
  overflow: clip;
}
.seigaiha {
  /* olas seigaiha: el mar de Puntarenas en patrón japonés */
  --w: var(--sumi-950);
  --l: #2A211C;
  display: block;
  height: 80px;
  margin: 0 calc(var(--gutter) * -1) var(--s-8);
  background-color: var(--w);
  background-image:
    radial-gradient(circle at 100% 150%, var(--w) 24%, var(--l) 24%, var(--l) 28%, var(--w) 28%, var(--w) 36%, var(--l) 36%, var(--l) 40%, transparent 40%, transparent),
    radial-gradient(circle at 0 150%, var(--w) 24%, var(--l) 24%, var(--l) 28%, var(--w) 28%, var(--w) 36%, var(--l) 36%, var(--l) 40%, transparent 40%, transparent),
    radial-gradient(circle at 50% 100%, var(--l) 10%, var(--w) 10%, var(--w) 23%, var(--l) 23%, var(--l) 30%, var(--w) 30%, var(--w) 43%, var(--l) 43%, var(--l) 50%, var(--w) 50%, var(--w) 63%, var(--l) 63%, var(--l) 71%, transparent 71%, transparent),
    radial-gradient(circle at 100% 50%, var(--l) 5%, var(--w) 5%, var(--w) 15%, var(--l) 15%, var(--l) 20%, var(--w) 20%, var(--w) 29%, var(--l) 29%, var(--l) 34%, var(--w) 34%, var(--w) 40%, transparent 40%, transparent),
    radial-gradient(circle at 0 50%, var(--l) 5%, var(--w) 5%, var(--w) 15%, var(--l) 15%, var(--l) 20%, var(--w) 20%, var(--w) 29%, var(--l) 29%, var(--l) 34%, var(--w) 34%, var(--w) 40%, transparent 40%, transparent);
  background-size: 64px 32px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
  mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.closing-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.closing .mark-lg { width: 120px; height: 102px; }
.closing-jp {
  margin-top: var(--s-5);
  writing-mode: vertical-rl;
  font-size: 1.6rem;
  letter-spacing: 0.18em;
  color: var(--shu-500);
  height: auto;
  white-space: nowrap;
}
.closing h2 {
  margin-top: var(--s-5);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.1;
  text-wrap: balance;
}
.closing-lede { margin-top: var(--s-3); color: var(--color-on-night-soft); max-width: 42ch; }
.closing .btn { margin-top: var(--s-5); }
.closing-notes {
  list-style: none;
  margin: var(--s-7) 0 0;
  padding: var(--s-5) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--color-on-night-soft);
}
.closing-sign {
  margin-top: var(--s-6);
  font-family: var(--font-display);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8E8072;
}

/* ==========================================================================
   Bandeja "Mi selección"
   ========================================================================== */
.tray {
  position: fixed;
  z-index: var(--z-tray);
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(calc(100vw - 24px), 460px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: var(--sumi-900);
  color: var(--washi-50);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 0);
  transition: transform 420ms var(--ease-drawer), opacity 220ms var(--ease-out), visibility 0s;
}
.tray[data-state="hidden"] {
  transform: translate(-50%, calc(100% + 40px));
  opacity: 0;
  visibility: hidden;
  transition: transform 260ms var(--ease-out), opacity 200ms var(--ease-out), visibility 0s linear 260ms;
}
.tray-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 4px;
  background: var(--shu-600);
  font-family: var(--font-brush);
  font-size: 24px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}
.tray-count {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--washi-50);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.tray-count.tick { animation: tick 360ms var(--ease-out); }
@keyframes tick {
  0% { transform: scale(0.6); filter: blur(2px); opacity: 0.4; }
  60% { transform: scale(1.15); filter: blur(0); opacity: 1; }
  100% { transform: scale(1); }
}
.tray-text { flex: 1; min-width: 0; line-height: 1.25; }
.tray-text strong { display: block; font-family: var(--font-display); font-size: 1rem; }
.tray-text span { font-size: 0.875rem; color: var(--color-on-night-soft); font-variant-numeric: tabular-nums; }
.tray .btn { min-height: 44px; padding: 0 18px; }

/* ==========================================================================
   Hojas (dialog)
   ========================================================================== */
dialog { padding: 0; border: 0; max-width: none; max-height: none; color: inherit; background: transparent; }

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0;
  width: 100%;
  max-height: min(94dvh, 100%);
  display: flex;
  flex-direction: column;
  background: url("img/washi.webp") 0 0 / 256px repeat, var(--color-paper);
  color: var(--color-ink);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  overscroll-behavior: contain;
  transform: translateY(0);
  transition:
    transform var(--dur-sheet) var(--ease-drawer),
    overlay var(--dur-sheet) allow-discrete,
    display var(--dur-sheet) allow-discrete;
}
.sheet:not([open]) {
  display: none;
  transform: translateY(100%);
  transition-duration: 280ms;
  transition-timing-function: var(--ease-out);
}
@starting-style {
  .sheet[open] { transform: translateY(100%); }
}
.sheet::backdrop {
  background: rgba(8, 5, 4, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 1;
  transition: opacity 320ms ease, overlay 320ms allow-discrete, display 320ms allow-discrete;
}
.sheet:not([open])::backdrop { opacity: 0; }
@starting-style {
  .sheet[open]::backdrop { opacity: 0; }
}
.sheet.no-anim, .sheet.no-anim::backdrop { transition: none !important; }
.sheet.is-dragging { transition: none; }

.sheet-grip {
  position: absolute;
  z-index: 3;
  top: 0; left: 0; right: 0;
  height: 28px;
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: grab;
}
.sheet-grip::before {
  content: "";
  width: 44px; height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.sheet-close {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  background: rgba(248, 243, 234, 0.92);
  color: var(--color-ink);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
@media (hover: hover) and (pointer: fine) {
  .sheet-close:hover { background: #fff; }
}
.sheet-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ficha del plato */
.dish-fig {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 0.86;
  background: var(--washi-200);
  overflow: hidden;
}
.dish-fig img { width: 100%; height: 100%; object-fit: cover; }
.dish-fig .dish-callig {
  position: absolute;
  inset: 0;
  container-type: size;
  display: grid;
  place-items: center;
  background: url("img/washi.webp") 0 0 / 256px repeat, var(--color-paper-shade);
}
.dish-callig .brush {
  writing-mode: vertical-rl;
  font-size: var(--fs, 20cqh);
  line-height: 1.12;
  max-height: 82%;
  line-break: strict;
  word-break: normal;
  color: var(--color-ink);
}
.dish-callig .rakkan { position: absolute; left: 18px; bottom: 18px; width: 30px; height: 30px; font-size: 19px; }
.dish-fig .dish-stamp {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border: 3px solid var(--shu-600);
  border-radius: 4px;
  background: rgba(248, 243, 234, 0.82);
  color: var(--shu-600);
  font-family: var(--font-brush);
  font-size: 34px;
  transform: rotate(-9deg);
  opacity: 0;
}
.dish-sheet.is-selected .dish-stamp { opacity: 1; }
.dish-sheet.just-stamped .dish-stamp { animation: stamp 440ms var(--ease-out); }

.dish-info {
  position: relative;
  padding: var(--s-5) calc(var(--s-5) + 34px) calc(var(--s-5) + env(safe-area-inset-bottom)) var(--s-5);
}
.dish-jp {
  position: absolute;
  top: calc(var(--s-5) + 4px);
  right: var(--s-5);
  writing-mode: vertical-rl;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--shu-600);
  max-height: 9em;
  overflow: hidden;
}
.dish-sheet.no-photo .dish-jp { display: none; }
.dish-sheet.no-photo .dish-info { padding-right: var(--s-5); }
.dish-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6.6vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.dish-sub { margin-top: 4px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--color-ink-soft); }
.dish-meta {
  margin-top: var(--s-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-ink-soft);
}
.dish-meta .tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--color-ink); }
.dish-desc {
  grid-column: 1 / -1;
  margin-top: var(--s-4);
  font-size: 1.02rem;
  line-height: 1.68;
  max-width: 60ch;
}
.dish-variants {
  grid-column: 1 / -1;
  margin: var(--s-5) 0 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dish-variants legend { width: 100%; margin-bottom: 8px; font-size: 0.875rem; font-weight: 700; color: var(--color-ink-soft); }
.variant {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(26, 20, 17, 0.25);
  border-radius: 2px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color var(--dur-state) ease, border-color var(--dur-state) ease, color var(--dur-state) ease;
}
.variant input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.variant .num { font-family: var(--font-display); font-weight: 700; }
.variant:has(input:checked) { background: var(--sumi-950); border-color: var(--sumi-950); color: var(--washi-50); }
.variant:has(input:focus-visible) { outline: 2px solid var(--shu-600); outline-offset: 2px; }

.dish-foot {
  grid-column: 1 / -1;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(26, 20, 17, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.dish-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.dish-price small { display: block; margin-top: 6px; font-family: var(--font-ui); font-weight: 400; font-size: 0.78rem; color: var(--color-ink-soft); }
.dish-actions { display: flex; align-items: center; gap: 10px; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(26, 20, 17, 0.25);
  border-radius: 2px;
}
.qty .icon-btn { color: var(--color-ink); }
@media (hover: hover) and (pointer: fine) {
  .qty .icon-btn:hover { background: rgba(26, 20, 17, 0.06); }
}
.qty output {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dish-note { grid-column: 1 / -1; margin-top: var(--s-4); font-size: 0.8rem; color: var(--color-ink-soft); }

@media (min-width: 900px) {
  .sheet {
    inset: 0;
    margin: auto;
    width: min(960px, calc(100vw - 64px));
    max-height: min(88vh, 720px);
    border-radius: 4px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
    transform: none;
    opacity: 1;
    transition:
      transform 320ms var(--ease-out),
      opacity 240ms var(--ease-out),
      overlay 320ms allow-discrete,
      display 320ms allow-discrete;
  }
  .sheet:not([open]) { transform: scale(0.97); opacity: 0; transition-duration: 200ms; }
  @starting-style {
    .sheet[open] { transform: translateY(12px) scale(0.97); opacity: 0; }
  }
  .sheet-grip { display: none; }
  .dish-sheet .sheet-scroll { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100%; }
  .dish-fig { aspect-ratio: auto; min-height: 100%; }
  .dish-info { padding: var(--s-7) var(--s-6) var(--s-6); align-content: start; }
}

/* selección */
.sel-head {
  padding: var(--s-6) var(--s-5) var(--s-4);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(26, 20, 17, 0.12);
}
.sel-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1.1; }
.sel-head p { margin-top: 4px; font-size: 0.875rem; color: var(--color-ink-soft); }
.sel-head .brush { flex: none; font-size: 1.05rem; line-height: 1.3; color: var(--shu-600); }
.sel-list { list-style: none; margin: 0; padding: 0 var(--s-5); }
.sel-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(26, 20, 17, 0.1);
}
.sel-item-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.sel-item-name small { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 0.82rem; color: var(--color-ink-soft); }
.sel-item-total { grid-column: 1; font-size: 0.875rem; color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }
.sel-item .qty { grid-column: 2; grid-row: 1 / span 2; }
.sel-sum {
  margin: 0;
  padding: var(--s-4) var(--s-5) 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-variant-numeric: tabular-nums;
}
.sel-sum dt { color: var(--color-ink-soft); }
.sel-sum dd { margin: 0; text-align: right; }
.sel-sum .total { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--color-ink); }
.sel-note { padding: 6px var(--s-5) 0; font-size: 0.8rem; color: var(--color-ink-soft); }
.sel-actions {
  padding: var(--s-5) var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}
.btn-text {
  justify-self: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--shu-700);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

/* modo salonero */
.waiter {
  inset: 0;
  width: 100%;
  max-height: none;
  height: 100dvh;
  border-radius: 0;
  background: var(--washi-50);
}
@media (min-width: 900px) {
  .waiter { width: 100vw; max-height: none; height: 100dvh; border-radius: 0; }
}
.waiter-inner { padding: var(--s-7) var(--s-5) var(--s-8); max-width: 760px; margin: 0 auto; }
.waiter-inner h2 { font-family: var(--font-display); font-weight: 800; font-size: 2rem; }
.waiter-table {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}
.waiter-table input {
  width: 4.2em;
  height: 56px;
  padding: 0 12px;
  border: 2px solid rgba(26, 20, 17, 0.3);
  border-radius: 2px;
  background: #fff;
  color: var(--color-ink);
  font: inherit;
  text-align: center;
  outline: none;
  transition: border-color var(--dur-state) ease;
}
.waiter-table input:focus { border-color: var(--shu-600); }
.waiter-list { list-style: none; margin: var(--s-5) 0 0; padding: 0; }
.waiter-list li {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 2px solid rgba(26, 20, 17, 0.12);
  font-size: 1.45rem;
  line-height: 1.3;
}
.waiter-list b { font-family: var(--font-display); font-weight: 800; min-width: 2.2em; color: var(--shu-600); }
.waiter-list small { display: block; font-size: 1rem; color: var(--color-ink-soft); }

/* aviso */
.toast {
  position: fixed;
  z-index: var(--z-toast);
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: 8px;
  background: var(--washi-50);
  color: var(--color-ink);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, 16px);
  opacity: 0;
  visibility: hidden;
  transition: transform 260ms var(--ease-out), opacity 200ms ease, visibility 0s linear 260ms;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 360ms var(--ease-out), opacity 220ms ease, visibility 0s; }
.toast button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 2px; background: var(--sumi-950); color: var(--washi-50); font-weight: 700; font-size: 0.85rem; }
.toast:empty { display: none; }

/* ==========================================================================
   Transiciones de vista (foto compartida tira → ficha)
   ========================================================================== */
::view-transition-group(*) {
  animation-duration: 480ms;
  animation-timing-function: var(--ease-drawer);
}
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 280ms; }
::view-transition-new(dish-sheet) { animation: vt-sheet-in 480ms var(--ease-drawer) both; }
::view-transition-old(dish-sheet) { animation: vt-sheet-out 260ms var(--ease-out) both; }
::view-transition-image-pair(dish-photo) { isolation: auto; }
::view-transition-old(dish-photo),
::view-transition-new(dish-photo) { animation: none; mix-blend-mode: normal; height: 100%; object-fit: cover; }
@keyframes vt-sheet-in { from { transform: translateY(100%); } }
@keyframes vt-sheet-out { to { transform: translateY(100%); } }
@media (min-width: 900px) {
  @keyframes vt-sheet-in { from { transform: translateY(14px) scale(0.97); opacity: 0; } }
  @keyframes vt-sheet-out { to { transform: scale(0.98); opacity: 0; } }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .slip { transform: none !important; }
  .sheet, .sheet:not([open]) { transform: none; transition: opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete; }
  .sheet:not([open]) { opacity: 0; }
  @starting-style { .sheet[open] { transform: none; opacity: 0; } }
  .tray, .tray[data-state="hidden"] { transform: translate(-50%, 0); }
  .search, .search.is-open { transform: none; transition: visibility 0s, opacity 200ms ease; }
  .search { opacity: 0; }
  .search.is-open { opacity: 1; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@media print {
  .bar, .tray, .search, .hero-petals, .hero-stage, .toast { display: none !important; }
  .hero { min-height: auto; }
  .sect { break-inside: avoid-page; }
}
