/* ============================================================
   Kodu Sandbox — landing загвар
   Build алхамгүй, цэвэр CSS. Гадаад сан/фонт ХЭРЭГЛЭХГҮЙ.
   ============================================================ */

/* ── Токенууд ───────────────────────────────────────────────── */
:root {
  --bg: #070a14;
  --panel: #0e1425;
  --panel-2: #131a2f;
  --line: #1d2540;
  --line-2: #2a3459;

  --text: #e9ecf7;
  --text-dim: #aab2ca;
  --muted: #7a839f;

  --violet: #7c6cff;
  --blue: #5fa8ff;
  --cyan: #4fd6e0;
  --green: #3ddc84;
  --amber: #ffb454;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  --maxw: 1140px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

* {
  margin: 0;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: rgba(124, 108, 255, 0.35);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 16px;
  text-decoration: none;
}

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

/* ── Дэвсгэрийн давхаргууд ──────────────────────────────────── */
.bg-aurora,
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Зөөлөн өнгөт туяа — hero-гийн ард */
.bg-aurora {
  background:
    radial-gradient(58rem 34rem at 12% -8%, rgba(124, 108, 255, 0.28), transparent 62%),
    radial-gradient(48rem 30rem at 92% 2%, rgba(95, 168, 255, 0.2), transparent 60%),
    radial-gradient(40rem 28rem at 60% 34%, rgba(79, 214, 224, 0.09), transparent 66%);
  filter: blur(0.5px);
}

/* Нарийн тор — доошоо бүдгэрнэ */
.bg-grid {
  background-image:
    linear-gradient(rgba(148, 163, 210, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 210, 0.055) 1px, transparent 1px);
  background-size: 62px 62px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 46%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 46%, transparent 78%);
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ── Толгой ─────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 10, 20, 0.62);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
header.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(7, 10, 20, 0.86);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 66px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: none;
}
.logo__mark {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 8px;
  filter: drop-shadow(0 2px 10px rgba(255, 148, 40, 0.4));
}
.logo__text {
  font-size: 16px;
  color: var(--text-dim);
}
.logo__text b {
  color: var(--text);
  font-weight: 800;
}

.nav__links {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}
.nav__links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  padding: 7px 12px;
  border-radius: 9px;
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover {
  color: var(--text);
  background: rgba(148, 163, 210, 0.07);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

/* ── Жижиг элементүүд ───────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: rgba(19, 26, 47, 0.7);
  border-radius: 999px;
  padding: 5px 13px;
  white-space: nowrap;
}
.pill--accent {
  color: #c3c9ff;
  border-color: rgba(124, 108, 255, 0.34);
  background: rgba(124, 108, 255, 0.1);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55);
  animation: ping 2.4s var(--ease) infinite;
  flex: none;
}
.pill--accent .dot {
  background: var(--violet);
  box-shadow: 0 0 0 0 rgba(124, 108, 255, 0.55);
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(61, 220, 132, 0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 11px;
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, background 0.25s,
    border-color 0.25s;
}
.btn--sm {
  padding: 7px 15px;
  font-size: 14px;
  border-radius: 9px;
}
.btn--primary {
  background: linear-gradient(135deg, var(--violet), #5b6bff 55%, var(--blue));
  color: #fff;
  box-shadow: 0 8px 26px -10px rgba(124, 108, 255, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px rgba(124, 108, 255, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn--ghost {
  background: rgba(148, 163, 210, 0.06);
  border-color: var(--line-2);
  color: var(--text-dim);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: #3c497a;
  background: rgba(148, 163, 210, 0.11);
  transform: translateY(-2px);
}
.btn svg {
  transition: transform 0.25s var(--ease);
}
.btn:hover svg {
  transform: translateX(3px);
}

.grad {
  background: linear-gradient(100deg, #a99bff 0%, var(--blue) 48%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 54px;
  align-items: center;
  padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 76px);
}

.hero__copy > * + * {
  margin-top: 22px;
}

h1 {
  font-size: clamp(33px, 4.5vw, 52px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.032em;
}

.sub {
  color: var(--text-dim);
  font-size: clamp(16px, 1.5vw, 18px);
  max-width: 34em;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px !important;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.stat dt {
  font-size: clamp(19px, 2.3vw, 24px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff, #a9b6e8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat dd {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* ── Демо (терминал + preview цонх) ─────────────────────────── */
.hero__demo {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 470px;
  align-content: start;
}

.demo__glow {
  position: absolute;
  inset: -14% 0 -6%;
  background: radial-gradient(60% 55% at 50% 40%, rgba(124, 108, 255, 0.3), transparent 70%);
  filter: blur(46px);
  pointer-events: none;
  z-index: -1;
}

.term,
.browser {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(16, 22, 41, 0.96), rgba(10, 14, 28, 0.96));
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.term__bar,
.browser__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding-inline: 14px;
  background: linear-gradient(180deg, rgba(31, 40, 68, 0.75), rgba(20, 27, 47, 0.75));
  border-bottom: 1px solid var(--line);
}

