:root {
    --bg: #0a0b12;
    --surface: #12141c;
    --surface2: #171a24;
    --surface3: #1e2230;
    --line: #232734;
    --line2: #2e3344;
    --txt: #edeff5;
    --txt2: #aeb4c2;
    --mut: #79808f;
    --v: #a855f7;
    --b: #5b8def;
    --c: #38bdf8;
    --brand: linear-gradient(135deg,
            #a855f7 0%,
            #5b8def 50%,
            #38bdf8 100%);
    --brand-soft: linear-gradient(135deg,
            rgba(168, 85, 247, 0.16),
            rgba(56, 189, 248, 0.16));
    --accent: #7e9bff;
    --up: #1fd08a;
    --down: #f6465d;
    --glow: 0 0 40px rgba(91, 141, 239, 0.35);
}

html:not(.dark) {
    --bg: #fbfcfe;
    --surface: #ffffff;
    --surface2: #f6f8fc;
    --surface3: #eef2f8;
    --line: #e7ebf2;
    --line2: #d6dce8;
    --txt: #0b0e17;
    --txt2: #2a3040;
    --mut: #6b7385;
    --accent: #6c5ce7;
    --glow: 0 0 40px rgba(108, 92, 231, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--txt);
    font-family: "Inter", sans-serif;
    overflow-x: hidden;
    transition:
        background 0.25s,
        color 0.25s;
    -webkit-font-smoothing: antialiased;
}

.mono {
    font-family: "JetBrains Mono", monospace;
    font-variant-numeric: tabular-nums;
}

.orb {
    font-family: "Orbitron", sans-serif;
}

::selection {
    background: var(--b);
    color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.gtext {
    background: var(--brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* premium ambient glow (subtle, brand) */
.amb {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.amb span {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.22;
}

.amb .g1 {
    width: 540px;
    height: 540px;
    background: #a855f7;
    top: -180px;
    left: -120px;
}

.amb .g2 {
    width: 560px;
    height: 560px;
    background: #38bdf8;
    top: -120px;
    right: -160px;
}

.amb .g3 {
    width: 480px;
    height: 480px;
    background: #5b8def;
    bottom: -220px;
    left: 38%;
    opacity: 0.14;
}

html:not(.dark) .amb span {
    opacity: 0.1;
}

.gridlines {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 54px 54px;
    opacity: 0.25;
    -webkit-mask: radial-gradient(ellipse 75% 55% at 50% 0%,
            #000 25%,
            transparent 72%);
    mask: radial-gradient(ellipse 75% 55% at 50% 0%,
            #000 25%,
            transparent 72%);
}

/* ticker */
.tape {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    white-space: nowrap;
    height: 38px;
    display: flex;
    align-items: center;
}

.tape-track {
    display: inline-flex;
    gap: 32px;
    padding-left: 32px;
    animation: tape 42s linear infinite;
}

.tape:hover .tape-track {
    animation-play-state: paused;
}

@keyframes tape {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.tk {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--mut);
}

.tk b {
    font-family: "JetBrains Mono";
    font-weight: 500;
    color: var(--txt);
}

/* header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.navlink {
    color: var(--txt2);
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: color 0.15s;
}

.navlink:hover {
    color: var(--txt);
}

.navlink::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    height: 2px;
    width: 0;
    background: var(--brand);
    border-radius: 2px;
    transition: width 0.25s;
}

.navlink:hover::after {
    width: 100%;
}

.seg {
    display: inline-flex;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 3px;
}

.seg button {
    border: none;
    background: transparent;
    color: var(--mut);
    width: 34px;
    height: 30px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.15s;
}

.seg button.on {
    background: var(--brand);
    color: #fff;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--txt2);
    border: 1px solid var(--line);
    background: var(--surface2);
    cursor: pointer;
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.18s;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 26px -10px rgba(91, 141, 239, 0.7);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px -10px rgba(91, 141, 239, 0.85);
}

.btn-outline {
    background: var(--surface2);
    border-color: var(--line2);
    color: var(--txt);
}

.btn-outline:hover {
    border-color: var(--b);
    color: var(--c);
}

.btn-ghost {
    background: var(--surface2);
    border-color: var(--line);
    color: var(--txt);
}

.btn-ghost:hover {
    border-color: var(--b);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* surfaces + gradient border */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    transition:
        transform 0.2s,
        border-color 0.2s;
}

.gborder::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--brand);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.gborder:hover::before {
    opacity: 1;
}

.gborder:hover {
    transform: translateY(-4px);
}

.kick {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.h-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
}

.fic {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 10px 26px -10px rgba(91, 141, 239, 0.6);
}

.fic-soft {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: var(--brand-soft);
    color: var(--c);
    border: 1px solid color-mix(in srgb, var(--b) 30%, transparent);
}

/* terminal */
.terminal {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 30px 80px -36px rgba(91, 141, 239, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.terminal::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--brand);
    opacity: 0.5;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.term-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface2);
}

.term-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px 0;
}

.term-tabs button {
    font-size: 12px;
    font-weight: 600;
    color: var(--mut);
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.term-tabs button.on {
    background: var(--brand);
    color: #fff;
}

.term-body {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
}

.chart-wrap {
    padding: 10px 4px 4px 12px;
    border-right: 1px solid var(--line);
}

.tf {
    display: flex;
    gap: 3px;
    padding: 0 4px 8px;
}

.tf button {
    background: transparent;
    border: none;
    color: var(--mut);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-family: "JetBrains Mono";
}

.tf button.on {
    background: var(--surface3);
    color: var(--c);
}

#chart {
    width: 100%;
    height: 232px;
    display: block;
}

.book {
    padding: 10px 12px;
    font-family: "JetBrains Mono";
    font-size: 11.5px;
}

.book .hd {
    display: flex;
    justify-content: space-between;
    color: var(--mut);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.obrow {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 2.5px 6px;
    border-radius: 3px;
}

.obrow .bar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 0;
    border-radius: 3px;
    opacity: 0.14;
}

.obrow span {
    position: relative;
    z-index: 1;
}

.obrow.ask .bar {
    background: var(--down);
}

.obrow.bid .bar {
    background: var(--up);
}

.obrow.ask .px {
    color: var(--down);
}

.obrow.bid .px {
    color: var(--up);
}

.midrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 6px;
    margin: 5px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.term-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.term-foot button {
    padding: 13px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
}

.term-foot .buy {
    background: var(--up);
    color: #04130c;
}

.term-foot .sell {
    background: var(--down);
    color: #fff;
}

.term-foot button:hover {
    filter: brightness(1.08);
}

.fc {
    position: absolute;
    animation: bob 7s ease-in-out infinite;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.5));
    z-index: 5;
}

