/* ==========================================================
   JaringanKu — Portal Layanan
   Palet warna diambil dari logo JSN:
   - Biru tua   #0B6BAA  (huruf "JSN")
   - Biru       #1189CF
   - Biru langit #4FB3E6 (cincin luar)
   - Oranye     #E35B25  (cincin dalam)
   - Merah bata #D1412B
   - Teks gelap #1F2329  (tulisan PT.)
   ========================================================== */

:root {
    --brand-navy: 11, 107, 170;
    --brand-blue: 17, 137, 207;
    --brand-sky: 79, 179, 230;
    --brand-orange: 227, 91, 37;
    --brand-red: 209, 65, 43;

    --bg: #f4f9fd;
    --surface: rgba(255, 255, 255, .85);
    --border: rgba(11, 107, 170, .10);
    --text: #1f2329;
    --muted: #5a6573;

    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html, body {
    background: var(--bg);
    color: var(--text);
}

body {
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(var(--brand-sky), .18) 0%, transparent 65%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    background-attachment: fixed;
}

/* ---------- Background ---------- */
#network-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: .55;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    z-index: 0;
    pointer-events: none;
}

.bg-glow-1 {
    width: 520px; height: 520px;
    top: -200px; left: -160px;
    background: rgba(var(--brand-blue), .22);
}

.bg-glow-2 {
    width: 460px; height: 460px;
    bottom: -200px; right: -160px;
    background: rgba(var(--brand-orange), .16);
}

/* ---------- Layout ---------- */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh; /* mobile: hindari tertutup address bar */
}

.page main {
    padding-top: max(2.5rem, env(safe-area-inset-top));
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}

/* ---------- Hero ---------- */
.hero {
    max-width: 640px;
    margin-bottom: 2.5rem !important;
}

.hero-logo {
    display: block;
    width: clamp(170px, 42vw, 280px);
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 10px 24px rgba(var(--brand-navy), .12));
}

.hero-lead {
    max-width: 520px;
    font-size: clamp(.95rem, 2.6vw, 1.1rem);
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- App launcher tiles ---------- */
.services {
    width: 100%;
    max-width: 560px;          /* mobile & tablet: grid 2x2 */
}

@media (min-width: 992px) {
    .services { max-width: 960px; }   /* desktop: 4 sejajar */
}

.app-tile {
    --accent: var(--brand-blue);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 1.75rem 1rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border-radius: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow:
        0 1px 2px rgba(var(--brand-navy), .05),
        0 8px 22px -12px rgba(var(--brand-navy), .22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s, box-shadow .3s, background-color .3s;
}

.app-icon {
    display: grid;
    place-items: center;
    width: 4.75rem; height: 4.75rem;
    margin-bottom: 1rem;
    border-radius: 1.35rem;
    font-size: 2.1rem;
    color: #fff;
    background: linear-gradient(145deg, rgba(var(--accent), .82), rgb(var(--accent)));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .35),
        0 12px 22px -10px rgba(var(--accent), .75);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.app-name {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6em;          /* tinggi seragam untuk nama 2 baris */
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
}

/* Hover: card terangkat + ikon membesar (hanya perangkat dengan pointer) */
@media (hover: hover) and (pointer: fine) {
    .app-tile:hover {
        transform: translateY(-6px);
        color: var(--text);
        background-color: #fff;
        border-color: rgba(var(--accent), .35);
        box-shadow: 0 22px 40px -18px rgba(var(--accent), .5);
    }

    .app-tile:hover .app-icon { transform: scale(1.08); }
}

/* Sentuh (mobile): efek tekan */
.app-tile:active {
    transform: scale(.97);
    background-color: #fff;
}

.app-tile:focus-visible {
    outline: 3px solid rgb(var(--accent));
    outline-offset: 3px;
    background-color: #fff;
}

.app-icon {
    display: grid;
    place-items: center;
    width: 4.75rem; height: 4.75rem;
    margin-bottom: 1rem;
    border-radius: 1.35rem;
    font-size: 2.1rem;
    color: #fff;
    background: linear-gradient(145deg, rgba(var(--accent), .82), rgb(var(--accent)));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .35),
        0 10px 20px -10px rgba(var(--accent), .6);
}

.app-name {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6em;          /* tinggi seragam untuk nama 2 baris */
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
}

/* Interaksi minimal: hanya border & bayangan yang berubah warna */
.app-tile:hover,
.app-tile:active,
.app-tile:focus-visible {
    color: var(--text);
    background-color: #fff;
    border-color: rgba(var(--accent), .45);
    box-shadow:
        0 0 0 3px rgba(var(--accent), .10),
        0 12px 28px -14px rgba(var(--accent), .45);
}

.app-tile:focus-visible {
    outline: none;
    border-color: rgb(var(--accent));
}

/* Tablet */
@media (max-width: 991.98px) {
    .app-tile { padding: 1.5rem .9rem 1.35rem; }
}

/* Mobile */
@media (max-width: 575.98px) {
    .hero { margin-bottom: 2rem !important; }

    .app-tile {
        padding: 1.25rem .6rem 1.15rem;
        border-radius: 1.15rem;
    }

    .app-icon {
        width: 3.75rem; height: 3.75rem;
        font-size: 1.6rem;
        border-radius: 1.05rem;
        margin-bottom: .75rem;
    }

    .app-name { font-size: .85rem; }

    .bg-glow-1 { width: 320px; height: 320px; }
    .bg-glow-2 { width: 300px; height: 300px; }
}

/* ---------- Reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: reveal .8s cubic-bezier(.2, .8, .2, 1) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes reveal {
    to { opacity: 1; transform: none; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal { opacity: 1; transform: none; }
}
