:root {
  --bg: #0b0c0e;
  --panel: #15171b;
  --panel-2: #1c1f24;
  --cream: #f4efe7;
  --cream-soft: #cabfb1;
  --muted: #8d877f;
  --gold: #fdd506;
  --gold-soft: rgba(253, 213, 6, .12);
  --line: rgba(244, 239, 231, .12);
  --line-strong: rgba(244, 239, 231, .22);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --display: "Inter Tight", "Inter", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

/* Японский — японскими шрифтами, иначе общие иероглифы возьмут китайское начертание */
:lang(ja) {
  --sans: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --display: "Inter Tight", "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.55 var(--sans);
  color: var(--cream);
  background:
    radial-gradient(60rem 36rem at 50% -12rem, rgba(253, 213, 6, .13), transparent 70%),
    radial-gradient(40rem 30rem at 100% 100%, rgba(253, 213, 6, .05), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img, video { display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.03em; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Значок «AI» с пульсирующей точкой — и на главной, и на странице языка */
.live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  background: rgba(11, 12, 14, .72);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  color: var(--cream);
}
.live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(253, 213, 6, .6);
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(253, 213, 6, .55); }
  80%, 100% { box-shadow: 0 0 0 9px rgba(253, 213, 6, 0); }
}

/* ---------- Главная: выбор языка ---------- */
.chooser {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) 16px 64px;
  text-align: center;
}
.who { position: relative; width: 132px; margin: 0 auto 22px; }
.orb {
  width: 132px; height: 132px; border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--gold), rgba(253, 213, 6, .05) 40%, var(--gold) 70%, rgba(253, 213, 6, .05));
  animation: spin 8s linear infinite;
}
.orb video {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 3px solid var(--bg);
  animation: spin 8s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.who .live { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); white-space: nowrap; }

