/* STC, Signal Telegram Copier
   Design system */

:root {
  /* Core palette, pulled from logo */
  --bg-0: #05060A;
  --bg-1: #0A0C14;
  --bg-2: #11141F;
  --bg-3: #1A1F2E;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hi: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.14);

  /* Brand gradient, logo cyan → violet */
  --cyan: #4FC3F7;
  --cyan-bright: #7DDFFF;
  --violet: #7B4BFF;
  --violet-deep: #5B2FD1;
  --magenta: #B94BFF;

  /* Semantic */
  --up: #00E6A8;
  --down: #FF4D6D;
  --warn: #FFB547;
  --text-0: #F5F7FB;
  --text-1: #B8C0D0;
  --text-2: #8B93A5;   /* was #6E7688 = 4.03:1 on cards, under AA */
  --text-3: #767E92;   /* was #4A5163 = 2.32:1 on cards; now 4.52:1, clears AA */

  /* Type */
  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(79,195,247,0.18) 0%, rgba(123,75,255,0.18) 100%);
  --grad-text: linear-gradient(135deg, #7DDFFF 0%, #B088FF 55%, #E07BFF 100%);

  /* Glow */
  --glow-cyan: 0 0 40px rgba(79, 195, 247, 0.35);
  --glow-violet: 0 0 40px rgba(123, 75, 255, 0.35);
  --glow-brand: 0 0 60px rgba(123, 75, 255, 0.25), 0 0 20px rgba(79, 195, 247, 0.2);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background, subtle grid + aurora */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient::before {
  content: "";
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 85%);
}
.ambient::after {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 80%;
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(79,195,247,0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 75% 55%, rgba(123,75,255,0.22), transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 80%, rgba(185,75,255,0.12), transparent 60%);
  filter: blur(20px);
}

/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(44px, 6vw, 88px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 4vw, 56px); line-height: 1.08; letter-spacing: -0.028em; }
h3 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; }
p  { margin: 0; color: var(--text-1); }
a  { color: inherit; text-decoration: none; }
.mono { font-family: var(--f-mono); }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Eyebrow / chip */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-1);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 10px var(--up);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--grad-brand);
  color: white;
  box-shadow: var(--glow-brand);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), transparent 50%);
  opacity: 0;
  transition: opacity .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 80px rgba(123,75,255,0.45), 0 0 30px rgba(79,195,247,0.35); }
.btn-primary:hover::before { opacity: 1; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-0);
}
.btn-ghost:hover { background: var(--surface-hi); border-color: var(--border-hi); transform: translateY(-1px); }
/* Press feedback: scale, not padding/size, so the button never reflows its
   row mid-click (CLS), and :active must beat :hover's lift or the press
   reads as a second hover. */
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary:active { box-shadow: var(--glow-brand); }
/* Keyboard users get a ring where mouse users get a glow. :focus-visible, not
   :focus, a click already shows hover/active state, and a ring on every
   click reads as a rendering glitch. Outline (not box-shadow) so it survives
   the overflow:hidden sheen layer on .btn-primary. */
.btn:focus-visible,
.bt-btn:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 3px;
}
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(5,6,10,0.7);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--text-1);
  font-size: 14px;
  transition: color .15s;
}
.nav-links a:hover { color: var(--text-0); }

/* Mobile navigation.
   The links used to be display:none below 860px with nothing replacing them,
   so a phone had a header with no way to reach any section of the site. The
   toggle is hidden on desktop and the panel is driven by [data-nav-open] on
   <body>, so the same markup serves both without duplicating the link list. */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-0);
  cursor: pointer;
  flex: none;
}
.nav-toggle:hover { border-color: var(--border-hi); }
/* Sit clear of the CTA next to it; the flex gap alone left them touching on a
   phone. flex:none so the toggle keeps its size when the row gets tight. */
.nav-toggle { margin-left: 6px; }
/* The header CTA must never wrap "Get started" onto two lines inside the pill,
   which is what made the text look like it spilled out of the button. */
