/* Aroma brand site — flat brand colours (no gradients), Bodoni Moda for
   display, Kantumruy Pro for text and all Khmer. Mobile first. */

:root {
  --blue: #1049d8;
  --blue-dark: #0c3bb4;
  --navy: #00289a;
  --navy-deep: #001e74;
  --pink: #f83182;
  --ink: #0b1b4a;
  --muted: #55618a;
  --line: #e2e7f2;
  --surface: #f5f7fc;
  --white: #ffffff;
  --display: 'Bodoni Moda', 'Kantumruy Pro', Didot, 'Bodoni 72', Georgia, serif;
  --sans: 'Kantumruy Pro', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(11, 27, 74, 0.06), 0 10px 30px -14px rgba(11, 27, 74, 0.22);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--white);
  border-radius: 8px;
}
.skip:focus {
  left: 8px;
}

/* ── Khmer: taller lines for stacked glyphs, no tracking ───────── */
:lang(km) {
  line-height: 1.75;
}
:lang(km) h1,
:lang(km) h2,
:lang(km) h3 {
  line-height: 1.45;
  letter-spacing: 0;
}
/* A Khmer phrase that must stay on one line (see phrases() in build.mjs). */
.ph {
  white-space: nowrap;
}
:lang(km) .eyebrow,
:lang(km) .hero-eyebrow,
:lang(km) .filter-label,
:lang(km) .ingredient-note {
  letter-spacing: 0;
  text-transform: none;
}
/* Latin names inside Khmer pages keep the display rhythm. */
[lang='en'] {
  line-height: inherit;
}
h1[lang='en'],
h3[lang='en'] {
  line-height: 1.15;
}

/* ── Wordmark ──────────────────────────────────────────────────── */
.wordmark {
  position: relative;
  display: inline-block;
  padding-right: 0.55em;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--navy);
}
.wordmark svg {
  position: absolute;
  top: -0.18em;
  right: 0;
  width: 0.42em;
  height: 0.42em;
  fill: var(--pink);
}
.wordmark.on-dark {
  color: var(--white);
}
.brand {
  text-decoration: none;
  display: inline-flex;
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.nav {
  display: none;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover {
  color: var(--ink);
  background: var(--surface);
}
.lang-switch {
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, background-color 0.15s;
}
.lang-switch:hover {
  border-color: var(--blue);
  background: var(--surface);
}
@media (min-width: 860px) {
  .nav {
    display: flex;
  }
  .lang-switch {
    margin-left: 8px;
  }
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 600 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 22px -10px rgba(16, 73, 216, 0.7);
}
.btn-light {
  background: var(--white);
  color: var(--navy);
}
.btn-light:hover {
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.5);
}
.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--white);
}
.btn-outline-light:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
}
.hero-grid {
  display: grid;
  gap: 36px;
  padding-top: 56px;
  padding-bottom: 56px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.plus {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--pink);
  clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%);
}
.hero h1 {
  font-size: clamp(36px, 7.4vw, 64px);
  max-width: 14ch;
}
:lang(km) .hero h1 {
  max-width: none;
  font-size: clamp(30px, 6vw, 50px);
}
.hero-lead {
  max-width: 38rem;
  margin-top: 20px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.82);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* Product "shelf": three photos on white cards, the middle one raised. */
.hero-shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
}
.shelf-item {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s;
}
.shelf-item:hover {
  transform: translateY(-4px);
}
.shelf-1 {
  transform: translateY(-18px);
}
.shelf-1:hover {
  transform: translateY(-22px);
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
    gap: 48px;
    padding-top: 88px;
    padding-bottom: 104px;
  }
  .hero-shelf {
    gap: 18px;
    padding-top: 40px;
  }
  .shelf-item {
    border-radius: 24px;
  }
  .shelf-1 {
    transform: translateY(-48px) scale(1.08);
  }
  .shelf-1:hover {
    transform: translateY(-52px) scale(1.08);
  }
}

/* ── Sections ──────────────────────────────────────────────────── */
.section {
  padding: 64px 0;
}
@media (min-width: 900px) {
  .section {
    padding: 96px 0;
  }
}
.section-tint {
  background: var(--surface);
}
.section-navy {
  background: var(--navy-deep);
  color: var(--white);
}
.section-head {
  max-width: 42rem;
  margin-bottom: 32px;
}
.section-head h2 {
  font-size: clamp(30px, 4.6vw, 44px);
}
.section-head h2::before {
  /* Brand mark: a blue bar and the pink "+" dot, flat segments. */
  content: '';
  display: block;
  width: 44px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--blue) 0 32px, transparent 32px 36px, var(--pink) 36px 100%);
}
.section-navy .section-head h2::before {
  background: linear-gradient(to right, var(--white) 0 32px, transparent 32px 36px, var(--pink) 36px 100%);
}
.section-head p {
  margin-top: 12px;
  font-size: 17px;
  color: var(--muted);
}
.section-navy .section-head p {
  color: rgba(255, 255, 255, 0.78);
}

