@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap');

:root {
  --font: 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'Source Serif 4', Georgia, serif;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --theme-dur: 0.38s;
  /* Dark fallback (no JS / before early script) */
  color-scheme: dark;
  --bg: #12140f;
  --bg-2: #18160f;
  --surface: #221f1a;
  --surface-2: #2c2924;
  --line: #3c3934;
  --text: #e8e4db;
  --muted: #9a958b;
  --accent: #4d7a1c;
  --accent-2: #6a9a2e;
  --gold: #d4ae4a;
  --on-accent: #f4f7ef;
  --on-gold: #1a1408;
  --gold-wash: #2a2418;
  --atm-gold: rgba(212, 174, 74, 0.12);
  --atm-accent: rgba(77, 122, 28, 0.18);
  --atm-accent-soft: rgba(77, 122, 28, 0.07);
  --checker-a: #16140f;
  --checker-b: #1c1a15;
  --atm-opacity: 0.5;
  --glow: rgba(106, 154, 46, 0.32);
  --phone-bg: #0e0d0b;
  --phone-bezel: #1f1d19;
  --phone-ring: #0a0908;
  --phone-shadow: 0 32px 64px rgba(0, 0, 0, 0.55);
  --phone-shadow-sm: 0 20px 40px rgba(0, 0, 0, 0.4);
  --theme-color: #12140f;
}

/* Dark: warm olive night — soft contrast, muted gold */
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #12140f;
  --bg-2: #18160f;
  --surface: #221f1a;
  --surface-2: #2c2924;
  --line: #3c3934;
  --text: #e8e4db;
  --muted: #9a958b;
  --accent: #4d7a1c;
  --accent-2: #6a9a2e;
  --gold: #d4ae4a;
  --on-accent: #f4f7ef;
  --on-gold: #1a1408;
  --gold-wash: #2a2418;
  --atm-gold: rgba(212, 174, 74, 0.12);
  --atm-accent: rgba(77, 122, 28, 0.18);
  --atm-accent-soft: rgba(77, 122, 28, 0.07);
  --checker-a: #16140f;
  --checker-b: #1c1a15;
  --atm-opacity: 0.5;
  --glow: rgba(106, 154, 46, 0.32);
  --phone-bg: #0e0d0b;
  --phone-bezel: #1f1d19;
  --phone-ring: #0a0908;
  --phone-shadow: 0 32px 64px rgba(0, 0, 0, 0.55);
  --phone-shadow-sm: 0 20px 40px rgba(0, 0, 0, 0.4);
  --theme-color: #12140f;
}

