:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface2: #1a1a28;
    --border: #2a2a3e;
    --text: #e8e8f0;
    --text-dim: #8888a0;
    --accent: #62B1F7;
    --accent2: #FF5F6D;
    --radius: 16px;
    --shadow: 0 4px 30px rgba(0,0,0,0.4);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(98,177,247,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(255,95,109,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Nav ─── */
#navbartop {
    position: fixed;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 52px;
    width: calc(100% - 24px);
    max-width: 1400px;
    background: rgba(10,10,15,0.5);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(42,42,62,0.25);
    border-radius: 14px;
    z-index: 100;
}

#navbartop .First {
    background: linear-gradient(135deg, var(--accent2), #FD9644);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.5px;
    text-decoration: none;
    padding: 8px 0;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--surface2);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-overlay.show {
    display: block;
    opacity: 1;
}

/* ─── SVG Hero ─── */
#svgText {
    width: 96vw;
    max-width: 1400px;
    height: auto;
    user-select: none;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 56px;
}

#maskImmediate, #maskResidual1, #maskResidual2, #maskResidual3 {
    transition: none;
}

/* ─── Text variants ─── */
.mobile-title { display: none; }

.gradient-masked {
    animation: textGlow 4s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(212,175,55,0.15)); }
    50% { filter: drop-shadow(0 0 18px rgba(212,175,55,0.35)) drop-shadow(0 0 40px rgba(167,139,250,0.15)); }
}

/* ─── Scroll Indicator ─── */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    animation: bob 2s ease-in-out infinite;
    padding-bottom: 8vh;
}

.scroll-arrow {
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
    border-radius: 1px;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ─── Sections ─── */
.section {
    max-width: 800px;
    margin: 0 auto 32px;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 40px; height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
}

/* ─── Cards ─── */
.card-grid {
    display: grid;
    gap: 10px;
}

.card {
    display: block;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(98,177,247,0.04), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

@media (hover: hover) {
    .card:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }
    .card:hover::before {
        opacity: 1;
    }
}

.card:active {
    transform: scale(0.98);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    position: relative;
}

.card p {
    color: var(--text-dim);
    font-size: 13px;
    position: relative;
}

.card-icon {
    margin-bottom: 10px;
}

.icon-svg {
    width: 26px;
    height: 26px;
    display: block;
}

.card-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent2), #FD9644);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    position: relative;
}

.card-new {
    background: linear-gradient(135deg, var(--surface), rgba(255,95,109,0.06));
    border-color: rgba(255,95,109,0.2);
}

@media (hover: hover) {
    .card-new:hover {
        border-color: var(--accent2);
    }
}

.guide-card {
    border-left: 3px solid var(--border);
}

.guide-card.g1 { border-left-color: #F1C40F; }
.guide-card.g2 { border-left-color: #F40A07; }
.guide-card.g3 { border-left-color: #FF8001; }

@media (hover: hover) {
    .guide-card.g1:hover { border-left-color: #F1C40F; background: rgba(241,196,15,0.04); }
    .guide-card.g2:hover { border-left-color: #F40A07; background: rgba(244,10,7,0.04); }
    .guide-card.g3:hover { border-left-color: #FF8001; background: rgba(255,128,1,0.04); }
}

/* ─── Server IP ─── */
.server-info {
    display: flex;
    justify-content: center;
}

.server-ip-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.ip-label {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.ip-address {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    word-break: break-all;
}

.copy-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.copy-btn:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .copy-btn:hover {
        background: #4a9be0;
        transform: scale(1.04);
    }
}

/* ─── Back to top ─── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:active {
    transform: scale(0.9);
}

@media (hover: hover) {
    .back-to-top:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

/* ─── Footer ─── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 28px 16px 16px;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.footer-section h3 {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.footer-section p,
.footer-section a {
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 6px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.social-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: 800px;
    margin: 20px auto 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}

/* ─── Desktop ≥768px ─── */
@media (min-width: 768px) {
    .mobile-title { display: none; }
    .gradient-masked { display: block; }
    #navbartop {
        padding: 0 20px;
        height: 56px;
        width: calc(100% - 48px);
    }

    #navbartop .First {
        font-size: 18px;
    }

    .nav-links a {
        padding: 8px 16px;
        font-size: 14px;
    }

    #svgText {
        width: 90vw;
        margin: 0 auto;
    }

    .hero-wrap {
        padding-top: 56px;
    }

    .scroll-indicator {
        margin-top: 40px;
        font-size: 13px;
        padding-bottom: 10vh;
    }

    .scroll-arrow {
        height: 30px;
    }

    .section {
        padding: 0 24px;
        margin-bottom: 60px;
    }

    .section-title {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .section-title::after {
        width: 60px;
    }

    .card-grid {
        gap: 16px;
    }

    .card {
        padding: 24px;
    }

    .card h3 {
        font-size: 18px;
    }

    .card p {
        font-size: 14px;
    }

    .icon-svg {
        width: 30px;
        height: 30px;
    }

    .server-ip-card {
        gap: 16px;
        padding: 20px 32px;
    }

    .ip-label {
        font-size: 13px;
    }

    .ip-address {
        font-size: 20px;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }

    footer {
        padding: 40px 24px 20px;
    }

    .back-to-top {
        bottom: 32px;
        right: 32px;
    }
}

/* ─── Mobile <768px ─── */
@media (max-width: 767px) {
    #svgText { display: none; }

    .mobile-title {
        display: block;
        font-size: 14vw;
        font-weight: 800;
        color: var(--text);
        text-align: center;
        letter-spacing: 2px;
        margin: 0;
        line-height: 1.2;
        animation: mobileTitleGlow 3s ease-in-out infinite;
    }

    @keyframes mobileTitleGlow {
        0%, 100% { text-shadow: 0 0 20px rgba(200,200,220,0.15); }
        50% { text-shadow: 0 0 40px rgba(200,200,220,0.35), 0 0 80px rgba(167,139,250,0.15); }
    }

    .hero-wrap {
        padding-top: 56px;
    }
    .gradient-masked { display: none; }

    .nav-links {
        position: fixed;
        top: 0; right: -280px;
        width: 260px; height: 100vh;
        flex-direction: column;
        background: var(--surface);
        border-left: 1px solid var(--border);
        padding: 72px 20px 24px;
        gap: 2px;
        transition: right 0.3s;
        z-index: 99;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 10px;
    }

    .hamburger {
        display: flex;
    }

    .scroll-indicator {
        margin-top: 16px;
        padding-bottom: 6vh;
    }

    .server-ip-card {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
