/* ============================================================
   Chồ — The River's Heritage — Menu Styles
   ============================================================ */

:root {
  --terracotta: #a8452f;
  --terracotta-deep: #8a3624;
  --terracotta-darker: #6e2a1c;
  --maroon: #7a2618;
  --maroon-soft: #9c3a28;
  --cream: #f4ead9;
  --cream-soft: #faf4e9;
  --cream-dim: #ece0cc;
  --ink: #3a2115;
  --ink-soft: #6b4a38;
  --gold: #c99354;
  --gold-soft: #e0bd8b;
  --shadow-color: 20, 8, 4;

  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-name: 'Cormorant Garamond', 'Georgia', serif;
  --font-ui: 'Jost', 'Helvetica Neue', sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--terracotta);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- decorative ring / wave background ---------- */
.ring-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.16;
}
.ring-field svg { width: 100%; height: 100%; }

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(168, 69, 47, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244, 234, 217, 0.18);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 10px 30px -12px rgba(0,0,0,0.35); }

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream-soft);
  text-decoration: none;
}
.brand .brand-mark { width: 34px; height: 34px; color: var(--cream-soft); }
.brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand .brand-tagline {
  display: block;
  font-family: var(--font-name);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--gold-soft);
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  background: rgba(58, 21, 15, 0.25);
  border-radius: 999px;
  padding: 4px;
}
.lang-btn {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  padding: 7px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(244, 234, 217, 0.75);
  font-size: 0.78rem;
  font-family: var(--font-ui);
  transition: color 0.25s var(--ease);
}
.lang-btn .flag {
  width: 20px; height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
  flex: none;
}
.lang-btn .code { display: none; letter-spacing: 0.05em; text-transform: uppercase; }
.lang-btn.active { color: var(--cream-soft); }
.lang-btn:hover { color: var(--cream-soft); }

.lang-indicator {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: 40px;
  background: var(--cream-soft);
  border-radius: 999px;
  z-index: 1;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.4);
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
}

@media (min-width: 640px) {
  .lang-btn .code { display: inline; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 64px 24px 96px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--cream));
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; }

