/* =========================================================
   Nhà Của Nấm — nền tảng giao diện
   Tông: vữa trát kem · đất nung · mây tre · nâu cacao · lá xanh
   ========================================================= */
:root {
  --cream: #F6EEE2;
  --paper: #FCF8F1;
  --plaster: #EFE3D1;
  --sand: #E4D3B9;
  --clay: #C0683A;
  --clay-d: #9F512A;
  --clay-l: #E7A77C;
  --rattan: #C9934F;
  --rattan-l: #E7C694;
  --cocoa: #3B2418;
  --cocoa-2: #5B3A28;
  --cocoa-3: #2A1810;
  --ink-soft: #7A6050;
  --leaf: #4E6B35;
  --leaf-l: #8FAE5E;
  --matcha: #8A9A3B;
  --gold: #E0A84B;
  --line: rgba(59, 36, 24, .13);
  --line-2: rgba(59, 36, 24, .22);
  --shadow-s: 0 1px 2px rgba(59, 36, 24, .08), 0 4px 14px rgba(59, 36, 24, .07);
  --shadow-m: 0 2px 6px rgba(59, 36, 24, .08), 0 18px 40px -12px rgba(59, 36, 24, .25);
  --shadow-l: 0 30px 80px -24px rgba(59, 36, 24, .45);
  --r-s: 12px;
  --r-m: 20px;
  --r-l: 32px;
  --arch: 999px 999px 22px 22px;
  --f-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-display: 'Fraunces', 'Times New Roman', serif;
  --f-script: 'Pacifico', 'Brush Script MT', cursive;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Consolas', monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .14 0 0 0 0 .09 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --pad: clamp(20px, 5vw, 64px);
  --maxw: 1240px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
main, footer { overflow-x: clip; } /* chặn tràn ngang trên điện thoại mà không làm hỏng position: sticky */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--f-body); font-size: 16px; line-height: 1.6; color: var(--cocoa);
  background: var(--cream) var(--noise);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--clay); color: var(--paper); }
:focus-visible { outline: 2.5px solid var(--clay); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--maxw), 100% - var(--pad) * 2); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Chữ ---------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--clay-d);
}
.eyebrow::before { content: ''; width: 26px; height: 1.5px; background: currentColor; opacity: .7; }
.display {
  font-family: var(--f-display); font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(38px, 6.2vw, 84px); line-height: 1.02; letter-spacing: -.025em; margin: 0;
  font-variation-settings: 'SOFT' 100, 'WONK' 0;
}
.display em { font-style: italic; color: var(--clay); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(32px, 4.6vw, 60px); line-height: 1.06; letter-spacing: -.02em; margin: 0; }
.h2 em { font-style: italic; color: var(--clay); }
.h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.lead { font-size: clamp(16px, 1.4vw, 19px); color: var(--cocoa-2); max-width: 58ch; }
.script { font-family: var(--f-script); font-weight: 400; }
.muted { color: var(--ink-soft); }

/* ---------------- Nút ---------------- */
.btn {
  --bg: var(--cocoa); --fg: var(--paper);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 15px; letter-spacing: .01em;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s;
  overflow: hidden; isolation: isolate; white-space: nowrap;
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--clay { --bg: var(--clay); }
.btn--clay:hover { --bg: var(--clay-d); }
.btn--ghost { --bg: transparent; --fg: var(--cocoa); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn--ghost:hover { --bg: rgba(255, 255, 255, .5); }
.btn--light { --bg: var(--paper); --fg: var(--cocoa); }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; padding: 0 30px; font-size: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------------- Logo ---------------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--cocoa); }
.logo__mark { width: 34px; height: 34px; color: var(--clay); --spot: var(--paper); transition: transform .6s var(--ease); }
.logo:hover .logo__mark { transform: rotate(-12deg) scale(1.06); }
.logo__text { font-family: var(--f-script); font-size: 22px; line-height: 1; padding-bottom: 4px; }
.logo__sub { display: block; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }

