/* BeyondWall — чёрный, белый, красный; угловатые линии, как в логотипе */
:root {
  --bg: #07070a;
  --bg-2: #0e0e13;
  --card: rgba(255, 255, 255, 0.035);
  --card-bd: rgba(255, 255, 255, 0.09);
  --txt: #f4f4f6;
  --muted: #9b9ba8;
  --red: #ff1f3d;
  --red-deep: #8f0016;
  --white: #ffffff;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--txt);
  background:
    repeating-linear-gradient(-48deg, transparent 0 46px, rgba(255, 255, 255, 0.018) 46px 48px),
    radial-gradient(900px 520px at 88% -8%, rgba(255, 31, 61, 0.20), transparent 62%),
    radial-gradient(700px 420px at -5% 12%, rgba(255, 255, 255, 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 5vw, 56px);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(7, 7, 10, 0.72);
  border-bottom: 1px solid var(--card-bd);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; letter-spacing: .3px; }
.brand b { font-weight: 800; color: var(--red); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; gap: 24px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.nav a { padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.nav a:hover { color: var(--txt); border-color: var(--red); }

/* ── Layout ──────────────────────────────────────────── */
main { max-width: 900px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 24px) 64px; }

.eyebrow {
  display: inline-block; color: var(--red); font-weight: 800; letter-spacing: 4px;
  text-transform: uppercase; font-size: 12px; margin: 0 0 14px;
  padding: 5px 12px; border: 1px solid rgba(255, 31, 61, .45); border-radius: 999px;
}
.hero { text-align: center; }
.hero h1 { font-size: clamp(30px, 5.4vw, 50px); margin: 0 0 12px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.hero h1 span { color: var(--muted); font-weight: 700; }
.sub { color: var(--muted); margin: 0 auto 26px; max-width: 48ch; }

/* ── Gauge ───────────────────────────────────────────── */
.gauge-wrap { position: relative; width: min(420px, 92vw); margin: 8px auto 6px; }
.gauge { width: 100%; height: auto; overflow: visible; }
.gauge-track { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 14; stroke-linecap: butt; }
.gauge-arc {
  fill: none; stroke: url(#arc); stroke-width: 14; stroke-linecap: butt;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .12s linear;
  filter: drop-shadow(0 0 10px rgba(255, 31, 61, .45));
}
.gauge .tick { stroke: rgba(255,255,255,.30); stroke-width: 2; }
.gauge .tick-label { fill: var(--muted); font-size: 9px; text-anchor: middle; }
.needle { stroke: var(--white); stroke-width: 3; stroke-linecap: square; transform-origin: 160px 200px; transition: transform .12s linear; filter: drop-shadow(0 0 6px rgba(255,255,255,.45)); }
.needle-hub { fill: var(--red); stroke: var(--white); stroke-width: 2; }

.readout { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; pointer-events: none; }
.phase { display: block; color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.value { font-size: clamp(42px, 9vw, 62px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); font-size: 14px; }

.go {
  margin-top: 14px; width: 104px; height: 104px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(135deg, var(--red), var(--red-deep));
  color: var(--white); font-weight: 800; font-size: 24px; letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 0 0 8px rgba(255, 31, 61, .10), 0 16px 40px -10px rgba(255, 31, 61, .75);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.go:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 0 12px rgba(255, 31, 61, .12), 0 18px 44px -10px rgba(255, 31, 61, .85); }
.go:active { transform: scale(.97); }
.go[disabled] { opacity: .6; cursor: progress; }

/* ── Stats ───────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 32px 0; }
.stat {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius);
  border-top: 2px solid rgba(255, 31, 61, .55);
}
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.stat-ico { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; font-size: 18px; background: rgba(255,255,255,.06); }
.stat-ico.down { color: var(--red); }
.stat-ico.up { color: var(--white); }

/* ── Cards ───────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--card-bd); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin: 18px 0; }
.conn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: end; }
.conn small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.conn b { font-size: 16px; }
.conn select { margin-top: 4px; width: 100%; padding: 8px 10px; border-radius: 10px; background: #15151c; color: var(--txt); border: 1px solid var(--card-bd); }
.conn select:focus { outline: 2px solid rgba(255, 31, 61, .6); outline-offset: 1px; }

/* ── History ─────────────────────────────────────────── */
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.history h2 { margin: 0; font-size: 18px; }
.history table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 8px 6px; border-bottom: 1px solid var(--card-bd); }
.history td { padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.05); font-variant-numeric: tabular-nums; }
.history tr:last-child td { border-bottom: 0; }
.history .empty td { color: var(--muted); text-align: center; padding: 18px; }
.ghost { background: transparent; border: 1px solid var(--card-bd); color: var(--muted); padding: 6px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.ghost:hover { color: var(--txt); border-color: var(--red); }

/* ── Prose ───────────────────────────────────────────── */
.prose h2 { margin-top: 0; font-size: 20px; }
.prose h2::before { content: ""; display: inline-block; width: 18px; height: 3px; background: var(--red); vertical-align: middle; margin-right: 10px; transform: skewX(-40deg); }
.prose p { color: #c9c9d2; }
.features { color: #c9c9d2; padding-left: 18px; margin: 12px 0 0; }
.features li { margin: 6px 0; }
.features li::marker { color: var(--red); }

/* ── Footer ──────────────────────────────────────────── */
.foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; padding: 28px 16px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--card-bd); }
.foot a:hover { color: var(--txt); }
.foot .dot { color: var(--red); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .conn { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
}
