:root {
  --bg: #0E1014;
  --ink: #E9EBF0;
  --muted: #99A1B1;
  --line: #262B36;
  --cobalt: #2C4BDF;
  --cobalt-l: #8CA2FF;
  --amber: #F5A524;
  --paper: #F5F5F5;
}

* { box-sizing: border-box; }

/* Сияние за знаком AI при «вдохе» шире узкого экрана — не даём ему вызвать горизонтальный скролл */
html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { position: relative; max-width: 1280px; margin: 0 auto; padding: 36px 32px 0; }

/* ---------- RU / EN ---------- */

.lang {
  position: absolute; top: 28px; right: 32px; z-index: 5;
  display: flex; gap: 6px; align-items: center;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .1em; color: var(--muted);
}
.lang a { color: var(--muted); text-decoration: none; transition: color .2s, text-shadow .2s; }
.lang a[aria-current] { color: var(--ink); font-weight: 500; cursor: default; }
.lang a[href]:hover,
.lang a[href]:focus-visible { color: var(--cobalt-l); text-shadow: 0 0 8px rgba(140, 162, 255, .8); outline: none; }

/* Текст для поисковиков и скринридеров, визуально скрыт */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Шапка ---------- */

.header { text-align: center; margin-bottom: 40px; }
h1 { font-family: Unbounded, sans-serif; font-weight: 700; font-size: 40px; letter-spacing: .02em; margin: 0; }
h1 .acc { color: var(--cobalt-l); }
.tagline {
  font-family: Unbounded, sans-serif; font-weight: 300; font-size: 18px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--paper); margin: 12px 0 0;
}
.bookmark { font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .06em; color: var(--muted); margin: 12px 0 0; }
.bookmark kbd {
  font: inherit; color: var(--ink); background: #161920;
  border: 1px solid #3A4152; border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; margin: 0 2px;
}

/* ---------- Раскладка: лесенка вокруг знака AI ---------- */

/* Колонки: левая | 4 центральные дорожки | правая. Полосы заходят в центральные дорожки и огибают знак. */
.layout {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 1fr 50px 80px 80px 50px 1fr; gap: 40px 16px;
}
.sec.l { grid-column: 1 / 2; }
.sec.r { grid-column: 6 / 7; }
.sec[data-row="1"].l, .sec[data-row="5"].l { grid-column: 1 / 4; }
.sec[data-row="1"].r, .sec[data-row="5"].r { grid-column: 4 / 7; }
.sec[data-row="2"].l, .sec[data-row="4"].l { grid-column: 1 / 3; }
.sec[data-row="2"].r, .sec[data-row="4"].r { grid-column: 5 / 7; }