/* ---------------- Thanh điều hướng ---------------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 76px;
  display: flex; align-items: center; transition: background .4s, box-shadow .4s, height .4s;
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(1360px, 100% - var(--pad) * 2); margin-inline: auto; }
.nav--solid { background: rgba(246, 238, 226, .82); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 1px 0 var(--line); height: 66px; }
.nav__links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__links a { position: relative; padding: 8px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; transition: background .25s; }
.nav__links a:hover { background: rgba(59, 36, 24, .06); }
.nav__cta { display: flex; gap: 10px; align-items: center; }
.nav__cta .btn { min-height: 44px; padding: 0 18px; font-size: 14px; }
.nav__burger { display: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-s); position: relative; }
.nav__burger span { position: absolute; left: 14px; right: 14px; height: 2px; background: var(--cocoa); border-radius: 2px; transition: transform .4s var(--ease), opacity .3s; }
.nav__burger span:nth-child(1) { top: 17px; }
.nav__burger span:nth-child(2) { top: 22px; }
.nav__burger span:nth-child(3) { top: 27px; }
.menu-open .nav__burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-open .nav__burger span:nth-child(2) { opacity: 0; }
.menu-open .nav__burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.nav__sheet {
  position: fixed; inset: 0; z-index: 45; background: var(--cocoa-3) var(--noise); color: var(--paper);
  display: flex; flex-direction: column; justify-content: center; padding: 100px var(--pad) 40px;
  clip-path: circle(0 at calc(100% - 44px) 38px); transition: clip-path .7s var(--ease-out); pointer-events: none;
}
.menu-open .nav__sheet { clip-path: circle(150% at calc(100% - 44px) 38px); pointer-events: auto; }
.menu-open { overflow: hidden; }
.menu-open .nav { background: transparent; box-shadow: none; backdrop-filter: none; }
.menu-open .nav .logo, .menu-open .nav .logo__sub { color: var(--paper); }
.nav__sheet a.big { display: block; font-family: var(--f-display); font-size: clamp(38px, 10vw, 64px); line-height: 1.15; letter-spacing: -.02em; opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .6s var(--ease); }
.nav__sheet a.big em { font-style: italic; color: var(--clay-l); }
.menu-open .nav__sheet a.big { opacity: 1; transform: none; }
.menu-open .nav__sheet a.big:nth-child(2) { transition-delay: .06s; }
.menu-open .nav__sheet a.big:nth-child(3) { transition-delay: .12s; }
.menu-open .nav__sheet a.big:nth-child(4) { transition-delay: .18s; }
.menu-open .nav__sheet a.big:nth-child(5) { transition-delay: .24s; }
.nav__sheet .sheet-foot { margin-top: 40px; font-size: 14px; opacity: .7; }

@media (max-width: 960px) {
  .nav__links, .nav__cta .btn--ghost { display: none; }
  .nav__burger { display: block; z-index: 2; }
}
@media (max-width: 520px) {
  .nav__cta .btn { display: none; }
}

/* ---------------- Thẻ & form ---------------- */
.card { background: var(--paper); border-radius: var(--r-m); box-shadow: var(--shadow-s); border: 1px solid var(--line); }
.field { display: grid; gap: 8px; }
.field > label, .label { font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 8px; }
.input, .textarea, .select {
  width: 100%; min-height: 52px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line-2);
  background: #fff; font-size: 16px; transition: border-color .2s, box-shadow .2s; outline: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--clay); box-shadow: 0 0 0 4px rgba(192, 104, 58, .14); }
.input::placeholder, .textarea::placeholder { color: #B09A88; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* chip / segmented */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line-2); font-weight: 500; font-size: 14.5px; transition: all .25s var(--ease); white-space: nowrap;
}
.chip input:checked + span { background: var(--cocoa); color: var(--paper); border-color: var(--cocoa); }
.chip input:focus-visible + span { outline: 2.5px solid var(--clay); outline-offset: 2px; }
.chip input:disabled + span { opacity: .35; text-decoration: line-through; }
.chip:hover input:not(:checked):not(:disabled) + span { border-color: var(--cocoa); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.seg .face {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 6px 4px; border-radius: 14px;
  background: #fff; border: 1.5px solid var(--line-2); font-weight: 600; font-size: 15px; line-height: 1.2; text-align: center;
  transition: background .25s var(--ease), color .25s, border-color .25s, transform .2s;
}
.seg .face small { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; opacity: .7; margin-top: 2px; letter-spacing: .02em; }
.seg input:checked + .face { background: var(--cocoa); color: var(--paper); border-color: var(--cocoa); }
.seg input:focus-visible + .face { outline: 2.5px solid var(--clay); outline-offset: 2px; }
.seg label:active .face { transform: scale(.96); }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line-2); }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; font-weight: 500; display: grid; place-items: center; transition: background .2s; }
.stepper button:hover { background: var(--plaster); }
.stepper button:active { transform: scale(.92); }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------------- Hiện dần ---------------- */
[data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--delay, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal="arch"] { opacity: 1; transform: none; }
[data-reveal="arch"] > * { clip-path: inset(100% 0 0 0); transform: scale(1.18); transition: clip-path 1.3s var(--ease-out), transform 1.8s var(--ease-out), opacity .5s; transition-delay: var(--delay, 0s); }
[data-reveal="arch"].in > * { clip-path: inset(0 0 0 0); transform: none; }
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(.94); }
[data-reveal="scale"].in { transform: none; }

