/* === RESET & TOKENS === */
:root {
  --tg-blue: #2AABEE;
  --tg-blue-dark: #1E96C8;
  --tg-navy: #17212B;
  --bg-soft: #F4F8FB;
  --surface: #FFFFFF;
  --text-main: #102535;
  --text-muted: #506A7B;
  --border-soft: #DCE8F0;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 30px rgba(16, 37, 53, 0.08);
  --shadow-hover: 0 18px 38px rgba(16, 37, 53, 0.14);
  --container: min(1120px, 100% - 2rem);
  --nav-height: 76px;
  --dur-fast: 220ms;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text-main);
  background: var(--bg-soft);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(42, 171, 238, 0.45);
  outline-offset: 2px;
}

/* === GLOBAL LAYOUT === */
.container {
  width: var(--container);
  margin-inline: auto;
}

.section {
  padding: 4.5rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  margin-bottom: 0.7rem;
}

.section-head p {
  color: var(--text-muted);
  max-width: 660px;
  margin-inline: auto;
}

.eyebrow {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9FDFFF;
  font-size: 0.76rem;
  margin-bottom: 0.8rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(42, 171, 238, 0.12);
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}

.btn-primary {
  background: linear-gradient(120deg, var(--tg-blue), var(--tg-blue-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 150, 200, 0.32);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(30, 150, 200, 0.4);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 999;
  background: #fff;
  color: #000;
  padding: 0.5rem 0.8rem;
  border-radius: 0.35rem;
}

.skip-link:focus {
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === NAVIGATION === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(23, 33, 43, 0.08);
}

.nav {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  color: var(--tg-navy);
}

.nav-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-soft);
  background: #fff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--tg-navy);
  border-radius: 2px;
}

.nav-links {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: calc(var(--nav-height) - 0.3rem);
  display: grid;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 0.65rem;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur-fast), opacity var(--dur-fast);
}

.nav-links.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-links a {
  min-height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.75rem;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  background: rgba(42, 171, 238, 0.12);
  color: #0B6B97;
}

/* === HERO === */
.hero {
  position: relative;
  color: #fff;
  background: linear-gradient(130deg, #17212B 10%, #1A354A 55%, #2AABEE 120%);
  overflow: clip;
  min-height: min(100svh, 840px);
  display: grid;
  align-items: center;
  padding: 5.5rem 0 4rem;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 70%, transparent 100%);
  opacity: 0.2;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  max-width: 14ch;
  margin-bottom: 0.9rem;
}

.hero-sub {
  color: rgba(230, 244, 251, 0.95);
  max-width: 54ch;
  margin-bottom: 1.25rem;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.store-link {
  min-height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  transition: transform var(--dur-fast), border-color var(--dur-fast);
}

.store-link:hover,
.store-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
}

.store-link img {
  height: 44px;
  width: auto;
}

.hero-visual {
  justify-self: center;
}

.phone-frame {
  width: min(290px, 80vw);
  background: #0F1A24;
  border-radius: 36px;
  border: 8px solid #0B141C;
  padding: 0.5rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
  position: relative;
}

.phone-frame.small {
  width: 220px;
}

.phone-notch {
  position: absolute;
  top: 0.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 16px;
  background: #0B141C;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone-frame img {
  border-radius: 28px;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 9 / 19;
}

