/* jgit.lv — main stylesheet */
:root {
  --bg: #f4f3f9;
  --surface: #ffffff;
  --surface-2: #f0eefb;
  --ink: #1d1f24;
  --muted: #545862;
  --line: #e3e1ee;
  --brand: #7562fa;        /* logo purple — large text & decoration */
  --brand-strong: #6650f0; /* buttons (white text passes AA) */
  --brand-hover: #5a44e3;
  --brand-ink: #5a44e3;    /* small purple text on light backgrounds */
  --brand-soft: #ece8ff;
  --logo-gray: #3f4244;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow: 0 24px 50px -24px rgba(45, 33, 120, 0.28);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); }
a:hover { color: var(--brand-hover); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; z-index: 100;
}
.skip-link:focus { top: 12px; color: #fff; }

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

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header { padding: 20px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: block; line-height: 0; }
.logo img { width: 140px; height: auto; }

.nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 10px 14px; border-radius: 999px;
}
.nav-link:hover { background: var(--surface); color: var(--ink); }

.lang-switch {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; margin-left: 4px;
}
.lang-switch a {
  min-width: 40px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); text-decoration: none;
}
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }
.lang-switch a:not([aria-current="true"]):hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; border: 0;
  transition: background-color .15s ease, transform .15s ease;
}
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--ink); }
.btn:active { transform: translateY(1px); }

/* ---------- Hero ---------- */
.hero { padding: 32px 0 72px; }
.hero-grid { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.hero-copy { flex: 1 1 460px; min-width: 0; padding-top: 28px; display: flex; flex-direction: column; gap: 22px; }

.hero-title {
  margin: 0;
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero-title .line { display: block; }

/* Rotating word: each slot is taller than the glyphs (room for j, g, p
   descenders), and the negative margins pull the surrounding lines back so
   the heading keeps its tight rhythm. */
.rotator {
  --slot: 1.36em;
  display: block;
  height: var(--slot);
  margin: -0.1em 0 -0.16em;
  overflow: hidden;
  color: var(--brand);
}
.rotator-track { display: block; transition: transform .6s cubic-bezier(.7, 0, .2, 1); will-change: transform; }
.rotator-track.no-anim { transition: none; }
.rotator-word { display: block; height: var(--slot); line-height: var(--slot); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .rotator-track { transition: none; } }

.hero-lead { margin: 0; font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 480px; }

.facts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.facts svg { flex: none; color: var(--brand); }

/* ---------- Chat ---------- */
.chat {
  flex: 1 1 480px; min-width: 0; max-width: 580px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
}
.chat-head strong { display: block; line-height: 1.3; }
.status { font-size: 13px; color: #1f7a52; display: flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fb36d; }

.chat-log {
  padding: 22px; display: flex; flex-direction: column; gap: 12px;
  min-height: 300px; max-height: 420px; overflow-y: auto;
  background: #fbfbfe; scroll-behavior: smooth;
}
.bubble { max-width: 85%; padding: 12px 16px; line-height: 1.5; font-size: 16px; animation: pop .25s ease-out; }
.bubble-bot { align-self: flex-start; background: var(--surface-2); border-radius: 18px 18px 18px 4px; }
.bubble-user { align-self: flex-end; background: var(--brand-strong); color: #fff; border-radius: 18px 18px 4px 18px; font-weight: 500; }
.bubble .meta { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.bubble a { color: inherit; font-weight: 700; }
.typing { display: inline-flex; gap: 4px; padding: 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9a96b8; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble, .typing span { animation: none; } }

.chips { padding: 16px 22px 6px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }

.chat-form { padding: 10px 22px 20px; }
.chat-row { display: flex; gap: 8px; }
.chat-row + .chat-row { margin-top: 8px; }
.chat-input {
  flex: 1; min-width: 0; min-height: 50px;
  border: 1.5px solid #d9d6e8; border-radius: 999px;
  padding: 0 18px; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
}
.chat-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.send-btn { width: 50px; height: 50px; padding: 0; border-radius: 50%; flex: none; }
.form-note { margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* JS-enhanced two-step flow: without JS both rows show and the form posts normally. */
.js .step-contact { display: none; }
.js .chat-form[data-step="contact"] .step-message { display: none; }
.js .chat-form[data-step="contact"] .step-contact { display: flex; }
.js .chat-form[data-step="done"] .chat-row { display: none; }
.restart { display: none; }
.js .chat-form[data-step="done"] .restart { display: inline-flex; }
.no-js-submit { margin-top: 8px; }
.js .no-js-submit { display: none; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; max-width: 640px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); }
.section h2 { margin: 0; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.section-head p { margin: 0; color: var(--muted); font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius-md); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.card h3 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; padding: 24px; border-top: 3px solid var(--brand); background: var(--surface); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-size: 34px; font-weight: 800; color: var(--brand); letter-spacing: -0.03em; line-height: 1.2; }
.steps h3 { margin: 8px 0 6px; font-size: 19px; }
.steps p { margin: 0; color: var(--muted); font-size: 16px; }

.about { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; background: var(--surface); border-radius: var(--radius-lg); padding: 44px; }
.about-text { flex: 999 1 420px; display: flex; flex-direction: column; gap: 14px; }
.about-text p { margin: 0; color: var(--muted); font-size: 18px; }
.about-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; }
.about-side .stat { background: var(--bg); border-radius: 16px; padding: 16px 18px; }
.about-side .stat strong { display: block; font-size: 15px; }
.about-side .stat span { color: var(--muted); font-size: 15px; }

.cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 44px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.cta-band h2 { color: #fff; }
.cta-band p { margin: 8px 0 0; color: #c9cad3; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 48px; color: var(--muted); font-size: 15px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 32px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 28px; }
.footer-contacts { display: flex; flex-wrap: wrap; gap: 8px 24px; font-style: normal; }
.footer-contacts a { color: var(--ink); text-decoration: none; font-weight: 600; }
.footer-contacts a:hover { color: var(--brand-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .chat { max-width: none; }
}
@media (max-width: 900px) {
  .nav-link { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .site-header { padding: 14px 0; }
  .logo img { width: 108px; }
  .nav .btn { min-height: 42px; padding: 0 16px; font-size: 14px; }
  .lang-switch a { min-width: 36px; padding: 0 8px; }
  .hero { padding: 8px 0 48px; }
  .hero-grid { gap: 32px; }
  .hero-copy { padding-top: 12px; gap: 18px; }
  .hero-lead { font-size: 17px; }
  .chat { border-radius: 22px; }
  .chat-head, .chat-log { padding-left: 16px; padding-right: 16px; }
  .chat { max-width: none; }
  .chat-log { min-height: 180px; max-height: 360px; }
  .chips { padding: 14px 16px 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .chat-form { padding: 8px 16px 16px; }
  .bubble { max-width: 92%; font-size: 15px; }
  .section { padding: 48px 0; }
  .about, .cta-band { padding: 28px 22px; border-radius: 22px; }
}
@media (max-width: 380px) {
  .nav .btn-label-long { display: none; }
}

/* ---------- 404 page ---------- */
.nf { padding-top: 56px; padding-bottom: 72px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.nf-code { margin: 0; font-size: clamp(64px, 12vw, 132px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--brand); }
.nf-title { margin: 0; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; font-weight: 800; letter-spacing: -0.035em; }
.nf-accent { color: var(--brand); }
.nf-text { margin: 0; color: var(--muted); font-size: 18px; max-width: 560px; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.nf-en { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.nf-en-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 640px) { .nf { padding-top: 24px; padding-bottom: 48px; } }
