/* StarReach — landing styles. Dark «telegraph» aesthetic: deep ink canvas,
   star-gold accents (Telegram Stars currency), mono numerals, net motif. */

:root {
  --ink: #0b0b10;
  --ink-2: #12121a;
  --ink-3: #1a1a26;
  --line: #262636;
  --line-soft: #1e1e2c;
  --text: #e8e6f0;
  --muted: #9a97ad;
  --faint: #5f5c72;
  --gold: #f5c451;
  --gold-soft: #ffd97a;
  --gold-dim: rgba(245, 196, 81, .14);
  --accent: #7ee0c3;      /* mint for owner-side highlights */
  --blue: #8ab4ff;        /* telegram blue, used sparingly */
  --danger: #ff7a7a;
  --radius: 14px;
  --font-display: "Unbounded", "Manrope", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(245,196,81,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(138,180,255,.05), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body { text-align: right; }

.mono { font-family: var(--font-mono); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}

h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -.01em; }

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

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: .9rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(11, 11, 16, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand b { font-weight: 700; color: var(--gold); }

.brand-mark {
  width: 26px;
  height: 26px;
  fill: var(--gold);
  filter: drop-shadow(0 0 6px rgba(245,196,81,.45));
}

.top-nav {
  display: flex;
  gap: 1.6rem;
  margin-inline-start: auto;
  font-size: .95rem;
  color: var(--muted);
}

.top-nav a { transition: color .15s; }
.top-nav a:hover { color: var(--text); }

.top-actions { display: flex; align-items: center; gap: .8rem; }

/* language switcher */

.lang { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: .42rem .85rem;
  font: 600 .9rem var(--font-body);
  cursor: pointer;
  transition: border-color .15s;
}

.lang-btn:hover { border-color: var(--gold); }
.lang-globe { color: var(--gold); font-size: .8rem; }
.lang-caret { font-size: .7rem; color: var(--muted); }

.lang-menu {
  position: absolute;
  top: calc(100% + .5rem);
  inset-inline-end: 0;
  min-width: 190px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .35rem;
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
}

.lang-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font: 500 .92rem var(--font-body);
  padding: .5rem .7rem;
  cursor: pointer;
  text-align: start;
}

.lang-menu button:hover { background: var(--ink-3); }
.lang-menu button[aria-selected="true"] { color: var(--gold); }
.lang-menu .lang-native { color: var(--faint); font-size: .82rem; }
.lang-menu button[aria-selected="true"] .lang-native { color: var(--muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 999px;
  padding: .78rem 1.6rem;
  font: 700 .98rem var(--font-body);
  letter-spacing: .01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s, background .12s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #17120a;
  box-shadow: 0 6px 22px rgba(245,196,81,.28);
}

.btn-primary:hover { box-shadow: 0 8px 28px rgba(245,196,81,.42); }

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--muted); }

.btn-outline {
  border-color: var(--line);
  color: var(--text);
  width: 100%;
}

.btn-outline:hover { border-color: var(--gold); color: var(--gold-soft); }

.btn-sm { padding: .5rem 1.1rem; font-size: .88rem; }
.btn-lg { padding: 1rem 2.4rem; font-size: 1.08rem; }

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 2rem;
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}

.hero-kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font: 600 .85rem var(--font-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 1.2rem;
  min-height: 3.2em;
}

.hero-title .accent { color: var(--gold); }

.cursor {
  display: inline-block;
  color: var(--gold);
  animation: blink 1.1s steps(1) infinite;
  margin-inline-start: .1em;
}

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

