/* ==========================================================================
   MEKACAO — Reset + nền tảng typography + tiện ích layout
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--on-bg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

/* [hidden] phải thắng mọi display của component */
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -.015em;
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 40;
}
p { margin: 0; }

::selection { background: var(--red-600); color: var(--cream-100); }

:focus-visible {
  outline: 2px solid var(--red-600);
  outline-offset: 3px;
  border-radius: 3px;
}
.on-red :focus-visible { outline-color: var(--cream-100); }

/* ---------------------------------------------------------------- Layout */
.wrap {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 900px; }
.wrap--wide   { max-width: calc(var(--page) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--red {
  background: var(--red-600);
  color: var(--cream-100);
}
.section--cream-2 { background: var(--bg-alt); }

.stack > * + * { margin-top: var(--sp-4); }
.grid { display: grid; gap: var(--sp-5); }

/* ------------------------------------------------------------ Typography */
.display-1 { font-family: var(--font-display); font-size: var(--fs-display-1); font-weight: 700; line-height: .98; letter-spacing: -.03em; }
.display-2 { font-family: var(--font-display); font-size: var(--fs-display-2); font-weight: 700; line-height: 1.02; letter-spacing: -.025em; }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--red-600);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .6;
}
.on-red .eyebrow { color: var(--blue-300); }

.lead { font-size: var(--fs-body-lg); color: var(--ink-soft); max-width: 62ch; }
.on-red .lead { color: rgba(255,248,231,.82); }

.muted { color: var(--ink-soft); }
.on-red .muted { color: rgba(255,248,231,.72); }

/* chữ nhấn mạnh bằng font display nghiêng — dùng cho 1–2 từ trong heading */
.accent-serif {
  font-style: italic;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 60;
  color: var(--red-500);
}
.on-red .accent-serif { color: var(--blue-300); }

/* ---------------------------------------------------------- Tiện ích ---- */
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.center .eyebrow::after {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .6;
}
.flow > * + * { margin-top: var(--sp-4); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 999;
  background: var(--red-600); color: var(--cream-100);
  padding: 10px 18px; border-radius: var(--r-sm); font-weight: 600;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------- Motif: hoạ tiết nền -- */
/* Lưới Cờ Gánh mờ — dùng làm nền section */
.pattern-co-ganh {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .1;
  background-image:
    linear-gradient(currentColor 1px, transparent 1px),
    linear-gradient(90deg, currentColor 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
}
.pattern-co-ganh::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,  currentColor 0 1px, transparent 1px 101.82px),
    repeating-linear-gradient(-45deg, currentColor 0 1px, transparent 1px 101.82px);
  opacity: .55;
}

/* Sóng Mekong — divider giữa 2 section */
.wave {
  display: block; width: 100%; height: clamp(38px, 5vw, 76px);
  color: var(--bg);
}
.wave svg { display: block; width: 100%; height: 100%; }
.wave--flip svg { transform: scaleY(-1); }

/* Khung vòm — motif ảnh sản phẩm */
.arch {
  border-radius: var(--r-arch);
  overflow: hidden;
  position: relative;
  background: var(--cream-200);
}
.arch > img { width: 100%; height: 100%; object-fit: cover; }
.arch--soft { border-radius: 180px 180px 16px 16px; }

/* Đường viền nét mảnh kiểu line-art */
.hairline { border: 1px solid var(--line); }
.on-red .hairline { border-color: rgba(255,248,231,.28); }

/* ------------------------------------------------------- Animate on scroll */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