.nav-inner .btn-sm { white-space: nowrap; }
.nav-toggle span {
  display: block; position: relative;
  width: 18px; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: background .18s;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; position: absolute; left: 0;
  width: 18px; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: transform .22s ease, top .18s ease;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }
/* Open state becomes an X, so the same control closes it. */
body[data-nav-open="1"] .nav-toggle span { background: transparent; }
body[data-nav-open="1"] .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body[data-nav-open="1"] .nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 18px;
    /* Fully opaque, not a translucent sheet: the hero headline sits directly
       behind this panel and ghosted through at 0.97 alpha, which made the
       links hard to read on exactly the screen size that needs them most. */
    background: #0A0C14;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(0,0,0,0.55);
    /* Collapsed by default and animated open, rather than display:none, so the
       transition has something to interpolate. visibility keeps the links out
       of the tab order while closed. */
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height .28s ease, opacity .2s ease, visibility .28s;
    z-index: 200;
  }
  body[data-nav-open="1"] .nav-links {
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
  }
  .nav-links a {
    padding: 14px 4px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: 0; }
  /* On a narrow screen two header buttons crowd the toggle; "Sign in" lives
     in the panel instead and the primary CTA stays visible. */
  .nav-inner > .flex .btn-ghost { display: none; }
  .nav-signin-mobile { color: var(--cyan) !important; }
}
/* The panel's own "Sign in" is a mobile affordance only, on desktop the
   header button already covers it. */
.nav-signin-mobile { display: none; }
@media (max-width: 860px) { .nav-signin-mobile { display: block; } }
@media (prefers-reduced-motion: reduce) {
  .nav-links, .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    transition: none;
  }
}

/* Cards */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--border-hi); }
.card-glow::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: var(--r-lg);
  padding: 1px;
  background: var(--grad-brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
  pointer-events: none;
}

/* Section spacing */
section { padding: 120px 0; position: relative; }
@media (max-width: 768px) { section { padding: 80px 0; } }

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 64px;
}
.section-head .eyebrow { margin-bottom: 20px; }
.section-head p { color: var(--text-1); font-size: 18px; margin-top: 18px; }

/* Utility */
.flex { display: flex; }
.grid { display: grid; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.center { display: flex; align-items: center; justify-content: center; }

/* Form controls */
.input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-0);
  font-family: var(--f-body);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(123,75,255,0.18);
}
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 8px;
  font-family: var(--f-display);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-up { background: rgba(0,230,168,0.12); color: var(--up); }
.badge-down { background: rgba(255,77,109,0.12); color: var(--down); }
.badge-warn { background: rgba(255,181,71,0.12); color: var(--warn); }
.badge-brand { background: rgba(123,75,255,0.15); color: #B088FF; }

/* Scroll reveal, driven by the single IntersectionObserver in shared.js.
   The blur is part of the entrance, but it MUST resolve to `filter: none`
   once settled: a lingering filter (like a lingering transform) turns the
   element into a containing block for any position:fixed descendant, and it
   keeps a composite layer alive for content that is just sitting there. */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(7px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1), filter .8s ease;
}
.reveal.in { opacity: 1; transform: none; filter: none; }
/* Reduced motion: content must simply be there. The observer still adds .in,
   but with no hidden initial state there is nothing to animate, this also
   covers the no-JS case where .in never arrives. */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* Ticker */
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker { overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent); }
.ticker-track { display: flex; gap: 48px; width: max-content; animation: ticker-scroll 40s linear infinite; }
.ticker-item { display: flex; gap: 8px; align-items: center; font-family: var(--f-mono); font-size: 13px; color: var(--text-1); white-space: nowrap; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
  position: relative;
  z-index: 1;
}
.risk-disclaimer {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  padding: 20px;
  background: rgba(255,77,109,0.04);
  border: 1px solid rgba(255,77,109,0.15);
  border-radius: var(--r-md);
  margin-top: 40px;
}