/* ---------------- Ly nước (SVG) ---------------- */
.cup { overflow: visible; }
.cup .ice { transform-box: fill-box; transform-origin: center; animation: ice-bob 3.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.cup .wave { animation: wave 5s linear infinite; }
.cup .steam path { animation: steam 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); opacity: 0; }
.cup .fizz circle { animation: fizz 2.8s linear infinite; animation-delay: var(--d, 0s); opacity: 0; }
.cup .scoop { transform-box: fill-box; transform-origin: 50% 100%; animation: melt 4s ease-in-out infinite; }
.cup.pour .liq { animation: pour 1s var(--ease-out) both; }
.cup.pour .ice { animation: ice-drop .9s var(--ease-out) both, ice-bob 3.4s ease-in-out .9s infinite; }
.cup--mini .ice, .cup--mini .wave, .cup--mini .scoop { animation: none; }
.cup--mini .steam path { animation-duration: 4s; }
@keyframes ice-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes wave { to { transform: translateX(100px); } }
@keyframes steam { 0% { opacity: 0; transform: translateY(14px); } 30% { opacity: .7; } 100% { opacity: 0; transform: translateY(-18px); } }
@keyframes fizz { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-140px); } }
@keyframes melt { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.97) scaleX(1.01); } }
@keyframes pour { from { transform: translateY(150px); } to { transform: none; } }
@keyframes ice-drop { from { transform: translateY(-160px); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 16px; background: var(--cocoa-3); color: var(--paper);
  font-size: 14.5px; line-height: 1.45; box-shadow: var(--shadow-l); opacity: 0; transform: translateY(16px) scale(.97); transition: all .45s var(--ease-out);
}
.toast.in { opacity: 1; transform: none; }
.toast__dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--leaf-l); box-shadow: 0 0 0 4px rgba(143, 174, 94, .25); }
.toast--err .toast__dot { background: #E46A4E; box-shadow: 0 0 0 4px rgba(228, 106, 78, .25); }
.toast--info .toast__dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(224, 168, 75, .25); }

/* ---------------- Chân trang ---------------- */
.footer { position: relative; background: var(--cocoa-3) var(--noise); color: #E9DCCB; padding: clamp(70px, 9vw, 120px) 0 calc(40px + env(safe-area-inset-bottom)); overflow: hidden; }
.footer a:hover { color: var(--clay-l); }
.footer__big { font-family: var(--f-script); font-size: clamp(56px, 13vw, 190px); line-height: 1.1; color: var(--paper); margin: 0 0 30px; letter-spacing: -.01em; }
.footer__big span { color: var(--clay-l); }
.footer__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 36px; border-top: 1px solid rgba(255, 255, 255, .14); }
.footer h4 { margin: 0 0 12px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--rattan-l); font-weight: 600; }
.footer p { margin: 0; font-size: 15px; line-height: 1.7; }
.footer__bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 56px; font-size: 13px; opacity: .55; }
.footer__mush { position: absolute; right: -40px; top: -30px; width: clamp(160px, 22vw, 320px); color: rgba(255, 255, 255, .04); --spot: rgba(255, 255, 255, .03); transform: rotate(14deg); }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; clip-path: none; }
}

/* ---------------- Thông báo nhanh của quán ---------------- */
.notice { position: fixed; z-index: 44; left: 50%; top: calc(var(--notice-top, 86px) + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(92vw, 560px); padding: 8px 8px 8px 12px; border-radius: 18px; background: var(--cocoa-3); color: var(--paper); box-shadow: var(--shadow-m); font-size: 14px; opacity: 0; transform: translate(-50%, -12px); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.notice.in { opacity: 1; transform: translate(-50%, 0); }
.notice__ico { width: 22px; height: 22px; flex: none; color: var(--clay-l); --spot: var(--cocoa-3); }
.notice__text { line-height: 1.4; }
.notice__x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: var(--paper); font-size: 18px; line-height: 1; }
.notice__x:hover { background: rgba(255, 255, 255, .25); }
body.order { --notice-top: 72px; }