@keyframes bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* pairs cards */
.pair-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    transition: 0.2s;
    overflow: hidden;
}

.pair-card:hover {
    border-color: var(--b);
    transform: translateY(-3px);
}

/* market table */
.mkt {
    width: 100%;
    border-collapse: collapse;
}

.mkt th {
    color: var(--mut);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    padding: 13px 18px;
    font-weight: 600;
}

.mkt td {
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.mkt tbody tr {
    transition: background 0.15s;
}

.mkt tbody tr:hover {
    background: var(--surface2);
}

.tabbtn {
    font-size: 13px;
    font-weight: 600;
    color: var(--mut);
    background: var(--surface2);
    border: 1px solid var(--line);
    padding: 7px 16px;
    border-radius: 9px;
    cursor: pointer;
    transition: 0.15s;
}

.tabbtn.on {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
}

/* about stat */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}

.stat-card .num {
    font-family: "Orbitron";
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1;
}

/* trust */
.trust {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--mut);
    font-size: 13px;
    font-weight: 500;
}

.trust i {
    color: var(--c);
}

/* shield */
.shield {
    position: relative;
    width: min(340px, 78vw);
    aspect-ratio: 1;
    margin: auto;
    display: grid;
    place-items: center;
}

.shield .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
}

.shield .ring.r2 {
    inset: 15%;
    border-style: dashed;
    animation: rot 30s linear infinite;
}

.shield .ring.r3 {
    inset: 30%;
    animation: rot 20s linear infinite reverse;
}

@keyframes rot {
    to {
        transform: rotate(360deg);
    }
}

.shield .orbit {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface2);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--c);
}

/* phone */
.phone {
    width: 236px;
    height: 486px;
    border-radius: 40px;
    background: #0c0d15;
    padding: 10px;
    box-shadow:
        0 40px 80px -34px rgba(91, 141, 239, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    margin: auto;
    animation: bob 7s ease-in-out infinite;
}

.phone .scr {
    width: 100%;
    height: 100%;
    border-radius: 31px;
    overflow: hidden;
    background: var(--surface);
    position: relative;
    display: flex;
    flex-direction: column;
}

.phone .nb {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 20px;
    background: #0c0d15;
    border-radius: 0 0 14px 14px;
    z-index: 5;
}

.phone .ph-top {
    padding: 26px 16px 14px;
    background: var(--brand);
    color: #fff;
}

.phone .ph-list {
    padding: 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.phone .ph-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface2);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 12px;
}

/* footer */
footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.flink {
    color: var(--mut);
    font-size: 14px;
    line-height: 2.2;
    transition: 0.15s;
}

.flink:hover {
    color: var(--c);
}

.soc {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--mut);
    transition: 0.15s;
    background: var(--surface2);
}

.soc:hover {
    color: #fff;
    background: var(--brand);
    border-color: transparent;
    transform: translateY(-3px);
}

[data-aos] {
    will-change: transform, opacity;
}

.flash-up {
    animation: fu 0.55s;
}

.flash-down {
    animation: fd 0.55s;
}

@keyframes fu {
    0% {
        color: var(--up);
    }

    100% {}
}

@keyframes fd {
    0% {
        color: var(--down);
    }

    100% {}
}

@media (max-width: 991px) {
    .term-body {
        grid-template-columns: 1fr;
    }

    .chart-wrap {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .fc {
        display: none;
    }
}

@media (max-width: 639px) {
    .login-btn {
        display: none;
    }

    .wm-ex {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}