/* ============================================================
   BOTWORKS DESIGN SYSTEM
   Palette lifted from Telegram's own dark theme, so the site
   speaks the same visual language as the product.
   ============================================================ */

:root {
  --bg:      #0E1621;   /* Telegram dark canvas */
  --panel:   #17212B;   /* Telegram dark panel */
  --panel-2: #1D2733;   /* raised panel */
  --line:    #26313E;   /* hairline borders */
  --bubble:  #2B5278;   /* outgoing bubble blue */
  --accent:  #5EB5F7;   /* link blue */
  --star:    #F5B84C;   /* Telegram Stars gold */
  --text:    #E7EDF3;
  --muted:   #8A9BAB;
  --ok:      #4FBF67;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---------- copy protection ----------
   Applied via JS (main.js) only on customer-facing pages, never
   on admin.html. Blocks text selection and image dragging; the
   matching JS also blocks right-click, copy/cut and Ctrl+C/U/S/P. */
.no-copy, .no-copy * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}
.no-copy img { -webkit-user-drag: none; user-drag: none; }
.no-copy input,
.no-copy textarea {
  user-select: text;
  -webkit-user-select: text;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.13rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 58ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 22, 33, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.nav-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--text); display: flex; align-items: center; gap: 9px;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand .dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--bubble));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}