.center {
  grid-column: 3 / 5; grid-row: 2 / 5;
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* ---------- Знак AI и сияние ---------- */

.glow {
  position: absolute; left: 50%; top: 50%; width: 820px; height: 820px; z-index: -1; pointer-events: none;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(140, 162, 255, .42) 0%, rgba(140, 162, 255, 0) 22%),
    radial-gradient(circle, rgba(44, 75, 223, .75) 0%, rgba(44, 75, 223, .38) 24%, rgba(44, 75, 223, .12) 44%, transparent 66%);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .7; transform: translate(-50%, -50%) scale(.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

.mark {
  position: relative;
  font-family: "Archivo Black", sans-serif; font-size: 150px; line-height: 1; letter-spacing: -.015em;
  color: transparent; -webkit-text-stroke: .045em var(--cobalt-l);
  filter: drop-shadow(0 0 8px rgba(140, 162, 255, .75)) drop-shadow(0 0 24px rgba(44, 75, 223, .6));
  transition: filter .08s;
  user-select: none;
}
.mark.flicker { animation: flicker .9s linear 1; }
.mark.zap { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 18px var(--cobalt-l)) drop-shadow(0 0 40px var(--cobalt)); }
@keyframes flicker {
  0%, 100% { opacity: 1; } 8% { opacity: .25; } 12% { opacity: 1; } 20% { opacity: .4; } 24% { opacity: .95; }
  55% { opacity: 1; } 58% { opacity: .3; } 62% { opacity: 1; }
}

/* ---------- Терминальная строка ---------- */

.term {
  margin: 22px 0 0; white-space: nowrap; text-align: left;
  font-family: "IBM Plex Mono", monospace; font-size: 14px; letter-spacing: .08em;
  color: var(--cobalt-l); text-shadow: 0 0 8px rgba(140, 162, 255, .6);
}
.term .cur {
  display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; margin-left: 2px;
  background: var(--cobalt-l); box-shadow: 0 0 8px rgba(140, 162, 255, .6);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Полоса раздела ---------- */

/* У .sec нет z-index намеренно: иначе таб попадёт в слой полосы и заряд нарисуется поверх названия */
.sec { --c: var(--cobalt-l); position: relative; }
.sec.amber { --c: var(--amber); }

.band {
  height: 100%;
  border: 1.5px solid var(--c); border-radius: 10px; padding: 30px 14px 16px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 25%, transparent), inset 0 0 24px color-mix(in srgb, var(--c) 8%, transparent);
  transition: box-shadow .3s, background-color .3s;
}
.sec.hit .band {
  background-color: color-mix(in srgb, var(--c) 13%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 40px color-mix(in srgb, var(--c) 22%, transparent);
}

.tab {
  position: absolute; top: 0; left: 50%; z-index: 4; transform: translate(-50%, -50%);
  margin: 0; background: var(--bg); border: 1.5px solid var(--c); border-radius: 6px; padding: 5px 14px;
  font-family: Unbounded, sans-serif; font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--c); white-space: nowrap;
  transition: color .3s, box-shadow .3s;
}
.sec.hit .tab {
  color: color-mix(in srgb, var(--c) 55%, #fff);
  text-shadow: 0 0 4px var(--c), 0 0 12px var(--c), 0 0 24px var(--c);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 10px color-mix(in srgb, var(--c) 30%, transparent);
  animation: tab-neon 2.6s linear 1;
}
@keyframes tab-neon {
  0%   { text-shadow: none; opacity: .5; }
  6%   { text-shadow: 0 0 4px var(--c), 0 0 12px var(--c), 0 0 24px var(--c); opacity: 1; }
  10%  { text-shadow: none; opacity: .45; }
  16%  { text-shadow: 0 0 4px var(--c), 0 0 12px var(--c), 0 0 24px var(--c); opacity: 1; }
  30%  { text-shadow: 0 0 4px var(--c), 0 0 12px var(--c); opacity: .9; }
  34%  { text-shadow: none; opacity: .5; }
  38%  { text-shadow: 0 0 4px var(--c), 0 0 12px var(--c), 0 0 24px var(--c); opacity: 1; }
  100% { text-shadow: 0 0 4px var(--c), 0 0 12px var(--c), 0 0 24px var(--c); opacity: 1; }
}

/* ---------- Иконки ---------- */

.icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; margin: 0; padding: 0; list-style: none; }

.icons li { min-width: 0; }
.tool {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0;
  color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 500; line-height: 1.2;
  transition: opacity .25s;
}
.tool .ico {
  width: 46px; height: 46px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; overflow: hidden; flex: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent);
  transition: transform .18s, box-shadow .18s;
}
.tool .ico img { width: 28px; height: 28px; object-fit: contain; }
.tool .ico .mono {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--c); color: var(--bg); font-family: Unbounded, sans-serif; font-weight: 700; font-size: 18px;
}
.tool .name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tool:hover .ico,
.tool:focus-visible .ico { transform: scale(1.1); box-shadow: 0 0 0 2px var(--c), 0 0 18px var(--c); }
.tool:focus-visible { outline: none; }

/* ---------- Подсказка ---------- */

