/* =========================================================
   X168 — Landing Page  |  SKY / "DI ATAS AWAN" (bright & airy)
   Elemen semi-transparan (frosted) agar menyatu dgn gambar langit Anda.
   ========================================================= */

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

:root {
    --sky-1: #bfe3fb;
    --sky-2: #e9f6ff;

    --cyan: #4fc3f7;
    --blue: #1e88e5;
    --blue-dp: #0277bd;
    --ink: #0d3b66;

    --white-glass: rgba(255, 255, 255, 0.22);
    --brd: rgba(255, 255, 255, 0.9);
    --brd-soft: rgba(255, 255, 255, 0.6);

    --pill: 999px;
    --radius: 18px;

    --shadow: 0 12px 30px rgba(20, 90, 150, 0.25);
    --shadow-soft: 0 8px 20px rgba(20, 90, 150, 0.2);

    --font-body: 'Poppins', system-ui, sans-serif;
}

html,
body {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;   /* jaminan: tidak pernah ada scroll horizontal */
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    /* fallback langit bila gambar belum dipasang */
    background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================================
   PANGGUNG (background gambar langit Anda)
   ========================================================= */
.landing {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--sky-1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    isolation: isolate;
}

/* Wash sangat halus: sedikit terang di atas utk logo, tanpa menutupi gambar */
.landing::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 22%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, transparent 18%);
}

.landing__fx {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Awan lembut untuk kedalaman (tetap terlihat walau tanpa gambar) */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb--cyan {
    width: 40vw;
    height: 26vw;
    top: 8vw;
    left: 6vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 70%);
}

.orb--purple {
    width: 46vw;
    height: 28vw;
    bottom: 2vw;
    right: 3vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent 70%);
    animation-delay: -7s;
}

.orb--pink {
    width: 24vw;
    height: 16vw;
    top: 4vw;
    right: 30vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 70%);
    animation-delay: -12s;
}

.grid-lines,
.scanline {
    display: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(2vw, 1.5vh); }
}

/* =========================================================
   GRID UTAMA (DESKTOP)
   ========================================================= */
.page-grid {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(120px, 10vw)
        minmax(420px, 1fr)
        minmax(460px, 32vw)
        minmax(20px, 4vw);
    grid-template-rows:
        minmax(150px, 26vh)
        1fr
        minmax(30px, 8vh);
    grid-template-areas:
        "sidebar character logo  empty"
        "sidebar character links empty"
        "sidebar character links empty";
    width: 100%;
    min-height: 100vh;
}

/* =========================================================
   SIDEBAR (menu bulat biru — seperti referensi)
   ========================================================= */
/* Pembungkus sidebar (memegang area grid) + tombol panah geser */
.sidebar-shell {
    grid-area: sidebar;
    position: relative;
    min-width: 0;
    min-height: 0;
}

/* Tombol panah hanya untuk mobile */
.menu-scroll {
    display: none;
}

.sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(6px, 1.1vh, 16px);
    padding-top: clamp(10px, 1.6vh, 24px);
    padding-bottom: clamp(10px, 1.6vh, 24px);
    /* Bila tombol banyak & layar pendek, sidebar bisa digulir */
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.menu-item {
    position: relative;
    flex: 0 0 auto;
    /* min(vw, vh) -> ikut menyusut di layar pendek agar 9 tombol tetap muat */
    width: clamp(46px, min(4.7vw, 7.8vh), 80px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 8px;
    color: #fff;
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.92) 0%, rgba(2, 136, 209, 0.92) 100%);
    border: 2px solid var(--brd);
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-item:hover,
.menu-item:focus-visible,
.menu-item.is-active {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 26px rgba(20, 90, 150, 0.35);
}

.menu-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(16px, min(1.9vw, 3.1vh), 28px);
    aspect-ratio: 1 / 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.menu-item__icon img,
.menu-item__icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.menu-item__icon svg {
    color: #fff;
}

