/* ── FONT FACES ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'InterKhmerLooped';
  src: url('InterKhmer/ttf/InterKhmerLooped-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'InterKhmerLooped';
  src: url('InterKhmer/ttf/InterKhmerLooped-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'InterKhmerLooped';
  src: url('InterKhmer/ttf/InterKhmerLooped-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'InterKhmerLooped';
  src: url('InterKhmer/ttf/InterKhmerLooped-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  --ease: cubic-bezier(.22,1,.36,1);
  --radius: 16px;
  --radius-sm: 8px;
  --font-display: 'Inter', 'InterKhmerLooped', 'Noto Serif Khmer', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Inter', monospace;
}

[data-theme="dark"] {
  --bg:          #0a0c10;
  --bg2:         #10141c;
  --bg3:         #161b26;
  --surface:     #1c2232;
  --surface2:    #222a3a;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.14);
  --text:        #eef2ff;
  --text2:       #94a3b8;
  --text3:       #64748b;
  --accent:      #6c8ef5;
  --accent2:     #4f6fd4;
  --gold:        #f0c060;
  --gold2:       #c89a30;
  --glow:        rgba(108,142,245,0.18);
  --glow-gold:   rgba(240,192,96,0.15);
  --nav-bg:      rgba(10,12,16,0.85);
}

[data-theme="light"] {
  --bg:          #f4f6fb;
  --bg2:         #ffffff;
  --bg3:         #eef1f8;
  --surface:     #ffffff;
  --surface2:    #f0f3fa;
  --border:      rgba(0,0,0,0.08);
  --border2:     rgba(0,0,0,0.14);
  --text:        #0f172a;
  --text2:       #475569;
  --text3:       #94a3b8;
  --accent:      #3b5bdb;
  --accent2:     #2f4dc4;
  --gold:        #b45309;
  --gold2:       #92400e;
  --glow:        rgba(59,91,219,0.10);
  --glow-gold:   rgba(180,83,9,0.08);
  --nav-bg:      rgba(244,246,251,0.90);
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

[data-lang="km"] .en { display: none !important; }
[data-lang="en"] .km { display: none !important; }

/* ── NAV ────────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: 64px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}

.nav-logo {
  display: flex; align-items: baseline; gap: 0.5rem;
  text-decoration: none;
}

.nav-logo .word-en {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem; font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.nav-logo .word-km {
  font-family: 'InterKhmerLooped', 'Noto Serif Khmer', serif;
  font-size: 1rem; font-weight: 400;
  color: var(--gold);
  opacity: 0.85;
}

.nav-controls { display: flex; align-items: center; gap: 0.5rem; }

.pill-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.pill-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--accent); }
.pill-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-size: 1rem;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--accent); }

.cta-nav {
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.25s var(--ease);
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.cta-nav:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 20px var(--glow); }

/* ── HERO ───────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 100px clamp(1.5rem, 6vw, 5rem) 6rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Mesh background */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, var(--glow), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, var(--glow-gold), transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(108,142,245,0.05), transparent);
}

/* Grid lines */
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 70%);
}

.hero-inner { position: relative; z-index: 1; max-width: 860px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface);
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em;
  color: var(--text2);
  margin-bottom: 2rem;
  animation: fadeUp 0.7s var(--ease) 0.1s both;
}
.hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }

.hero-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
  animation: fadeUp 0.7s var(--ease) 0.2s both;
}
.hero-title .accent { color: var(--accent); }
.hero-title .gold   { color: var(--gold);   }

.hero-sub-km {
  font-family: 'InterKhmerLooped', 'Noto Serif Khmer', serif;
  font-size: clamp(1.2rem, 3.5vw, 2.2rem);
  font-weight: 300;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.7s var(--ease) 0.3s both;
}

.hero-desc {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text2);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  font-weight: 300;
  line-height: 1.7;
  animation: fadeUp 0.7s var(--ease) 0.35s both;
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
  animation: fadeUp 0.7s var(--ease) 0.45s both;
}