.tip {
  position: fixed; z-index: 50; left: 0; top: 0; max-width: 320px;
  padding: 7px 11px; border-radius: 8px; border: 1px solid var(--c, var(--cobalt-l));
  background: rgba(16, 19, 27, .96); color: var(--muted); font-size: 12px; line-height: 1.35;
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.tip b { color: var(--ink); font-weight: 600; }
/* Тарифы: «Бесплатно» и минимальный платный, под линией */
.tip dl {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 7px 0 0; padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--c, var(--cobalt-l)) 35%, transparent);
}
.tip dt { color: var(--c, var(--cobalt-l)); font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .04em; line-height: 1.6; white-space: nowrap; }
.tip dd { margin: 0; color: var(--ink); }
.tip.show { opacity: 1; transform: none; }

/* ---------- Слой эффектов ---------- */

.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }

/* ---------- Подвал ---------- */

.footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 30px 0 40px; text-align: center; }
.lockup { display: inline-flex; align-items: center; gap: 16px; color: var(--paper); text-align: left; cursor: pointer; transition: filter .25s; }
.lockup .name { font-family: "Schibsted Grotesk", sans-serif; font-weight: 700; letter-spacing: .02em; font-size: 16px; line-height: 1.25; }
.lockup .role { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; transition: opacity .25s; }
.lockup .role .ai { transition: color .25s; }
.lockup:hover { filter: drop-shadow(0 0 6px rgba(140, 162, 255, .7)) drop-shadow(0 0 18px rgba(44, 75, 223, .6)); }
.lockup:hover .role { opacity: 1; }
.lockup:hover .role .ai { color: var(--cobalt-l); }

/* ---------- Подсказка ⌘D — только на компьютере (мышь или тачпад) ---------- */

@media (hover: none), (pointer: coarse) {
  .bookmark { display: none; }
}

/* ---------- Узкий десктоп (900–1099px): та же лесенка, иконки 3×3 ---------- */

@media (min-width: 900px) and (max-width: 1099px) {
  .page { padding: 32px 24px 0; }
  .lang { right: 24px; }
  .header { margin-bottom: 36px; }
  h1 { font-size: 34px; }
  .tagline { font-size: 16px; }

  .layout { gap: 36px 8px; }
  .glow { width: 700px; height: 700px; }
  .mark { font-size: 130px; }

  .band { padding: 28px 6px 14px; }
  /* 8 иконок в сетке 3×3: ряды 3 + 3 + 2, последние две по центру */
  .icons { grid-template-columns: repeat(6, 1fr); gap: 14px 2px; }
  .icons li { grid-column: span 2; }
  .icons li:nth-child(7) { grid-column: 2 / 4; }
  .icons li:nth-child(8) { grid-column: 4 / 6; }
}

/* ---------- Мобильная версия (< 900px) ---------- */

@media (max-width: 899px) {
  .page { padding: 20px 16px 0; }
  .lang { top: 18px; right: 16px; font-size: 11px; }

  .header { margin: 34px 0 0; }
  h1 { font-size: clamp(24px, 6.4vw, 40px); line-height: 1.2; }
  h1 .acc { display: block; }
  .tagline { font-size: clamp(12px, 3.2vw, 16px); margin-top: 10px; }

  .layout { display: flex; flex-direction: column; gap: 30px; }
  .center { order: -1; padding: 30px 0 4px; }
  .glow { width: 420px; height: 420px; }
  .mark { font-size: 104px; }
  .term { margin-top: 18px; font-size: 13px; }

  .band { padding: 26px 8px 14px; }
  .tab { font-size: 11px; padding: 4px 12px; }
  .icons { gap: 14px 4px; }
  .tool { font-size: 11px; }
  .tool .ico { width: 44px; height: 44px; }

  .footer { margin-top: 40px; padding: 24px 0 30px; }
  .tip { display: none; }
}

/* ---------- Уменьшить движение ---------- */

@media (prefers-reduced-motion: reduce) {
  .glow, .mark.flicker, .sec.hit .tab, .term .cur { animation: none; }
  .glow { opacity: .85; }
  .tool .ico, .lockup, .band, .tab { transition: none; }
}