/* ── Product cards ─────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}
@media (min-width: 1100px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid-best {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.card {
  min-width: 0;
}
.card[hidden] {
  display: none;
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card-link:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--shadow);
}
.card-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.card-link:hover .card-media img {
  transform: scale(1.03);
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 18px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
.card-title {
  font-size: 19px;
}
.card-size {
  font-size: 14px;
  color: var(--muted);
}
.card-text {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35);
}
.badge-best-seller {
  background: var(--pink);
}
.badge-popular {
  background: var(--blue);
}
.badge-new {
  background: var(--navy);
}

/* ── Filters ───────────────────────────────────────────────────── */
.filters {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}
.filter-row::-webkit-scrollbar {
  display: none;
}
@media (min-width: 768px) {
  .filter-row {
    flex-wrap: wrap;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
}
.filter-label {
  flex: none;
  align-self: center;
  margin-right: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font: 500 14px/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.chip[aria-pressed='true'] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.filter-count {
  font-size: 14px;
  color: var(--muted);
}
.empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}

/* ── Ingredients ───────────────────────────────────────────────── */
.ingredients {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .ingredients {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}
@media (min-width: 1100px) {
  .ingredients {
    grid-template-columns: repeat(3, 1fr);
  }
}
.ingredient {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.ingredient h3 {
  margin: 6px 0 10px;
  font-size: 24px;
}
.ingredient > p:not(.ingredient-note):not(.found-in) {
  color: var(--muted);
}
.ingredient-note {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}
.found-in {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.found-in span {
  color: var(--muted);
}
.found-in a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}
.found-in a:hover {
  text-decoration: underline;
}

/* ── About pillars ─────────────────────────────────────────────── */
.pillars {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 860px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}
.pillar {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}
.pillar-num {
  display: block;
  margin-bottom: 18px;
  font-family: var(--display);
  font-size: 30px;
  color: var(--pink);
}
.pillar h3 {
  margin-bottom: 10px;
  font-size: 22px;
}
.pillar p {
  color: rgba(255, 255, 255, 0.78);
}

/* ── Contact ───────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.contact-card:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: var(--shadow);
}
.contact-card > .icon:not(.arrow) {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 14px;
  background: var(--surface);
  fill: var(--blue);
}
.contact-card > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.contact-card strong {
  font-weight: 600;
}
.contact-card span span {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.contact-card .arrow {
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: auto;
  fill: var(--muted);
  transition: transform 0.15s, fill 0.15s;
}
a.contact-card:hover .arrow {
  transform: translateX(3px);
  fill: var(--blue);
}

/* ── Product page ──────────────────────────────────────────────── */
.product-main {
  padding: 24px 0 72px;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--blue);
}
.product {
  display: grid;
  gap: 28px;
}
.product-media {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
}
@media (min-width: 900px) {
  .product {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }
  /* The photo stays in view while the details scroll past it. */
  .product-media {
    position: sticky;
    top: 88px;
  }
}
.product-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.product-media .badge {
  top: 16px;
  left: 16px;
  font-size: 13px;
  padding: 4px 12px;
}
.product-info h1 {
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 52px);
}
.product-size {
  margin-top: 10px;
  font-size: 16px;
  color: var(--muted);
}
.product-size span {
  font-weight: 600;
  color: var(--ink);
}
.price {
  margin-top: 14px;
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
}
.price span {
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
}
.product-block {
  margin-top: 28px;
}
.product-block h2 {
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
:lang(km) .product-block h2 {
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}
.product-block > p {
  font-size: 17px;
}
.benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.benefits li {
  position: relative;
  padding-left: 22px;
  font-size: 16px;
}
.benefits li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 9px;
  height: 9px;
  background: var(--pink);
  clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
}
.tag-link {
  border: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.tag-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.ingredients-list {
  color: var(--muted);
  font-size: 15px !important;
}
.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.related {
  margin-top: 72px;
}
.related h2 {
  margin-bottom: 24px;
  font-size: clamp(26px, 3.6vw, 34px);
}
@media (min-width: 1100px) {
  .grid-related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── 404 ───────────────────────────────────────────────────────── */
.not-found {
  padding-top: 96px;
  padding-bottom: 120px;
  display: grid;
  gap: 16px;
  justify-items: start;
}
.not-found h1 {
  font-size: 44px;
}
.not-found p {
  color: var(--muted);
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding-top: 48px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.footer-tagline {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover {
  color: var(--white);
  text-decoration: underline;
}
.footer-base {
  margin-top: 36px;
  padding: 20px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* ── Reveal on scroll (only once JS is running; motion-safe) ───── */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card-link,
  .card-media img,
  .btn,
  .shelf-item {
    transition: none;
  }
}
