/* ═══════════════════════════════════════════
   AI GOV KH — Base & Typography
   ═══════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography Scale ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.7rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }
h6 { font-size: .875rem; font-family: var(--font-body); font-weight: 600; }

p { color: var(--text-secondary); line-height: 1.75; }

a { color: var(--royal-mid); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--royal); }

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

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

/* ── Layout Utilities ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s5);
}

.container--narrow { max-width: 760px; }
.container--wide   { max-width: 1400px; }

.section { padding: var(--s9) 0; }
.section--sm { padding: var(--s7) 0; }
.section--lg { padding: calc(var(--s9) * 1.5) 0; }

/* ── Flex & Grid Utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--s3); }
.gap-md { gap: var(--s5); }
.gap-lg { gap: var(--s6); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 13px 28px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .9375rem;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all var(--t-mid) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--royal);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(111,46,145,.22);
}
.btn--primary:hover {
  background: var(--royal-mid);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(111,46,145,.3);
  transform: translateY(-1px);
}

.btn--gold {
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(200,150,42,.30);
}
.btn--gold:hover {
  background: var(--gold-light);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(200,150,42,.40);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--royal);
  border: 1.5px solid var(--royal);
}
.btn--outline:hover {
  background: var(--royal);
  color: var(--white);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--royal-light);
  padding-left: 0; padding-right: 0;
}
.btn--ghost:hover { color: var(--royal); gap: var(--s3); }
.btn--ghost .arrow { transition: transform var(--t-mid) var(--ease-spring); }
.btn--ghost:hover .arrow { transform: translateX(4px); }

.btn--sm { padding: 9px 18px; font-size: .875rem; }
.btn--lg { padding: 16px 36px; font-size: 1.0625rem; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.card__body { padding: var(--s5); }
.card__img { aspect-ratio: 16/9; overflow: hidden; background: var(--ink-05); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.card:hover .card__img img { transform: scale(1.04); }

/* ── Tags / Badges ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tag--blue  { background: var(--royal-pale); color: var(--royal); }
.tag--gold  { background: var(--gold-pale); color: #8A6218; }
.tag--red   { background: #FAEBEB; color: var(--crimson); }
.tag--green { background: #E8F5EE; color: #1D6B3E; }
.tag--gray  { background: var(--ink-05); color: var(--ink-70); }

/* ── Section Labels ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--royal-light);
  margin-bottom: var(--s3);
}
.eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ── Dividers ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--s5) 0;
}

/* ── Form Elements ── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-70);
}

.input {
  padding: 11px 16px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  width: 100%;
}
.input:focus {
  border-color: var(--royal-light);
  box-shadow: 0 0 0 3px rgba(111,46,145,.18);
  outline: none;
}
.input::placeholder { color: var(--ink-40); }

textarea.input { resize: vertical; min-height: 140px; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A8898' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t-mid) var(--ease);
}
.nav.scrolled { box-shadow: var(--shadow-md); }

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav__logo-mark {
  width: 38px;
  height: 38px;
  background: var(--royal);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: -.03em;
  flex-shrink: 0;
}
.nav__logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1;
}
.nav__logo-sub {
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s1);
}
.nav__link {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-70);
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}
.nav__link:hover { color: var(--royal); background: var(--ink-05); }
.nav__link.active { color: var(--royal); background: var(--royal-pale); }

.nav__cta { margin-left: var(--s3); }

.nav__lang {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 7px 12px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-70);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.nav__lang:hover { border-color: var(--royal-light); color: var(--royal); }

.nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav__mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all var(--t-mid) var(--ease);
}

/* ── Footer ── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: var(--s8) 0 var(--s6);
}
.footer h5 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: var(--s4);
}
.footer__link {
  display: block;
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  text-decoration: none;
  padding: 3px 0;
  transition: color var(--t-fast) var(--ease);
}
.footer__link:hover { color: var(--gold-light); }
.footer__logo-text { color: var(--white); font-family: var(--font-display); font-size: 1.3rem; }
.footer__tagline { font-size: .9rem; margin-top: var(--s3); max-width: 280px; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: var(--s7);
  padding-top: var(--s5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  font-size: .85rem;
  color: rgba(255,255,255,.4);
}
.footer__social {
  display: flex;
  gap: var(--s3);
  margin-top: var(--s4);
}
.footer__social a {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  font-size: .9rem;
}
.footer__social a:hover {
  background: var(--gold);
  color: var(--white);
}

/* ── Hero ── */
.hero {
  padding-top: calc(var(--nav-h) + var(--s9));
  padding-bottom: var(--s9);
  position: relative;
  overflow: hidden;
}
.hero--sm {
  padding-top: calc(var(--nav-h) + var(--s7));
  padding-bottom: var(--s7);
}
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 70% 0%, rgba(111,46,145,.06) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 10% 80%, rgba(200,150,42,.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero__pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(111,46,145,.03) 39px, rgba(111,46,145,.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(111,46,145,.03) 39px, rgba(111,46,145,.03) 40px);
  pointer-events: none;
}

/* ── Stats ── */
.stat {
  text-align: center;
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--white);
  border: 1px solid var(--border);
}
.stat__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--royal);
  line-height: 1;
}
.stat__label {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: var(--s2);
}

/* ── Accordion / FAQ ── */
.accordion__item {
  border-bottom: 1px solid var(--border);
}
.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) 0;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  gap: var(--s4);
}
.accordion__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-mid) var(--ease);
  color: var(--ink-40);
}
.accordion__trigger[aria-expanded="true"] .accordion__icon {
  background: var(--royal);
  border-color: var(--royal);
  color: var(--white);
  transform: rotate(45deg);
}
.accordion__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--t-slow) var(--ease), padding var(--t-slow) var(--ease);
}
.accordion__body.open {
  max-height: 400px;
  padding-bottom: var(--s4);
}
.accordion__body p { font-size: .9375rem; }

/* ── Toast / Alert ── */
.alert {
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  border-left: 4px solid;
}
.alert--info  { background: #F5E9FB; border-color: var(--royal-light); color: var(--royal); }
.alert--success { background: #EBF6F1; border-color: #2A9460; color: #1D6B3E; }
.alert--warn  { background: var(--gold-pale); border-color: var(--gold); color: #8A6218; }
.alert--error { background: #FAEBEB; border-color: var(--crimson); color: var(--crimson); }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.page-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-70);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.page-btn:hover { border-color: var(--royal); color: var(--royal); }
.page-btn.active { background: var(--royal); border-color: var(--royal); color: var(--white); }

/* ── Animate on scroll ── */
.aos {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.aos.visible {
  opacity: 1;
  transform: translateY(0);
}
.aos-delay-1 { transition-delay: 80ms; }
.aos-delay-2 { transition-delay: 160ms; }
.aos-delay-3 { transition-delay: 240ms; }
.aos-delay-4 { transition-delay: 320ms; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .nav__links, .nav__cta, .nav__lang { display: none; }
  .nav__mobile-toggle { display: flex; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--s7) 0; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
}

/* ── Mobile Nav Drawer ── */
.nav__drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 999;
  padding: var(--s5);
  overflow-y: auto;
  flex-direction: column;
  gap: var(--s2);
  border-top: 1px solid var(--border);
}
.nav__drawer.open { display: flex; }
.nav__drawer .nav__link {
  display: block;
  font-size: 1.1rem;
  padding: 14px 16px;
}
