/* iteach apps hub — dark, high-contrast, deliberately unlike the iteach.mn blog */
@font-face {
  font-family: 'Dashitseden';
  src: url('mongol-bichig/assets/fonts/cmdashitseden.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07070d;
  --text: #f4f2ff;
  --muted: #a9a3c4;
  --line: rgba(255, 255, 255, .12);
  --gold: #ffd60a;
  --violet: #6b4fb8;
  --indigo: #2d1b69;
  --parchment: #f6efdf;
  --ink: #2a2118;
  --bronze: #8a6418;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
em { font-style: normal; }
.muted { color: var(--muted); }

/* ---------- background glow ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .55; animation: drift 24s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 560px; height: 560px; left: -140px; top: -120px; background: #4c34c8; }
.aurora i:nth-child(2) { width: 520px; height: 520px; right: -160px; top: 38vh; background: #b8862b; opacity: .38; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 460px; height: 460px; left: 28vw; bottom: -200px; background: #c24d8a; opacity: .28; animation-delay: -15s; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.12); } }

/* ---------- header ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: none; margin: 0 auto; padding: 14px max(20px, calc((100% - var(--maxw)) / 2 + 20px));
  background: rgba(7, 7, 13, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.brand { font-size: 22px; letter-spacing: -.03em; display: inline-flex; gap: 6px; align-items: baseline; }
.brand b { font-weight: 800; }
.brand span { font-weight: 800; color: var(--gold); }
.bar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.bar nav::-webkit-scrollbar { display: none; }
.bar nav a { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .15s, background .15s; }
.bar nav a:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.bar nav .ext { border: 1px solid var(--line); color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 16px; letter-spacing: -.01em;
  border: 1px solid transparent; transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--text); color: #14102a; }
.btn.ghost { border-color: rgba(255, 255, 255, .28); color: var(--text); }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.gold { background: var(--gold); color: #2b1d00; }
.btn.ink { background: var(--ink); color: var(--parchment); }
.btn.line { border-color: currentColor; background: transparent; }
.btn.big { min-height: 58px; padding: 0 38px; font-size: 18px; }

/* ---------- hero ---------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 72px 20px 56px; text-align: center; }
.kicker { display: inline-block; margin: 0 0 22px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: clamp(52px, 11vw, 132px); line-height: .95; letter-spacing: -.055em; font-weight: 900; }
h1 em { background: linear-gradient(100deg, #ffd60a, #ff8a5c 55%, #c24d8a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 620px; margin: 28px auto 0; font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.icons { list-style: none; display: flex; gap: 28px; justify-content: center; margin: 54px 0 0; padding: 0; }
.icons a { display: grid; justify-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .15s, transform .2s; }
.icons a:hover { color: var(--text); transform: translateY(-4px); }
.icons img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1); }

/* ---------- app panels ---------- */
.apps { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; display: grid; gap: 28px; }
.app { position: relative; overflow: hidden; border-radius: 36px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; align-items: center; padding: clamp(28px, 5vw, 56px); }
.app h3 { margin: 6px 0 14px; font-size: clamp(36px, 5.5vw, 60px); line-height: 1; letter-spacing: -.045em; font-weight: 900; }
.tag { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sum { margin: 0 0 20px; font-size: clamp(16px, 1.8vw, 19px); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.soon { font-size: 13px; font-weight: 700; opacity: .7; }

.app.math { background: radial-gradient(120% 120% at 100% 0%, #6b4fb8 0%, #2d1b69 55%, #1f1148 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.app.math .tag { color: var(--gold); }
.app.math .sum { color: #e6defa; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; color: #f1ecff; font-size: 15.5px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; background: var(--gold); color: #2b1d00; font-size: 12px; font-weight: 900; display: grid; place-items: center; }

.phones { position: relative; display: flex; justify-content: center; align-items: center; min-height: 440px; }
.phones img { border-radius: 26px; border: 5px solid #0d0820; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); background: #0d0820; }
.phones .p2 { position: relative; z-index: 2; width: 40%; max-width: 240px; }
.phones .p1, .phones .p3 { position: relative; width: 31%; max-width: 190px; z-index: 1; opacity: .96; }
.phones .p1 { margin-right: -5%; transform: rotate(-6deg) translateY(18px); }
.phones .p3 { margin-left: -5%; transform: rotate(6deg) translateY(18px); }

.app.bichig { background: var(--parchment); color: var(--ink); grid-template-columns: .55fr 1fr; box-shadow: inset 0 0 0 1px rgba(138, 100, 24, .35); }
.app.bichig .tag { color: var(--bronze); }
.app.bichig .sum { color: #4a3b29; }
.script { display: flex; justify-content: center; align-items: center; min-height: 340px; border-radius: 28px; background: radial-gradient(circle at 50% 40%, #fffaf0, #eadfc6); box-shadow: inset 0 0 0 1px rgba(138, 100, 24, .3); }
.mongol { font-family: 'Dashitseden', serif; writing-mode: vertical-lr; text-orientation: sideways; font-size: clamp(84px, 12vw, 150px); line-height: 1.1; color: var(--ink); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chips li { padding: 9px 16px; border-radius: 14px; background: rgba(138, 100, 24, .12); border: 1px solid rgba(138, 100, 24, .28); font-size: 14.5px; color: #4a3b29; }
.chips b { color: var(--ink); margin-right: 4px; }
.app.bichig .btn.line { color: var(--ink); }

/* ---------- promise ---------- */
.promise, .langs, .contact { max-width: var(--maxw); margin: 0 auto; padding: 110px 20px 0; text-align: center; }
h2 { margin: 0 0 12px; font-size: clamp(34px, 6vw, 68px); line-height: 1; letter-spacing: -.045em; font-weight: 900; }
h2 em { color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 40px 0 0; }
.stats div { padding: 28px 16px; border-radius: 24px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.stats dt { font-size: clamp(40px, 6vw, 68px); font-weight: 900; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, #fff, #b9a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats dd { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- languages ---------- */
.lang-group { margin-top: 30px; }
.lang-group h3 { margin: 0 0 14px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.lang-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lang-group a { display: inline-block; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-weight: 600; transition: background .2s, border-color .2s, transform .15s; }
.lang-group a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); transform: translateY(-2px); }

/* ---------- contact + footer ---------- */
.contact { padding-bottom: 20px; }
.contact .btn { margin-top: 26px; }
.foot { max-width: var(--maxw); margin: 90px auto 0; padding: 28px 20px 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.foot a:hover { color: var(--text); text-decoration: underline; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .app, .app.bichig { grid-template-columns: 1fr; }
  .app.bichig .script { order: -1; min-height: 240px; }
  .phones { min-height: 0; padding-top: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 48px; }
  .bar { flex-wrap: wrap; row-gap: 4px; }
  .bar nav { width: 100%; }
}
@media (max-width: 480px) {
  .icons img { width: 72px; height: 72px; }
  .btn { padding: 0 20px; }
  .promise, .langs, .contact { padding-top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora i { animation: none; }
  * { transition: none !important; }
}
