:root {
  --bg: #020308;
  --bg2: #070911;
  --card: rgba(13, 16, 28, 0.66);
  --card-solid: #0d101b;
  --line: rgba(110, 145, 220, 0.14);
  --text: #eaeefb;
  --dim: #8a93b0;
  --accent: #4d8dff;
  --accent2: #8ab8ff;
  --accent-soft: rgba(77, 141, 255, 0.13);
  --glow: rgba(77, 141, 255, 0.5);
  --ok: #3ddc97;
  --err: #ff6b81;
  --warn: #ffc857;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ================= background stack (every page) ================= */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}
.aurora i:nth-child(1) {
  width: 62vw; height: 46vh;
  left: -12vw; top: -18vh;
  background: radial-gradient(ellipse at center, rgba(38, 84, 190, 0.55), transparent 65%);
  animation: auroraA 16s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 55vw; height: 44vh;
  right: -15vw; top: -10vh;
  background: radial-gradient(ellipse at center, rgba(64, 120, 235, 0.4), transparent 65%);
  animation: auroraB 21s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  width: 58vw; height: 40vh;
  left: 18vw; bottom: -22vh;
  background: radial-gradient(ellipse at center, rgba(30, 66, 150, 0.45), transparent 65%);
  animation: auroraC 19s ease-in-out infinite alternate;
}
.aurora i:nth-child(4) {
  width: 34vw; height: 26vh;
  right: 8vw; bottom: -6vh;
  background: radial-gradient(ellipse at center, rgba(96, 152, 255, 0.22), transparent 60%);
  animation: auroraB 13s ease-in-out infinite alternate-reverse;
}
@keyframes auroraA {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg);        opacity: 0.75; }
  50%  { transform: translate(9vw, 7vh) scale(1.15) rotate(8deg); opacity: 1;    }
  100% { transform: translate(-4vw, 12vh) scale(1.05) rotate(-6deg); opacity: 0.6; }
}
@keyframes auroraB {
  0%   { transform: translate(0, 0) scale(1);          opacity: 0.55; }
  50%  { transform: translate(-7vw, 9vh) scale(1.2);   opacity: 0.95; }
  100% { transform: translate(5vw, -4vh) scale(1.05);  opacity: 0.5;  }
}
@keyframes auroraC {
  0%   { transform: translate(0, 0) scale(1) skewX(0deg);     opacity: 0.6; }
  50%  { transform: translate(6vw, -8vh) scale(1.12) skewX(-6deg); opacity: 0.95; }
  100% { transform: translate(-6vw, -3vh) scale(1.02) skewX(4deg); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none !important; opacity: 0.6; }
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

nav, main, footer { position: relative; z-index: 2; }

/* ================= loading screen ================= */
#loader {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: var(--bg);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.no-loader #loader { display: none; }

.loader-mark {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 800; letter-spacing: 14px; text-indent: 14px;
  background: linear-gradient(180deg, #ffffff 20%, #8ab8ff 60%, #3f7bff 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px var(--glow));
  animation: markPulse 1.6s ease-in-out infinite;
}
@keyframes markPulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(77, 141, 255, 0.35)); }
  50%      { filter: drop-shadow(0 0 34px rgba(77, 141, 255, 0.7));  }
}
.loader-bar {
  width: 170px; height: 2px; border-radius: 2px;
  background: rgba(110, 145, 220, 0.15);
  overflow: hidden;
}
.loader-bar i {
  display: block; height: 100%; width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #4d8dff, #b0d0ff, transparent);
  animation: barSlide 1.05s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes barSlide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(430%); }
}