img.dot { object-fit: cover; border: 1px solid var(--line); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.94rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #08121C; }

/* hamburger toggle — hidden on desktop, shown under 760px */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 34px; height: 34px;
  background: transparent; border: none; padding: 0; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.96rem;
  padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #08121C; }
.btn-primary:hover { background: #79c4fa; }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 48px; align-items: center;
  padding: 76px 0 64px;
}
.hero .actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero h1 .hl { color: var(--accent); }
.hero p { margin-top: 18px; }

/* Two phone mockups shown side by side — the main one (store demo)
   up front-right, a smaller secondary one (feedback/broadcast demo)
   to its left, to show the bot does more than sell. Side by side
   (not overlapping) so neither card's messages get clipped. */
.phone-stack { display: flex; align-items: flex-end; justify-content: flex-end; gap: 16px; }
.phone-secondary {
  opacity: 0.65;
  filter: saturate(0.8);
  transform: translateY(22px);
}
.phone-secondary .phone { max-width: 210px; margin-left: 0; }
.phone-secondary .chat { min-height: 190px; }
@media (max-width: 900px) {
  .phone-stack { justify-content: center; }
  .phone-secondary { display: none; }
}

/* ---------- telegram chat mockup (signature element) ---------- */
.phone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  max-width: 380px;
  margin-left: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.phone-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.phone-top .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--bubble));
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  overflow: hidden;
}
.phone-top .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.phone-top .who b { display: block; font-size: 0.92rem; font-family: var(--font-display); }
.phone-top .who span { font-size: 0.76rem; color: var(--ok); }
.chat { padding: 18px 14px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 340px; }
.msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  animation: pop 0.4s ease forwards;
}
.msg.in  { background: var(--panel-2); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.out { background: var(--bubble); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg .time { display: block; font-size: 0.66rem; color: var(--muted); text-align: right; margin-top: 3px; font-family: var(--font-mono); }
.msg .kb { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.msg .kb span {
  background: rgba(94,181,247,0.13);
  border: 1px solid rgba(94,181,247,0.35);
  color: var(--accent);
  border-radius: 7px;
  padding: 6px 10px;
  text-align: center;
  font-size: 0.8rem;
  font-family: var(--font-display);
}
.msg .star { color: var(--star); font-weight: 600; }
.msg:nth-child(1) { animation-delay: 0.15s; }
.msg:nth-child(2) { animation-delay: 0.75s; }
.msg:nth-child(3) { animation-delay: 1.35s; }
.msg:nth-child(4) { animation-delay: 1.95s; }
@keyframes pop { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */
section { padding: 58px 0; }
section.alt { background: rgba(23, 33, 43, 0.72); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 34px; }

/* ---------- animated background ----------
   Injected by main.js as .bg-fx: three softly drifting glow blobs
   (Telegram blue + brand gold) over a slow star field. Pure CSS
   transforms — cheap on the GPU, and fully disabled when the
   visitor prefers reduced motion. */
.bg-fx {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.bg-fx span { position: absolute; will-change: transform; }

.bg-fx .stars {
  inset: 0; height: 200%;
  background-image:
    radial-gradient(1.5px 1.5px at 25px 35px,  rgba(231,237,243,0.55), transparent 100%),
    radial-gradient(1px 1px     at 130px 90px, rgba(94,181,247,0.45),  transparent 100%),
    radial-gradient(1px 1px     at 200px 160px,rgba(231,237,243,0.35), transparent 100%),
    radial-gradient(1.5px 1.5px at 70px 200px, rgba(245,184,76,0.35),  transparent 100%);
  background-size: 260px 260px;
  opacity: 0.5;
  animation: star-drift 160s linear infinite;
}
@keyframes star-drift { to { transform: translateY(-50%); } }

.bg-fx .b1, .bg-fx .b2, .bg-fx .b3 { border-radius: 50%; }
.bg-fx .b1 {
  width: 65vmax; height: 65vmax; top: -28vmax; left: -18vmax;
  background: radial-gradient(circle, rgba(94,181,247,0.13), transparent 62%);
  animation: drift-a 34s ease-in-out infinite alternate;
}
.bg-fx .b2 {
  width: 55vmax; height: 55vmax; top: 8vmax; right: -22vmax;
  background: radial-gradient(circle, rgba(245,184,76,0.09), transparent 62%);
  animation: drift-b 44s ease-in-out infinite alternate;
}
.bg-fx .b3 {
  width: 60vmax; height: 60vmax; bottom: -30vmax; left: 22vmax;
  background: radial-gradient(circle, rgba(43,82,120,0.28), transparent 62%);
  animation: drift-c 38s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(9vmax, 7vmax)  scale(1.12); } }
@keyframes drift-b { to { transform: translate(-8vmax, 9vmax) scale(1.18); } }
@keyframes drift-c { to { transform: translate(-9vmax, -7vmax) scale(1.1); } }

/* Dynamic blurred golden light — a soft glowing orb that roams
   the page on a slow, irregular loop. Customer-facing pages only
   (renderBackground() is called by main.js, which admin.html never
   loads, so the admin panel stays on a flat background). */
.bg-fx .gold-light {
  width: 46vmax; height: 46vmax;
  top: -10vmax; left: -10vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,184,76,0.4), rgba(245,184,76,0.14) 45%, transparent 72%);
  filter: blur(50px);
  animation: gold-roam 30s ease-in-out infinite;
}
@keyframes gold-roam {
  0%   { transform: translate(0, 0)        scale(1); }
  25%  { transform: translate(55vw, 10vh)  scale(1.2); }
  50%  { transform: translate(35vw, 55vh)  scale(0.85); }
  75%  { transform: translate(-5vw, 30vh)  scale(1.1); }
  100% { transform: translate(0, 0)        scale(1); }
}
@media (max-width: 700px) {
  .bg-fx .gold-light { width: 70vmax; height: 70vmax; filter: blur(34px); }
}

/* Golden sheen — a soft diagonal band of gold light that sweeps
   across the page every ~18 s, like light passing over metal. */
.bg-fx .sheen {
  top: -25%; left: 0;
  width: 55vmax; height: 150%;
  background: linear-gradient(100deg,
    transparent 15%,
    rgba(245, 184, 76, 0.045) 38%,
    rgba(245, 184, 76, 0.10) 50%,
    rgba(245, 184, 76, 0.045) 62%,
    transparent 85%);
  transform: translateX(-70vw) skewX(-14deg);
  animation: sheen-sweep 18s ease-in-out infinite;
}
@keyframes sheen-sweep {
  0%        { transform: translateX(-70vw)  skewX(-14deg); }
  55%, 100% { transform: translateX(130vw)  skewX(-14deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-fx span { animation: none; }
}

/* ---------- scroll-reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- draft preview banner ---------- */
.draft-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 9px 16px;
  background: linear-gradient(90deg, #3a2c10, #2c230e);
  border-bottom: 1px solid var(--star);
  color: var(--text); font-size: 0.86rem;
}
.draft-banner .draft-actions { display: flex; gap: 12px; align-items: center; }
.draft-banner a { color: var(--star); font-weight: 600; }
.draft-banner button {
  background: transparent; border: 1px solid var(--star); color: var(--star);
  border-radius: 6px; padding: 3px 10px; font: inherit; font-size: 0.8rem; cursor: pointer;
}
.draft-banner button:hover { background: rgba(245,184,76,0.15); }

/* ---------- project cards ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card { color: var(--text); display: block; }
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card .emoji { font-size: 1.7rem; }
.card h3 { margin: 12px 0 6px; }
.card p { color: var(--muted); font-size: 0.94rem; }
.card .card-foot { margin-top: 16px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }

.status {
  float: right;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
}
.status.live { color: var(--ok); background: rgba(79,191,103,0.12); }
.status.beta { color: var(--star); background: rgba(245,184,76,0.12); }
.status.soon { color: var(--muted); background: rgba(138,155,171,0.12); }

/* feature cards reuse .card */
.card.feature { background: var(--panel-2); }
section.alt .card.feature { background: var(--bg); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 22px 20px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.82rem;
  display: block;
  margin-bottom: 10px;
}
.step h3 { font-size: 1.02rem; }
.step p { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* ---------- pricing ---------- */
.tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; align-items: stretch; }
.tier {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; display: flex; flex-direction: column; position: relative;
}
.tier.popular { border-color: var(--star); }
.tier .tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--star); color: #1a1205;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 11px; border-radius: 20px; white-space: nowrap;
}
.tier h3 { font-size: 1.05rem; color: var(--muted); font-weight: 500; }
.tier .price { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; margin: 8px 0 2px; }
.tier .price .unit { font-size: 0.85rem; color: var(--star); font-weight: 500; }
.tier ul { list-style: none; margin: 18px 0 22px; flex: 1; }
.tier li { font-size: 0.9rem; color: var(--muted); padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tier li::before { content: "✓ "; color: var(--ok); }
.tier .btn { width: 100%; justify-content: center; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 10px;
}
.faq summary { font-family: var(--font-display); font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); font-size: 0.94rem; margin-top: 10px; }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 52px 28px;
}
.cta-band p { color: var(--muted); margin: 12px auto 26px; max-width: 48ch; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 34px 0; margin-top: 30px; }
.foot-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
footer, footer a { color: var(--muted); font-size: 0.88rem; }
.foot-legal { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.foot-legal a {
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-family: var(--font-display); font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.foot-legal a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.foot-contact { display: flex; flex-direction: column; gap: 6px; text-align: right; }

/* ---------- legal pages (privacy / terms / etc.) ---------- */
.legal { max-width: 760px; padding-top: 56px; padding-bottom: 40px; }
.legal h1 { margin-bottom: 6px; }
.legal .updated {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  margin-bottom: 22px;
}
.legal .lead { margin-bottom: 10px; }
.legal-section { padding: 26px 0 0; }
.legal-section h2 { font-size: 1.18rem; margin-bottom: 10px; }
.legal-section p { color: var(--muted); font-size: 0.96rem; margin-bottom: 10px; }
.legal-section ul { margin: 4px 0 12px 20px; }
.legal-section li { color: var(--muted); font-size: 0.96rem; padding: 4px 0; }
.legal-section li::marker { color: var(--accent); }
.legal-nav {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--font-display); font-weight: 600; font-size: 0.94rem;
}

/* ---------- project not found ---------- */
.notfound { padding: 90px 22px; text-align: center; }
.notfound .lead { margin: 14px auto 26px; }
.notfound .actions { justify-content: center; display: flex; }

/* ---------- focus visibility ---------- */
a:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 48px 0 40px; }
  .phone { margin: 0 auto; }
  .hero .eyebrow { margin-bottom: 20px; }
  .hero h1 { margin-bottom: 8px; }
  .hero p.lead { margin-top: 24px; }
  .hero .actions { margin-top: 36px; }
  .grid.cols-3, .steps, .tiers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(14, 22, 33, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 60vh; overflow-y: auto; }
  .nav-links a { padding: 15px 22px; border-bottom: 1px solid var(--line); }
  .nav-links a.btn { margin: 14px 22px; width: calc(100% - 44px); justify-content: center; }
}
@media (max-width: 560px) {
  .grid.cols-3, .grid.cols-2, .steps, .tiers { grid-template-columns: 1fr; }
  .foot-contact { text-align: left; }
}
