/* ==========================================================================
   WOW4U — нийтийн сайтын загвар (light / dark)
   ========================================================================== */

:root {
  --bg:          #f6f7fb;
  --surface:     #ffffff;
  --surface-2:   #f0f1f8;
  --ink:         #0f1020;
  --text:        #3b3d55;
  --muted:       #6b6e8a;
  --line:        #e4e6f0;
  --brand:       #5b4cf0;
  --brand-dk:    #4433d8;
  --brand-soft:  #eeecff;
  --accent:      #ff5a7a;
  --accent-soft: #ffe8ee;
  --danger:      #d92d4b;
  --success:     #12865a;
  --hero-bg:     #0b0b1a;
  --grad:        linear-gradient(120deg, #6a5cff 0%, #b04cf0 50%, #ff5a7a 100%);
  --radius:      18px;
  --radius-sm:   10px;
  --shadow-sm:   0 1px 2px rgba(15, 16, 32, .05);
  --shadow:      0 1px 2px rgba(15, 16, 32, .04), 0 8px 24px rgba(15, 16, 32, .06);
  --shadow-lg:   0 20px 50px rgba(15, 16, 32, .14);
  --display:     'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --sans:        'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h:    70px;
  color-scheme: light;
}

/* Dark mode: system preference unless the visitor picked a theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0a0b14;
    --surface:     #12131f;
    --surface-2:   #1a1b2b;
    --ink:         #f2f3ff;
    --text:        #c3c5da;
    --muted:       #8b8ea8;
    --line:        #24263a;
    --brand:       #8b80ff;
    --brand-dk:    #a79fff;
    --brand-soft:  rgba(139, 128, 255, .14);
    --accent:      #ff7d97;
    --accent-soft: rgba(255, 125, 151, .14);
    --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg:   0 20px 50px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:          #0a0b14;
  --surface:     #12131f;
  --surface-2:   #1a1b2b;
  --ink:         #f2f3ff;
  --text:        #c3c5da;
  --muted:       #8b8ea8;
  --line:        #24263a;
  --brand:       #8b80ff;
  --brand-dk:    #a79fff;
  --brand-soft:  rgba(139, 128, 255, .14);
  --accent:      #ff7d97;
  --accent-soft: rgba(255, 125, 151, .14);
  --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg:   0 20px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

::selection { background: var(--brand); color: #fff; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Эх үүсвэрийн домэйнээр харуулах мэдэгдэл */
.referral-notice {
  padding: 20px 0;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.referral-message { white-space: pre-wrap; }
.referral-form { margin: 0; width: 100%; }
.referral-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.referral-link:hover { color: var(--brand-dk); }
.referral-notice [hidden] { display: none !important; }
.referral-page {
  width: min(100% - 32px, 900px);
  margin: 28px auto 48px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.referral-wait:has([hidden]) { display: none; }
.referral-page-image { width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.referral-ad { width: 100%; min-width: 0; overflow-x: auto; }
.referral-image-button { display: block; width: 100%; max-width: 100%; border-radius: var(--radius-sm); }
.referral-image-button img { width: 100%; max-width: 100%; height: auto; }
.referral-image-button:focus-visible { outline: 3px solid var(--brand); outline-offset: 6px; }
.referral-preview-note { padding-top: 20px; text-align: center; color: var(--muted); }
@media (max-width: 600px) { .referral-page { padding: 16px; gap: 20px; } }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dk); }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
h4 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow, .narrow { max-width: 780px; }

.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section .container.section, .container.section { padding-top: 44px; padding-bottom: 64px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 1.05rem; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #d9d6ff;
  margin-bottom: 22px;
}
.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ee6a4;
  box-shadow: 0 0 0 0 rgba(62, 230, 164, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 230, 164, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(62, 230, 164, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 230, 164, 0); }
}

.kicker {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}

/* ---------- Товчнууд ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 600 .95rem/1.2 var(--sans);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { transition: transform .15s; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(91, 76, 240, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: var(--brand-dk); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: #1b1550; }
.btn-light:hover { background: #f1efff; color: #1b1550; }

/* ---------- Толгой хэсэг ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(15, 16, 32, .5); }

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); flex-shrink: 0; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(122, 76, 240, .8);
}
.brand-text { display: flex; flex-direction: column; font: 800 1.22rem/1 var(--display); letter-spacing: -.02em; }
.brand-text small {
  font: 600 .66rem/1.3 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav > a, .dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  font-size: .93rem;
  white-space: nowrap;
}
.main-nav > a:hover, .dropdown > a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.chev { opacity: .7; transition: transform .15s; }
.dropdown:hover .chev, .dropdown.open .chev { transform: rotate(180deg); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: -8px;
  min-width: 270px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 10;
}
.dropdown-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink); font-size: .92rem; font-weight: 600; line-height: 1.3; }
.dropdown-menu a small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.dropdown-menu a:hover { background: var(--surface-2); color: var(--brand); }
.dd-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); font-size: 1.1rem; flex-shrink: 0; }

.nav-search { position: relative; margin-left: 8px; display: flex; align-items: center; }
.nav-search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.nav-search input {
  width: 190px;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  transition: width .2s, border-color .2s, box-shadow .2s;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { outline: none; border-color: var(--brand); width: 230px; box-shadow: 0 0 0 4px var(--brand-soft); }

.nav-tools { display: flex; align-items: center; gap: 6px; }
.theme-toggle, .nav-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle .i-sun { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: block; }
.theme-toggle[aria-pressed="true"] .i-moon { display: none; }
.nav-toggle { display: none; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; }

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 150;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Нүүр — hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: #b9bad6;
  background: var(--hero-bg);
  padding: 80px 0 88px;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 380px at 12% 8%, rgba(106, 92, 255, .38), transparent 65%),
    radial-gradient(520px 360px at 92% 18%, rgba(255, 90, 122, .26), transparent 65%),
    radial-gradient(700px 300px at 60% 110%, rgba(176, 76, 240, .3), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.05; letter-spacing: -.035em; margin-bottom: 20px; }
.hero-copy > p { font-size: 1.12rem; max-width: 520px; color: #b9bad6; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero .btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }

.hero-stats { display: flex; gap: 36px; margin: 40px 0 0; padding: 0; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt { font: 800 1.6rem/1.1 var(--display); color: #fff; letter-spacing: -.02em; }
.hero-stats dd { margin: 4px 0 0; font-size: .82rem; color: #8f90b0; }

.hero-bento { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-feature {
  grid-column: 1 / -1;
  position: relative;
  display: block;
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7);
  transition: transform .25s;
}
.hero-feature:hover { transform: translateY(-4px); color: #fff; }
.hero-feature:hover .cover img { transform: scale(1.04); }
.hero-feature-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 80px 24px 22px;
  background: linear-gradient(transparent, rgba(8, 8, 22, .9) 55%);
}
.hero-feature-body h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.25; margin: 10px 0 6px; color: #fff; }
.hero-feature-body p { color: #c9cae2; margin: 0; font-size: .93rem; }
.hero-feature .tag { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(6px); }

.hero-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  color: #fff;
  transition: background .15s, border-color .15s;
  min-width: 0;
}
.hero-mini:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .2); color: #fff; }
.hero-mini > div { min-width: 0; }
.hero-mini strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .88rem; line-height: 1.35; font-weight: 600; }
.mini-cat { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #a99fff; margin-bottom: 2px; }
.mini-cover { flex: 0 0 64px; width: 64px; aspect-ratio: 1 / 1 !important; border-radius: 12px; }
.mini-cover.ph span { font-size: 1.6rem; }

/* ---------- Зураг / placeholder ---------- */

.cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.hero-cover { aspect-ratio: 16 / 9; }
.post-cover { border-radius: 22px; margin: 8px 0 36px; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.thumb-cover { width: 72px; aspect-ratio: 1 / 1; border-radius: 12px; }
.thumb-cover.ph span { font-size: 1.6rem; }

.ph { display: grid; place-items: center; }
.ph::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(135deg, transparent 20%, #000);
  mask-image: linear-gradient(135deg, transparent 20%, #000);
}
.ph span { position: relative; z-index: 1; font-size: 3.4rem; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .3)); }
.ph.p1 { background: radial-gradient(circle at 20% 20%, #8b7dff, transparent 60%), linear-gradient(135deg, #3b2fc9, #1b1550); }
.ph.p2 { background: radial-gradient(circle at 80% 20%, #ff8fa6, transparent 55%), linear-gradient(135deg, #b04cf0, #4a1d8f); }
.ph.p3 { background: radial-gradient(circle at 25% 80%, #54e0c0, transparent 55%), linear-gradient(135deg, #0f766e, #0b2e4a); }
.ph.p4 { background: radial-gradient(circle at 75% 25%, #ffd27a, transparent 55%), linear-gradient(135deg, #ff5a7a, #8a1f5b); }
.ph.p5 { background: radial-gradient(circle at 30% 25%, #7cc4ff, transparent 55%), linear-gradient(135deg, #2563eb, #0b1b4a); }
.ph.p6 { background: radial-gradient(circle at 70% 75%, #c3a6ff, transparent 55%), linear-gradient(135deg, #1f2033, #0b0b1a); }

/* ---------- Хэсгийн гарчиг ---------- */

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: .88rem;
}
.link-arrow:hover { border-color: var(--brand); color: var(--brand); }
.link-arrow span { transition: transform .15s; }
.link-arrow:hover span { transform: translateX(3px); }

/* ---------- Сэдвүүд ---------- */

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; }
.topic {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.topic::after {
  content: '→';
  position: absolute;
  right: 18px;
  top: 20px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}
.topic:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--ink); }
.topic:hover::after { opacity: 1; transform: none; color: var(--brand); }
.topic strong { font-family: var(--display); font-size: 1.02rem; letter-spacing: -.01em; }
.topic small { color: var(--muted); font-size: .84rem; }
.topic-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-soft);
  font-size: 1.45rem;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.topic:nth-child(6n+2) .topic-icon { background: var(--accent-soft); }
.topic:nth-child(6n+3) .topic-icon { background: rgba(18, 166, 130, .12); }
.topic:nth-child(6n+4) .topic-icon { background: rgba(245, 158, 11, .14); }
.topic:nth-child(6n+5) .topic-icon { background: rgba(37, 99, 235, .12); }
.topic:nth-child(6n+6) .topic-icon { background: rgba(176, 76, 240, .13); }

.cat-list { display: grid; gap: 12px; max-width: 860px; margin: 0 auto; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.cat-row:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--text); transform: translateY(-2px); }
.cat-row .topic-icon { margin: 0; }
.cat-row > div { flex: 1; min-width: 0; }
.cat-row strong { color: var(--ink); font-family: var(--display); font-size: 1.08rem; }
.cat-row p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.cat-row .count {
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  text-align: center;
}

/* ---------- Нийтлэлийн карт ---------- */

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.section-alt .card { background: var(--bg); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card:hover .cover img { transform: scale(1.05); }
.card-media { display: block; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.card-body h3 { font-size: 1.14rem; line-height: 1.32; margin: 12px 0 8px; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--brand); }
.card-body p { color: var(--muted); font-size: .93rem; flex: 1; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .82rem; color: var(--muted); }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }

.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
a.tag:hover { background: var(--brand); color: #fff; }
.tag-warn { background: #fff0d1; color: #8a5a00; margin-left: 6px; }

/* ---------- Band ---------- */

.band { padding: 24px 0 72px; }
.band-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 52px;
  border-radius: 28px;
  background: var(--grad);
  color: rgba(255, 255, 255, .88);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 30px 60px -30px rgba(122, 76, 240, .8);
}
.band-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
  mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.band h2 { color: #fff; margin-bottom: 8px; }
.band p { margin: 0; max-width: 620px; }
.band .btn-light { flex-shrink: 0; }
.section-alt + .band { padding-top: 72px; }

/* ---------- Их уншсан ---------- */

.popular-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.popular-list li {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.popular-list li:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.popular-list li > div { flex: 1; min-width: 0; }
.popular-list .num { font: 800 1.9rem/1 var(--display); letter-spacing: -.04em; min-width: 44px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popular-list li > div > a { display: block; font-family: var(--display); font-weight: 700; color: var(--ink); line-height: 1.35; }
.popular-list li > div > a:hover { color: var(--brand); }
.popular-list small { color: var(--muted); }
.popular-thumb { flex-shrink: 0; }

/* ---------- Хуудасны толгой ---------- */

.page-head {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 48px;
  overflow: hidden;
  isolation: isolate;
}
.page-head::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(500px 220px at 0% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.page-head h1 { margin-bottom: 8px; }
.page-head p { color: var(--muted); font-size: 1.08rem; margin: 0; max-width: 640px; }

.notfound { text-align: center; padding: 96px 0; }
.notfound .big { font: 800 clamp(5rem, 14vw, 8rem)/1 var(--display); letter-spacing: -.06em; color: var(--ink); margin-bottom: 12px; }
.notfound p { margin: 0 auto 28px; }
.notfound .btn { margin: 4px; }

/* ---------- Pagination ---------- */

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 48px; flex-wrap: wrap; }
.pagination a {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Нийтлэл ---------- */

.post-head { padding-top: 56px; text-align: center; }
.post-head .tag { align-self: center; }
.post-head h1 { margin: 16px 0 14px; font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1.12; }
.post-head .meta { justify-content: center; font-size: .9rem; margin-bottom: 28px; }

.prose { font-size: 1.08rem; line-height: 1.8; color: var(--text); overflow-wrap: break-word; }
.prose.section { padding-top: 44px; }
.prose > p:first-child { font-size: 1.18rem; color: var(--ink); }
.prose h2 { font-size: 1.6rem; margin: 1.8em 0 .6em; }
.prose h3 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.prose strong { color: var(--ink); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--brand); }
.prose img { border-radius: var(--radius-sm); margin: 1.5em auto; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: -.8em; }
.prose blockquote {
  margin: 1.8em 0;
  padding: 18px 24px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-weight: 500;
}
.prose blockquote p:last-child { margin: 0; }
.prose a { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .95rem; }
.prose th, .prose td { padding: 11px 14px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.prose iframe, .prose video { max-width: 100%; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose .photo-credit { margin-top: 2em; font-size: .8rem; line-height: 1.5; color: var(--muted); }
.prose .photo-credit a { color: var(--muted); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .88em; }

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 24px 24px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.share span { font-weight: 700; color: var(--ink); margin-right: 4px; }
.share a { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--text); background: var(--surface); }
.share a:hover { border-color: var(--brand); color: var(--brand); }

.prevnext { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 28px; }
.prevnext a {
  flex: 0 1 48%;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: .93rem;
  transition: border-color .15s, color .15s;
}
.prevnext a:last-child:not(:first-child) { text-align: right; }
.prevnext a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Галерей ---------- */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery-item { position: relative; display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery-item .cover { aspect-ratio: 1 / 1; }
.gallery-item:hover .cover img { transform: scale(1.06); }
.gallery-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 44px 16px 14px;
  background: linear-gradient(transparent, rgba(8, 8, 22, .88));
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.35;
}

/* ---------- Маягт ---------- */

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.form input, .form textarea, .form select,
.search-big input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font: 400 1rem/1.5 var(--sans);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form textarea:focus, .search-big input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.form textarea { resize: vertical; min-height: 150px; }
.form .btn { justify-self: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.contact-info {
  position: relative;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.contact-info::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.contact-info p { margin-bottom: 18px; overflow-wrap: anywhere; }
.contact-info strong { color: var(--ink); }

.search-big { display: flex; gap: 10px; margin-top: 22px; max-width: 640px; }
.search-big input { padding-left: 18px; }

/* ---------- Сайтын бүтэц ---------- */

.sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px; }
.sitemap ul { list-style: none; padding: 0; margin: 0; }
.sitemap li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .94rem; }
.sitemap h3 a { color: var(--ink); }

/* ---------- Реклам ---------- */

.ad-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 24px auto; max-width: 100%; text-align: center; }
.ad-label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ad-body { max-width: 100%; overflow: hidden; }
.ad-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 0 auto; }
.ad-body iframe, .ad-body ins, .ad-body > div { max-width: 100%; }
.ad-header_below, .ad-footer_above { width: 100%; max-width: 1200px; padding: 0 24px; }
.ad-header_below { margin: 16px auto 0; }
.ad-footer_above { margin: 40px auto 0; }
.ad-home_middle { margin-top: 44px; }
.ad-post_top { margin: -8px auto 32px; }
.ad-post_bottom { margin: 32px auto 8px; }
.ad-list_top { margin: 0 auto 28px; }

/* ---------- Хөл хэсэг ---------- */

.site-footer { position: relative; background: var(--hero-bg); color: #9a9cba; margin-top: 48px; font-size: .94rem; overflow: hidden; isolation: isolate; }
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(600px 260px at 10% 0%, rgba(106, 92, 255, .22), transparent 70%), radial-gradient(500px 240px at 100% 100%, rgba(255, 90, 122, .14), transparent 70%);
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: 40px; padding-top: 64px; padding-bottom: 44px; }
.site-footer h4 { color: #fff; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #9a9cba; }
.site-footer a:hover { color: #fff; }
.site-footer .muted { color: #8587a6; margin-top: 16px; }
.brand-footer, .brand-footer:hover { color: #fff; }

.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { padding: 6px 13px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; font-size: .84rem; }
.socials a:hover { background: rgba(255, 255, 255, .08); }

.newsletter { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font: inherit;
}
.newsletter input::placeholder { color: #7d7f9e; }
.newsletter input:focus { outline: none; border-color: #8b80ff; box-shadow: 0 0 0 4px rgba(139, 128, 255, .2); }
.newsletter button {
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font: 600 .92rem var(--sans);
  cursor: pointer;
  transition: filter .15s;
}
.newsletter button:hover { filter: brightness(1.1); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 26px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .85rem;
  color: #7d7f9e;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1140px) {
  .nav-search input { width: 150px; }
  .nav-search input:focus { width: 180px; }
  .main-nav > a, .dropdown > a { padding: 8px 9px; }
}

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .hero { padding: 56px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-bento { max-width: 640px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .popular-list { grid-template-columns: 1fr; }

  /* Гар утасны цэс (backdrop-filter нь fixed цэсийг толгой дотор хорьдог тул унтраана) */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav-toggle { display: grid; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: 16px 20px 32px;
    background: var(--bg);
    overflow-y: auto;
    border-top: 1px solid var(--line);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s;
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  .main-nav > a, .dropdown > a { padding: 13px 14px; font-size: 1.02rem; border-radius: 12px; }
  .dropdown-menu {
    position: static;
    min-width: 0;
    padding: 0 0 0 8px;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    display: none;
    opacity: 1;
    visibility: visible;
  }
  .dropdown-menu::before { display: none; }
  .dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { transform: none; }
  .dropdown.open .dropdown-menu { display: block; }
  .nav-search { margin: 14px 0 0; }
  .nav-search input, .nav-search input:focus { width: 100%; padding: 13px 16px 13px 38px; font-size: 1rem; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }
  .container.section { padding-top: 30px; padding-bottom: 44px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 52px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-stats { gap: 24px; margin-top: 32px; }
  .hero-bento { grid-template-columns: 1fr; }
  .band { padding: 8px 0 48px; }
  .section-alt + .band { padding-top: 48px; }
  .band-inner { flex-direction: column; align-items: flex-start; padding: 32px 24px; border-radius: 22px; }
  .page-head { padding: 38px 0 32px; }
  .post-head { padding-top: 36px; }
  .row2 { grid-template-columns: 1fr; }
  .form .btn { justify-self: stretch; }
  .search-big { flex-direction: column; }
  .prevnext { flex-direction: column; }
  .prevnext a { flex-basis: auto; }
  .prevnext a:last-child:not(:first-child) { text-align: left; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-cap { font-size: .8rem; padding: 28px 10px 10px; }
  .cat-row { padding: 14px 16px; gap: 14px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-text { font-size: 1.1rem; }
  .prose { font-size: 1.03rem; }
  .prose table { display: block; overflow-x: auto; }
  .post-cover { border-radius: 16px; }
  .popular-list li { padding: 14px; gap: 14px; }
  .popular-list .num { font-size: 1.5rem; min-width: 34px; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .topic-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .topic { padding: 16px 14px; }
  .topic::after { display: none; }
  .brand-text small { display: none; }
  .thumb-cover { width: 60px; }
  .hero-feature-body { padding: 60px 18px 18px; }
  .hero-feature-body p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
