/* Relaybird website. Same tokens as the panel: dark graphite, one teal accent,
   grouped lists with alternating rows. One orchestrated moment: the relay demo in the hero. */

:root {
  --bg: #15171a;
  --alt: #1d2024;
  --raised: #23272c;
  --ink: #e6e8eb;
  --muted: #8a919a;
  --faint: #5d646d;
  --accent: #6fb7b4;
  --accent-ink: #0d1716;
  --bubble-out: #24393a;
  --code: #c9ced4;
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px rgb(111 183 180 / 0.6); border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px;
  border-radius: 10px; background: var(--alt); color: var(--ink); font-weight: 550; font-size: 15px; white-space: nowrap;
}
.btn:hover { background: var(--raised); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #82c4c1; }
.btn.big { min-height: 46px; padding: 0 22px; font-size: 16px; }
.link-quiet { color: var(--muted); font-size: 15px; }
.link-quiet:hover { color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- header */

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px;
  max-width: 1160px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 40px);
  background: rgb(21 23 26 / 0.88); backdrop-filter: blur(10px);
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--accent); }
.top-nav { display: flex; gap: 24px; }
.top-nav a { color: var(--muted); font-size: 15px; }
.top-nav a:hover { color: var(--ink); text-decoration: none; }
.top-cta { margin-left: auto; display: flex; align-items: center; gap: 18px; }
@media (max-width: 760px) {
  .top { gap: 12px; }
  .top-nav { display: none; }
  .top-cta { gap: 12px; }
  .top-cta .btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
}

main { max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px);
  align-items: center; padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
}
.hero h1 { font-size: clamp(36px, 5.2vw, 60px); font-weight: 700; letter-spacing: -0.035em; max-width: 13ch; }
.lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); margin-top: 22px; max-width: 46ch; line-height: 1.55; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.fine { color: var(--faint); font-size: 14px; margin-top: 16px; }

/* the relay: request -> Telegram -> webhook */
.relay { display: grid; gap: 0; }
.relay-step { margin: 0; padding: 16px 18px; border-radius: var(--radius); background: var(--alt); }
.relay-step figcaption { font-size: 12.5px; color: var(--faint); margin-bottom: 8px; }
.relay pre { margin: 0; font: 13px/1.6 var(--mono); color: var(--code); white-space: pre-wrap; overflow-wrap: anywhere; }
.t-m { color: var(--accent); font-weight: 600; } .t-k { color: #9fb4c8; } .t-s { color: #d6c08f; } .t-v { color: var(--faint); }
.relay-chat { display: grid; gap: 6px; background: transparent; padding: 14px 4px; }
.relay-chat figcaption { padding-left: 14px; }
.bubble { max-width: 82%; padding: 9px 14px 7px; border-radius: 18px; background: var(--raised); font-size: 15px; }
.bubble.out { justify-self: end; background: var(--bubble-out); border-bottom-right-radius: 6px; }
.bubble.in { justify-self: start; border-bottom-left-radius: 6px; }
.bubble time { display: block; text-align: right; font-size: 11px; color: var(--faint); margin-top: 2px; }
.relay-wire { height: 26px; display: grid; justify-items: center; }
.relay-wire i { width: 2px; height: 100%; background: linear-gradient(var(--accent), transparent); border-radius: 2px; }
.relay-wire.back i { background: linear-gradient(transparent, var(--accent)); }

@media (prefers-reduced-motion: no-preference) {
  .relay-req, .relay-wire, .bubble.out, .bubble.in, .relay-hook, .relay-chat figcaption { opacity: 0; animation: rise 0.5s ease-out forwards; }
  .relay-req { animation-delay: 0.15s; }
  .relay-wire { animation-delay: 0.65s; }
  .relay-chat figcaption { animation-delay: 0.8s; }
  .bubble.out { animation-delay: 0.95s; }
  .bubble.in { animation-delay: 1.7s; }
  .relay-wire.back { animation-delay: 2.05s; }
  .relay-hook { animation-delay: 2.3s; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
}

/* ---------------------------------------------------------------- blocks */

.block { padding: clamp(40px, 7vw, 80px) 0; }
.block h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 650; margin-bottom: 14px; }
.block-lead { color: var(--muted); font-size: 17px; max-width: 62ch; margin-bottom: 28px; }

/* grouped list with alternating rows, like the panel */
.group { list-style: none; margin: 24px 0 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
.group > :nth-child(even) { background: var(--alt); }
.features { display: grid; grid-template-columns: 1fr 1fr; }
.features li { padding: 20px 22px; display: grid; gap: 4px; }
.features li b { font-weight: 600; font-size: 16px; }
.features li span { color: var(--muted); font-size: 15px; }
/* two columns: alternate per row, not per cell */
@media (min-width: 761px) {
  .features > :nth-child(even) { background: none; }
  .features > :nth-child(4n + 3), .features > :nth-child(4n + 4) { background: var(--alt); }
}
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.steps { list-style: none; counter-reset: step; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.steps li { counter-increment: step; display: grid; gap: 6px; align-content: start; }
.steps li::before { content: counter(step); font-size: 14px; font-weight: 600; color: var(--accent); }
.steps b { font-size: 17px; font-weight: 600; }
.steps span { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* pricing */
.plans { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border-radius: var(--radius); overflow: hidden; }
.plan { padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.plans > :nth-child(even) { background: var(--alt); }
.plan h3 { font-size: 18px; font-weight: 600; }
.price { margin-top: 2px; }
.price b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.price span { color: var(--faint); font-size: 14px; }
.plan-limit { color: var(--accent); font-size: 15px; font-weight: 550; }
.plan ul { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: 15px; }
.plan .btn { margin-top: auto; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

.rules .block-lead { margin-bottom: 0; }

.faq details { padding: 0 22px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 550; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding: 0 0 20px; max-width: 70ch; }

.final { padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 10vw, 120px); display: grid; justify-items: start; gap: 24px; }
.final h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 650; max-width: 18ch; }

/* ---------------------------------------------------------------- footer */

.foot {
  max-width: 1160px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 14px;
}
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* ---------------------------------------------------------------- text pages */

.doc-page { max-width: 760px; padding-top: clamp(32px, 6vw, 72px); padding-bottom: 64px; }
.doc-page h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 700; }
.doc-page h2 { font-size: 21px; font-weight: 600; margin: 40px 0 12px; }
.doc-page p, .doc-page li { color: var(--muted); }
.doc-page ul { padding-left: 20px; display: grid; gap: 6px; }
.doc-page .lead { margin-top: 16px; }
