/* =====================================================================
   STYLE.CSS - Gaya bersama halaman publik
   Isi: token desain, navbar, beranda (hero, layanan, CTA), footer.
   Komponen halaman masyarakat ada di masyarakat/masyarakat.css
   ===================================================================== */

:root {
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

    --brand-950: #0a2619;
    --brand-900: #0f3323;
    --brand-800: #123d2a;
    --brand-700: #166534;
    --brand-600: #15803d;
    --brand-500: #16a34a;
    --brand-400: #4ade80;
    --brand-100: #dcfce7;
    --brand-50: #f0fdf4;

    --bg: #f4f8f5;
    --surface: #ffffff;
    --surface-2: #f8faf9;
    --border: #e3eae5;
    --text: #10231a;
    --text-2: #435a4e;
    --text-3: #77897f;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 35, 26, 0.04), 0 12px 32px -16px rgba(16, 35, 26, 0.2);
    --shadow-lg: 0 24px 60px -24px rgba(10, 38, 25, 0.45);
    --nav-h: 72px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

img {
    max-width: 100%;
}

.ikon {
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}

:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

/* ---------- NAVBAR ---------- */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: var(--nav-h);
    padding: 0 max(24px, calc((100% - 1240px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(10, 38, 25, 0.88);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    color: #fff;
}

.nav-brand img {
    width: 42px;
    height: 42px;
    padding: 4px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-brand-text strong {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nav-brand-text small {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.6);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.nav-menu a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    color: rgba(255, 255, 255, 0.78);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.nav-menu a.active {
    color: #fff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
}

.nav-menu a.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-400);
}

.nav-menu .login-menu {
    flex-shrink: 0;
    margin-left: 10px;
    padding: 0 18px;
    background: var(--brand-500);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px -6px rgba(22, 163, 74, 0.7);
}

.nav-menu .login-menu:hover {
    background: var(--brand-600);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 11px;
    color: #fff;
    cursor: pointer;
}

.menu-toggle .ikon-close {
    display: none;
}

.menu-toggle.active .ikon-menu {
    display: none;
}

.menu-toggle.active .ikon-close {
    display: inline-block;
}

/* ---------- BERANDA: HERO ---------- */
.cover {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--nav-h) + 40px) max(24px, calc((100% - 1240px) / 2)) 90px;
    background: var(--brand-900) url("images/dinas.jpg") center / cover no-repeat;
    overflow: hidden;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(100deg, rgba(10, 38, 25, 0.95) 0%, rgba(10, 38, 25, 0.8) 45%, rgba(10, 38, 25, 0.35) 100%),
        linear-gradient(0deg, rgba(10, 38, 25, 0.6), transparent 40%);
}

.cover .content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 760px;
    color: #fff;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #bbf7d0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    backdrop-filter: blur(6px);
}

.hero-text h1 {
    margin-bottom: 16px;
    font-size: clamp(34px, 5.6vw, 64px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    text-wrap: balance;
}

.hero-text h2 {
    margin-bottom: 18px;
    font-size: clamp(13px, 1.6vw, 16px);
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--brand-400);
}

.hero-text p {
    max-width: 560px;
    font-size: clamp(15px, 1.7vw, 18px);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 26px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--brand-500);
    color: #fff;
    box-shadow: 0 12px 28px -10px rgba(22, 163, 74, 0.8);
}

