/* RelayCast — centered product-launch landing page. */

:root {
  --bg: #000000;
  --surface: #0A0A0C;
  --surface-2: #121216;
  --surface-3: #19191F;
  --border: #1E1E24;
  --border-strong: #2D2D36;
  --text: #F4F4F6;
  --text-muted: #8E8E9A;
  --text-dim: #5A5A66;
  --accent: #7C9EFF;
  --accent-bg: rgba(124, 158, 255, 0.14);
  --green: #34D399;
  --red: #F87171;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.project-page,
.legal-page { background: #000; min-height: 100vh; }

.legal-page h1,
.legal-page h2,
.legal-page h3,
.legal-page p,
.project-page h1,
.project-page h2,
.project-page h3,
.project-page p { margin: 0; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* A single structural hairline behind the page. */
.page-line {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.035);
  pointer-events: none;
  z-index: 0;
}
.project-page main,
.project-page .site-header,
.project-page .site-footer { position: relative; z-index: 1; }

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow 0.25s;
}
.site-header.scrolled { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.header-inner { height: 64px; display: flex; align-items: center; gap: 26px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand .brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-bg);
  border: 1px solid rgba(124, 158, 255, 0.34);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; }
.brand-text small { margin-top: 3px; font-size: 8.5px; letter-spacing: 0.13em; color: var(--text-dim); }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { position: relative; color: var(--text-muted); font-size: 12.5px; text-decoration: none; transition: color 0.15s; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px;
  height: 1px; background: var(--accent); transition: right 0.25s var(--ease);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { right: 0; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(18, 18, 22, 0.75); color: var(--text-muted);
  font-size: 10.5px; white-space: nowrap;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); flex: none; }
.status-pill.on { border-color: rgba(52, 211, 153, 0.32); color: var(--green); }
.status-pill.on .status-dot { background: var(--green); animation: pulse-dot 2.6s infinite; }
.status-pill.off { border-color: rgba(248, 113, 113, 0.32); color: var(--red); }
.status-pill.off .status-dot { background: var(--red); }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Buttons ----------------------------------------------------------------- */

.project-page .btn,
.legal-page .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: inherit;
  font-size: 12.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.project-page .btn:hover,
.legal-page .btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.project-page .btn-quiet { padding: 7px 11px; font-size: 11.5px; }
.project-page .btn-primary,
.legal-page .btn-primary {
  background: var(--accent); border-color: var(--accent); color: #04060B;
  font-weight: 600; padding: 11px 18px;
}
.project-page .btn-primary:hover,
.legal-page .btn-primary:hover { filter: brightness(1.08); background: var(--accent); }

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

.launch { padding: 84px 0 0; text-align: center; }
.launch-inner { max-width: 760px; margin: 0 auto; }

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(18, 18, 22, 0.6); color: var(--text-muted);
  font-size: 9.5px; letter-spacing: 0.12em;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(124, 158, 255, 0.6); }

.launch h1 {
  margin-top: 24px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 650;
}
.launch h1 span { color: var(--accent); }

