/* Lino: shared chrome for every page. Navigation, the chat, buttons, subpage shell.
   The scroll engine stays untouched; this file only themes and adds. */

:root {
  --sc-canvas:     #FCFAF6;
  --sc-surface:    #FFFFFF;
  --sc-ink:        #1C1114;
  --sc-ink-soft:   #66565A;
  --sc-accent:     #CC0000;
  --sc-accent-ink: #FFFFFF;
  --sc-font-display: "Bricolage Grotesque", "Be Vietnam Pro", system-ui, sans-serif;
  --sc-font-text:    "Be Vietnam Pro", system-ui, sans-serif;
  --sc-shadow-color: 352 55% 18%;

  --red: #CC0000;
  --red-deep: #A80000;
  --paper: #FCFAF6;
  --blush: #FBEDEA;
  --night: #170A0D;
  --r-photo: 22px;
  --dock-h: 0px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[hidden] { display: none !important; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

h1, h2, h3 { font-family: var(--sc-font-display); font-weight: 800; line-height: 1.12;
  letter-spacing: -0.028em; margin: 0; text-wrap: balance; }
p { margin: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.em { color: var(--red); }

/* ----------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--red); color: #fff; font: 700 1rem/1.1 var(--sc-font-text); text-decoration: none; white-space: nowrap;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--sc-ink); outline-offset: 3px; }
.btn--line { background: #fff; color: var(--sc-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sc-ink) 20%, transparent); }
.btn--soft { background: var(--blush); color: var(--red-deep); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--red-deep); }
  .btn--line:hover { background: color-mix(in srgb, var(--red) 7%, #fff); }
  .btn--soft:hover { background: color-mix(in srgb, var(--red) 16%, #fff); }
}

/* -------------------------------------------------------------------- dock -- */
.dock {
  position: fixed; z-index: var(--sc-z-chrome, 50);
  top: 18px; right: 22px;
  display: flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, #fff 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--sc-e2, 0 8px 24px -10px hsl(352 55% 18% / 0.3)), inset 0 0 0 1px color-mix(in srgb, var(--sc-ink) 8%, transparent);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.dock.is-away { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.dock__links { display: flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid color-mix(in srgb, var(--sc-ink) 10%, transparent); }
.dock__links a, .dock__call, .dock__menu {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  color: var(--sc-ink); font: 600 0.95rem/1 var(--sc-font-text); text-decoration: none; white-space: nowrap;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.dock__links a[aria-current="page"] { color: var(--red); }
.dock__call { font-variant-numeric: tabular-nums; padding-left: 12px; }
.dock__call svg, .dock__menu svg { width: 18px; height: 18px; color: var(--red); flex: none; }
.dock__menu { display: none; }
@media (hover: hover) and (pointer: fine) {
  .dock__links a:hover, .dock__call:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
}

/* the sheet that holds the links on a phone */
.sheet { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; visibility: hidden; }
.sheet.is-open { visibility: visible; }
.sheet__bg { position: absolute; inset: 0; background: rgb(23 10 13 / 0.42); opacity: 0; transition: opacity 280ms var(--ease); border: 0; padding: 0; }
.sheet.is-open .sheet__bg { opacity: 1; }
.sheet__panel {
  position: relative; margin: 10px; padding: 12px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  border-radius: 26px; background: #fff; box-shadow: 0 -10px 40px -12px rgb(0 0 0 / 0.35);
  transform: translateY(110%); transition: transform 380ms var(--ease);
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet__panel a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 16px; border-radius: 16px;
  color: var(--sc-ink); font: 700 1.12rem/1.2 var(--sc-font-display); letter-spacing: -0.01em; text-decoration: none; }
.sheet__panel a small { font: 500 0.85rem/1.2 var(--sc-font-text); color: var(--sc-ink-soft); letter-spacing: 0; }
.sheet__panel a:active { background: var(--blush); }
.sheet__panel a + a { border-top: 1px solid color-mix(in srgb, var(--sc-ink) 7%, transparent); }

/* -------------------------------------------------------- subpage header -- */
.top { position: absolute; z-index: 5; left: var(--sc-gutter); top: 22px; display: flex; align-items: center; gap: 16px; }
.top a { display: block; border-radius: 10px; }
.top img { height: 46px; width: auto; max-width: none; display: block; }
.top__slogan { padding-left: 16px; border-left: 2px solid color-mix(in srgb, var(--red) 30%, transparent);
  font: italic 600 1.08rem/1.25 Georgia, "Times New Roman", serif; color: var(--red); white-space: nowrap; }
.top__slogan span { display: block; }

/* --------------------------------------------------------------------- chat -- */
.chat-fab {
  position: fixed; z-index: 60; right: 22px; bottom: 22px;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 0 22px 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--red); color: #fff; font: 700 1rem/1 var(--sc-font-text);
  box-shadow: 0 2px 4px hsl(352 70% 20% / 0.22), 0 18px 34px -12px hsl(352 80% 30% / 0.6);
  transition: transform 260ms var(--ease), opacity 220ms var(--ease), background-color 160ms var(--ease);
}
.chat-fab svg { width: 24px; height: 24px; }
.chat-fab:active { transform: scale(0.96); }
.chat-fab:focus-visible { outline: 2px solid var(--sc-ink); outline-offset: 3px; }
.chat-fab__dot { position: absolute; top: 9px; left: 36px; width: 10px; height: 10px; border-radius: 50%; background: #3CCB6E; box-shadow: 0 0 0 2px var(--red); }
.chat-open .chat-fab { opacity: 0; transform: scale(0.8) translateY(10px); pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .chat-fab:hover { background: var(--red-deep); transform: translateY(-2px); } }

.chat-nudge {
  position: fixed; z-index: 59; right: 96px; bottom: 26px; max-width: 18rem;
  padding: 14px 40px 14px 16px; border-radius: 18px 18px 6px 18px; background: #fff; color: var(--sc-ink);
  font: 500 0.98rem/1.45 var(--sc-font-text);
  box-shadow: 0 2px 4px hsl(352 55% 18% / 0.12), 0 18px 34px -14px hsl(352 55% 18% / 0.4), inset 0 0 0 1px color-mix(in srgb, var(--sc-ink) 7%, transparent);
  opacity: 0; transform: translateY(10px) scale(0.98); transform-origin: 100% 100%; pointer-events: none;
  transition: opacity 320ms var(--ease), transform 420ms var(--ease);
}
.chat-nudge.is-on { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.chat-nudge__x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--sc-ink-soft); font-size: 1.2rem; line-height: 1; }
.chat-open .chat-nudge { opacity: 0; pointer-events: none; }

.chat {
  position: fixed; z-index: 61; right: 22px; bottom: 22px;
  width: min(25rem, calc(100vw - 32px)); height: min(40rem, calc(100svh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 26px; background: var(--paper);
  box-shadow: 0 2px 6px hsl(352 55% 18% / 0.14), 0 40px 80px -24px hsl(352 55% 18% / 0.55), inset 0 0 0 1px color-mix(in srgb, var(--sc-ink) 7%, transparent);
  opacity: 0; transform: translateY(18px) scale(0.96); transform-origin: 100% 100%; visibility: hidden;
  transition: opacity 260ms var(--ease), transform 420ms var(--ease), visibility 0s linear 420ms;
}
.chat-open .chat { opacity: 1; transform: none; visibility: visible; transition: opacity 260ms var(--ease), transform 420ms var(--ease), visibility 0s; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--red); color: #fff; }
.chat__ava { position: relative; width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.chat__ava img { width: 30px; height: 30px; }
.chat__ava::after { content: ""; position: absolute; right: -1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #3CCB6E; box-shadow: 0 0 0 2px var(--red); }
.chat__who { flex: 1; min-width: 0; }
.chat__who b { display: block; font: 700 1.02rem/1.2 var(--sc-font-display); letter-spacing: -0.01em; }
.chat__who span { font-size: 0.82rem; opacity: 0.88; }
.chat__x { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgb(255 255 255 / 0.14); color: #fff; }
.chat__x svg { width: 20px; height: 20px; }
.chat__x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font: 400 0.98rem/1.5 var(--sc-font-text); text-wrap: pretty;
  animation: msg-in 420ms var(--ease) both; }
.msg--bot { align-self: flex-start; background: #fff; color: var(--sc-ink); border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px hsl(352 55% 18% / 0.08), inset 0 0 0 1px color-mix(in srgb, var(--sc-ink) 6%, transparent); }
.msg--me { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 6px; }
.msg b { font-weight: 700; }
.msg a { color: var(--red); font-weight: 600; }
.msg--typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--sc-ink) 35%, transparent); animation: dot 1s infinite ease-in-out; }
.msg--typing i:nth-child(2) { animation-delay: 0.15s; } .msg--typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 6px; animation: msg-in 420ms var(--ease) both; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer; background: #fff; color: var(--red-deep);
  font: 600 0.92rem/1.2 var(--sc-font-text); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 35%, transparent);
  transition: background-color 160ms var(--ease), transform 160ms var(--ease); text-align: left; }
.chip:active { transform: scale(0.97); }
.chip--go { background: var(--red); color: #fff; box-shadow: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .chip:hover { background: var(--blush); } .chip--go:hover { background: var(--red-deep); } }

.chat__ticket { padding: 12px 14px; border-radius: 14px; background: var(--blush); font-size: 0.92rem; line-height: 1.5; color: var(--sc-ink); }

.chat__bar { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid color-mix(in srgb, var(--sc-ink) 8%, transparent); background: #fff; }
.chat__bar input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--paper);
  font: 400 1rem/1 var(--sc-font-text); color: var(--sc-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sc-ink) 12%, transparent); }
.chat__bar input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--red); }
.chat__send { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--red); color: #fff; flex: none; }
.chat__send svg { width: 20px; height: 20px; }
.chat__send:focus-visible { outline: 2px solid var(--sc-ink); outline-offset: 2px; }

/* ---------------------------------------------------------- quick contact -- */
.quick { position: fixed; z-index: 58; right: 22px; bottom: 98px; display: flex; flex-direction: column; gap: 10px;
  transition: opacity 260ms var(--ease), transform 320ms var(--ease); }
.chat-open .quick { opacity: 0; transform: translateY(12px); pointer-events: none; }
.quick__btn { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; text-decoration: none; color: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.16), 0 12px 24px -10px rgb(0 0 0 / 0.45); transition: transform 240ms var(--ease); }
.quick__btn:active { transform: scale(0.94); }
.quick__btn:focus-visible { outline: 2px solid var(--sc-ink); outline-offset: 3px; }
.quick__btn--zalo { background: #0068FF; }
.quick__btn--mess { background: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A033FF 100%); }
.quick__btn--call { background: #13A04A; }
.quick__ico { display: grid; place-items: center; font: 800 0.86rem/1 "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: -0.02em; }
.quick__ico svg { width: 25px; height: 25px; }
.quick__btn--call::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.quick__tip { position: absolute; right: calc(100% + 10px); top: 50%; translate: 0 -50%; white-space: nowrap; padding: 7px 12px; border-radius: 999px;
  background: var(--sc-ink); color: #fff; font: 600 0.85rem/1 var(--sc-font-text); opacity: 0; transform: translateX(6px); pointer-events: none;
  transition: opacity 200ms var(--ease), transform 260ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .quick__btn:hover { transform: translateY(-2px) scale(1.05); }
  .quick__btn:hover .quick__tip, .quick__btn:focus-visible .quick__tip { opacity: 1; transform: none; }
}
/* motion: the three buttons arrive one by one, then take turns asking for attention
   on one shared 9s cycle so only one moves at a time. Individual transform properties
   (scale / rotate / translate) keep these from fighting the hover transform. */
.quick__btn { animation: q-in 700ms var(--ease) both; overflow: visible; isolation: isolate; }
.quick__btn:nth-child(1) { animation-delay: 300ms; }
.quick__btn:nth-child(2) { animation-delay: 420ms; }
.quick__btn:nth-child(3) { animation-delay: 540ms; }
@keyframes q-in { 0% { opacity: 0; scale: 0.3; translate: 36px 0; } 60% { opacity: 1; scale: 1.14; translate: 0 0; } 100% { opacity: 1; scale: 1; translate: 0 0; } }

.quick__ico { position: relative; z-index: 1; }
.quick__btn--zalo .quick__ico { animation: q-wiggle 9s ease-in-out 1.6s infinite; }
.quick__btn--mess .quick__ico { animation: q-hop 9s ease-in-out 4.6s infinite; }
.quick__btn--call .quick__ico { animation: q-ring 9s ease-in-out 7.4s infinite; }
@keyframes q-wiggle { 0%, 12%, 100% { rotate: 0deg; scale: 1; } 2% { rotate: -14deg; scale: 1.12; } 4% { rotate: 12deg; } 6% { rotate: -9deg; } 8% { rotate: 6deg; } 10% { rotate: -3deg; scale: 1; } }
@keyframes q-hop { 0%, 14%, 100% { translate: 0 0; scale: 1; } 3% { translate: 0 -7px; scale: 1.08; } 6% { translate: 0 0; scale: 0.96; } 9% { translate: 0 -4px; scale: 1.04; } 12% { translate: 0 0; scale: 1; } }
@keyframes q-ring { 0%, 14%, 100% { rotate: 0deg; } 1.5%, 4.5%, 7.5%, 10.5% { rotate: -18deg; } 3%, 6%, 9%, 12% { rotate: 18deg; } }

/* a soft light sweeps across each button on the same cycle */
.quick__btn::before { content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.55) 48%, transparent 66%) no-repeat;
  background-size: 250% 100%; background-position: 160% 0; animation: q-shine 9s ease-in-out infinite; }