/* ================= layout ================= */
main.wrap { flex: 1; width: 100%; max-width: 1140px; margin: 0 auto; padding: 26px 22px 56px; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent2); }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
h1 { font-size: 28px; margin-bottom: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.break { word-break: break-all; }
.ok-text { color: var(--ok); }
.inline { display: inline; }

/* ---------------- nav ---------------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(3, 5, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  color: var(--text); font-weight: 800;
  letter-spacing: 6px; font-size: 17px;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--glow), 0 0 4px var(--glow);
}
.links { display: flex; gap: 20px; align-items: center; }
.links a:not(.btn) {
  color: var(--dim); font-size: 14px; font-weight: 500;
  padding: 4px 2px; position: relative;
}
.links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
  transition: right .22s cubic-bezier(.4, 0, .2, 1);
}
.links a:not(.btn):hover::after, .links a.on:not(.btn)::after { right: 0; }
.links a:not(.btn):hover, .links a.on:not(.btn) { color: var(--text); }

/* ---------------- hero (compact — fits the first viewport) ---------------- */
.hero { text-align: center; padding: 34px 0 26px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent2); background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 255, 0.3);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1.brand-title {
  font-family: var(--font-display);
  font-size: clamp(54px, 9vw, 104px);
  font-weight: 800; letter-spacing: 18px; text-indent: 18px;
  line-height: 1.02;
  background: linear-gradient(165deg, #ffffff 25%, #a9c8ff 55%, #3f7bff 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(77, 141, 255, 0.35));
  animation: titlePulse 5.5s ease-in-out infinite;
}
@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(77, 141, 255, 0.28)); }
  50%      { filter: drop-shadow(0 0 42px rgba(77, 141, 255, 0.55)); }
}
@media (prefers-reduced-motion: reduce) { .hero h1.brand-title { animation: none; } }

.slogan {
  margin: 14px auto 8px;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 600; letter-spacing: 0.4px;
  color: var(--text);
}
.slogan-sub { max-width: 620px; margin: 0 auto 22px; color: var(--dim); font-size: 14.5px; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

.stats {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
  margin: 26px auto 0; padding: 16px 26px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  backdrop-filter: blur(8px);
  max-width: 780px;
}
.stat { min-width: 110px; }
.stat b {
  display: block; font-family: var(--font-display);
  font-size: 21px; color: var(--text); letter-spacing: -0.4px;
}
.stat span { color: var(--dim); font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; }

.sub2 { margin-bottom: 18px; }

/* ---------------- cards ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 18px;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), border-color .25s ease, box-shadow .25s ease;
}
.card:hover { border-color: rgba(77, 141, 255, 0.35); }
.grid3 .card:hover, .grid4 .card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; align-items: start; }

.feature-card { padding: 19px; }
.feature-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 15.5px; }
.feature-card .ic {
  width: 33px; height: 33px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; font-size: 15px;
  background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 255, 0.28);
}
.feature-card p { font-size: 13.5px; }

.featured { display: flex; gap: 30px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.featured-sm { border-color: rgba(77, 141, 255, 0.4); box-shadow: 0 0 36px rgba(77, 141, 255, 0.09) inset, 0 14px 40px rgba(0,0,0,.4); }

.tag {
  display: inline-block; font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase;
  font-weight: 700;
  color: var(--accent2); background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 255, 0.3);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 10px;
}
.feats { list-style: none; margin-top: 10px; color: var(--dim); }
.feats li { padding: 3px 0; font-size: 14px; }
.feats li::before { content: "◆ "; color: var(--accent); font-size: 10px; vertical-align: 2px; }

.buy { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; justify-content: center; }
.price {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(180deg, #fff, #9db9ee);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 2px 0;
}

.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; list-style: none; counter-reset: step;
}
.steps-grid li {
  counter-increment: step;
  position: relative; padding: 16px 16px 16px 60px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px;
  color: var(--dim); font-size: 13.5px;
}
.steps-grid li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: #fff; background: linear-gradient(135deg, #3b74e8, #22549f);
  border-radius: 9px; box-shadow: 0 0 16px var(--glow);
}
.steps-grid li b { color: var(--text); display: block; margin-bottom: 2px; }

.product .price { margin: 2px 0; }
.changelog summary { cursor: pointer; color: var(--dim); font-size: 13px; margin: 8px 0; }
.changelog pre { white-space: pre-wrap; color: var(--dim); font-size: 13px; margin: 6px 0 10px; }

.narrow { max-width: 500px; margin: 0 auto; }

.section-head { text-align: center; margin: 34px 0 16px; }
.section-head h2 { font-size: 23px; }
.section-head p { color: var(--dim); font-size: 14px; margin-top: 4px; }

/* ---------------- forms ---------------- */
label { display: block; font-size: 13px; color: var(--dim); margin: 13px 0 6px; font-weight: 500; }
input, textarea, select {
  width: 100%; background: rgba(4, 6, 12, 0.85); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; outline: none;
  font-family: var(--font-body);
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.15);
}
textarea { resize: vertical; font-family: var(--font-mono); font-size: 13px; }
button { font-family: inherit; cursor: pointer; }
select { width: auto; min-width: 250px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #3f7bff, #2a5fd0);
  color: #fff; border: 0;
  padding: 11px 22px; border-radius: 10px;
  font-weight: 700; font-size: 14px; font-family: var(--font-body);
  box-shadow: 0 6px 20px rgba(52, 108, 217, 0.35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: filter .16s ease, transform .12s ease, box-shadow .16s ease;
  text-align: center;
}
.btn:hover {
  filter: brightness(1.14); text-decoration: none;
  box-shadow: 0 8px 26px rgba(64, 120, 235, 0.45);
  color: #fff;
}
.btn:active { transform: translateY(1px); }
.btn.lg { padding: 13px 30px; font-size: 15px; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent2); box-shadow: 0 0 18px rgba(77,141,255,.12); }
.btn.block { display: block; width: 100%; margin-top: 16px; }
.btn.disabled { opacity: .4; pointer-events: none; }