.launch-sub {
  max-width: 600px;
  margin: 22px auto 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.command { max-width: 620px; margin: 34px auto 0; text-align: left; }
.command-label { display: block; margin-bottom: 7px; font-size: 9px; letter-spacing: 0.13em; color: var(--text-dim); }
.command-row { display: flex; gap: 9px; }
.project-page .js-input {
  flex: 1; min-width: 0;
  background: rgba(18, 18, 22, 0.9); border: 1px solid var(--border);
  color: var(--text); padding: 11px 13px; border-radius: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.project-page .js-input::placeholder { color: var(--text-dim); }
.project-page .js-input:focus { border-color: var(--accent); background: var(--surface-2); }
.join-hint { margin-top: 8px; min-height: 14px; font-size: 10.5px; color: var(--text-dim); }
.join-hint.error { color: var(--red); }

.launch-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 18px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-muted); font-size: 11.5px; text-decoration: none;
  transition: color 0.15s;
}
.link-arrow svg { transition: transform 0.2s var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover svg { transform: translateX(2px); }

.screen {
  position: relative;
  margin: 58px auto 0;
  max-width: 1010px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: #08080A;
  overflow: hidden;
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.screen::after {
  content: ""; position: absolute; inset: 0; border-radius: 17px;
  pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.screen img { display: block; width: 100%; height: auto; }
.screen-meta {
  max-width: 1010px;
  margin: 11px auto 0;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 8.5px; letter-spacing: 0.08em; color: var(--text-dim);
}

/* Stats ------------------------------------------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 980px; margin: 38px auto 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { padding: 18px 10px; text-align: center; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.stat:first-child { border-left: none; }
.stat-value { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.stat-value small { margin-left: 5px; font-size: 9px; font-weight: 500; letter-spacing: 0.08em; color: var(--text-dim); }
.stat-label { font-size: 10px; color: var(--text-muted); }

/* Sections ---------------------------------------------------------------- */

.section { padding: 104px 0 8px; }
.section-index { display: block; font-size: 9.5px; letter-spacing: 0.14em; color: var(--text-dim); }
.section-index::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 9px;
  border-radius: 50%; background: var(--accent); vertical-align: 1px;
}
.section-head h2, .why-head h2, .flow-head h2, .requirements-head h2 {
  margin-top: 13px;
  font-size: clamp(27px, 3.2vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 620;
}

/* Why P2P ----------------------------------------------------------------- */

.why { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 84px; align-items: start; }
.why-head { position: sticky; top: 100px; }
.why-head h2 { margin-top: 13px; }
.why-head p { margin-top: 16px; color: var(--text-muted); font-size: 12.5px; line-height: 1.7; max-width: 380px; }
.why-head .link-arrow { margin-top: 18px; }

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.why-item { padding: 22px 0 20px; border-top: 1px solid var(--border); }
.why-item:nth-child(-n + 2) { border-top: none; padding-top: 0; }
.why-item .num { font-size: 9.5px; color: var(--text-dim); }
.why-item h3 { margin-top: 9px; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.why-item p { margin-top: 7px; color: var(--text-muted); font-size: 11.5px; line-height: 1.6; }

/* Flow -------------------------------------------------------------------- */

.flow { padding-top: 116px; }
.flow-head { text-align: center; }
.flow-head h2 { margin-top: 13px; }
.flow-steps {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px; margin-top: 54px; text-align: center;
}
.flow-steps::before {
  content: ""; position: absolute; top: 18px; left: 10%; right: 10%;
  height: 1px; background: var(--border);
}
.flow-step { position: relative; padding: 0 18px; }
.flow-dot {
  position: relative; z-index: 1;
  width: 37px; height: 37px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-strong);
  background: #000; color: var(--accent); font-size: 10px;
}
.flow-step h3 { margin-top: 18px; font-size: 14px; font-weight: 600; }
.flow-step p { margin: 8px auto 0; max-width: 290px; color: var(--text-muted); font-size: 11.5px; line-height: 1.6; }

/* Security band ----------------------------------------------------------- */

.security-band {
  margin-top: 108px;
  padding: 82px 0;
  background: #050506;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.security-inner { display: grid; grid-template-columns: 1fr 0.92fr; gap: 64px; align-items: center; }
.security-copy h2 { margin-top: 13px; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.04; letter-spacing: -0.035em; }
.security-copy p { margin-top: 16px; max-width: 500px; color: var(--text-muted); font-size: 12.5px; line-height: 1.7; }
.security-copy .link-arrow { margin-top: 18px; }

.security-code {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #08080A;
  padding: 8px 18px 6px;
}
.code-head, .code-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 9.5px; letter-spacing: 0.06em; color: var(--text-dim);
}
.code-row span:last-child { color: var(--text-muted); }
.code-row .big { color: var(--text); font-size: 13px; letter-spacing: 0.1em; }
.code-head .ok { color: var(--green); }
.code-row .off { color: var(--text-dim); }
.code-foot { padding: 11px 0 5px; font-size: 9px; color: var(--text-dim); }

/* Requirements ------------------------------------------------------------ */

.requirements { padding-top: 100px; }
.requirements-head { text-align: center; }
.requirements-head h2 { margin-top: 13px; }
.specs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 46px; border-top: 1px solid var(--border);
}
.spec { text-align: center; padding: 22px 16px 6px; border-left: 1px solid var(--border); }
.spec:first-child { border-left: none; }
.spec-label { font-size: 9px; letter-spacing: 0.12em; color: var(--text-dim); }
.spec strong { display: block; margin: 9px 0 5px; font-size: 14.5px; font-weight: 600; }
.spec p { color: var(--text-muted); font-size: 10.5px; line-height: 1.55; }

/* Closing ----------------------------------------------------------------- */

.closing { padding: 108px 0 96px; text-align: center; }
.closing h2 { font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -0.03em; }
.closing > p { margin-top: 9px; color: var(--text-muted); font-size: 12.5px; }
.closing .command { margin-top: 26px; }

/* Footer ------------------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--border); padding: 22px 0 34px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; color: var(--text-dim); font-size: 11px;
}
.footer-brand { display: flex; align-items: center; gap: 9px; color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; }
.footer-version { color: var(--text-dim); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-mode { font-size: 9.5px; letter-spacing: 0.06em; }

/* Motion ------------------------------------------------------------------ */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.launch-inner > * { animation: rise 0.8s var(--ease) both; }
.launch-inner > :nth-child(1) { animation-delay: 0.04s; }
.launch-inner > :nth-child(2) { animation-delay: 0.1s; }
.launch-inner > :nth-child(3) { animation-delay: 0.16s; }
.launch-inner > :nth-child(4) { animation-delay: 0.22s; }
.launch-inner > :nth-child(5) { animation-delay: 0.28s; }
.screen { animation: screen-in 1s var(--ease) 0.2s both; }
.screen-meta { animation: rise 0.8s var(--ease) 0.4s both; }
.stats { animation: rise 0.8s var(--ease) 0.45s both; }

.js .reveal { transform: translateY(12px); transition: transform 0.65s var(--ease); }
.js .reveal.in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .launch-inner > *, .screen, .screen-meta, .stats { animation: none; }
  .js .reveal { transform: none; transition: none; }
  .status-pill.on .status-dot { animation: none; }
}

/* Legal page -------------------------------------------------------------- */

.legal { max-width: 860px; padding: 64px 0 84px; }
.legal h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.03em; margin-top: 14px; }
.legal .lead { margin-top: 14px; max-width: 700px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.legal-grid { display: grid; gap: 12px; margin-top: 30px; }
.legal-card {
  border: 1px solid var(--border); background: var(--surface); border-radius: 12px;
  padding: 18px 20px; display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start;
}
.legal-card h2 { font-size: 13.5px; font-weight: 600; }
.legal-card p { color: var(--text-muted); font-size: 11.5px; line-height: 1.65; }
.legal-card .links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.legal-foot {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 11px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.legal-code {
  display: block; margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #050506;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 10px; overflow-x: auto;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1020px) {
  .site-nav { display: none; }
  .page-line { display: none; }
  .why { grid-template-columns: 1fr; gap: 34px; }
  .why-head { position: static; }
  .security-inner { grid-template-columns: 1fr; gap: 30px; }
  .specs { grid-template-columns: repeat(2, 1fr); }
  .spec:nth-child(3) { border-left: none; border-top: 1px solid var(--border); }
  .spec:nth-child(4) { border-top: 1px solid var(--border); }
  .legal-card { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { height: 58px; gap: 12px; }
  .brand-text small { display: none; }
  .header-right .btn-quiet { display: none; }
  .status-pill { font-size: 9.5px; padding: 4px 8px; }
  .launch { padding: 42px 0 0; }
  .launch h1 { font-size: 38px; }
  .launch-sub { font-size: 13px; }
  .command-row { flex-direction: column; }
  .command-row .btn { width: 100%; }
  .screen { margin-top: 38px; border-radius: 13px; }
  .screen-meta { flex-direction: column; gap: 4px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-left: none; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .section { padding: 66px 0 4px; }
  .why-grid { grid-template-columns: 1fr; }
  .why-item:nth-child(2) { border-top: 1px solid var(--border); padding-top: 20px; }
  .flow { padding-top: 78px; }
  .flow-steps { grid-template-columns: 1fr; gap: 28px; }
  .flow-steps::before { display: none; }
  .security-band { margin-top: 74px; padding: 56px 0; }
  .requirements { padding-top: 66px; }
  .specs { grid-template-columns: 1fr; }
  .spec { border-left: none; border-top: 1px solid var(--border); }
  .spec:first-child { border-top: none; }
  .closing { padding: 70px 0; }
  .footer-inner { align-items: flex-start; }
  .footer-links { gap: 12px; }
}