.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.tdot--r {
  background: #ff5f57;
}
.tdot--y {
  background: #febc2e;
}
.tdot--g {
  background: #28c840;
}

.term__title {
  margin-left: 8px;
  font: 12px/1 var(--mono);
  color: var(--muted);
  letter-spacing: 0.01em;
}

.term__body {
  padding: 15px 16px 17px;
  font: 12.8px/1.75 var(--mono);
  min-height: 168px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tline {
  display: block;
  opacity: 0;
  transform: translateY(4px);
  animation: lineIn 0.34s var(--ease) forwards;
}
@keyframes lineIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.tline--cmd {
  color: #dfe4f7;
}
.tline--cmd .prompt {
  color: var(--violet);
  font-weight: 700;
}
.tline--dim {
  color: var(--muted);
}
.tline--run {
  color: var(--blue);
}
.tline--ok {
  color: var(--green);
}
.tline--res {
  color: var(--text-dim);
}
.tline .k {
  color: var(--cyan);
}
.tline .s {
  color: #b8e6a0;
}
.tline .b {
  color: var(--amber);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  vertical-align: -2px;
  background: var(--blue);
  margin-left: 1px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.spinner {
  display: inline-block;
  width: 1ch;
  color: var(--blue);
}

/* Preview цонх — JS-гүй үед шууд харагдана (дээрхтэй ижил зарчим) */
.js .browser {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.js .browser.is-on {
  opacity: 1;
  transform: none;
}

.browser__url {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  font: 11.5px/1 var(--mono);
  color: #9fd8b4;
  background: rgba(61, 220, 132, 0.08);
  border: 1px solid rgba(61, 220, 132, 0.2);
  border-radius: 999px;
  padding: 5px 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Preview дотор "асаж" буй жишээ сайт */
.mini {
  padding: 14px;
  height: 182px;
  background: linear-gradient(180deg, #101733 0%, #0a0e1c 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.js .mini > * {
  opacity: 0;
  transform: translateY(8px);
}
.browser.is-on .mini > * {
  animation: miniIn 0.5s var(--ease) forwards;
}
.browser.is-on .mini__nav {
  animation-delay: 0.12s;
}
.browser.is-on .mini__hero {
  animation-delay: 0.24s;
}
.browser.is-on .mini__cards {
  animation-delay: 0.38s;
}
@keyframes miniIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.mini__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mini__logo {
  width: 46px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--blue));
}
.mini__links {
  display: flex;
  gap: 7px;
}
.mini__links i {
  width: 22px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 210, 0.22);
}

.mini__hero {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  padding-block: 6px 2px;
}
.mini__h1 {
  width: 74%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(233, 236, 247, 0.85), rgba(169, 182, 232, 0.5));
}
.mini__h1--short {
  width: 46%;
}
.mini__btn {
  margin-top: 5px;
  width: 78px;
  height: 20px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 6px 16px -6px rgba(124, 108, 255, 0.9);
}

.mini__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: auto;
}
.mini__cards div {
  height: 46px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 210, 0.14);
  background: rgba(148, 163, 210, 0.06);
}