.menu-item__label {
    font-size: clamp(7px, min(0.62vw, 1.15vh), 10.5px);
    font-weight: 600;
    line-height: 1.05;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* =========================================================
   KARAKTER
   ========================================================= */
.character-section {
    grid-area: character;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.character-stage {
    position: relative;
    display: flex;
    align-items: center;      /* karakter dipusatkan vertikal (tidak menempel bawah) */
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.character-image {
    position: relative;
    z-index: 2;
    width: min(100%, 650px);
    height: min(86vh, 840px);
    object-fit: contain;
    object-position: center center;
    transform: translateX(1.5vw);
    filter: drop-shadow(0 18px 30px rgba(20, 90, 150, 0.3));
    animation: bob 7s ease-in-out infinite;
}

/* Cahaya lembut di bawah karakter */
.character-podium {
    position: absolute;
    z-index: 1;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: min(58%, 400px);
    height: clamp(28px, 5.5vh, 56px);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.75), rgba(79, 195, 247, 0.3) 55%, transparent 76%);
    filter: blur(7px);
    animation: pulse 5s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateX(1.5vw) translateY(0); }
    50% { transform: translateX(1.5vw) translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* =========================================================
   LOGO
   ========================================================= */
.logo-section {
    grid-area: logo;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: clamp(20px, 5vh, 64px);
    min-width: 0;
}

.logo-image {
    width: clamp(240px, 24vw, 420px);
    max-height: 170px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(20, 90, 150, 0.35));
}

/* =========================================================
   DAFTAR LINK / SERVER
   ========================================================= */
.server-list {
    grid-area: links;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(12px, 1.5vh, 18px);
    padding-top: clamp(6px, 1.5vh, 18px);
    padding-right: clamp(6px, 1vw, 16px);
    min-width: 0;
}

.server-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 2px;
}

.server-list__title {
    font-size: clamp(16px, 1.4vw, 23px);
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(13, 59, 102, 0.55);
}

.server-list__live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #0a6b2f;
    padding: 4px 12px;
    border-radius: var(--pill);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

.server-list__live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 8px #22c55e;
    animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.server-item {
    position: relative;
    display: grid;
    grid-template-columns:
        clamp(48px, 4vw, 66px)
        clamp(84px, 6vw, 112px)
        minmax(0, 1fr)          /* 0 = boleh menyusut, cegah baris melebar */
        clamp(92px, 7vw, 120px);
    align-items: center;
    gap: clamp(6px, 0.8vw, 14px);
    min-height: clamp(58px, 7vh, 74px);
    border-radius: var(--pill);
    padding: 5px 8px 5px 14px;
    color: #fff;
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.9) 0%, rgba(30, 136, 229, 0.9) 100%);
    border: 2px solid var(--brd);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.server-item:hover {
    transform: translateX(-4px) scale(1.01);
    box-shadow: 0 14px 32px rgba(20, 90, 150, 0.4);
}

/* Server tercepat (ping terendah) — disorot oleh JS */
.server-item.is-fastest {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 14px 32px rgba(20, 90, 150, 0.4);
}

.server-item__rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(42px, 3.6vw, 58px);
    aspect-ratio: 1 / 1;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}

.server-item__rank img,
.server-item__rank svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.server-item__ping {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: clamp(14px, 1.1vw, 19px);
    font-weight: 700;
    white-space: nowrap;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ping-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #eafaff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
    animation: blink 1.8s ease-in-out infinite;
}