.quick__btn--zalo::before { animation-delay: 1.6s; }
.quick__btn--mess::before { animation-delay: 4.6s; }
.quick__btn--call::before { animation-delay: 7.4s; }
@keyframes q-shine { 0% { background-position: 160% 0; } 10%, 100% { background-position: -60% 0; } }

/* the phone keeps a gentle double ripple, like an incoming call */
.quick__btn--call::after { animation: q-ripple 2.2s ease-out infinite; }
@keyframes q-ripple {
  0% { box-shadow: 0 0 0 0 rgb(19 160 74 / 0.5), 0 0 0 0 rgb(19 160 74 / 0.35); }
  70% { box-shadow: 0 0 0 12px rgb(19 160 74 / 0), 0 0 0 20px rgb(19 160 74 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(19 160 74 / 0), 0 0 0 0 rgb(19 160 74 / 0); } }

/* on hover the icon answers back */
@media (hover: hover) and (pointer: fine) {
  .quick__btn:hover .quick__ico { animation: q-wiggle 1.1s ease-in-out; }
  .quick__btn--mess:hover .quick__ico { animation: q-hop 1.1s ease-in-out; }
  .quick__btn--call:hover .quick__ico { animation: q-ring 1.1s ease-in-out; }
  /* first visit: the labels peek out one after another so people know what each button does */
  .quick.is-intro .quick__tip { animation: q-peek 1.9s var(--ease) both; }
  .quick.is-intro .quick__btn:nth-child(1) .quick__tip { animation-delay: 1.2s; }
  .quick.is-intro .quick__btn:nth-child(2) .quick__tip { animation-delay: 2.1s; }
  .quick.is-intro .quick__btn:nth-child(3) .quick__tip { animation-delay: 3s; }
}
@keyframes q-peek { 0% { opacity: 0; transform: translateX(8px); } 18%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  .quick__btn, .quick__btn::before, .quick__btn::after, .quick__ico, .quick.is-intro .quick__tip { animation: none !important; }
}

/* -------------------------------------------------------------------- phone -- */
@media (max-width: 860px) {
  :root { --dock-h: 76px; }
  .dock { top: auto; right: 10px; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; }
  .dock.is-away { transform: translateY(14px); }
  .dock__links { display: none; }
  .dock__menu { display: inline-flex; padding: 0 12px; }
  .dock__call { padding: 0 12px; }
  .dock__call span { display: none; }
  .dock .btn { flex: 1; padding-inline: 14px; }
  .top img { height: 34px; }
  .top { top: 14px; gap: 10px; }
  .top__slogan { padding-left: 10px; font-size: 0.86rem; }

  .chat-fab { right: 14px; bottom: calc(var(--dock-h) + 14px + env(safe-area-inset-bottom, 0px)); width: 56px; min-height: 56px; padding: 0; justify-content: center;
    transition: transform 260ms var(--ease), opacity 220ms var(--ease), bottom 320ms var(--ease); }
  .chat-fab > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .chat-fab__dot { top: 8px; left: auto; right: 8px; }
  .dock.is-away ~ .chat-fab { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .quick { right: 18px; bottom: calc(var(--dock-h) + 82px + env(safe-area-inset-bottom, 0px)); gap: 9px; transition: opacity 260ms var(--ease), transform 320ms var(--ease), bottom 320ms var(--ease); }
  .dock.is-away ~ .quick { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .quick__btn { width: 48px; height: 48px; }
  .quick__ico svg { width: 23px; height: 23px; }
  .chat-nudge { right: 80px; bottom: calc(var(--dock-h) + 18px + env(safe-area-inset-bottom, 0px)); max-width: 15rem; }
  .chat { right: 0; bottom: 0; width: 100vw; height: min(92svh, 46rem); border-radius: 24px 24px 0 0; transform-origin: 50% 100%; transform: translateY(40px); }
}

@media (prefers-reduced-motion: reduce) {
  .msg, .chips { animation: none; }
  .chat, .chat-nudge, .sheet__panel, .sheet__bg { transition-duration: 1ms !important; }
}