.btn-primary {
  padding: 0.85rem 2.2rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.3s var(--ease);
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); box-shadow: 0 8px 32px var(--glow); }

.btn-outline {
  padding: 0.85rem 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  text-decoration: none;
}
.btn-outline:hover { background: var(--surface); border-color: var(--accent); transform: translateY(-2px); }

/* floating stat chips */
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
  margin-top: 3.5rem;
  animation: fadeUp 0.7s var(--ease) 0.55s both;
}
.stat-chip {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface);
  font-size: 0.82rem; color: var(--text2);
}
.stat-chip strong { color: var(--text); font-size: 1rem; font-variant-numeric: tabular-nums; }

/* ── SECTION SHARED ─────────────────────────────────────────────── */
section { padding: 5rem clamp(1.5rem, 6vw, 5rem); }
.section-label {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.section-desc {
  font-size: 1rem; color: var(--text2);
  max-width: 560px; line-height: 1.75; font-weight: 300;
}
.center { text-align: center; }
.center .section-desc { margin: 0 auto; }

/* ── OVERVIEW CARDS ─────────────────────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
.ov-card {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.ov-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0; transition: opacity 0.3s;
}
.ov-card:hover { border-color: var(--border2); transform: translateY(-4px); box-shadow: 0 16px 48px rgba(0,0,0,0.15); }
.ov-card:hover::before { opacity: 1; }
.ov-icon { display:flex; align-items:center; margin-bottom: 0.75rem; }
.ov-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.ov-desc  { font-size: 0.85rem; color: var(--text2); line-height: 1.6; }

/* ── FEATURES ───────────────────────────────────────────────────── */
.features-wrapper { max-width: 1160px; margin: 0 auto; }
.feature-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
  align-items: start; padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}
.feature-block:last-child { border-bottom: none; }
.feature-block.reverse { direction: rtl; }
.feature-block.reverse > * { direction: ltr; }

.feature-num {
  font-family: var(--font-mono);
  font-size: 0.72rem; color: var(--accent);
  letter-spacing: 0.1em; margin-bottom: 0.5rem;
}
.feature-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800; line-height: 1.2;
  margin-bottom: 1rem;
}
.feature-desc {
  font-size: 0.95rem; color: var(--text2);
  line-height: 1.75; font-weight: 300;
  margin-bottom: 1.25rem;
}
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.feature-list li {
  display: flex; align-items: flex-start; gap: 0.65rem;
  font-size: 0.875rem; color: var(--text2); line-height: 1.5;
}
.feature-list li::before {
  content: '→';
  color: var(--accent); flex-shrink: 0; margin-top: 0.05rem;
  font-family: var(--font-mono);
}

/* feature mockup card */
.feature-mockup {
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg3);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.mock-bar {
  height: 36px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px; padding: 0 1rem;
}
.mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.mock-body { padding: 1.25rem; }
.mock-title { font-size: 0.7rem; color: var(--text3); font-family: var(--font-mono); margin-bottom: 0.75rem; }

.mock-stat-row { display: flex; gap: 0.6rem; margin-bottom: 0.75rem; }
.mock-stat {
  flex: 1; padding: 0.7rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
}
.mock-stat .l { font-size: 0.6rem; color: var(--text3); margin-bottom: 0.2rem; }
.mock-stat .v { font-size: 1rem; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }

.mock-bar-chart { display: flex; gap: 5px; align-items: flex-end; height: 52px; margin-bottom: 0.75rem; }
.mock-bar-item { flex: 1; border-radius: 3px 3px 0 0; background: var(--accent); opacity: 0.7; transition: opacity 0.2s; }

.mock-table { width: 100%; border-collapse: collapse; }
.mock-table th, .mock-table td {
  font-size: 0.62rem; padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left; color: var(--text2);
}
.mock-table th { color: var(--text3); font-family: var(--font-mono); font-weight: 400; }
.mock-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem; border-radius: 999px;
  font-size: 0.55rem; font-weight: 600;
}

