:root {
  --bg-primary: #050508;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #12121a;
  --bg-hover: #1a1a24;
  --bg-card: #0e0e14;
  --border: #1f1f2e;
  --border-light: #2e2e42;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent: #a855f7;
  --accent-hover: #c084fc;
  --accent-dim: rgba(168, 85, 247, 0.15);
  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg-primary); color: var(--text-primary); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.note { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ---------- top nav ---------- */
.topnav { position: sticky; top: 0; z-index: 50; background: rgba(5,5,8,.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topnav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: inherit; }
.logo:hover { text-decoration: none; }
.logo img { border-radius: 9px; }
.logo-text { font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.logo-text span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { color: var(--text-secondary); font-weight: 500; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); text-decoration: none; }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; border: 1px solid transparent; transition: var(--transition); white-space: nowrap; color: inherit; background: none; }
.btn:hover { text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 30px rgba(168,85,247,.35); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { color: var(--text-primary); border-color: var(--border-light); }
.btn-ghost:hover { background: var(--bg-hover); border-color: #4a4a66; }
.btn-danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(248,113,113,.3); border-radius: var(--radius-sm); }
.btn-danger:hover { background: var(--danger); color: #1a0505; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-sq { border-radius: var(--radius-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input, textarea, select { width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none; transition: var(--transition); }
.input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 70% at 78% 40%, rgba(168,85,247,.28), transparent 70%), radial-gradient(ellipse 40% 50% at 10% 100%, rgba(124,58,237,.14), transparent 70%), var(--bg-secondary); }
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(168,85,247,.35) 1.2px, transparent 1.2px); background-size: 22px 22px; mask-image: radial-gradient(ellipse 35% 45% at 62% 55%, #000, transparent 70%); opacity: .6; pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 18px; color: var(--text-secondary); }
.eyebrow img { border-radius: 8px; }
.hero h1 { font-size: clamp(40px, 5vw, 66px); line-height: 1.02; letter-spacing: -2.5px; font-weight: 900; margin-bottom: 22px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #c084fc, #a855f7 60%, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--text-secondary); max-width: 480px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.dl-meta { margin-top: 14px; font-size: 13px; color: var(--text-muted); display: flex; gap: 14px; flex-wrap: wrap; }
.dl-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dl-meta svg { width: 14px; height: 14px; color: var(--success); }
.shot { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-light); box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(168,85,247,.15), 0 0 80px rgba(168,85,247,.25); transform: perspective(1600px) rotateY(-8deg) rotateX(2deg); transition: transform .6s ease; background: #000; }
.shot:hover { transform: perspective(1600px) rotateY(-3deg) rotateX(1deg); }
.shot img { display: block; width: 100%; }
.shot-wrap { position: relative; }
.shot-badge { position: absolute; left: -14px; bottom: 34px; display: flex; align-items: center; gap: 10px; background: rgba(14,14,20,.92); border: 1px solid var(--border-light); border-radius: 12px; padding: 10px 14px; font-size: 13px; box-shadow: 0 12px 40px rgba(0,0,0,.6); backdrop-filter: blur(8px); }
.shot-badge strong { display: block; font-size: 15px; }
.shot-badge .ring { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-dim); display: grid; place-items: center; color: var(--accent); }

/* ---------- sections ---------- */
section.block { padding: 84px 0; border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.1; margin-bottom: 12px; }
.section-sub { color: var(--text-secondary); font-size: 17px; max-width: 640px; margin-bottom: 40px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(180deg, var(--bg-card), var(--bg-primary)); transition: var(--transition); }
.feature:hover { border-color: rgba(168,85,247,.45); transform: translateY(-3px); }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); margin-bottom: 16px; }
.feature .fi svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.step::before { counter-increment: s; content: counter(s); flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step h4 { margin-bottom: 2px; }
.step p { color: var(--text-muted); font-size: 14px; }

/* ---------- magnet opener ---------- */
.opener { padding: 28px; border-radius: 18px; border: 1px solid rgba(168,85,247,.35); background: radial-gradient(ellipse at top right, rgba(168,85,247,.18), transparent 60%), var(--bg-card); }
.opener-row { display: flex; gap: 10px; }
.opener-row .input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.share { margin-top: 14px; display: flex; gap: 8px; align-items: center; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 14px; }
.panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { word-break: break-all; }
.open-page { max-width: 760px; margin: 0 auto; padding: 64px 24px; }
.big-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--accent-dim); color: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.big-icon svg { width: 36px; height: 36px; }

/* ---------- prose / faq ---------- */
.prose { max-width: 780px; margin: 0 auto; padding: 64px 24px; line-height: 1.75; color: var(--text-secondary); }
.prose h1 { color: var(--text-primary); font-size: 40px; letter-spacing: -1px; line-height: 1.1; margin-bottom: 12px; }
.prose h2 { color: var(--text-primary); font-size: 21px; margin: 34px 0 10px; }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose li { margin: 5px 0; }
.prose strong { color: var(--text-primary); }
.prose code { background: var(--bg-tertiary); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
details.faq { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); margin-bottom: 10px; }
details.faq summary { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; color: var(--accent); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: '–'; }
details.faq div { padding: 0 20px 18px; color: var(--text-secondary); }
.diagram { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; text-align: center; }
.diagram div { border: 1px solid var(--border); border-radius: 12px; padding: 16px 10px; background: var(--bg-card); font-size: 13px; line-height: 1.5; }
.diagram strong { display: block; color: var(--accent-hover); margin-bottom: 4px; font-size: 14px; }

/* ---------- ads ---------- */
.site-ad { display: block; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); text-align: center; }
.site-ad img { display: block; width: 100%; max-height: 120px; object-fit: contain; margin: 0 auto; }
.ad-label { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: rgba(0,0,0,.7); color: var(--text-secondary); padding: 2px 6px; border-radius: 4px; }
.ad-slot { padding-top: 28px; }

/* ---------- admin ---------- */
.admin-wrap { padding-top: 40px; padding-bottom: 80px; }
.auth-card { max-width: 400px; margin: 60px auto; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 4px; }
.page-sub { color: var(--text-muted); margin-bottom: 22px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--text-secondary); font-weight: 600; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text-primary); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.pill.ok { background: var(--success-dim); color: var(--success); }
.pill.off { background: var(--warning-dim); color: var(--warning); }
.progress { height: 6px; background: var(--bg-primary); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); width: 0; transition: width .3s; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; margin-top: 2px; }
.alert.info { background: var(--accent-dim); border-color: rgba(168,85,247,.35); color: #e3cbff; }
.alert.err { background: var(--danger-dim); border-color: rgba(248,113,113,.35); color: #ffd0d0; }
.alert.warn { background: var(--warning-dim); border-color: rgba(251,191,36,.35); color: #ffe8a8; }

#toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--bg-tertiary); border: 1px solid var(--border-light); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.6); font-size: 14px; max-width: 360px; animation: slide .25s ease; }
.toast.ok { border-left-color: var(--success); } .toast.err { border-left-color: var(--danger); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

.footer { border-top: 1px solid var(--border); background: var(--bg-secondary); padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--text-secondary); font-size: 14px; }

@media (max-width: 900px) {
  .hero-inner, .split { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 40px; padding-bottom: 50px; }
  .shot { transform: none !important; }
  .shot-badge { left: 10px; }
  .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .opener-row { flex-direction: column; }
  .diagram { grid-template-columns: 1fr; }
}