.alert { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin: 9px 0; border: 1px solid; }
.alert.ok   { color: var(--ok);   border-color: rgba(61,220,151,.35);  background: rgba(61,220,151,.08); }
.alert.err  { color: var(--err);  border-color: rgba(255,107,129,.35); background: rgba(255,107,129,.08); }
.alert.warn { color: var(--warn); border-color: rgba(255,200,87,.35);  background: rgba(255,200,87,.08); }

.keybox {
  background: rgba(4, 6, 12, 0.92);
  border: 1px dashed rgba(77, 141, 255, 0.6);
  box-shadow: 0 0 30px rgba(77, 141, 255, 0.12) inset;
  padding: 17px; border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 20px; text-align: center; margin: 12px 0;
  letter-spacing: 2px; user-select: all; color: var(--accent2);
}

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 6px; margin: 6px 0 20px; border-bottom: 1px solid var(--line); }
.tab {
  color: var(--dim); padding: 9px 18px; font-size: 14px; font-weight: 500;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent;
  transition: all .18s ease;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on {
  color: var(--accent2); border-bottom-color: var(--accent);
  background: linear-gradient(180deg, rgba(77,141,255,.12), transparent);
}

/* ---------------- tables ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; color: var(--dim); font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.5px; padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .14s ease; }
.tbl tbody tr:hover { background: rgba(77, 141, 255, 0.05); }
.tbl tr:last-child td { border-bottom: 0; }
.row-bad td { background: rgba(255, 107, 129, 0.06); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { display: inline; }

.file-label { position: relative; overflow: hidden; display: inline-flex; align-items: center; }
.file-label input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------------- chat ---------------- */
.chat-card { display: flex; flex-direction: column; height: 60vh; }
.chat-log {
  flex: 1; overflow-y: auto; background: rgba(4, 6, 12, 0.7);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
  padding: 7px 13px; border-radius: 12px;
  background: rgba(77, 141, 255, 0.07);
  border: 1px solid rgba(77, 141, 255, 0.1);
  max-width: 82%;
}
.chat-msg .who { color: var(--accent2); font-weight: 700; margin-right: 9px; font-size: 13.5px; }
.chat-msg .when { color: var(--dim); font-size: 11px; margin-left: 9px; }
.chat-form { display: flex; gap: 10px; margin-top: 12px; }
.chat-form input { flex: 1; }

.foot {
  border-top: 1px solid var(--line); padding: 16px 32px;
  display: flex; justify-content: space-between;
  background: rgba(3, 5, 11, 0.85);
  font-size: 13px;
}

@media (max-width: 640px) {
  .nav { flex-direction: column; gap: 12px; padding: 12px 16px; }
  .hero h1.brand-title { letter-spacing: 8px; text-indent: 8px; }
  .stats { gap: 16px; }
  .featured { text-align: left; }
  .buy { align-items: flex-start; text-align: left; }
}
