:root {
  --bg: #07060d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hi: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #ecebf3;
  --muted: #8d8aa1;
  --magenta: #d946ef;
  --cyan: #2ee6f0;
  --ok: #5ee3a1;
  --err: #ff7a8a;
  --discord: #5865f2;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent; /* the dark base lives on html so the ::before/::after layers show */
  color: var(--text);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Background: the gradient render, heavily dimmed, plus a faint perspective grid. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    linear-gradient(180deg, rgba(7, 6, 13, 0.6) 0%, rgba(7, 6, 13, 0.82) 35%, var(--bg) 75%),
    url("../img/bg-gradient.webp") center 30% / cover no-repeat;
  opacity: 0.55;
}
body::after {
  background: url("../img/grid.webp") center / cover no-repeat;
  opacity: 0.1;
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Header / footer */
.site-header { padding: 20px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); }

main { flex: 1; padding: 24px 0 56px; }

.site-footer { padding: 28px 0 32px; color: var(--muted); font-size: 12px; }
.site-footer .wrap { display: flex; align-items: center; justify-content: center; gap: 8px; }
.site-footer img { height: 14px; width: auto; opacity: 0.6; }

/* Landing */
.hero { text-align: center; padding-top: 8px; }
.hero-art { width: min(440px, 100%); height: auto; margin: 0 auto 8px; display: block;
            filter: drop-shadow(0 18px 40px rgba(46, 230, 240, 0.08)); }
.hero h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0 auto 28px; max-width: 420px; }
.hero .fine { font-size: 13px; margin-top: 18px; }

/* Cards */
h1.page-title { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 14px;
  backdrop-filter: blur(6px);
}
.card h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 12px; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.card.notice { border-color: rgba(88, 101, 242, 0.35); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card.notice p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

.tier { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
.tier-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
              padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border-hi); color: var(--text); }
.tier-badge.pro { border-color: rgba(217, 70, 239, 0.5); color: #f0abfc; }
.tier-badge.starter { border-color: rgba(46, 230, 240, 0.45); color: #a5f3fc; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font: inherit; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--text); color: #0b0a12; }
.btn-primary:hover { background: #fff; }
.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: #4752c4; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-hi); }
.btn-ghost:hover { background: var(--surface-hi); }
.btn-quiet { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn-quiet:hover { color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-lg { padding: 13px 22px; font-size: 16px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
form.inline { display: inline; margin: 0; }

/* License key */
.key {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 4px 0 12px;
}
.key code { flex: 1; font: 600 16px/1.3 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 0.05em; overflow-wrap: anywhere; user-select: all; }
.key.new { border-color: rgba(46, 230, 240, 0.45); box-shadow: 0 0 0 4px rgba(46, 230, 240, 0.06); }
code.inline { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-hi); padding: 1px 6px; border-radius: 6px; }

/* Devices */
.devices-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
                 font-size: 14px; font-weight: 600; margin: 22px 0 10px; }
.devices-count { font-size: 13px; font-weight: 600; color: var(--cyan); }
.device-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.device-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
                  gap: 4px 12px; padding: 10px 14px; }
.device-list li + li { border-top: 1px solid var(--border); }
.device-name { font-weight: 500; }
.device-name code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); margin-left: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 4px 8px; }
td { padding: 9px 4px; border-top: 1px solid var(--border); }
td code { font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
.meter { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 6px; }
.meter span { width: 18px; height: 5px; border-radius: 3px; background: var(--border-hi); }
.meter span.on { background: var(--cyan); }

/* Flash messages */
.flash { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; border: 1px solid var(--border); background: var(--surface); }
.flash.ok { border-color: rgba(94, 227, 161, 0.35); color: var(--ok); }
.flash.error { border-color: rgba(255, 122, 138, 0.35); color: var(--err); }

.discord-user { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }

@media (max-width: 520px) {
  .card { padding: 16px; }
  .key code { font-size: 14px; }
  .actions .btn { flex: 1 1 auto; }
}
