/* ============================================================
   vasyldev.com — дизайн-система сайту
   Та сама мова, що й у продуктах: system-шрифти, hairline-кільця,
   «конверти перекладу», сквіркли, iOS-акуратність. Dark-first.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #0D0D12;
  --surface: #16161D;
  --card: #1C1C24;
  --card-hover: #21212B;
  --text: #F5F5F7;
  --text-2: rgba(235, 235, 245, .64);
  --text-3: rgba(235, 235, 245, .38);
  --hair: rgba(255, 255, 255, .09);
  --hair-strong: rgba(255, 255, 255, .14);

  --accent: #7480FF;
  --accent-deep: #5865F2;
  --accent-tint: rgba(116, 128, 255, .11);
  --accent-ring: rgba(116, 128, 255, .25);
  --on: #30D158;
  --on-text: #30D158;

  --env-bg: rgba(116, 128, 255, .10);
  --env-ring: rgba(116, 128, 255, .22);

  --shadow-card: 0 0 0 1px var(--hair), 0 18px 50px rgba(0, 0, 0, .45);
  --shadow-pop: 0 0 0 1px var(--hair-strong), 0 30px 80px rgba(0, 0, 0, .6);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI",
          system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code", Consolas, Menlo, monospace;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #F5F5F8;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --card-hover: #FFFFFF;
  --text: #16161B;
  --text-2: rgba(60, 60, 67, .72);
  --text-3: rgba(60, 60, 67, .42);
  --hair: rgba(0, 0, 0, .08);
  --hair-strong: rgba(0, 0, 0, .14);

  --accent: #5865F2;
  --accent-deep: #4653DA;
  --accent-tint: rgba(88, 101, 242, .09);
  --accent-ring: rgba(88, 101, 242, .28);
  --on-text: #1E7D3C;

  --env-bg: rgba(88, 101, 242, .07);
  --env-ring: rgba(88, 101, 242, .20);

  --shadow-card: 0 0 0 1px var(--hair), 0 12px 40px rgba(22, 22, 27, .10);
  --shadow-pop: 0 0 0 1px var(--hair), 0 24px 70px rgba(22, 22, 27, .16);
}

/* ---------- База ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Фонове blurple-світіння — фірмовий шар глибини */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 78% -6%, rgba(88, 101, 242, .16), transparent 70%),
    radial-gradient(700px 420px at -8% 32%, rgba(88, 101, 242, .08), transparent 70%),
    radial-gradient(640px 380px at 92% 88%, rgba(48, 209, 88, .05), transparent 70%);
}

main { position: relative; z-index: 1; }

::selection { background: rgba(116, 128, 255, .35); }

a { color: inherit; }

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Навігація ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  transition: box-shadow .25s ease;
}

.nav.scrolled { box-shadow: 0 1px 0 var(--hair); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}

.squircle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(180deg, #6875F5, #4F5BE8);
  color: #fff;
  flex-shrink: 0;
}

.squircle svg { width: 17px; height: 17px; }

.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color .15s;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.icon-btn:hover { background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- «Конверт перекладу» — фірмовий елемент ---------- */
.env {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 16px;
  background:
    linear-gradient(to right, var(--accent) 0, var(--accent) 3px, transparent 3px),
    var(--env-bg);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--env-ring);
}

.env .globe { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

.env-text { font-size: 15.5px; font-weight: 550; letter-spacing: -0.01em; min-width: 7.5ch; }

.env-text.swap { animation: envSwap .45s ease; }

@keyframes envSwap {
  0% { opacity: 0; transform: translateY(6px); filter: blur(3px); }
  100% { opacity: 1; transform: none; filter: none; }
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  border-radius: 6px;
  padding: 2px 7px;
  box-shadow: 0 0 0 1px var(--hair);
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(72px, 14vh, 140px) 0 64px;
}

.hero .env { margin-bottom: 28px; }

h1 {
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.033em;
  max-width: 15ch;
}

h1 .accent {
  background: linear-gradient(92deg, var(--accent) 0%, #9AA3FF 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 24px;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-2);
  max-width: 56ch;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn-primary {
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 0 10px 30px rgba(88, 101, 242, .35);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 38px rgba(88, 101, 242, .45); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
}

.btn-ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

.btn svg { width: 16px; height: 16px; }

/* ---------- LIVE-елементи ---------- */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--on-text);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--on);
  box-shadow: 0 0 0 0 rgba(48, 209, 88, .5);
  animation: livePulse 2.4s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .45); }
  70% { box-shadow: 0 0 0 9px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 72px;
}

.stat {
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}