.hero-sub {
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0 0 2rem;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero-note {
  margin: 1.3rem 0 0;
  color: var(--faint);
  font-size: .88rem;
}

/* typewriter canvas: rotating verbs */

.hero-title .accent { display: inline-block; }

/* constellation net */

.hero-visual { position: relative; min-height: 380px; }

.net { position: absolute; inset: 0; }

.net svg { width: 100%; height: 100%; display: block; }

.net-line { stroke: rgba(138,180,255,.22); stroke-width: 1; }

.net-line.hot { stroke: rgba(245,196,81,.55); stroke-width: 1.4; }

.net-node { fill: #2e2e42; }

.net-node.hub { fill: var(--gold); filter: drop-shadow(0 0 6px rgba(245,196,81,.7)); }

.net-node.hub2 { fill: var(--blue); filter: drop-shadow(0 0 6px rgba(138,180,255,.6)); }

@keyframes pulse { 50% { r: 7; } }
.net-node.hub { animation: pulse 2.4s ease-in-out infinite; }

/* ---------- tape (marquee) ---------- */

.tape {
  border-block: 1px solid var(--line-soft);
  overflow: hidden;
  padding: .8rem 0;
  background: rgba(18, 18, 26, .5);
}

.tape-track {
  display: inline-flex;
  gap: 3.2rem;
  white-space: nowrap;
  font: 500 .86rem var(--font-mono);
  color: var(--muted);
  animation: tape 36s linear infinite;
}

[dir="rtl"] .tape-track { animation-direction: reverse; }

.tape-track b { color: var(--gold); font-weight: 600; }
.tape-track .up { color: var(--accent); }

@keyframes tape {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- generic block ---------- */

.block {
  padding: clamp(3.2rem, 6vw, 5.5rem) clamp(1.2rem, 4vw, 3rem);
  max-width: 1180px;
  margin: 0 auto;
}

.block-kicker {
  margin: 0 0 .7rem;
  color: var(--gold);
  font: 600 .82rem var(--font-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.block-head { margin-bottom: 2.4rem; max-width: 60ch; }

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.4rem;
  transition: border-color .15s, transform .15s;
}

.step:hover { border-color: var(--gold-dim); transform: translateY(-2px); }

.step-n {
  display: block;
  font: 700 .95rem var(--font-mono);
  color: var(--faint);
  margin-bottom: .9rem;
}

.step:hover .step-n { color: var(--gold); }

.step h3 { font-size: 1.12rem; margin-bottom: .55rem; font-weight: 700; }

.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- chat demo ---------- */

.chat-demo {
  margin: 2.6rem 0 0;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 640px;
  margin-inline: auto;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  font: 600 .92rem var(--font-body);
  color: var(--muted);
}

.chat-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(126,224,195,.7);
}

.chat-live {
  margin-inline-start: auto;
  font: 500 .78rem var(--font-mono);
  color: var(--faint);
}

.chat-body {
  padding: 1.2rem 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  min-height: 300px;
  justify-content: flex-end;
}

.msg {
  max-width: 86%;
  border-radius: 14px;
  padding: .65rem .95rem;
  font-size: .93rem;
  line-height: 1.45;
  animation: msg-in .35s ease both;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.msg-ad {
  align-self: flex-start;
  background: var(--ink-3);
  border: 1px solid var(--line);
}

.msg-ad .msg-link {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: .88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(180deg, #2b2440, #241f36);
  border: 1px solid #3a3154;
}

.msg-note {
  align-self: center;
  font: 500 .8rem var(--font-mono);
  color: var(--faint);
  background: none;
}

.msg-note b { color: var(--gold); font-weight: 600; }

/* ---------- roles ---------- */

.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.role {
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem;
  border: 1px solid var(--line-soft);
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.role-advertiser { border-top: 2px solid var(--blue); }
.role-owner { border-top: 2px solid var(--gold); }

.role h3 {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.role-glyph { font-size: 1.05rem; }
.role-advertiser .role-glyph { color: var(--blue); }
.role-owner .role-glyph { color: var(--gold); }

.role-tag { margin: 0; color: var(--muted); font-size: .98rem; }

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  color: var(--text);
  font-size: .95rem;
  flex: 1;
}

.ticks li {
  display: grid;
  grid-template-columns: 1.15em 1fr;
  gap: .55rem;
  align-items: baseline;
}

.ticks li::before { content: "✦"; color: var(--faint); font-size: .8em; }

.role-advertiser .ticks li::before { color: var(--blue); }
.role-owner .ticks li::before { color: var(--gold); }

.payout-chip {
  display: inline-flex;
  align-items: baseline;
  gap: .6rem;
  align-self: flex-start;
  background: var(--gold-dim);
  border: 1px solid rgba(245,196,81,.3);
  border-radius: 10px;
  padding: .55rem .9rem;
  font-size: .88rem;
  color: var(--gold-soft);
}

.payout-num {
  font: 700 1.35rem var(--font-mono);
  color: var(--gold);
}

/* ---------- stats ---------- */

.stats-block .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}

.stat {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.3rem;
}

.stat-num {
  display: block;
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -.02em;
  margin-bottom: .35rem;
  font-variant-numeric: tabular-nums;
}

.stat:nth-child(2) .stat-num,
.stat:nth-child(4) .stat-num { color: var(--accent); }

.stat-cap { color: var(--muted); font-size: .9rem; line-height: 1.4; display: block; }

.ticker-card {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem 1.4rem;
}

.ticker-cap {
  margin: 0 0 .8rem;
  color: var(--faint);
  font: 500 .8rem var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ticker {
  display: grid;
  gap: .45rem;
  font-size: .9rem;
  color: var(--muted);
}

.ticker-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto;
  gap: 1rem;
  align-items: baseline;
  padding: .3rem 0;
  border-bottom: 1px dashed var(--line-soft);
}

.ticker-row:last-child { border-bottom: 0; }

.ticker-slot { color: var(--text); font-weight: 600; }

.ticker-stars { color: var(--gold); }

.ticker-bids { color: var(--faint); font-size: .82rem; }

.ticker-row.win .ticker-slot { color: var(--accent); }

/* ---------- faq ---------- */

.faq { display: grid; gap: .8rem; max-width: 780px; }

.faq details {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  transition: border-color .15s;
}

.faq details[open] { border-color: rgba(245,196,81,.35); }

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font: 400 1.3rem var(--font-mono);
  color: var(--gold);
  transition: transform .15s;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { margin: .8rem 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- final ---------- */

.final {
  text-align: center;
  padding: clamp(3.5rem, 7vw, 6rem) 1.5rem clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(700px 320px at 50% 120%, rgba(245,196,81,.08), transparent 65%);
}

.final h2 { margin-bottom: 2rem; }

.final .hero-cta { justify-content: center; }

.final-note { margin: 1.2rem 0 0; color: var(--faint); font-size: .9rem; }

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

.foot {
  border-top: 1px solid var(--line-soft);
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  background: var(--ink-2);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.2rem;
  max-width: 1180px;
  margin: 0 auto;
}

.brand-foot { font-size: .95rem; }

.foot-line { color: var(--muted); font-size: .88rem; }

.foot-hint { margin-inline-start: auto; color: var(--faint); font-size: .78rem; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 260px; order: 2; }
  .top-nav { display: none; }
  .hero-title { min-height: 0; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .ticker-row { grid-template-columns: 1fr auto; }
  .ticker-bids { display: none; }
  .top { gap: 1rem; }
}

/* reduced motion */

@media (prefers-reduced-motion: reduce) {
  .tape-track { animation: none; }
  .cursor { animation: none; }
  .net-node.hub { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- legal page (legal.html) ---------- */

main.legal {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.legal-head { margin-bottom: 2rem; }
.legal-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  margin-bottom: .4rem;
}
.legal-updated { color: var(--faint); font-size: .85rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chips a.chip {
  padding: .35rem .9rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.chips a.chip:hover { border-color: var(--gold); color: var(--gold); }
.chips a.chip-active { border-color: var(--gold); color: var(--gold); }

.legal-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; }
@media (max-width: 860px) { .legal-layout { grid-template-columns: 1fr; } }

nav.legal-toc { display: flex; flex-direction: column; gap: .45rem; position: sticky; top: 5.5rem; align-self: start; }
@media (max-width: 860px) { nav.legal-toc { position: static; flex-direction: row; flex-wrap: wrap; } }
.legal-toc a {
  color: var(--faint);
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.35;
}
.legal-toc a:hover { color: var(--gold); }

.legal-body section { margin-bottom: 2.2rem; }
.legal-body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin-bottom: .8rem;
}
.legal-body p { margin-bottom: .7rem; line-height: 1.65; color: var(--text); font-size: .95rem; }
.legal-body ul { margin: .5rem 0 0 1.2rem; }
.legal-body li { margin-bottom: .45rem; line-height: 1.6; color: var(--text); font-size: .95rem; }

.legal-backline { margin-top: 3rem; }

nav.foot-legal { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
nav.foot-legal a { color: var(--muted); text-decoration: none; font-size: .85rem; }
nav.foot-legal a:hover { color: var(--gold); }