/* === FEATURES === */
.features {
  background: linear-gradient(180deg, #F4F8FB, #EEF5FA);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  border-top: 4px solid var(--tg-blue);
  padding: 1.1rem 1rem;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 0.45rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === CAROUSEL === */
.screenshots {
  background: #fff;
}

.carousel {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #F9FCFF 0%, #EFF7FC 100%);
  padding: 1.2rem;
}

.carousel-track {
  display: flex;
  transition: transform 460ms ease;
}

.carousel-slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  padding: 0.8rem;
}

.carousel-dots {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.carousel-dots button {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #B8D3E3;
  cursor: pointer;
}

.carousel-dots button.is-active {
  width: 28px;
  background: var(--tg-blue);
}

/* === DOWNLOAD CTA === */
.download-cta {
  background: linear-gradient(145deg, #17212B, #1A2F3F 70%, #1E96C8 140%);
  color: #fff;
  padding: 4.25rem 0;
  text-align: center;
}

.download-cta h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin-bottom: 0.6rem;
}

.download-cta p {
  color: rgba(235, 246, 252, 0.95);
  margin-bottom: 1.2rem;
}

.store-badges.large {
  justify-content: center;
}

.store-badges.large .store-link img {
  height: 52px;
}

/* === BLOG PAGE === */
.blog-page {
  background: linear-gradient(180deg, #F3F8FC 0%, #F7FBFE 100%);
}

.blog-hero {
  padding-bottom: 2rem;
}

.blog-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  color: var(--tg-navy);
  margin-bottom: 0.7rem;
}

.blog-hero p {
  color: var(--text-muted);
  max-width: 62ch;
}

.blog-controls-wrap {
  position: sticky;
  top: var(--nav-height);
  z-index: 25;
  background: rgba(243, 248, 252, 0.85);
  backdrop-filter: blur(10px);
  border-block: 1px solid rgba(23, 33, 43, 0.09);
}

.blog-controls {
  padding-block: 0.8rem;
  display: grid;
  gap: 0.8rem;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

.filter-tab {
  min-height: 44px;
  border: 1px solid var(--border-soft);
  background: #fff;
  border-radius: 999px;
  padding: 0 0.85rem;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
}

.filter-tab.is-active {
  background: var(--tg-blue);
  color: #fff;
  border-color: var(--tg-blue);
}

.search-wrap input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0 0.95rem;
  background: #fff;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.blog-card {
  overflow: hidden;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(42, 171, 238, 0.42);
}

.blog-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.blog-card-body {
  padding: 1rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0B6B97;
  background: rgba(42, 171, 238, 0.14);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  margin-bottom: 0.6rem;
}

.blog-card h2 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.blog-card p {
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.9rem;
}

.blog-meta time {
  color: var(--text-muted);
}

.blog-meta a {
  color: #0B6B97;
  font-weight: 600;
}

.no-results {
  margin-top: 1rem;
  color: var(--text-muted);
  text-align: center;
}

.pagination {
  margin-top: 1.4rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pagination button {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.pagination button.is-active {
  background: var(--tg-blue);
  color: #fff;
  border-color: var(--tg-blue);
}

/* === FOOTER === */
.site-footer {
  background: #17212B;
  color: #D7E7F2;
}

.footer-grid {
  padding: 3rem 0 2rem;
  display: grid;
  gap: 1.5rem;
}

.footer-tagline {
  margin-top: 0.85rem;
  color: #AFC8D8;
  max-width: 36ch;
}

.site-footer h3 {
  color: #fff;
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.footer-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: #C4DBE8;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #fff;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.social-btn,
.icon-btn {
  min-height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0.78rem;
}

.telegram-btn {
  background: linear-gradient(120deg, var(--tg-blue), var(--tg-blue-dark));
  border-color: transparent;
  font-weight: 700;
}

.icon-btn img,
.social-btn img {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  color: #AFC8D8;
  font-size: 0.9rem;
  padding: 1rem;
}

/* === ANIMATIONS & UTILITIES === */
.floating {
  animation: floatY 4s ease-in-out infinite;
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-animate].in-view {
  opacity: 1;
  transform: none;
}

.is-hidden {
  display: none;
}

/* === RESPONSIVE BREAKPOINTS === */
@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .nav-links {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.2rem;
  }

  .nav-toggle {
    display: none;
  }

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

  .feature-card:last-child {
    grid-column: auto;
  }

  .blog-controls {
    grid-template-columns: 1fr minmax(260px, 320px);
    align-items: center;
  }

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

  .footer-grid {
    grid-template-columns: 1.1fr 0.8fr 1fr;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-top: 6rem;
  }

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

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

  * {
    animation: none !important;
    transition: none !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