.stat-num {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }

.stats-caption {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Секції ---------- */
.section { padding: 88px 0; }

.kicker {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 720;
  letter-spacing: -0.028em;
  line-height: 1.12;
}

.section-sub { margin-top: 12px; color: var(--text-2); max-width: 52ch; }

/* ---------- Картка проєкту ---------- */
.project-card {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 40px;
  align-items: center;
  margin-top: 44px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 40px;
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
}

.project-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

.project-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--hair);
}

.project-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

.project-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 2px 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.project-stats .sep { color: var(--text-3); }

.project-desc { color: var(--text-2); font-size: 15.5px; max-width: 46ch; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.chip {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--hair);
}

.project-links { display: flex; gap: 18px; margin-top: 26px; align-items: center; }

.link-arrow {
  font-size: 15px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-arrow:hover { text-decoration: underline; }

.project-shot {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  transform: rotate(1.2deg);
  transition: transform .3s ease;
}

.project-card:hover .project-shot { transform: rotate(0deg) scale(1.015); }

.project-shot img { display: block; width: 100%; height: auto; }

/* Слот «наступний проєкт» */
.next-card {
  margin-top: 18px;
  border-radius: var(--r-lg);
  padding: 30px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-3);
  box-shadow: inset 0 0 0 1.5px var(--hair);
  border: none;
}

.next-card .globe { width: 20px; height: 20px; opacity: .55; }

.next-card .cursor {
  display: inline-block;
  width: 9px;
  height: 19px;
  background: var(--text-3);
  margin-left: 6px;
  vertical-align: -3px;
  animation: blink 1.15s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Сторінка проєкту ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 40px;
}

.back-link:hover { color: var(--text); }

.case-hero { padding: 56px 0 24px; }

.case-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.case-icon { width: 76px; height: 76px; border-radius: 19px; box-shadow: 0 0 0 1px var(--hair); }

.case-hero h1 { max-width: none; font-size: clamp(34px, 5vw, 54px); }

.case-tagline { margin-top: 18px; font-size: 19px; color: var(--text-2); max-width: 58ch; }

.feature {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0;
}

.feature:nth-child(even) .feature-text { order: 2; }

.feature h3 {
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  letter-spacing: -0.024em;
  line-height: 1.18;
  margin-bottom: 14px;
}

.feature p { color: var(--text-2); font-size: 16px; max-width: 44ch; }

.feature .shot {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}

.feature .shot img { display: block; width: 100%; height: auto; }

/* Under the hood */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 40px;
}

.tech {
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 22px;
}

.tech-title { font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; }
.tech p { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }

/* Таймлайн версій */
.timeline { margin-top: 44px; position: relative; padding-left: 26px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: var(--hair-strong);
}

.tl-item { position: relative; padding: 0 0 30px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2.5px var(--accent);
}

.tl-ver { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); }
.tl-what { margin-top: 3px; font-size: 15px; color: var(--text-2); max-width: 60ch; }

/* CTA-стрічка */
.cta-band {
  margin: 40px 0 0;
  background:
    radial-gradient(480px 220px at 85% 0%, rgba(116, 128, 255, .16), transparent 70%),
    var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.cta-band h2 { font-size: clamp(24px, 3vw, 32px); }
.cta-band p { color: var(--text-2); margin-top: 8px; }

/* ---------- Privacy / текстові сторінки ---------- */
.prose { max-width: 720px; padding: 56px 0 96px; }
.prose h1 { font-size: clamp(30px, 4vw, 42px); max-width: none; }
.prose .updated { margin-top: 10px; font-size: 13.5px; color: var(--text-3); }
.prose h2 { font-size: 21px; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--text-2); font-size: 15.5px; }
.prose ul { padding-left: 22px; margin-top: 8px; }
.prose a { color: var(--accent); }

/* ---------- Футер ---------- */
footer {
  border-top: 1px solid var(--hair);
  padding: 44px 0 60px;
  margin-top: 60px;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }

.foot-link {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
}

.foot-link:hover { color: var(--text); }

.foot-note { font-size: 13px; color: var(--text-3); }

/* ---------- Reveal-анімації ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.22, .7, .25, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .project-card { grid-template-columns: 1fr; padding: 28px; gap: 26px; }
  .feature { grid-template-columns: 1fr; gap: 26px; padding: 44px 0; }
  .feature:nth-child(even) .feature-text { order: 0; }
  .tech-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
  .cta-band { padding: 34px 28px; }
}

@media (max-width: 520px) {
  .tech-grid { grid-template-columns: 1fr; }
  .nav-link.optional { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