.mock-user-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.mock-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); opacity: 0.7; flex-shrink: 0; }
.mock-uname { font-size: 0.65rem; color: var(--text2); }
.mock-udept { font-size: 0.57rem; color: var(--text3); }
.mock-dot-status { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-pill {
  padding: 0.3rem 0.85rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
}

/* ── EXPORT ─────────────────────────────────────────────────────── */
.export-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem; margin-top: 2.5rem;
}
.export-card {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.3s var(--ease);
}
.export-card:hover { border-color: var(--accent); box-shadow: 0 8px 32px var(--glow); transform: translateY(-3px); }
.export-icon { display:flex; align-items:center; margin-bottom: 0.75rem; }
.export-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.export-desc { font-size: 0.85rem; color: var(--text2); line-height: 1.6; margin-bottom: 0.75rem; }
.export-meta { font-size: 0.72rem; color: var(--text3); font-family: var(--font-mono); }

/* ── NOT INCLUDED ───────────────────────────────────────────────── */
.scope-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 2rem; }
.scope-item {
  display: flex; gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
}
.scope-x {
  display:flex; align-items:flex-start; padding-top:2px;
  flex-shrink: 0;
}
.scope-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.2rem; }
.scope-note  { font-size: 0.8rem; color: var(--text2); line-height: 1.5; }

/* ── SETTINGS ───────────────────────────────────────────────────── */
.settings-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem;
  margin-top: 2.5rem;
}
.settings-card {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.3s var(--ease);
}
.settings-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.settings-icon { display:flex; align-items:center; margin-bottom: 0.6rem; }
.settings-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.settings-desc { font-size: 0.85rem; color: var(--text2); line-height: 1.6; }

/* ── CTA BAND ───────────────────────────────────────────────────── */
.cta-band {
  margin: 0 clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent) 0%, #5b4fd4 100%);
  padding: 4rem 3rem;
  text-align: center;
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(255,255,255,0.08), transparent);
}
.cta-band h2 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800; color: #fff;
  position: relative; margin-bottom: 0.75rem;
}
.cta-band p {
  font-size: 1.05rem; color: rgba(255,255,255,0.8);
  max-width: 480px; margin: 0 auto 2rem; font-weight: 300;
  position: relative;
}
.cta-band .btn-white {
  padding: 0.9rem 2.4rem; border-radius: 999px;
  border: none; background: #fff;
  color: var(--accent); font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer; position: relative;
  transition: all 0.3s var(--ease); text-decoration: none; display: inline-block;
}
.cta-band .btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.2); }

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  padding: 3rem clamp(1.5rem, 6vw, 5rem) 2rem;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 2rem;
  align-items: center; justify-content: space-between;
}
.footer-brand .word-en {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.1em;
}
.footer-brand .word-km {
  font-family: 'InterKhmerLooped', 'Noto Serif Khmer', serif;
  font-size: 0.85rem; color: var(--gold); margin-left: 0.4rem;
}
.footer-copy { font-size: 0.8rem; color: var(--text3); }

/* ── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}

.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .feature-block { grid-template-columns: 1fr; gap: 2rem; }
  .feature-block.reverse { direction: ltr; }
  .settings-grid { grid-template-columns: 1fr; }
  .nav-logo .word-km { display: none; }
}
@media (max-width: 520px) {
  .hero-stats { gap: 0.6rem; }
  .stat-chip { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
}

/* ── KHMER FONT HELPERS ─────────────────────────────────────────── */
.km { font-family: 'InterKhmerLooped', 'Noto Serif Khmer', serif; }
[data-lang="km"] .section-title,
[data-lang="km"] .hero-title,
[data-lang="km"] .feature-title,
[data-lang="km"] .cta-band h2 {
  font-family: 'InterKhmerLooped', 'Noto Serif Khmer', serif;
  letter-spacing: 0;
  font-weight: 700;
}
