:root {
    --bg: #07060f;
    --bg-2: #120a22;
    --card: rgba(22, 14, 38, 0.72);
    --card-solid: #161022;
    --line: rgba(216, 180, 254, 0.16);
    --text: #f7f3ff;
    --muted: #b7a8d4;
    --violet: #a855f7;
    --violet-2: #7c3aed;
    --lilac: #e9d5ff;
    --magenta: #d946ef;
    --glow: rgba(168, 85, 247, 0.45);
    --ok: #c4b5fd;
    --danger: #fb7185;
    --radius: 22px;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
    --font: "Outfit", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    overflow-x: hidden;
}
a { color: inherit; }

.aurora, .grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
}
.aurora {
    z-index: 0;
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(168, 85, 247, 0.45), transparent 60%),
        radial-gradient(700px 480px at 110% 10%, rgba(217, 70, 239, 0.28), transparent 55%),
        radial-gradient(600px 500px at 50% 120%, rgba(124, 58, 237, 0.35), transparent 50%);
    animation: drift 16s ease-in-out infinite alternate;
}
.grain {
    z-index: 1;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background: rgba(7, 6, 15, 0.55);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--magenta), var(--violet-2));
    box-shadow: 0 8px 24px var(--glow);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-weight: 500; color: var(--muted); letter-spacing: 0; font-size: 0.72rem; }
.top-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    text-decoration: none;
    color: var(--lilac);
    font-size: 0.82rem;
    font-weight: 600;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.chip:hover { transform: translateY(-2px); background: rgba(168, 85, 247, 0.16); border-color: rgba(216, 180, 254, 0.4); }
.chip svg { width: 15px; height: 15px; }

.page {
    position: relative;
    z-index: 2;
    width: min(1120px, calc(100% - 1.5rem));
    margin: 1.25rem auto 5.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.25rem;
    align-items: stretch;
}
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    padding: 1.4rem;
    animation: rise .6s ease both;
}
.panel + .panel { animation-delay: .08s; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--lilac);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.kicker svg { width: 14px; height: 14px; }
h1 {
    margin: 0.55rem 0 0.4rem;
    font-size: clamp(1.8rem, 4vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}
.lead { color: var(--muted); max-width: 38rem; }

.platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.1rem 0 1.25rem;
}
.plat {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--lilac);
}

.field { position: relative; margin: 1rem 0 0.55rem; }
.field svg.icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
}
input, .ghost-btn, button.primary, a.primary, a.ghost {
    font-family: inherit;
}
input[type="text"], input[type="password"] {
    width: 100%;
    padding: 1rem 6.2rem 1rem 2.8rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(7, 6, 15, 0.45);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}
.paste {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: rgba(168, 85, 247, 0.18);
    color: var(--lilac);
    border-radius: 12px;
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    cursor: pointer;
}
.hint { color: var(--muted); font-size: 0.82rem; display: flex; gap: 0.4rem; align-items: center; }
.hint svg { width: 14px; height: 14px; flex: none; }

.primary, a.primary {
    margin-top: 1rem;
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.95rem 1.1rem;
    border-radius: 16px;
    background: linear-gradient(120deg, var(--magenta), var(--violet-2) 55%, #6d28d9);
    background-size: 160% 160%;
    box-shadow: 0 14px 40px -16px var(--glow);
    transition: transform .2s ease, filter .2s ease;
    position: relative;
    overflow: hidden;
}
.primary:hover { transform: translateY(-2px); filter: brightness(1.06); }
.primary:disabled { filter: grayscale(.4); cursor: wait; transform: none; }
.primary svg, a.ghost svg, .icon-btn svg { width: 18px; height: 18px; }

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-top: 1rem;
}
.stat {
    padding: 0.9rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
}
.stat strong { display: block; font-size: 0.95rem; }
.stat span { color: var(--muted); font-size: 0.78rem; }

.steps { display: flex; gap: 0.45rem; margin-top: 1.1rem; flex-wrap: wrap; }
.step {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}
.step.on { color: white; background: linear-gradient(120deg, var(--violet-2), var(--magenta)); border-color: transparent; }
.dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 0.68rem; }

.layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1rem;
    align-items: start;
}
.layout > aside {
    position: sticky;
    top: 5.2rem;
}
.stack { display: flex; flex-direction: column; gap: 0.85rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.18);
    color: var(--lilac);
    font-size: 0.75rem;
    font-weight: 700;
}
.code-stage {
    text-align: center;
    padding: 1.3rem 1rem 1.1rem;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(168, 85, 247, 0.18), rgba(7, 6, 15, 0.2));
    border: 1px solid rgba(216, 180, 254, 0.28);
    position: relative;
    overflow: hidden;
}
.code-stage::after {
    content: "";
    position: absolute;
    inset: -40% auto auto -20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(217,70,239,.45), transparent 70%);
    animation: pulse 3.4s ease-in-out infinite;
}
.code {
    position: relative;
    z-index: 1;
    font-family: var(--mono);
    font-size: clamp(1.7rem, 6vw, 2.7rem);
    letter-spacing: 0.14em;
    font-weight: 700;
    margin: 0.4rem 0 0.2rem;
    text-shadow: 0 0 28px var(--glow);
}
.row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(216, 180, 254, 0.1);
}
.row:last-child { border-bottom: 0; }
.row span { color: var(--muted); font-size: 0.82rem; }
.row b { font-size: 0.9rem; text-align: right; word-break: break-all; }
.inline { display: flex; align-items: center; gap: 0.4rem; }
.icon-btn, .text-btn {
    border: 0;
    background: rgba(168, 85, 247, 0.16);
    color: var(--lilac);
    border-radius: 10px;
    height: 32px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.icon-btn { width: 32px; }
.text-btn {
    padding: 0 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.icon-btn:hover, .text-btn:hover { background: rgba(168, 85, 247, 0.32); transform: translateY(-1px); }
.link-card, .option {
    display: block;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.link-card:hover, .option:hover {
    transform: translateY(-2px);
    border-color: rgba(216, 180, 254, 0.45);
    background: rgba(168, 85, 247, 0.12);
}
.option { font: inherit; }
.option-top, .section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}
.time {
    font-size: 0.72rem;
    color: var(--muted);
    background: rgba(255,255,255,0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}
.subject { color: var(--muted); font-size: 0.8rem; margin-top: 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.body-box {
    display: none;
    margin-top: 0.7rem;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8rem;
    color: var(--lilac);
    background: rgba(0,0,0,.28);
    border-radius: 12px;
    padding: 0.8rem;
}
.body-box.show { display: block; }
.ghost, a.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    cursor: pointer;
}
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.actions > * { flex: 1; }

.fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: white;
    background: linear-gradient(120deg, #7c3aed, #d946ef);
    box-shadow: 0 12px 30px var(--glow);
    animation: floaty 3.2s ease-in-out infinite;
}
.fab svg { width: 18px; height: 18px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 5.2rem;
    transform: translateX(-50%) translateY(12px);
    background: #2e1064;
    border: 1px solid rgba(216,180,254,.35);
    color: white;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: .25s ease;
    z-index: 40;
    font-weight: 700;
    font-size: 0.85rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

.error-ring {
    width: 74px; height: 74px; margin: 0 auto 0.6rem;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(251, 113, 133, 0.14);
    color: var(--danger);
    animation: shake .55s ease;
}
.error-ring svg { width: 32px; height: 32px; }
.callout {
    border-radius: 16px;
    padding: 0.95rem 1rem;
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.28);
    color: #fecdd3;
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-2%, 2%, 0) scale(1.05); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(1.15); } }
@keyframes floaty { 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

@media (max-width: 860px) {
    .hero-grid, .layout { grid-template-columns: 1fr; }
    .layout > aside { order: -1; }
    .topbar { flex-direction: column; align-items: flex-start; }
    h1 { font-size: 2rem; }
    .fab span { display: none; }
    .fab { padding: 0.85rem; border-radius: 50%; }
    input[type="text"], input[type="password"] { padding-right: 5.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