/* Light: cool slate-green chrome, deeper forest accent (no cream/terracotta) */
html[data-theme='light'] {
  color-scheme: light;
  --bg: #eef1ec;
  --bg-2: #e4e8e1;
  --surface: #f7f9f5;
  --surface-2: #dfe5d8;
  --line: #c5cdc0;
  --text: #1a2216;
  --muted: #5a6454;
  --accent: #3a6518;
  --accent-2: #4a7c1e;
  --gold: #a8892e;
  --on-accent: #f7faf3;
  --on-gold: #1a1608;
  --gold-wash: #ebe4d0;
  --atm-gold: rgba(168, 137, 46, 0.1);
  --atm-accent: rgba(58, 101, 24, 0.12);
  --atm-accent-soft: rgba(58, 101, 24, 0.05);
  --checker-a: #e6eae3;
  --checker-b: #eef1ec;
  --atm-opacity: 0.58;
  --glow: rgba(74, 124, 30, 0.26);
  --phone-bg: #1a1c18;
  --phone-bezel: #c5cebc;
  --phone-ring: #aeb8ab;
  --phone-shadow: 0 28px 56px rgba(26, 34, 22, 0.16);
  --phone-shadow-sm: 0 18px 36px rgba(26, 34, 22, 0.12);
  --theme-color: #eef1ec;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

html.theme-ready body,
html.theme-ready .nav,
html.theme-ready .atmosphere,
html.theme-ready .btn,
html.theme-ready .theme-switch,
html.theme-ready .theme-btn,
html.theme-ready .roadmap-track,
html.theme-ready .roadmap-track li,
html.theme-ready .roadmap-badge,
html.theme-ready .feedback,
html.theme-ready .hero-phone,
html.theme-ready .feature-phone,
html.theme-ready .foot,
html.theme-ready input,
html.theme-ready textarea,
html.theme-ready .hero-glow {
  transition:
    background-color var(--theme-dur) var(--ease),
    background var(--theme-dur) var(--ease),
    color var(--theme-dur) var(--ease),
    border-color var(--theme-dur) var(--ease),
    box-shadow var(--theme-dur) var(--ease),
    opacity var(--theme-dur) var(--ease);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(920px 520px at 78% 8%, var(--atm-gold), transparent 58%),
    radial-gradient(680px 480px at 8% 18%, var(--atm-accent), transparent 52%),
    radial-gradient(500px 360px at 50% 100%, var(--atm-accent-soft), transparent 60%),
    repeating-conic-gradient(from 90deg, var(--checker-a) 0% 25%, var(--checker-b) 0% 50%)
      0 0 / 64px 64px;
  opacity: var(--atm-opacity);
  mask-image: linear-gradient(#000 0%, #000 42%, transparent 88%);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand img,
.brand-lockup img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand-lockup img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.nav-links {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-actions .btn {
  cursor: pointer;
}

.share-wrap {
  position: relative;
}

#nav-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.share-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.share-dialog[hidden] {
  display: none !important;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: color-mix(in srgb, #000 48%, transparent);
  cursor: pointer;
}

.share-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  padding: 22px 22px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--phone-shadow);
}

.share-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.share-panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
}

.share-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.share-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.share-panel-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.share-url {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  color: var(--text);
  font-size: 0.88rem;
  word-break: break-all;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-action {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.share-note {
  margin: 12px 0 0;
  color: var(--accent-2);
  font-size: 0.92rem;
  text-align: center;
}

html.share-open {
  overflow: hidden;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.theme-btn[aria-checked='true'] {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}

.theme-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
  background: var(--accent-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.92rem;
}

.btn-lg {
  padding: 14px 22px;
  font-size: 1.05rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--surface);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 20px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px;
  align-items: center;
  min-height: calc(100svh - 72px);
}

.hero-copy {
  animation: rise 0.8s var(--ease) both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  letter-spacing: -0.02em;
}

.brand-lockup img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin: 0 0 16px;
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  margin: 0 0 10px;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 6px;
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 32ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stage {
  position: relative;
  display: flex;
  justify-content: center;
  animation: rise 0.9s var(--ease) 0.12s both;
}

.hero-glow {
  position: absolute;
  inset: 12% 18% 8%;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  filter: blur(28px);
  animation: pulse 4.5s ease-in-out infinite;
}

.hero-phone {
  position: relative;
  margin: 0;
  width: min(100%, 320px);
  border-radius: 36px;
  overflow: hidden;
  background: var(--phone-bg);
  border: 10px solid var(--phone-bezel);
  box-shadow:
    var(--phone-shadow),
    0 0 0 1px var(--phone-ring);
  animation: float 5.5s ease-in-out infinite;
}

.hero-phone img {
  display: block;
  width: 100%;
}

.features {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.features-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 40px;
  animation: rise 0.7s var(--ease) both;
}

.features-head p {
  margin: 0;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
}

.feature {
  text-align: center;
  animation: rise 0.75s var(--ease) both;
}

.feature:nth-child(1) {
  animation-delay: 0.05s;
}

.feature:nth-child(2) {
  animation-delay: 0.12s;
}

.feature:nth-child(3) {
  animation-delay: 0.2s;
}

.feature-phone {
  margin: 0 auto 16px;
  width: 100%;
  max-width: 240px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--phone-bg);
  border: 8px solid var(--phone-bezel);
  box-shadow: var(--phone-shadow-sm);
  transition: transform 0.35s var(--ease), background-color var(--theme-dur) var(--ease),
    border-color var(--theme-dur) var(--ease), box-shadow var(--theme-dur) var(--ease);
}

.feature:hover .feature-phone {
  transform: translateY(-6px);
}

.feature-phone img {
  display: block;
  width: 100%;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.about {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px 72px;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.about-copy p {
  margin: 0;
  color: var(--muted);
}

.about-copy a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-copy a:hover {
  color: var(--text);
}

.about-copy p + p {
  margin-top: 12px;
}

.about-cta {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}

.about-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.about-bot {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 8px 0 18px;
}

.story {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px 72px;
}

.story-body {
  max-width: 960px;
  margin: 0 auto 36px;
}

.story-intro {
  max-width: 640px;
  margin: 0 auto 8px;
}

.story-body p,
.story-body li {
  color: var(--muted);
}

.story-body p {
  margin: 0 0 14px;
}

.story-body a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story-body a:hover {
  color: var(--text);
}

.story-body h3 {
  margin: 28px 0 12px;
  font-size: 1.25rem;
}

.roadmap-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roadmap-head {
  width: 100%;
  max-width: 36rem;
  margin: 28px auto 22px;
  text-align: center;
}

.roadmap-title {
  margin: 0 0 8px;
  text-align: center;
  width: 100%;
}

.roadmap-lead {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.roadmap-tracks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 22px;
  width: 100%;
}

.roadmap-track {
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}

.roadmap-badge {
  display: inline-flex;
  align-self: flex-start;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.roadmap-badge.is-infra {
  color: var(--on-gold);
  background: var(--gold);
}

.roadmap-badge.is-dev {
  color: var(--on-accent);
  background: var(--accent);
}

.roadmap-badge.is-community {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--line));
  border-color: var(--line);
}

.roadmap-track h4 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.roadmap-blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.roadmap-track ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roadmap-track li {
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.roadmap-track li::before {
  content: attr(data-status);
  display: block;
  margin: 0 0 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.roadmap-track li[data-status='done']::before {
  content: 'Готово';
  color: var(--accent-2);
}

.roadmap-track li[data-status='now']::before {
  content: 'Сейчас';
  color: var(--gold);
}

.roadmap-track li[data-status='next']::before {
  content: 'Дальше';
  color: var(--muted);
}

.roadmap-track li[data-status='done'] {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.roadmap-track li[data-status='now'] {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  background: color-mix(in srgb, var(--gold-wash) 55%, var(--bg));
}

.roadmap-closing {
  margin: 0;
  text-align: center;
  width: 100%;
  max-width: 36rem;
}

.feedback {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.feedback h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.feedback > p {
  margin: 0 0 16px;
  color: var(--muted);
}

.feedback-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.feedback-field > span:not(.sr-only) {
  font-size: 0.85rem;
  color: var(--muted);
}

.feedback-form input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

@media (max-width: 560px) {
  .feedback-row {
    grid-template-columns: 1fr;
  }
}

.feedback-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.feedback-note {
  margin: 0;
  color: var(--gold);
  font-size: 0.92rem;
}

.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;
}

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
}

.foot a {
  color: var(--text);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 520px) {
  .share-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #nav-share {
    padding-left: 10px;
    padding-right: 10px;
  }

  .theme-btn {
    width: 30px;
    height: 28px;
  }
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-actions {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding-top: 24px;
    text-align: center;
  }

  .brand-lockup {
    justify-content: center;
  }

  .lede {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  h1 {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-phone {
    width: min(100%, 280px);
  }

  .feature-grid,
  .about {
    grid-template-columns: 1fr;
  }

  .feature-phone {
    max-width: 280px;
  }

  .roadmap-tracks {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}