:root {
  --gold: #D9BB84;
  --gold-light: #D9BB84;
  --gold-dim: rgba(212,175,55,0.15);
  --navy: #0B1F3A;
  --navy-mid: #132A4A;
  --navy-light: #1A3560;
  --white: #ffffff;
  --white-dim: rgba(255,255,255,0.7);
}

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

html { scroll-behavior: smooth; }

body {
  /* FIX 1: Noto Serif Khmer added as fallback so Khmer Unicode renders correctly on all devices */
  font-family: 'Montserrat', 'Noto Serif Khmer', sans-serif;
  background: var(--navy);
  color: var(--white);
  overflow-x: hidden;
}

/* ─── NAVBAR ─── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 60px;
  background: rgba(11,31,58,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  transition: padding 0.3s;
}

header.scrolled { padding: 12px 60px; }

/* FIX 2: Removed the duplicate .logo rule — merged into one clean block */
.logo {
  display: flex;
  align-items: center;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 1px;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  max-height: 70px;
  width: auto;
  object-fit: contain;
}

nav { display: flex; align-items: center; gap: 28px; }

nav a {
  text-decoration: none;
  color: var(--white-dim);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

nav a:hover { color: var(--gold); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: 0.3s;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 65px; left: 0; right: 0;
  background: rgba(11,31,58,0.97);
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 999;
  border-top: 1px solid rgba(212,175,55,0.2);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  text-decoration: none;
  color: var(--white-dim);
  font-size: 15px;
  padding: 16px 0;
  width: 100%;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.3s, background 0.3s;
}

.mobile-nav a:hover { color: var(--gold); background: var(--gold-dim); }

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 20px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 4s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
  to   { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.hero-ornament {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 0 auto 30px;
}

/* ─── TYPING BLOCK ─── */
.typing-block {
  /* FIX 3: Proper quoted font name + Noto Serif Khmer as fallback for Khmer script */
  font-family: 'Playfair Display', 'Noto Serif Khmer', serif;
  font-size: clamp(26px, 5vw, 48px);
  line-height: 1.6; /* FIX 4: increased from 1.5 — Khmer letters with above/below vowels need more line-height or they clip on mobile */
  min-height: 3em;
  position: relative;
  z-index: 1;
}

.typing-line {
  /* FIX 5: Changed white-space from nowrap to normal so long Khmer lines wrap on small screens instead of overflowing */
  display: block;
  overflow: hidden;
  white-space: normal;
  /* FIX 6: word-break ensures Khmer syllable clusters wrap cleanly without mid-cluster breaks */
  word-break: keep-all;
  opacity: 0;
}

.typing-line.gold { color: var(--gold); }

/* Cursor blink */
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--gold);
  vertical-align: middle;
  margin-left: 3px;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-sub {
  margin-top: 24px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transition: opacity 1s ease 0.3s;
}

.hero-sub.show { opacity: 0.8; }

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-buttons.show { opacity: 1; transform: translateY(0); }

.btn {
  padding: 13px 30px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: 0.3s;
  cursor: pointer;
}

.btn-outline {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--navy);
}

.btn-fill {
  background: var(--gold);
  color: var(--navy);
  border: 1px solid var(--gold);
}

.btn-fill:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 16px;
  height: 16px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: rotate(45deg);
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
  0%,100% { transform: rotate(45deg) translateY(0); }
  50%      { transform: rotate(45deg) translateY(5px); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  header { padding: 16px 30px; }
  header.scrolled { padding: 10px 30px; }
  nav { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  .typing-block { font-size: clamp(22px, 7vw, 34px); }
  /* FIX 7: Extra line-height on mobile so Khmer above/below vowels don't clip */
  .typing-block { line-height: 1.8; }
  .hero-buttons { gap: 10px; }
  .btn { padding: 11px 22px; font-size: 12px; }
}