/* ── Урсгалын мөр ───────────────────────────────────────────── */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(19, 26, 47, 0.66), rgba(14, 20, 37, 0.5));
  font: 13.5px/1 var(--mono);
  color: var(--text-dim);
}
.flow__node {
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(10, 14, 28, 0.7);
  white-space: nowrap;
}
.flow__node--api {
  color: #c3c9ff;
  border-color: rgba(124, 108, 255, 0.4);
  background: rgba(124, 108, 255, 0.12);
}
.flow__node--url {
  color: #9fd8b4;
  border-color: rgba(61, 220, 132, 0.32);
  background: rgba(61, 220, 132, 0.09);
}
.flow__arrow {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  position: relative;
  flex: none;
}
.flow__arrow::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 6px;
  height: 5px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: slide 2.6s linear infinite;
}
@keyframes slide {
  0% {
    left: 0;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 20px;
    opacity: 0;
  }
}
.flow__tail {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
}

/* ── Хэсгүүд ────────────────────────────────────────────────── */
.section {
  padding-block: clamp(46px, 5.6vw, 74px);
  scroll-margin-top: 84px;
}

.section__head {
  max-width: 620px;
  margin-bottom: 38px;
}
.eyebrow {
  display: inline-block;
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 14px;
}
h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.lead {
  color: var(--muted);
  margin-top: 10px;
  font-size: 16.5px;
}

/* ── Картууд ────────────────────────────────────────────────── */
.grid {
  display: grid;
  /* min(…, 100%) — нарийн дэлгэцэн дээр карт хүрээнээсээ халихаас сэргийлнэ */
  grid-template-columns: repeat(auto-fit, minmax(min(268px, 100%), 1fr));
  gap: 16px;
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(276px, 100%), 1fr));
  align-items: start;
}

.card {
  position: relative;
  padding: 24px 23px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(19, 26, 47, 0.72), rgba(13, 18, 34, 0.6));
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
  overflow: hidden;
}
/* Дээд ирмэгийн гэрэлтэх зураас — hover дээр гарна */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--blue), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.95);
}
.card:hover::before {
  opacity: 1;
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 21px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(124, 108, 255, 0.1);
  margin-bottom: 15px;
}
.card h3 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin-bottom: 7px;
}
.card p {
  color: var(--muted);
  font-size: 14.3px;
  line-height: 1.62;
}

/* ── Алхмууд ────────────────────────────────────────────────── */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}
.step {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 22px 0 26px 0;
}
/* Дугаарын доогуур холбогч шугам */
.step::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 60px;
  bottom: -4px;
  width: 1px;
  background: linear-gradient(180deg, var(--line-2), transparent);
}
.step:last-child::before {
  display: none;
}

.step__n {
  flex: none;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 8px 22px -10px rgba(124, 108, 255, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 1;
}
.step__body h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin-bottom: 5px;
}
.step__body p {
  color: var(--muted);
  font-size: 14.6px;
  max-width: 62ch;
}

code {
  font-family: var(--mono);
  font-size: 0.87em;
  color: #c3c9ff;
  background: rgba(124, 108, 255, 0.1);
  border: 1px solid rgba(124, 108, 255, 0.22);
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
}

/* ── Замын зураг ────────────────────────────────────────────── */
.card--road {
  padding-top: 20px;
}
.road__tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 16px;
}
.road__tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.road__tag--done {
  color: var(--green);
  background: rgba(61, 220, 132, 0.1);
  border: 1px solid rgba(61, 220, 132, 0.26);
}
.road__tag--now {
  color: var(--amber);
  background: rgba(255, 180, 84, 0.1);
  border: 1px solid rgba(255, 180, 84, 0.26);
}
.road__tag--next {
  color: var(--blue);
  background: rgba(95, 168, 255, 0.1);
  border: 1px solid rgba(95, 168, 255, 0.26);
}