.hero-mark {
  width: 68px; height: 68px;
  margin: 0 auto 18px;
  color: var(--cream-soft);
  animation: spin-slow 40s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.hero-eyebrow {
  font-family: var(--font-name);
  font-style: italic;
  color: var(--gold-soft);
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.hero-title {
  font-family: var(--font-display);
  color: var(--cream-soft);
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.95;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.hero-sub {
  font-family: var(--font-name);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(244, 234, 217, 0.88);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}
.hero-divider {
  width: 64px; height: 1px;
  background: var(--gold-soft);
  margin: 28px auto;
  opacity: 0.6;
}
.scroll-hint {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244, 234, 217, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scroll-hint svg { width: 14px; height: 14px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ============================================================
   CATEGORY NAV
   ============================================================ */
.cat-nav-wrap {
  position: sticky;
  top: var(--header-h, 61px);
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dim);
}
.cat-nav {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 20px;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-btn {
  flex: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
}
.cat-nav-btn:hover { background: var(--cream-dim); color: var(--maroon); }
.cat-nav-btn.active {
  background: var(--terracotta);
  color: var(--cream-soft);
  border-color: var(--terracotta);
  box-shadow: 0 6px 16px -6px rgba(168,69,47,0.6);
}

/* ============================================================
   MAIN / SECTIONS
   ============================================================ */
main { background: var(--cream); position: relative; }

.category-section { padding: 72px 24px 20px; max-width: 1240px; margin: 0 auto; }
.category-section:first-of-type { padding-top: 56px; }

.cat-header { text-align: center; margin-bottom: 44px; }
.cat-header .cat-icon {
  width: 40px; height: 40px;
  margin: 0 auto 14px;
  color: var(--gold);
}
.cat-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  color: var(--maroon);
  margin: 0 0 4px;
  line-height: 1.05;
}
.cat-header .cat-title-en {
  display: block;
  font-family: var(--font-name);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.cat-header p {
  font-family: var(--font-name);
  font-style: italic;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto;
  font-size: 1.02rem;
  line-height: 1.6;
}
.cat-header .cat-rule {
  width: 46px; height: 2px;
  background: var(--gold);
  margin: 18px auto 0;
  border-radius: 2px;
}

/* dish grid + card */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 28px;
}
@media (max-width: 980px) { .dish-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .dish-grid { grid-template-columns: 1fr; } }

.dish-card {
  position: relative;
  background: var(--cream-soft);
  border: 1px solid rgba(122, 38, 24, 0.08);
  border-radius: var(--radius-md);
  padding: 0;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.dish-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 40px -18px rgba(122, 38, 24, 0.35);
  border-color: rgba(201, 147, 84, 0.4);
}

/* dish illustration media */
.dish-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 140% at 30% 20%, color-mix(in srgb, var(--accent) 55%, white 15%) 0%, var(--accent) 62%, color-mix(in srgb, var(--accent) 80%, black 25%) 100%);
  color: var(--cream-soft);
  overflow: hidden;
  flex: none;
}
.dish-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 18px 18px, rgba(255,255,255,0.35) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  opacity: 0.18;
  mix-blend-mode: overlay;
}
.dish-media-ring {
  position: absolute;
  width: 68%; height: 68%;
  opacity: 0.35;
  transition: transform 0.5s var(--ease);
}
.dish-media-icon {
  position: relative;
  width: 34%; height: 34%;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
  transition: transform 0.45s var(--ease);
}
.dish-card:hover .dish-media-icon { transform: scale(1.1) rotate(-3deg); }
.dish-card:hover .dish-media-ring { transform: scale(1.12) rotate(8deg); }

.dish-body {
  padding: 18px 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dish-card .dish-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a7a4a;
  background: rgba(90, 140, 90, 0.12);
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 10px;
  width: fit-content;
}
.dish-card .dish-tag svg { width: 10px; height: 10px; }

.dish-card h3 {
  font-family: var(--font-name);
  font-style: italic;
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--maroon);
  margin: 0 0 3px;
  line-height: 1.25;
}
.dish-card .dish-name-alt {
  display: block;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.76rem;
  color: var(--ink-soft);
  opacity: 0.8;
  margin-bottom: 12px;
}
.dish-card .dish-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
}
.dish-card .dish-price {
  font-family: var(--font-display);
  color: var(--terracotta-deep);
  font-size: 1.05rem;
}
.dish-card .dish-cta {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.25s var(--ease);
}
.dish-card:hover .dish-cta { gap: 9px; }
.dish-card .dish-cta svg { width: 12px; height: 12px; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.dish-grid .reveal:nth-child(2) { transition-delay: 0.05s; }
.dish-grid .reveal:nth-child(3) { transition-delay: 0.1s; }
.dish-grid .reveal:nth-child(4) { transition-delay: 0.15s; }
.dish-grid .reveal:nth-child(5) { transition-delay: 0.2s; }
.dish-grid .reveal:nth-child(6) { transition-delay: 0.25s; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 12, 8, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--cream-soft);
  border-radius: var(--radius-lg);
  padding: 0;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.5);
}
.modal-overlay.open .modal-card { transform: scale(1) translateY(0); opacity: 1; }

.modal-sheet-handle { display: none; }

.modal-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}
.modal-media .dish-media-icon { width: 26%; height: 26%; }

.modal-body { padding: 30px 34px 34px; text-align: center; }

.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--maroon);
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.3);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.modal-close:hover { background: var(--terracotta); color: var(--cream-soft); transform: rotate(90deg); }
.modal-close svg { width: 16px; height: 16px; }

.modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a7a4a;
  background: rgba(90, 140, 90, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 0 auto 14px;
  width: fit-content;
}
.modal-card h2 {
  font-family: var(--font-name);
  font-style: italic;
  font-weight: 600;
  color: var(--maroon);
  font-size: 1.9rem;
  text-align: center;
  margin: 0 0 4px;
  line-height: 1.2;
}
.modal-card .modal-name-alt {
  display: block;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.modal-rule {
  width: 40px; height: 1px;
  background: var(--gold-soft);
  margin: 0 auto 20px;
}
.modal-card .modal-desc {
  font-family: var(--font-name);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--ink);
  text-align: center;
  margin: 0 0 26px;
}
.modal-ingredients {
  background: var(--cream-dim);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 24px;
}
.modal-ingredients .label {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
  display: block;
}
.modal-ingredients .value {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.modal-price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.modal-price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--terracotta-deep);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--terracotta-darker);
  color: rgba(244, 234, 217, 0.82);
  padding: 56px 24px 34px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.footer-mark { width: 46px; height: 46px; margin: 0 auto 16px; color: var(--gold-soft); }
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--cream-soft);
  margin-bottom: 6px;
}
.footer-tagline {
  font-family: var(--font-name);
  font-style: italic;
  color: var(--gold-soft);
  margin-bottom: 22px;
}
.footer-note {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(244, 234, 217, 0.68);
}
.footer-rule { width: 64px; height: 1px; background: rgba(244,234,217,0.25); margin: 26px auto; }
.footer-credit { font-size: 0.72rem; color: rgba(244, 234, 217, 0.4); letter-spacing: 0.04em; }

/* back to top */
.to-top {
  position: fixed;
  bottom: 26px; right: 26px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--cream-soft);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.35s var(--ease);
  z-index: 55;
}
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { background: var(--maroon); }

/* ============================================================
   MOBILE OPTIMIZATION
   ============================================================ */
@supports (padding: max(0px)) {
  .site-header, .site-footer { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .to-top { bottom: max(26px, env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .header-inner { padding: 11px 16px; }
  .brand .brand-mark { width: 28px; height: 28px; }
  .brand .brand-name { font-size: 1.25rem; }
  .brand .brand-tagline { display: none; }

  .lang-switcher { padding: 3px; gap: 0; }
  .lang-btn { padding: 9px 8px; min-height: 40px; }
  .lang-indicator { top: 3px; bottom: 3px; left: 3px; }

  .hero { padding: 40px 16px 64px; }
  .hero-mark { width: 52px; height: 52px; margin-bottom: 12px; }
  .hero-eyebrow { font-size: 0.9rem; }
  .hero-divider { margin: 20px auto; }

  .cat-nav { padding: 10px 14px; gap: 5px; scroll-snap-type: x proximity; }
  .cat-nav-btn { padding: 10px 14px; font-size: 0.78rem; min-height: 40px; scroll-snap-align: start; }

  .category-section { padding: 44px 16px 4px; }
  .category-section:first-of-type { padding-top: 36px; }
  .cat-header { margin-bottom: 30px; }
  .cat-header .cat-icon { width: 34px; height: 34px; margin-bottom: 10px; }

  .dish-grid { gap: 16px; margin-bottom: 20px; }
  .dish-media { aspect-ratio: 16 / 10; }
  .dish-body { padding: 16px 17px 15px; }
  .dish-card h3 { font-size: 1.22rem; }
  .dish-card:active { transform: scale(0.98); }

  /* modal becomes a bottom sheet on mobile for effortless thumb reach */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card {
    max-width: 100%;
    max-height: 86vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal-card { transform: translateY(0); }
  .modal-sheet-handle {
    display: block;
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.8);
    z-index: 3;
  }
  .modal-media { aspect-ratio: 16 / 11; }
  .modal-body { padding: 26px 22px max(26px, env(safe-area-inset-bottom)); }
  .modal-card h2 { font-size: 1.6rem; }
  .modal-desc { font-size: 1.02rem; }

  .to-top { width: 44px; height: 44px; bottom: 18px; right: 18px; }
  .footer-note { font-size: 0.8rem; }
}

@media (max-width: 380px) {
  .lang-btn { padding: 8px 6px; }
  .hero-title { font-size: 2.7rem; }
}
