/* ==========================================================================
   CWM Telegram Mini App — landing page styles
   ========================================================================== */

/* Khmer webfont ---------------------------------------------------------- */
@font-face { font-family: 'MiSans Khmer'; src: url('../fonts/MiSansKhmer-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'MiSans Khmer'; src: url('../fonts/MiSansKhmer-Semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'MiSans Khmer'; src: url('../fonts/MiSansKhmer-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'MiSans Khmer'; src: url('../fonts/MiSansKhmer-Heavy.woff2') format('woff2'); font-weight: 800 900; font-display: swap; }

/* Tokens ---------------------------------------------------------------- */
:root {
  --blue: #229ED9;
  --blue-bright: #2AABEE;
  --blue-deep: #1B93D6;
  --blue-pale: #eaf6fd;
  --blue-wash: #f0f8fd;
  --ink: #1C2733;
  --ink-soft: #5b6b76;
  --yellow: #FFC94D;
  --green: #34C795;
  --wrap: 1160px;
  --pad: clamp(20px, 5vw, 64px);
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-km: 'MiSans Khmer', 'Nunito', sans-serif;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  text-wrap: pretty;
  background-color: #fff;
  background-image: url('../img/doodles-bg.png');
  background-size: 560px 560px;
  background-repeat: repeat;
  background-position: 0 0;
}

body.cwm-lang-km { font-family: var(--font-km); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px;
  width: auto; height: auto; clip: auto;
  z-index: 999;
  padding: 10px 16px; border-radius: 999px;
  background: #fff; color: var(--blue-deep); font-weight: 800;
}

/* Language visibility --------------------------------------------------- */
.i18n-km { display: none; }
body.cwm-lang-km .i18n-en { display: none; }
body.cwm-lang-km .i18n-km { display: inline; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px; line-height: 1;
  padding: 14px 24px; border-radius: 999px; border: 0;
  white-space: nowrap; cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff;
  font-size: 14px; padding: 11px 20px;
  box-shadow: 0 6px 16px rgba(34, 158, 217, 0.35);
}
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(34, 158, 217, 0.45); }

.btn-onblue {
  background: #fff; color: var(--blue);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.btn-onblue:hover { color: var(--blue-deep); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24); }

.btn-outline-white {
  background: transparent; color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.53);
}
.btn-outline-white:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* Nav ------------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 16px var(--pad);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e3f0fa;
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { color: inherit; }

.brand-mark { position: relative; width: 40px; height: 40px; flex: none; }
.brand-tile-back,
.brand-tile-front { position: absolute; inset: 0; border-radius: 12px; }
.brand-tile-back { background: #DCEFFB; border: 2px solid #bfe1f6; transform: rotate(-14deg); }
.brand-tile-front {
  background: linear-gradient(150deg, #3BB6F2, var(--blue-deep));
  transform: rotate(7deg);
  box-shadow: 0 5px 14px rgba(27, 147, 214, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.brand-tile-front svg { transform: rotate(-7deg); }
.brand-dot {
  position: absolute; top: -3px; right: -4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 2px solid #fff;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-line { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.brand-accent { color: var(--blue); }

.nav-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.lang-switch, .billing-switch {
  display: flex; background: var(--blue-pale);
  border-radius: 999px; padding: 3px;
}
.lang-btn, .billing-btn {
  font-family: inherit; font-weight: 800;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn { font-size: 12px; padding: 7px 14px; }
.billing-btn { font-size: 13px; padding: 9px 18px; }
.lang-btn:hover, .billing-btn:hover { background: rgba(34, 158, 217, 0.12); }
.lang-btn.is-active, .billing-btn.is-active { background: var(--blue); color: #fff; }

/* Shared type ----------------------------------------------------------- */
.kicker {
  display: inline-block;
  font-size: 13px; font-weight: 800; letter-spacing: 0.03em;
  padding: 7px 14px; border-radius: 999px;
  background: var(--blue-pale); color: var(--blue);
  margin: 0 0 16px;
}
.kicker-onblue { background: rgba(255, 255, 255, 0.15); color: #fff; }
.kicker-onlight { background: #fff; color: var(--blue); }

.section-title { font-weight: 900; font-size: clamp(28px, 3.4vw, 40px); }
.section-title.sm { font-size: clamp(24px, 3vw, 34px); }
.section-title.on-blue { color: #fff; }

.body-copy { font-size: 15.5px; line-height: 26px; max-width: 44ch; color: var(--ink-soft); }
.body-copy.on-blue { color: #eaf6fd; max-width: 60ch; }

/* Hero ------------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--blue-bright), var(--blue-deep));
  border-radius: 0 0 44px 44px;
  padding: clamp(56px, 9vw, 96px) 0 clamp(72px, 10vw, 120px);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: 32px 48px;
  align-items: center;
}
.hero-anim { justify-self: center; width: 100%; max-width: 380px; }
.hero-anim dotlottie-player { display: block; width: 100%; aspect-ratio: 1 / 1; }
.hero-title { font-weight: 900; font-size: clamp(36px, 6vw, 68px); line-height: 1.12; letter-spacing: -0.02em; color: #fff; }
.hero-line { display: block; }
.hero-sub { font-size: 17px; line-height: 28px; max-width: 56ch; margin: 24px 0 0; color: #eaf6fd; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

/* Features -------------------------------------------------------------- */
.features { padding: clamp(56px, 8vw, 88px) 0 clamp(40px, 6vw, 64px); }
.features .section-title { margin-bottom: 40px; max-width: 22ch; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card {
  background: #fff; border-radius: 22px; padding: 26px;
  box-shadow: 0 6px 20px rgba(28, 39, 51, 0.07);
}
.feature-chip {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 16px; margin-bottom: 16px;
}
.feature-title { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.feature-copy { font-size: 14.5px; line-height: 23px; color: var(--ink-soft); }

/* Showcase (phone) ------------------------------------------------------ */
.showcase, .dashboard {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px 56px; align-items: center;
  padding: clamp(40px, 6vw, 64px) 0;
}
.showcase {
  background: var(--blue-wash); border-radius: 32px;
  padding-inline: clamp(24px, 4vw, 48px);
}

.phone-figure { position: relative; margin: 0; padding: 32px 0; justify-self: center; }
.phone {
  position: relative;
  width: 260px; aspect-ratio: 260 / 562;
  border-radius: 48px; background: #F2F2F7; overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.phone-island {
  position: absolute; top: 1.3%; left: 50%; transform: translateX(-50%);
  width: 27%; aspect-ratio: 126 / 37;
  border-radius: 999px; background: #000; z-index: 5;
}
.phone-home {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 35%; height: 5px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.25); z-index: 5;
}
/* contain, so the whole screenshot stays visible instead of cropping */
.phone-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* Dashboard ------------------------------------------------------------- */
.dash-figure {
  margin: 0; order: 1;
  border-radius: 24px; overflow: hidden;
  aspect-ratio: 16 / 10; background: var(--blue-wash);
  box-shadow: 0 16px 40px rgba(28, 39, 51, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.dash-shot { width: 100%; height: 100%; object-fit: contain; }
.dashboard > div:last-child { order: 2; }

.slot-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 20px;
  font-size: 13px; text-align: center; color: #8a97a1;
}

/* Multi-shop ------------------------------------------------------------ */
.multi { padding: clamp(40px, 6vw, 64px) 0; }
.multi-card {
  background: linear-gradient(160deg, var(--blue-bright), var(--blue-deep));
  border-radius: 28px; padding: clamp(32px, 5vw, 48px); color: #fff;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; align-items: center;
}
.shop-list {
  display: flex; flex-direction: column; gap: 10px;
  justify-self: center; width: 100%; max-width: 250px;
}
.shop-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px; padding: 11px 13px;
}
.shop-dot { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.shop-text { flex: 1; min-width: 0; }
.shop-name { display: block; font-weight: 800; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-meta { display: block; font-size: 11.5px; color: #dceefb; margin-top: 1px; }
.shop-row svg { flex: none; }

/* Pricing --------------------------------------------------------------- */
.pricing { padding: clamp(48px, 7vw, 80px) 0; }
.pricing .section-title { margin-bottom: 24px; max-width: 24ch; }

.billing-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
.billing-note { font-size: 13px; color: var(--ink-soft); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.plan {
  position: relative; background: #fff; color: var(--ink);
  border-radius: 26px; padding: 30px 26px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 6px 20px rgba(28, 39, 51, 0.07);
}
.plan.is-featured {
  background: linear-gradient(160deg, var(--blue-bright), var(--blue-deep));
  color: #fff;
  box-shadow: 0 16px 36px rgba(34, 158, 217, 0.35);
}
.plan-badge {
  position: absolute; top: -12px; right: 20px;
  background: var(--yellow); color: var(--ink);
  font-size: 12px; font-weight: 800;
  padding: 6px 14px; border-radius: 999px;
  transform: rotate(4deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.plan-name { font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-amount { font-weight: 900; font-size: 32px; letter-spacing: -0.02em; }
.plan-per { font-size: 14px; font-weight: 600; opacity: 0.75; }
.plan-billed { font-size: 12.5px; opacity: 0.75; }
.plan-shops { font-size: 13px; opacity: 0.75; }

.plan-features { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.plan-features li { position: relative; padding-left: 20px; font-size: 14px; line-height: 22px; }
.plan-features li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue);
}
.plan.is-featured .plan-features li::before { background: #fff; }

.plan-cta {
  margin-top: auto; justify-content: center;
  font-size: 14px; padding: 13px 20px;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff;
}
.plan-cta:hover { color: #fff; }
.plan.is-featured .plan-cta { background: #fff; color: var(--blue); }

.pricing-note { font-size: 13px; color: var(--ink-soft); margin-top: 24px; }

/* FAQ ------------------------------------------------------------------- */
.faq { padding: clamp(40px, 6vw, 64px) 0; }
.faq .section-title { margin-bottom: 32px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.faq-item {
  background: #fff; border-radius: 18px; padding: 20px 24px;
  box-shadow: 0 6px 20px rgba(28, 39, 51, 0.07);
}
.faq-item summary {
  font-weight: 800; font-size: 16px; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-weight: 800; color: var(--blue); flex: none;
}
.faq-item[open] summary::after { content: '\2013'; }
.faq-item p { margin-top: 12px; font-size: 15px; line-height: 25px; color: var(--ink-soft); }

/* Closing CTA ----------------------------------------------------------- */
.close-cta {
  position: relative; overflow: hidden; margin-top: 8px;
  background: linear-gradient(160deg, var(--blue-bright), var(--blue-deep));
  border-radius: 44px 44px 0 0;
  padding: clamp(56px, 8vw, 84px) 0;
}
.close-cta .wrap { position: relative; }
.close-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.8fr);
  gap: 32px 48px;
  align-items: center;
}
.close-copy { order: 1; }
.close-anim { order: 2; justify-self: center; width: 100%; max-width: 320px; }
.close-anim dotlottie-player { display: block; width: 100%; aspect-ratio: 1 / 1; }
.close-title { font-weight: 900; font-size: clamp(28px, 4vw, 46px); line-height: 1.15; max-width: 18ch; color: #fff; margin-bottom: 14px; }
.close-sub { font-size: 17px; line-height: 28px; max-width: 48ch; color: #eaf6fd; margin-bottom: 30px; }

/* Footer ---------------------------------------------------------------- */
.site-footer { background: #fff; position: relative; z-index: 1; padding-top: 8px; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between;
  padding-block: clamp(28px, 5vw, 40px);
  font-size: 13px; line-height: 22px; color: var(--ink-soft);
}
.footer-brand { font-weight: 800; color: var(--ink); }
.footer-contact { display: flex; flex-direction: column; gap: 4px; }

.fallback { padding-block: 64px; }

/* Small screens --------------------------------------------------------- */
@media (max-width: 720px) {
  .hero-inner, .close-inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .hero { border-radius: 0 0 32px 32px; }
  .close-cta { border-radius: 32px 32px 0 0; }
  .dash-figure { order: 2; }
  .dashboard > div:last-child { order: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