.btn-primary:hover {
    background: var(--brand-600);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    backdrop-filter: blur(6px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.scroll-down {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
}

.scroll-down div {
    animation: scrollMove 1.6s infinite;
}

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

/* ---------- BERANDA: LAYANAN ---------- */
.services {
    padding: 88px max(24px, calc((100% - 1240px) / 2));
    background: var(--bg);
}

.section-title {
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-title span {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 14px;
    background: var(--brand-100);
    border-radius: 999px;
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.section-title h2 {
    font-size: clamp(26px, 3.4vw, 36px);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--brand-900);
}

.section-title p {
    margin-top: 12px;
    color: var(--text-3);
    font-size: 16px;
    line-height: 1.7;
}

.service-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.service-card {
    display: flex;
    flex-direction: column;
    padding: 28px 24px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--brand-500);
    box-shadow: 0 22px 44px -22px rgba(22, 163, 74, 0.5);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    color: var(--brand-600);
    transition: background 0.25s ease, color 0.25s ease;
}

.service-card:hover .service-icon {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

.service-card h3 {
    margin-bottom: 8px;
    font-size: 17.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.service-card p {
    flex: 1;
    margin-bottom: 18px;
    color: var(--text-3);
    font-size: 14.5px;
    line-height: 1.65;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-600);
    font-size: 14px;
    font-weight: 600;
}

.read-more .ikon {
    transition: transform 0.2s ease;
}

.service-card:hover .read-more .ikon {
    transform: translateX(4px);
}

/* ---------- BERANDA: AJAKAN ---------- */
.cta-band {
    padding: 0 max(24px, calc((100% - 1240px) / 2)) 88px;
    background: var(--bg);
}

.cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 36px 40px;
    background: linear-gradient(120deg, var(--brand-900), var(--brand-700));
    border-radius: 22px;
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.cta-box h2 {
    margin-bottom: 6px;
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.cta-box p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
}

.cta-box .btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 50px;
    padding: 0 26px;
    background: #fff;
    border-radius: 12px;
    color: var(--brand-800);
    font-size: 14.5px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease;
}

.cta-box .btn-cta:hover {
    background: var(--brand-100);
    transform: translateY(-2px);
}

/* ---------- FOOTER ---------- */
footer {
    background: var(--brand-950);
    color: rgba(255, 255, 255, 0.78);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 56px 0 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: #fff;
}

.footer-brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.footer-brand small {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12.5px;
}

.footer-content p {
    max-width: 360px;
    font-size: 14px;
    line-height: 1.75;
}

.footer-content h4 {
    margin-bottom: 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--brand-400);
}

.copyright {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
}

/* ---------- RESPONSIF ---------- */
@media (max-width: 1100px) {
    .service-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-menu a {
        padding: 0 11px;
        font-size: 13.5px;
    }

    .nav-menu .login-menu {
        margin-left: 4px;
        padding: 0 14px;
    }
}

/* Menu hamburger mulai dari layar <= 1024px agar menu tidak berdesakan */
@media (max-width: 1024px) {
    .top-navbar {
        padding: 0 20px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 2px;
        max-height: calc(100vh - var(--nav-h) - 8px);
        overflow-y: auto;
        padding: 10px 16px 16px;
        background: rgba(10, 38, 25, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-menu a {
        height: 46px;
        padding: 0 16px;
    }

    .nav-menu a.active::after {
        display: none;
    }

    .nav-menu .login-menu {
        justify-content: center;
        margin: 8px 0 0;
    }
}

@media (max-width: 900px) {
    .cta-box {
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 26px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 36px 28px;
    }

    .footer-content > div:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    :root {
        --nav-h: 64px;
    }

    .nav-brand-text small {
        display: none;
    }

    .nav-brand img {
        width: 38px;
        height: 38px;
    }

    .cover {
        padding-bottom: 100px;
    }

    .overlay {
        background: linear-gradient(180deg, rgba(10, 38, 25, 0.88), rgba(10, 38, 25, 0.82));
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons a {
        width: 100%;
    }

    .services {
        padding: 64px 20px;
    }

    .cta-band {
        padding: 0 20px 64px;
    }

    .service-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .cta-box .btn-cta {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- NAVBAR: SUBMENU INFORMASI (Informasi Dinas + 6 Bidang) ---------- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle .ikon {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-toggle .ikon,
.nav-dropdown:focus-within .nav-dropdown-toggle .ikon {
    transform: rotate(180deg);
}

/* Tanda menu Informasi aktif saat salah satu bidang dibuka */
.nav-dropdown.active > .nav-dropdown-toggle {
    color: #fff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
}

.nav-dropdown.active > .nav-dropdown-toggle::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-400);
}

.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 270px;
    margin-top: 6px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    background: rgba(10, 38, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.6);
}

/* Jembatan hover agar menu tidak menutup saat kursor turun */
.nav-submenu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
    display: flex;
}

.nav-menu .nav-submenu a {
    height: 38px;
    padding: 0 14px;
    font-size: 13.5px;
}

.nav-menu .nav-submenu a.sub-active {
    background: rgba(74, 222, 128, 0.16);
    color: #fff;
    font-weight: 600;
}

/* Tombol panah pembuka daftar: hanya di tablet / ponsel */
.nav-dropdown-buka {
    display: none;
}

@media (max-width: 1024px) {
    /* Baris "Informasi" (teks = tautan, panah = pembuka daftar), daftar di bawahnya */
    .nav-dropdown {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
        column-gap: 4px;
    }

    .nav-dropdown > .nav-dropdown-toggle {
        grid-column: 1;
    }

    /* Panah di dalam tautan disembunyikan; diganti tombol panah terpisah */
    .nav-dropdown-toggle .ikon {
        display: none;
    }

    .nav-dropdown-buka {
        grid-column: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        padding: 0;
        color: rgba(255, 255, 255, 0.78);
        background: transparent;
        border: 0;
        border-radius: 10px;
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .nav-dropdown-buka:hover,
    .nav-dropdown.buka > .nav-dropdown-buka {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .nav-dropdown-buka .ikon {
        transition: transform 0.2s ease;
    }

    .nav-dropdown.buka > .nav-dropdown-buka .ikon {
        transform: rotate(180deg);
    }

    /* Daftar pilihan: MELAYANG di bawah baris "Informasi" (sama seperti dropdown desktop),
       menimpa menu di bawahnya dan tidak mendorongnya turun */
    .nav-submenu,
    .nav-dropdown:hover .nav-submenu,
    .nav-dropdown:focus-within .nav-submenu {
        grid-column: 1 / -1;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 20;
        display: none;
        min-width: 0;
        margin: 6px 0 0;
        padding: 8px;
        background: rgba(10, 38, 25, 0.99);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        box-shadow: 0 24px 40px -14px rgba(0, 0, 0, 0.75),
                    0 6px 16px -6px rgba(0, 0, 0, 0.5);
        animation: submenu-melayang 0.18s ease-out;
    }

    /* Panel menu biasanya memotong (overflow) isi yang melayang; lepas saat daftar terbuka */
    .nav-menu:has(.nav-dropdown.buka) {
        overflow: visible;
    }

    .nav-dropdown.buka .nav-submenu {
        display: flex;
    }

    .nav-submenu::before {
        display: none;
    }

    .nav-menu .nav-submenu a {
        height: 40px;
        padding: 0 14px;
        font-size: 13.5px;
    }

    .nav-dropdown.active > .nav-dropdown-toggle::after {
        display: none;
    }
}

@keyframes submenu-melayang {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layar pendek (HP landscape): panel menu harus bisa digulir, jadi daftar
   tetap tampil sebagai kartu bergaya sama tetapi di dalam alur panel */
@media (max-width: 1024px) and (max-height: 620px) {
    .nav-menu:has(.nav-dropdown.buka) {
        overflow-y: auto;
    }

    .nav-submenu,
    .nav-dropdown:hover .nav-submenu,
    .nav-dropdown:focus-within .nav-submenu {
        position: static;
        margin: 6px 0 4px;
    }
}

/* =====================================================================
   PENYEMPURNAAN TATA LETAK (responsif semua perangkat)
   Desktop, laptop, tablet, ponsel (portrait & landscape), layar lebar.
   ===================================================================== */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--brand-100);
    color: var(--brand-900);
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

/* Area aman pada ponsel berponi / berlekuk (notch) */
.top-navbar {
    padding-left: max(24px, env(safe-area-inset-left), calc((100% - 1240px) / 2));
    padding-right: max(24px, env(safe-area-inset-right), calc((100% - 1240px) / 2));
}

footer .copyright {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Tinggi layar ponsel yang benar saat bilah alamat browser naik/turun */
.cover {
    min-height: 100dvh;
}

/* Tabel apa pun di halaman publik tidak boleh membuat halaman bergeser ke samping */
.table-scroll,
.tabel-gulir {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Umpan balik sentuhan */
.btn-primary:active,
.btn-secondary:active,
.btn-cta:active,
.service-card:active {
    transform: translateY(1px) scale(0.99);
}

/* Layar sangat lebar: isi tidak melebar tanpa batas */
@media (min-width: 1600px) {
    :root {
        --nav-h: 76px;
    }

    .top-navbar,
    .cover {
        padding-left: max(24px, calc((100% - 1400px) / 2));
        padding-right: max(24px, calc((100% - 1400px) / 2));
    }

    .hero-text h1 {
        font-size: 72px;
    }
}

/* Tablet: menu dan kartu lebih lega, tombol mudah disentuh */
@media (min-width: 601px) and (max-width: 1024px) {
    .cover {
        padding-bottom: 110px;
    }

    .services {
        padding-left: 32px;
        padding-right: 32px;
    }

    .nav-menu {
        max-height: calc(100dvh - var(--nav-h) - 8px);
    }
}

/* Ponsel */
@media (max-width: 1024px) {
    .nav-menu {
        max-height: calc(100vh - var(--nav-h) - 8px);
        max-height: calc(100dvh - var(--nav-h) - 8px);
        overscroll-behavior: contain;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 600px) {
    .top-navbar {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .hero-text h1 {
        font-size: clamp(30px, 9vw, 40px);
    }
}

/* Ponsel posisi landscape (layar pendek): hero tidak perlu setinggi layar */
@media (max-height: 520px) and (orientation: landscape) {
    .cover {
        min-height: auto;
        padding-top: calc(var(--nav-h) + 24px);
        padding-bottom: 72px;
    }

    .scroll-down {
        display: none;
    }
}

/* Perangkat sentuh: target ketuk minimal 44 px */
@media (pointer: coarse) {
    .nav-menu a,
    .menu-toggle,
    .footer-links a {
        min-height: 44px;
    }

    .footer-links a {
        display: inline-flex;
        align-items: center;
    }
}

/* Cetak */
@media print {
    .top-navbar,
    .scroll-down,
    .menu-toggle {
        display: none !important;
    }

    body {
        background: #fff;
    }
}

/* =====================================================================
   BERANDA: TUTORIAL PENGGUNAAN
   Tombol di hero + blok pintasan panduan di isi beranda
   ===================================================================== */
.tutorial-band {
    padding: 0 max(24px, calc((100% - 1240px) / 2)) 28px;
    background: var(--bg);
}

.tutorial-box {
    padding: 32px 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.tutorial-intro {
    display: flex;
    align-items: center;
    gap: 22px;
}

.tutorial-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    color: var(--brand-600);
}

.tutorial-text {
    flex: 1;
    min-width: 0;
}

.tutorial-text h2 {
    margin-bottom: 4px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-900);
}

.tutorial-text p {
    max-width: 620px;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.65;
}

.btn-tutorial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 50px;
    padding: 0 26px;
    background: var(--brand-600);
    border-radius: 12px;
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    box-shadow: 0 12px 28px -12px rgba(21, 128, 61, 0.8);
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-tutorial:hover {
    background: var(--brand-700);
    transform: translateY(-2px);
}

.btn-tutorial:active {
    transform: translateY(1px) scale(0.99);
}

.tutorial-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.tutorial-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tutorial-links a:hover {
    background: var(--brand-50);
    border-color: var(--brand-500);
    transform: translateY(-2px);
}

.tutorial-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background: var(--brand-100);
    border-radius: 12px;
    color: var(--brand-700);
}

.tutorial-link-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.tutorial-link-text strong {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
}

.tutorial-link-text small {
    font-size: 12.5px;
    color: var(--text-3);
}

@media (max-width: 1100px) {
    .tutorial-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tutorial-intro {
        flex-wrap: wrap;
    }

    .tutorial-text {
        flex-basis: calc(100% - 82px);
    }

    .btn-tutorial {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .tutorial-band {
        padding: 0 16px 20px;
    }

    .tutorial-box {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .tutorial-icon {
        width: 52px;
        height: 52px;
    }

    .tutorial-text {
        flex-basis: calc(100% - 74px);
    }

    .tutorial-text h2 {
        font-size: 19px;
    }

    .tutorial-links {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
}

/* Tiga tombol di hero: rapi di semua lebar layar */
@media (max-width: 600px) {
    .hero-buttons .btn-tutorial-hero {
        width: 100%;
    }
}

/* =====================================================================
   JENDELA LOGO - muncul saat logo di navbar diklik (js/navbar.js)
   ===================================================================== */
.nav-brand > img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-brand > img:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5);
}

.lg-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 20, 13, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lg-overlay.terbuka {
    display: flex;
    animation: lg-fade 0.2s ease-out;
}

.lg-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--surface, #fff);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 40px 90px -24px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.lg-overlay.terbuka .lg-dialog {
    animation: lg-naik 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lg-judul {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Gambar utama: penuh sampai ke tepi atas jendela */
.lg-bingkai {
    position: relative;
    aspect-ratio: 1179 / 689;
    overflow: hidden;
    background: var(--brand-50, #f0fdf4);
    border-radius: 20px 20px 0 0;
}

.lg-bingkai::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 28%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.lg-gambar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lg-tutup {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 51, 35, 0.12);
    border-radius: 50%;
    color: #10231a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.lg-tutup:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: rotate(90deg);
}

.lg-tutup:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 2px;
}

.lg-isi {
    padding: 4px 28px 26px;
}

.lg-moto {
    margin: 0;
    color: var(--brand-700, #166534);
    font-size: 20px;
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.lg-kontak {
    margin: 6px 0 0;
    color: var(--text-3, #5f7268);
    font-size: 14px;
}

.lg-aksi {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5ede8;
}

.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 24px;
    background: #fff;
    border: 1px solid #cfe3d6;
    border-radius: 999px;
    color: var(--brand-700, #166534);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.lg-btn:hover {
    background: var(--brand-50, #f0fdf4);
    border-color: var(--brand-500, #16a34a);
}

.lg-btn:focus-visible {
    outline: 3px solid #4ade80;
    outline-offset: 2px;
}

.lg-btn.utama {
    background: var(--brand-600, #15803d);
    border-color: var(--brand-600, #15803d);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(21, 128, 61, 0.7);
}

.lg-btn.utama:hover {
    background: var(--brand-700, #166534);
    border-color: var(--brand-700, #166534);
}

@keyframes lg-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lg-naik {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
    .lg-overlay { padding: 14px; }
    .lg-isi { padding: 2px 18px 20px; }
    .lg-moto { font-size: 18px; }
    .lg-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-overlay.terbuka,
    .lg-overlay.terbuka .lg-dialog { animation: none; }
    .lg-tutup:hover { transform: none; }
}

body.lg-kunci {
    overflow: hidden;
}