.road {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 9px;
}
.road li {
  position: relative;
  padding-left: 22px;
  font-size: 14.2px;
  color: var(--text-dim);
  line-height: 1.5;
}
.road li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-2);
}
.card--road:nth-child(1) .road li::before {
  background: rgba(61, 220, 132, 0.75);
}
.card--road:nth-child(2) .road li::before {
  background: rgba(255, 180, 84, 0.75);
}
.card--road:nth-child(3) .road li::before {
  background: rgba(95, 168, 255, 0.7);
}

/* ── Хөл ────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  background: linear-gradient(180deg, transparent, rgba(124, 108, 255, 0.05));
}
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: center;
  justify-content: space-between;
  padding-block: 30px 44px;
}
.footer__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.logo--sm .logo__mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}
.logo--sm .logo__text {
  font-size: 14.5px;
}

.footer__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}
.footer__right a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.footer__right a:hover {
  color: var(--text);
}
.footer__sep {
  color: var(--line-2);
}

.veio {
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(100deg, #a99bff, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  position: relative;
}
.veio::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, #a99bff, var(--cyan));
  opacity: 0;
  transition: opacity 0.22s;
}
.veio:hover::after {
  opacity: 0.85;
}

/* ── Гүйлгэхэд гарч ирэх ────────────────────────────────────── */
/* ⚠️ Зөвхөн JS ажиллаж байвал нуупа (.js ангиллыг head доторх скрипт тавина).
   Эс бол app.js ачаалагдаагүй үед агуулга бүхэлдээ алга болно. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ── Дэлгэцийн хэмжээ ───────────────────────────────────────── */
@media (max-width: 980px) {
  .hero {
    /* minmax(0,…) ЧУХАЛ: энгийн 1fr бол доторх урт мөр track-ыг тэлж,
       бүх хуудсыг хэвтээгээр халиулдаг (grid blowout). */
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding-block: 40px 44px;
  }
  .hero__demo {
    min-height: 0;
    order: 2;
  }
  .nav__links {
    display: none;
  }
  .nav {
    justify-content: space-between;
  }
}

@media (max-width: 620px) {
  .stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .stat {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .stat dd {
    margin: 0;
  }
  .flow {
    font-size: 12.5px;
    gap: 9px;
    padding: 16px;
  }
  .flow__arrow {
    width: 18px;
  }
  .flow__tail {
    margin-left: 0;
    width: 100%;
  }
  .term__body {
    font-size: 11.6px;
    min-height: 196px;
  }
  .hero__cta .btn {
    flex: 1 1 100%;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Хөдөлгөөн багасгах горим ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* .js угтвартай дүрмүүдийг дарахын тулд ижил тодорхойлолттой байх ёстой */
  .js .reveal,
  .js .browser,
  .js .mini > * {
    opacity: 1;
    transform: none;
  }
  .caret {
    display: none;
  }
}

/* ── Амьд тоо: «Бидэнд бүү итгэ — өөрөө шалга» ───────────────────── */
.live {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 28px);
}
.live__status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.live__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.live[data-state="ok"] .live__dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: livePulse 2s var(--ease) infinite;
}
.live[data-state="ok"] .live__status { color: var(--green); }
.live[data-state="bad"] .live__dot,
.live[data-state="err"] .live__dot { background: var(--amber); }
.live[data-state="bad"] .live__status,
.live[data-state="err"] .live__status { color: var(--amber); }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}
.live__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.live__tile {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 16px;
}
.live__tile dt {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.live__tile dd {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.live__src {
  margin: 18px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.6;
}
.live__src a { color: var(--cyan); }
.live__at { display: inline-block; margin-left: 6px; font-family: var(--mono); }
/* Толгой дахь «Амьд» тэмдэг бодит төлөвийг дагана */
.pill--live[data-state="err"] .dot,
.pill--live[data-state="bad"] .dot { background: var(--amber); }
@media (max-width: 640px) {
  .live__grid { grid-template-columns: 1fr; }
}
