/* Zmongol Zcode download site — v2.
   Design language: apple.com. White ground, near-black type, grey
   secondary text, #f5f5f7 bands, one restrained brand-blue accent.
   Typography-led: no image gallery anywhere. No external dependencies. */

@font-face {
  font-family: "Z52TsagaanTig";
  src: url("fonts/z52tsagaantig.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Z52OrdosTig";
  src: url("fonts/z52ordostig.ttf") format("truetype");
  font-display: swap;
}

:root {
  --text: #1d1d1f;
  --grey: #6e6e73;
  --grey-2: #86868b;
  --band: #f5f5f7;
  --pill: #e8e8ed;
  --hair: #d2d2d7;
  --link: #0066cc;
  --brand: #0272AB;
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               Inter, "Helvetica Neue", Helvetica, Arial,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fff;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: var(--link); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* ---------- Z52 vertical text ----------
   Upright columns, the Z52 way: the text is shaped as one horizontal
   run in the Tsagaan Tig font, then the run is rotated 90 degrees
   clockwise — glyphs stand upright and joined, reading top-to-bottom.
   JavaScript packs words into column-length chunks (see app.js);
   columns progress left-to-right like a manuscript page. */
.z52box { display: flex; overflow-x: auto; overflow-y: hidden; }
.z52col { flex: none; position: relative; height: 100%; }
.z52strip {
  position: absolute; left: 0; top: 5px;
  white-space: nowrap;
  transform-origin: top left;
  transform: rotate(90deg) translateY(-100%);
  font-family: "Z52TsagaanTig", sans-serif;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 251, 253, .8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.wordmark {
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.wordmark em { font-style: normal; color: var(--brand); }
.wordmark-sm { font-size: 15px; }
.langs {
  display: flex; gap: 2px; background: var(--pill);
  padding: 2px; border-radius: 980px;
}
.lang-btn {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--grey);
  padding: 4px 13px; border-radius: 980px; line-height: 1.35;
}
.lang-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 88px 22px 110px;
  max-width: 1200px; margin: 0 auto;
}
.kicker {
  font-size: 14px; font-weight: 600; letter-spacing: .14em;
  color: var(--grey); margin: 0 0 22px; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.05;
  margin: 0 auto 26px; max-width: 12em;
}
.hero-line {
  font-size: clamp(19px, 2.6vw, 24px); line-height: 1.5;
  color: var(--grey); margin: 0 auto 36px; max-width: 40em;
}
.cta {
  display: inline-block; text-decoration: none;
  background: var(--link); color: #fff;
  font-size: 17px; font-weight: 400; line-height: 1.3;
  padding: 12px 26px; border-radius: 980px;
  transition: background .2s ease;
}
.cta::after { content: " ›"; }
.cta:hover { background: #0077ed; }
body.lang-z52 .cta::after { content: ""; }

.hero-stats {
  display: flex; justify-content: center; gap: clamp(36px, 7vw, 72px);
  margin: 64px 0 72px;
}
.stat strong {
  display: block; font-size: 44px; font-weight: 700;
  letter-spacing: -.02em; line-height: 1.1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat small { font-size: 14px; color: var(--grey); }

.hero-panel {
  background: var(--band);
  border-radius: 28px;
  padding: 30px 22px;
  max-width: 780px; margin: 0 auto;
}
.z52-hero { height: 320px; width: 100%; color: var(--text); }
@media (min-width: 900px) { .z52-hero { height: 340px; justify-content: center; } }

/* ---------- Sections ---------- */
.section { padding: 100px 0 110px; }
.section-band { background: var(--band); }
.section h2 {
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.08;
  margin: 0 0 14px;
}
.section-sub {
  font-size: clamp(17px, 2.2vw, 21px); line-height: 1.5;
  color: var(--grey); margin: 0 0 54px; max-width: 44em;
}

/* ---------- App tiles ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr; } }

.tile {
  background: var(--band); border-radius: var(--radius);
  padding: 40px; display: flex; flex-direction: column; gap: 18px;
}
@media (max-width: 600px) { .tile { padding: 30px 24px; } }
.tile-top { display: flex; align-items: center; gap: 20px; }
.app-icon {
  width: 80px; height: 80px; border-radius: 20px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, #0280bd, #045a87);
  color: #fff; font-weight: 700; font-size: 26px; letter-spacing: .01em;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon.gold { background: linear-gradient(145deg, #d99a26, #8a5a00); }
.app-icon.green { background: linear-gradient(145deg, #0b7a55, #084c36); }
.app-icon.plum { background: linear-gradient(145deg, #7a3e8c, #472257); }
.app-name { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.app-tag { font-size: 15px; color: var(--grey); margin-top: 4px; }
.intro {
  color: var(--grey); font-size: 17px; line-height: 1.55;
  margin: 0; min-height: 3.1em;
}
.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 980px; padding: 9px 17px;
  font-size: 14px; font-weight: 600; line-height: 1.3;
  text-decoration: none; white-space: nowrap;
}
.btn .sub { font-size: 12.5px; font-weight: 500; }
.btn-live { background: var(--text); color: #fff; transition: background .2s ease; }
.btn-live .sub { color: rgba(255, 255, 255, .62); }
.btn-live:hover { background: #000; }
.btn-soon { background: var(--pill); color: var(--grey); font-weight: 500; cursor: default; }
.btn-soon .sub { color: var(--grey-2); }

/* ---------- Fonts ---------- */
.font-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.font-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 22px 20px; background: #fff; border: 1px solid var(--hair); border-radius: 18px;
}
.font-glyph { width: 100%; height: 118px; flex: none; color: var(--text); }
.font-meta { min-width: 0; }
.font-name { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.font-size { color: var(--grey); font-size: 14px; margin-top: 3px; }
@media (max-width: 560px) {
  .font-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .font-row { padding: 18px 16px; }
  .font-name { font-size: 17px; }
}
.btn-dl {
  color: var(--link); text-decoration: none;
  font-size: 17px; flex: none; white-space: nowrap; margin-top: auto;
}
.btn-dl::after { content: " ›"; }
.btn-dl:hover { text-decoration: underline; }
body.lang-z52 .btn-dl::after { content: ""; }
.font-note {
  margin: 20px 0 0; color: var(--grey); font-size: 15px;
  line-height: 1.55; max-width: 780px;
}
.font-note a { color: var(--link); text-decoration: none; white-space: nowrap; }
.font-note a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer { padding: 36px 0 42px; }
.footer-top {
  display: flex; flex-wrap: wrap; gap: 20px 40px;
  align-items: flex-start; justify-content: space-between;
  padding-bottom: 22px; border-bottom: 1px solid var(--hair);
}
.footer-line { margin: 6px 0 0; color: var(--grey); font-size: 14px; line-height: 1.5; }
.visitors { display: flex; align-items: baseline; gap: 10px; }
.visitors-label {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--grey-2); font-weight: 600;
}
.visitors-num {
  font-size: 21px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.copyright { color: var(--grey-2); font-size: 12px; margin: 18px 0 0; }

/* ---------- Z52 language mode ----------
   When Z52 is the UI language, every translated block becomes an
   upright vertical-column box (filled by app.js z52Fill), centred
   where the Latin layout is centred. */
body.lang-z52 [data-i18n].z52-on { letter-spacing: 0; text-transform: none; }
body.lang-z52 .kicker.z52-on,
body.lang-z52 h1.z52-on,
body.lang-z52 .hero-line.z52-on,
body.lang-z52 .cta.z52-on { justify-content: center; margin-left: auto; margin-right: auto; }
body.lang-z52 .kicker.z52-on { height: 112px; }
body.lang-z52 h1.z52-on { height: 238px; max-width: none; }
body.lang-z52 .hero-line.z52-on { height: 188px; max-width: none; }
body.lang-z52 .cta.z52-on { height: 98px; padding: 8px 16px; }
body.lang-z52 h2.z52-on { height: 132px; }
body.lang-z52 .section-sub.z52-on { height: 176px; max-width: none; }
body.lang-z52 .intro { height: 172px; color: var(--text); }
body.lang-z52 .btn-soon { flex-direction: column; align-items: center; gap: 2px; }
body.lang-z52 .btn-soon .z52-soon { height: 66px; min-width: 106px; }
body.lang-z52 .btn-dl.z52-on {
  height: 86px; padding: 6px 10px;
  background: var(--pill); border-radius: 12px;
}
body.lang-z52 .visitors-label.z52-on { height: 74px; }
body.lang-z52 .footer-line.z52-on { height: 108px; color: var(--text); }

/* ---------- Footer legal link ---------- */
.footer-links { margin: 16px 0 0; }
.footer-privacy {
  display: inline-block;
  color: var(--grey); font-size: 12.5px; text-decoration: none; line-height: 1.4;
}
.footer-privacy:hover { text-decoration: underline; }
body.lang-z52 .footer-privacy.z52-on { height: 104px; color: var(--text); }

/* ---------- Privacy policy page ---------- */
.policy-wrap { max-width: 720px; margin: 0 auto; padding: 72px 22px 96px; }
.policy-title {
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.08;
  margin: 0 0 16px;
}
body.lang-z52 .policy-title.z52-on { height: 168px; }
.policy-date { color: var(--grey); font-size: 15px; margin: 0 0 10px; }
.policy-sec h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2;
  margin: 46px 0 12px;
}
body.lang-z52 .policy-sec h2.z52-on { height: 190px; }
.policy-sec p, .policy-sec li {
  font-size: 17px; line-height: 1.65; color: var(--text);
}
.policy-sec p { margin: 0 0 14px; }
.policy-sec ul { margin: 0 0 14px; padding-left: 22px; }
.policy-sec li { margin: 7px 0; }
.policy-sec a { color: var(--link); text-decoration: none; }
.policy-sec a:hover { text-decoration: underline; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* "See all fonts" / back link under the font grid */
.fonts-more { margin-top: 22px; font-size: 17px; }
.fonts-more a { color: var(--link); text-decoration: none; }
.fonts-more a:hover { text-decoration: underline; }