.kicker {
  margin: 26px 0 10px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.rotor {
  min-height: 1.1em;
  font-size: clamp(38px, 8vw, 68px);
  font-weight: 800;
  line-height: 1.05;
}
.rotor span { display: inline-block; animation: rise .55s var(--ease) both; }
.rotor-sub {
  min-height: 1.6em;
  margin: 12px auto 36px;
  max-width: 34ch;
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--cream-soft);
  animation: fade .55s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(.35em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.flags {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px;
}
.flag-card {
  position: relative;
  width: 172px;
  display: grid; justify-items: center; gap: 6px;
  padding: 22px 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(244, 239, 231, .05), rgba(244, 239, 231, .015));
  text-decoration: none;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.flag-card img {
  width: 56px; height: 56px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(244, 239, 231, .08), 0 10px 24px rgba(0, 0, 0, .45);
  margin-bottom: 6px;
  transition: transform .45s var(--ease), box-shadow .35s var(--ease);
}
.flag-card b { font: 600 17px/1.2 var(--display); letter-spacing: -.01em; }
.flag-card .hello {
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  color: var(--gold);
  opacity: 0; transform: translateY(4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.flag-card .go {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: background .3s var(--ease), color .3s var(--ease), transform .35s var(--ease), border-color .3s;
}
.flag-card .go svg { width: 14px; height: 14px; }
.flag-card:hover, .flag-card:focus-visible, .flag-card.is-on {
  border-color: rgba(253, 213, 6, .45);
  background: linear-gradient(180deg, rgba(253, 213, 6, .09), rgba(253, 213, 6, .02));
}
.flag-card:hover { transform: translateY(-4px); }
.flag-card:hover img, .flag-card.is-on img { transform: scale(1.06) rotate(-4deg); box-shadow: 0 0 0 3px rgba(253, 213, 6, .55), 0 12px 28px rgba(0, 0, 0, .5); }
.flag-card:hover .hello, .flag-card:focus-visible .hello, .flag-card.is-on .hello { opacity: 1; transform: none; }
.flag-card:hover .go, .flag-card:focus-visible .go { background: var(--gold); border-color: var(--gold); color: var(--bg); transform: rotate(-45deg); }
.flag-card.suggested::before {
  content: "";
  position: absolute; top: 15px; left: 15px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
}

/* ---------- Страница языка ---------- */
.top {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: border-color .3s, background .3s;
}
.back svg { width: 16px; height: 16px; }
.back:hover { border-color: var(--line-strong); background: rgba(244, 239, 231, .05); }
.mini-flags { display: flex; gap: 6px; }
.mini-flags a { border-radius: 50%; }
.mini-flags img {
  width: 28px; height: 28px; border-radius: 50%;
  opacity: .5; filter: saturate(.6);
  transition: opacity .25s, filter .25s, transform .3s var(--ease);
}
.mini-flags a:hover img { opacity: 1; filter: none; transform: translateY(-2px); }
.mini-flags a[aria-current] img { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }

.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(24px, 6vh, 72px) clamp(16px, 4vw, 40px) clamp(48px, 8vh, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(244, 239, 231, .06);
  border: 1px solid var(--line);
  font: 500 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-soft);
}
.eyebrow img { width: 22px; height: 22px; border-radius: 50%; }
.hero h1 {
  font-size: clamp(40px, 6.2vw, 78px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.hero h1:lang(ja) { word-break: keep-all; overflow-wrap: anywhere; }
.lead {
  margin: 22px 0 32px;
  max-width: 560px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--cream-soft);
}
.cta {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 9px 28px 9px 9px;
  border: 0; border-radius: 999px;
  background: var(--gold);
  color: var(--bg);
  font: 600 18px/1.2 var(--sans);
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(253, 213, 6, .22);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(253, 213, 6, .32); }
.cta-ico {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); color: var(--gold);
}
.cta-ico svg { width: 22px; height: 22px; }
.cta[data-state="wait"] .cta-ico { animation: breathe 1s var(--ease) infinite alternate; }
.cta[data-state="live"] { background: var(--cream); }
.cta[data-state="live"] .cta-ico { color: #ff4d3d; }
@keyframes breathe { to { transform: scale(.88); } }
.note {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.note svg { width: 16px; height: 16px; flex: none; }

.stage { position: relative; margin: 0; justify-self: end; width: 100%; max-width: 440px; }
.stage::before {
  content: "";
  position: absolute; inset: 12% -6% -4% 10%;
  background: radial-gradient(closest-side, rgba(253, 213, 6, .35), transparent);
  filter: blur(40px);
  z-index: -1;
}
.frame {
  aspect-ratio: 4 / 5;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  background: var(--panel);
}
.frame video { width: 100%; height: 100%; object-fit: cover; }
.stage .live { position: absolute; top: 18px; left: 18px; }
.bubble {
  position: absolute; left: -28px; right: 28px; bottom: 26px;
  display: grid;
  padding: 14px 18px;
  border-radius: 20px 20px 20px 6px;
  background: var(--cream);
  color: #15100c;
  font-size: 15px; line-height: 1.45; font-weight: 500;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.bubble > span { grid-area: 1 / 1; }
.bubble .ghost { visibility: hidden; }
.typed.typing::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1.05em;
  margin-left: 2px;
  vertical-align: -2px;
  background: currentColor;
  animation: blink .9s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.ask {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 40px;
}
.ask h2 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.card:hover { border-color: rgba(253, 213, 6, .35); transform: translateY(-3px); }
.card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--gold-soft);
  color: var(--gold);
  margin-bottom: 6px;
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.card p { margin: 0; color: var(--cream-soft); font-size: 15.5px; }
.card .q {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(253, 213, 6, .06);
  border: 1px dashed rgba(253, 213, 6, .3);
  color: var(--cream);
  font-size: 15px;
}
.card .q span {
  display: block;
  margin-bottom: 4px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 120px;
  color: var(--muted);
  font-size: 14px;
}
.foot p { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .stage { justify-self: center; max-width: 380px; }
  .bubble { left: -12px; right: 12px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .flag-card { width: calc(50% - 6px); }
  .mini-flags { gap: 4px; }
  .mini-flags img { width: 24px; height: 24px; }
  .back { padding: 7px 12px 7px 10px; }
  .cta { font-size: 17px; }
  .bubble { left: 10px; right: 10px; bottom: 14px; font-size: 14px; }
}
@media (max-width: 400px) {
  .back span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
