:root {
  --cream: #FBF1E4;
  --cream-deep: #F3E4D2;
  --cocoa: #74503A;
  --cocoa-soft: #8A6550;
  --peach: #E8A58A;
  --terra: #D9785A;
  --white: #FFFCF8;
  --shadow: rgba(116, 80, 58, 0.12);
  --radius: 18px;
  --font: "Be Vietnam Pro", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--cocoa);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 6vw;
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s;
}

.site-header.scrolled {
  background: rgba(251, 241, 228, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(116, 80, 58, 0.08);
}

.brand-logo {
  height: 42px;
  width: auto;
}

.nav-link {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cocoa);
  opacity: 0.85;
  transition: color 0.2s, opacity 0.2s;
}

.nav-link:hover {
  color: var(--terra);
  opacity: 1;
}

/* Hero — stable height: prefer svh; JS locks px height on mobile */
.hero {
  position: relative;
  /* Fallbacks then stable small viewport height (does not jump with URL bar) */
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cream-deep);
}

.hero.hero-locked {
  height: var(--hero-h, 100svh);
  min-height: var(--hero-h, 100svh);
  max-height: var(--hero-h, 100svh);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Prevent any paint-scale quirks; never use fixed background attachment */
  transform: none;
  will-change: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(251, 241, 228, 0.62) 0%,
    rgba(251, 241, 228, 0.42) 38%,
    rgba(243, 228, 210, 0.78) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  max-width: 780px;
  width: 100%;
}

.hero-logo {
  width: min(340px, 72vw);
  height: auto;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 4px 16px rgba(116, 80, 58, 0.15));
}

.slogan-panel {
  display: inline-block;
  max-width: 100%;
  margin: 0 auto 1.85rem;
  padding: 1rem 1.35rem 1.1rem;
  background: rgba(251, 241, 228, 0.88);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(116, 80, 58, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.slogan-en {
  font-family: "Nunito", var(--font);
  font-size: clamp(1.35rem, 3.4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cocoa);
  margin-bottom: 0.45rem;
  line-height: 1.3;
  text-shadow: none;
}

.slogan-vi {
  font-family: "Be Vietnam Pro", var(--font);
  font-size: clamp(0.95rem, 2.2vw, 1.12rem);
  font-weight: 500;
  color: var(--cocoa);
  opacity: 1;
  line-height: 1.45;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.75rem;
  background: var(--terra);
  color: var(--white);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(217, 120, 90, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s;
}

.cta:hover {
  background: #c96a4d;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(217, 120, 90, 0.4);
}

.cta svg {
  width: 18px;
  height: 18px;
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 28px;
  height: 44px;
  border: 2px solid rgba(116, 80, 58, 0.35);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-hint span {
  width: 4px;
  height: 8px;
  background: var(--terra);
  border-radius: 2px;
  animation: scrollPulse 1.6s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(8px); }
}

/* Gallery */
.gallery {
  padding: 5.5rem 6vw 4.5rem;
  background: var(--cream);
}

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.section-title {
  font-family: "Nunito", var(--font);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.section-title-vi {
  font-family: "Be Vietnam Pro", var(--font);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 500;
  color: var(--cocoa-soft);
  margin-bottom: 0.85rem;
}

.section-sub {
  color: var(--cocoa-soft);
  font-size: 0.98rem;
  max-width: 520px;
  margin: 0 auto 0.35rem;
}

.section-sub-vi {
  color: var(--cocoa-soft);
  font-size: 0.9rem;
  max-width: 520px;
  margin: 0 auto;
  opacity: 0.92;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  opacity: 0;
  transform: translateY(24px);
}

.product-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(116, 80, 58, 0.18);
}

.product-card.visible:hover {
  transform: translateY(-8px);
}

.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream-deep);
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-body {
  padding: 1.15rem 1.25rem 1.4rem;
}

.product-name-en {
  font-family: "Nunito", var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--cocoa);
}

.product-name-vi {
  font-family: "Be Vietnam Pro", var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--terra);
  margin-bottom: 0.55rem;
}

.product-desc {
  font-size: 0.88rem;
  color: var(--cocoa-soft);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.product-desc-vi {
  font-size: 0.82rem;
  color: var(--cocoa-soft);
  line-height: 1.45;
  opacity: 0.9;
}

/* Fade-in helpers */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* Footer */
.site-footer {
  background: var(--cocoa);
  color: var(--cream);
  padding: 2.5rem 6vw;
  text-align: center;
}

.footer-logo {
  height: 36px;
  width: auto;
  margin: 0 auto 1rem;
  filter: brightness(0) invert(1) sepia(0.3) saturate(0.4);
  opacity: 0.9;
}

.footer-tag {
  font-family: "Nunito", var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.92;
  margin-bottom: 0.25rem;
}

.footer-tag-vi {
  font-family: "Be Vietnam Pro", var(--font);
  font-size: 0.88rem;
  opacity: 0.8;
  margin-bottom: 0.85rem;
}

.footer-meta {
  font-size: 0.78rem;
  opacity: 0.55;
  letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.7rem 5vw;
  }

  .brand-logo {
    height: 34px;
  }

  .hero-content {
    padding: 5.5rem 1.15rem 3.5rem;
  }

  .hero-logo {
    width: min(260px, 74vw);
    margin-bottom: 1.15rem;
  }

  .slogan-panel {
    padding: 0.9rem 1.1rem 0.95rem;
    margin-bottom: 1.5rem;
  }

  /* No hover-scale on touch devices — avoids perceived zoom */
  .product-card:hover,
  .product-card.visible:hover {
    transform: none;
  }

  .product-card.visible:hover {
    transform: none;
  }

  .product-card:hover .product-img-wrap img {
    transform: none;
  }

  .cta:hover {
    transform: none;
  }

  .gallery {
    padding: 3.5rem 5vw 3rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .product-body {
    padding: 0.85rem 0.9rem 1.05rem;
  }

  .product-name-en {
    font-size: 0.92rem;
  }

  .product-name-vi {
    font-size: 0.78rem;
  }

  .product-desc,
  .product-desc-vi {
    font-size: 0.76rem;
  }

  .scroll-hint {
    display: none;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) {
  .hero-bg-mobile { display: none; }
}
@media (max-width: 640px) {
  .hero-bg-desktop { display: none; }
  .hero-bg-mobile { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .product-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .scroll-hint span {
    animation: none;
  }
}

body:not(.js-ready) .fade-up,
body:not(.js-ready) .product-card {
  opacity: 1;
  transform: none;
}
