/* rvoapp.ru — одностраничник: витрина приложений, голосование, журнал.
   Одна таблица стилей, без внешних зависимостей и веб-шрифтов. */

/* ---------- 1. Токены темы ---------- */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --max-width: 1080px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --accent: #4f7cff;
  --accent-2: #a78bfa;
  --accent-contrast: #ffffff;
  --transition: 180ms ease;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e16;
  --bg-soft: #0d1320;
  --surface: #111a28;
  --surface-2: #162133;
  --border: #22304a;
  --border-strong: #31456a;
  --text: #e9eefb;
  --muted: #96a4bd;
  --accent: #6f97ff;
  --accent-soft: rgba(79, 124, 255, 0.16);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.14);
  --warn: #f7b955;
  --warn-soft: rgba(247, 185, 85, 0.14);
  --info: #8db0ff;
  --info-soft: rgba(141, 176, 255, 0.14);
  --terminal-bg: #0b1220;
  --terminal-border: #1e2a42;
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fc;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f3f6fc;
  --border: #e1e7f2;
  --border-strong: #cbd5e6;
  --text: #101828;
  --muted: #5b6779;
  --accent: #2f62e8;
  --accent-soft: rgba(47, 98, 232, 0.1);
  --ok: #0f9d68;
  --ok-soft: rgba(15, 157, 104, 0.1);
  --warn: #a96707;
  --warn-soft: rgba(169, 103, 7, 0.12);
  --info: #2f62e8;
  --info-soft: rgba(47, 98, 232, 0.1);
  --terminal-bg: #0e1524;
  --terminal-border: #223050;
  --shadow-card: 0 12px 28px rgba(16, 24, 40, 0.08);
}

/* ---------- 2. Сброс и база ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(55rem 38rem at 8% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(46rem 32rem at 102% -4%, rgba(167, 139, 250, 0.12), transparent 58%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

[id] {
  scroll-margin-top: 96px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 16px;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

/* ---------- 3. Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 6px 16px var(--accent-soft);
}

.brand__text {
  font-size: 1.05rem;
}

.brand__dot {
  color: var(--muted);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 26px);
  font-size: 0.94rem;
}

.nav a {
  color: var(--muted);
  /* Пункты меню не переносятся на вторую строку: на узком экране они прокручиваются. */
  white-space: nowrap;
  transition: color var(--transition);
}

.nav a:hover {
  color: var(--text);
}

.theme-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .theme-toggle__icon--moon,
[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

/* ---------- 4. Первый экран ---------- */

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(44px, 6vw, 84px) clamp(28px, 4vw, 44px);
}

/* Длинная строка в «терминале» не должна растягивать колонку и всю страницу. */
.hero__content,
.terminal {
  min-width: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__title {
  margin-top: 14px;
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  font-weight: 800;
  text-wrap: balance;
}

.accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin-top: 18px;
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px var(--accent-soft);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: transparent;
}

.btn--ghost:hover {
  background: var(--surface);
}

/* Декоративный «терминал» в герое — картинки не нужны. */

.terminal {
  position: relative;
  padding: 44px 20px 20px;
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius-lg);
  background: var(--terminal-bg);
  box-shadow: var(--shadow-card);
  rotate: -1.2deg;
}