.server-item__name {
    min-width: 0;
    font-size: clamp(14px, 1.1vw, 19px);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.server-item__btn {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: clamp(92px, 7vw, 120px);
    min-height: clamp(40px, 5vh, 50px);
    padding: 0 14px;
    border-radius: var(--pill);
    font-size: clamp(12px, 0.95vw, 16px);
    font-weight: 700;
    color: var(--blue-dp);
    background: linear-gradient(180deg, #ffffff 0%, #eaf4fb 100%);
    border: 2px solid rgba(159, 224, 247, 0.9);
    box-shadow: var(--shadow-soft);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.server-item__btn:hover,
.server-item__btn:focus-visible {
    transform: scale(1.07);
    filter: brightness(1.03);
    box-shadow: 0 8px 18px rgba(20, 90, 150, 0.35);
}

.server-item__btn-short {
    display: none;
}

/* =========================================================
   RESPONSIVE — TABLET (<= 1200px)
   ========================================================= */
@media (max-width: 1200px) {
    .page-grid {
        grid-template-columns:
            minmax(100px, 14vw)
            minmax(280px, 1fr)
            minmax(380px, 42vw);
        grid-template-rows:
            minmax(110px, 20vh)
            1fr;
        grid-template-areas:
            "sidebar character logo"
            "sidebar character links";
    }

    .character-image {
        width: min(100%, 520px);
        height: min(78vh, 720px);
        transform: none;
        animation: bobt 7s ease-in-out infinite;
    }

    @keyframes bobt {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-9px); }
    }

    .logo-image {
        width: clamp(210px, 30vw, 350px);
    }

    .menu-item {
        width: clamp(46px, min(7.4vw, 7.8vh), 74px);
    }

    /* Baris server dirampingkan agar tombol "akses" tidak terpotong */
    .server-item {
        grid-template-columns:
            clamp(38px, 4.6vw, 54px)
            clamp(60px, 7vw, 92px)
            minmax(0, 1fr)
            clamp(72px, 9vw, 104px);
        gap: 8px;
        padding: 5px 6px 5px 10px;
    }

    .server-item__rank {
        width: clamp(32px, 3.8vw, 46px);
    }

    .server-item__ping {
        font-size: clamp(12px, 1.5vw, 16px);
        gap: 5px;
    }

    .server-item__name {
        font-size: clamp(13px, 1.6vw, 17px);
    }

    .server-item__btn {
        max-width: clamp(72px, 9vw, 104px);
        font-size: clamp(11px, 1.2vw, 14px);
        padding: 0 8px;
    }

    .server-list__title {
        font-size: clamp(14px, 1.9vw, 20px);
    }
}

/* =========================================================
   RESPONSIVE — MOBILE (<= 768px)
   ========================================================= */
@media (max-width: 768px) {
    .landing {
        overflow: visible;
    }

    body {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .page-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "logo"
            "character"
            "links"
            "sidebar";
        min-height: 100vh;
        max-width: 100%;
    }

    .logo-section {
        padding-top: clamp(18px, 4vh, 34px);
        padding-bottom: 4px;
    }

    .character-image {
        width: min(100%, 440px);
        height: auto;
        max-height: 48vh;
        transform: none;
    }

    .server-list {
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
        padding-left: clamp(12px, 4vw, 24px);
        padding-right: clamp(12px, 4vw, 24px);
    }

    .server-item {
        grid-template-columns:
            42px
            72px
            minmax(0, 1fr)
            80px;
    }

    /* Nav bawah fixed frosted putih — bisa digeser horizontal (tombol banyak) */
    .sidebar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        width: 100%;
        height: auto;   /* PENTING: jangan 100% saat fixed, nanti menutupi layar */
        padding: 8px clamp(8px, 3vw, 16px);
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        background: rgba(255, 255, 255, 0.6);
        border-top: 1px solid rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(14px);
        box-shadow: 0 -6px 20px rgba(20, 90, 150, 0.2);
        z-index: 50;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    /* Sembunyi saat menggulir di tengah halaman, muncul lagi di atas / di dasar */
    .sidebar {
        transition: transform 0.3s ease, opacity 0.3s ease;
        will-change: transform;
    }

    .sidebar.sidebar--hidden {
        transform: translateY(130%);
        opacity: 0;
        pointer-events: none;
    }

    /* --- Tombol panah untuk menggeser menu --- */
    .menu-scroll {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(28px + env(safe-area-inset-bottom));
        width: 30px;
        height: 30px;
        padding: 0;
        border-radius: 50%;
        border: 1.5px solid rgba(255, 255, 255, 0.95);
        background: linear-gradient(180deg, #4fc3f7 0%, #1e88e5 100%);
        color: #fff;
        box-shadow: 0 4px 12px rgba(20, 90, 150, 0.4);
        cursor: pointer;
        z-index: 55;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .menu-scroll svg {
        width: 16px;
        height: 16px;
    }

    .menu-scroll[hidden] {
        display: none;
    }

    .menu-scroll--left {
        left: 5px;
    }

    .menu-scroll--right {
        right: 5px;
    }

    /* Ikut tersembunyi saat nav disembunyikan */
    .menu-scroll.is-navhidden {
        transform: translateY(160%);
        opacity: 0;
        pointer-events: none;
    }

    /* Ruang agar tombol panah tidak menutupi item menu */
    .sidebar {
        padding-left: 38px;
        padding-right: 38px;
    }

    .menu-item {
        flex: 0 0 auto;
        width: 64px;
        margin: 0;
        scroll-snap-align: center;
    }

    .menu-item__label {
        font-size: clamp(8px, 2.4vw, 11px);
    }

    .orb {
        filter: blur(45px);
    }
}

/* =========================================================
   RESPONSIVE — MOBILE KECIL (<= 480px)
   ========================================================= */
@media (max-width: 480px) {
    .server-item__name {
        font-size: 13px;
    }

    .server-item__ping {
        font-size: 13px;
    }

    .server-item__btn-full {
        display: none;
    }

    .server-item__btn-short {
        display: inline;
    }

    .server-item {
        gap: 6px;
        padding: 5px 6px 5px 8px;
    }

    .server-item__btn {
        max-width: 80px;
    }

    .menu-item__label {
        font-size: 9px;
    }
}

/* =========================================================
   SEKSI ARTIKEL / SEO (di bawah hero) + FOOTER
   ========================================================= */
.home-seo {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(24px, 5vh, 60px) clamp(16px, 4vw, 40px) clamp(24px, 4vh, 48px);
}

/* Kartu artikel yang berupa link: teks tetap normal, hanya "selengkapnya" beraksen */
.page__body a.page__tile {
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.page__body a.page__tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 26px rgba(20, 90, 150, 0.16);
}

.page__body a.page__tile h3 {
    color: #0d3b66;
}

.page__body a.page__tile p {
    color: #274863;
}

.home-seo__more {
    display: inline-block;
    margin-top: 8px;
    font-weight: 700;
    color: var(--blue, #1e88e5);
}

.page__body a.page__tile:hover .home-seo__more {
    text-decoration: underline;
}

.home-seo__links {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 20px;
}

.home-seo__links li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-weight: 600;
    color: var(--blue-dp, #0277bd);
    text-decoration: none;
}

.home-seo__links li a::before {
    content: "\2192";
    color: var(--cyan, #4fc3f7);
}

.home-seo__links li a:hover {
    text-decoration: underline;
}

.home-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
}

.home-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px clamp(16px, 4vw, 40px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #3a5670;
    font-size: 14px;
}

.home-footer__nav {
    display: flex;
    flex-wrap: wrap;              /* cegah link meluber keluar layar */
    align-items: center;
    justify-content: flex-end;
    gap: 8px 16px;
    min-width: 0;
}

.home-footer__nav a {
    color: var(--blue-dp, #0277bd);
    font-weight: 600;
    white-space: nowrap;
}

.home-footer__nav a:hover {
    text-decoration: underline;
}

/* --- Footer di mobile: rapi, tombol 2 kolom --- */
@media (max-width: 768px) {
    .home-footer__inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 16px;
        padding: 22px 16px 26px;
    }

    .home-footer__nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        justify-content: stretch;
    }

    .home-footer__nav a {
        padding: 11px 10px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 12px rgba(20, 90, 150, 0.12);
        font-size: 13px;
        white-space: normal;      /* judul panjang boleh turun baris */
        line-height: 1.3;
    }
}

@media (max-width: 380px) {
    .home-footer__nav {
        grid-template-columns: 1fr;
    }
}