.terminal__dot {
  position: absolute;
  top: 17px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal__dot--red {
  left: 18px;
  background: #ff6b6b;
}

.terminal__dot--yellow {
  left: 34px;
  background: #f7b955;
}

.terminal__dot--green {
  left: 50px;
  background: #3ddc97;
}

.terminal__body {
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: #c9d5ea;
  white-space: pre;
}

.terminal__muted {
  color: #6c7d99;
}

.terminal__ok {
  color: #3ddc97;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding-bottom: clamp(36px, 5vw, 64px);
}

.facts__item {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts dd {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- 5. Секции ---------- */

.section {
  padding-block: clamp(52px, 6.5vw, 96px);
}

.section--alt {
  border-block: 1px solid var(--border);
  background: var(--bg-soft);
}

.section__head {
  max-width: 720px;
}

.section__title {
  margin-top: 10px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 800;
}

.section__lead {
  margin-top: 12px;
  color: var(--muted);
  max-width: 62ch;
}

/* ---------- 6. Карточки приложений ---------- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 18px;
  margin-top: clamp(24px, 3vw, 36px);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.app-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}

.pill {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill--live {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}

.pill--soon {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}

.pill--draft {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
}

.app-card__title {
  margin-top: 18px;
  font-size: 1.12rem;
  font-weight: 700;
}

.app-card__text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tags li {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.card__link {
  margin-top: auto;
  padding-top: 20px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
}

a.card__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card__link--muted {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

/* ---------- 6.1. Блок «Где здесь AI» ---------- */

.ai-grid {
  display: grid;
  /* Ровно 2×2: четыре карточки не должны оставлять сироту в последнем ряду. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(24px, 3vw, 36px);
}

.ai-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.ai-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.ai-card__index {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.ai-card__title {
  font-size: 1.06rem;
  font-weight: 700;
}

.ai-card__text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

/* ---------- 7. Голосование ---------- */

.ideas {
  display: grid;
  gap: 12px;
  margin-top: clamp(24px, 3vw, 36px);
}

.idea {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
}

.idea:hover {
  border-color: var(--border-strong);
}

.idea__title {
  font-size: 1.02rem;
  font-weight: 700;
}

.idea__text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 68ch;
}

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: none;
  min-width: 84px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.vote:hover {
  transform: translateY(-1px);
  background: var(--surface);
}

.vote__icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color var(--transition);
}

.vote__count {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.vote__label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vote[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.vote[aria-pressed="true"] .vote__icon,
.vote[aria-pressed="true"] .vote__label {
  color: var(--accent);
}

.vote:disabled {
  cursor: progress;
  opacity: 0.65;
  transform: none;
}

.roadmap__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.roadmap__note {
  max-width: 54ch;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- 8. Журнал ---------- */

.devlog {
  margin-top: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--border);
}

.devlog__item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 20px;
  padding-block: 18px;
  border-bottom: 1px solid var(--border);
}

.devlog__date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding-top: 3px;
}

.devlog__text {
  max-width: 78ch;
}

/* ---------- 9. Обо мне и контакты ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  align-items: start;
  gap: clamp(28px, 5vw, 56px);
}

.about__text p {
  margin-top: 14px;
  color: var(--muted);
  max-width: 62ch;
}

.contacts {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.contacts__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.contacts__list {
  margin-top: 10px;
}

.contact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-block: 12px;
  border-top: 1px solid var(--border);
}

.contacts__list li:first-child .contact {
  border-top: 0;
}

.contact__label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact__value {
  font-size: 0.94rem;
  font-weight: 600;
  transition: color var(--transition);
}

.contact:hover .contact__value {
  color: var(--accent);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 26px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- 11. Появление блоков ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 12. Адаптив ---------- */

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .terminal {
    max-width: 520px;
    rotate: 0deg;
  }

  .about {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 6px;
    font-size: 0.9rem;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .idea {
    align-items: flex-start;
  }

  .vote {
    min-width: 74px;
  }

  .devlog__item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding-block: 16px;
  }

  .site-footer__note {
    display: none;
  }
}

@media (max-width: 640px) {
  .ai-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .hero__actions .btn {
    width: 100%;
  }

  .idea {
    flex-direction: column;
    align-items: stretch;
  }

  .vote {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 12px;
  }

  .vote__label {
    text-transform: lowercase;
    letter-spacing: 0;
  }
}

/* ---------- 13. Уменьшенная анимация ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .card:hover,
  .vote:hover,
  .theme-toggle:hover {
    transform: none;
  }
}
