/* ============================================================================
   kementan.web.id — Homepage: showcase latar sawah + daftar aplikasi slider expandable.
   Tema mengikuti palet hijau #1B4332 + aksen kuning #E9C46A.
   ========================================================================== */

:root {
    --brand-900: #081C15;
    --brand-700: #1B4332;
    --brand-600: #2D6A4F;
    --brand-400: #74C69D;
    --brand-100: #D8F3DC;
    --agri-yellow: #E9C46A;

    --background: hsl(210 17% 98%);
    --foreground: hsl(150 59% 7%);
    --muted-foreground: hsl(152 12% 35%);
    --border: hsl(214 14% 89%);

    --font-heading: 'Cabinet Grotesk', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
    --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;

    --radius: 10px;
    --maxw: 72rem;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0;
}

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

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 1024px) {
    .container { padding-inline: 1.5rem; }
}

main { flex: 1; }

/* ---------------------------------------------------------------- Navbar --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
}

.brand__logo {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    background: var(--brand-700);
}

.brand__logo svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--agri-yellow);
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand__name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--brand-900);
}

.brand__sub {
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.nav__link {
    padding: .5rem .75rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    color: rgba(8, 28, 21, .72);
    transition: color .2s ease, background-color .2s ease;
}

.nav__link:hover {
    color: var(--brand-700);
    background: rgba(216, 243, 220, .6);
}

@media (max-width: 480px) {
    .brand__sub { display: none; }
    .nav__link { display: none; }
}

/* --------------------------------------------------------------- Showcase --- */
/* Section utama: latar gambar sawah + overlay hijau samar; konten (judul +
   slider kartu aplikasi) berada di atasnya agar kartu menonjol. */
.showcase {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    padding-block: 4.5rem;
}

/* Latar gambar sawah Indonesia (Unsplash), fixed cover. */
.showcase__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('https://images.unsplash.com/photo-1586771107445-d3ca888129ff?auto=format&fit=crop&w=1920&h=1200&q=80');
    background-size: cover;
    background-position: center;
    transform: scale(1.03);
}

/* Overlay hijau gelap samar agar background 'samar-samar' dan kartu menonjol. */
.showcase__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(8, 28, 21, .82) 0%, rgba(8, 28, 21, .72) 45%, rgba(8, 28, 21, .88) 100%),
        radial-gradient(120% 80% at 20% 10%, rgba(27, 67, 50, .55), rgba(8, 28, 21, .65));
    -webkit-backdrop-filter: saturate(120%);
    backdrop-filter: saturate(120%);
}

.showcase__inner {
    position: relative;
    z-index: 2;
    width: 100%;
}

.showcase__head {
    max-width: 44rem;
    margin-bottom: 2.25rem;
}

.showcase__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: .28rem .65rem;
    border-radius: 6px;
    background: rgba(233, 196, 106, .16);
    border: 1px solid rgba(233, 196, 106, .45);
    color: var(--agri-yellow);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.showcase__title {
    margin-top: 1rem;
    color: #fff;
    font-size: clamp(1.7rem, 4.5vw, 2.8rem);
    font-weight: 800;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.showcase__lead {
    margin-top: 1rem;
    max-width: 40rem;
    color: rgba(255, 255, 255, .88);
    font-size: 1rem;
}

/* ------------------------------------- Kartu aplikasi expandable (slider) --- */
/* Bersandar pada pola "expandable animated card slider": tiap kartu menampilkan
   judul saja, lalu melebar & memunculkan detail saat aktif/diklik. Tanpa
   dependency (tanpa jQuery/OwlCarousel/Bootstrap). */
.app-slider-wrap {
    position: relative;
}

.app-slider {
    display: flex;
    gap: 1rem;
    padding: .5rem .25rem 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.app-slider::-webkit-scrollbar { height: 8px; }
.app-slider::-webkit-scrollbar-thumb {
    background: rgba(45, 106, 79, .3);
    border-radius: 999px;
}

.app-card {
    position: relative;
    flex: 0 0 auto;
    width: 280px;
    height: 420px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--brand-900);
    box-shadow: 0 8px 24px -14px rgba(8, 28, 21, .5);
    cursor: pointer;
    scroll-snap-align: start;
    transition: width .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s ease;
}

/* Saat aktif: kartu melebar (expanded). */
.app-card.is-active {
    width: 500px;
    box-shadow: 0 26px 50px -20px rgba(8, 28, 21, .55);
}

.app-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

.app-card.is-active .app-card__bg { transform: scale(1.05); }

.app-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 28, 21, .15) 0%, rgba(8, 28, 21, .55) 55%, rgba(8, 28, 21, .95) 100%);
}

.app-card__logo {
    position: absolute;
    top: 1.1rem;
    left: 1.1rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5);
    overflow: hidden;
}

.app-card__logo img { width: 100%; height: 100%; object-fit: contain; padding: .3rem; }
.app-card__logo svg { width: 1.5rem; height: 1.5rem; }

.app-card__badge {
    position: absolute;
    top: 1.35rem;
    right: 1.1rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .65rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .92);
    color: var(--brand-700);
}

.app-card__badge--live::before {
    content: "";
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    background: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, .25);
}

.app-card__desc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.25rem 1.5rem;
    color: #fff;
    transform: translateY(calc(100% - 3.5rem));
    transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}

.app-card.is-active .app-card__desc { transform: none; }

.app-card__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

/* Isi detail: tersembunyi lalu muncul saat aktif. */
.app-card__body {
    margin-top: .6rem;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .45s ease .18s, transform .45s cubic-bezier(.22, 1, .36, 1) .18s;
    pointer-events: none;
}

.app-card.is-active .app-card__body {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.app-card__url {
    font-size: .78rem;
    font-weight: 600;
    color: var(--agri-yellow);
    word-break: break-all;
}

.app-card__text {
    margin-top: .6rem;
    font-size: .92rem;
    color: rgba(255, 255, 255, .88);
}

.app-card__btn {
    margin-top: 1.1rem;
    width: 100%;
}

/* -------------------------------------------- Panah navigasi mengambang --- */
.app-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-top: -1rem;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    background: rgba(8, 28, 21, .72);
    color: #fff;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px -10px rgba(8, 28, 21, .6);
    transition: opacity .25s ease, transform .2s ease, background-color .2s ease;
}

.app-nav:hover { background: var(--brand-700); }
.app-nav:active { transform: scale(.94); }
.app-nav svg { width: 1.4rem; height: 1.4rem; }

.app-nav--prev { left: -.5rem; }
.app-nav--next { right: -.5rem; }

.app-nav.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 767px) {
    .app-nav { width: 2.4rem; height: 2.4rem; }
    .app-nav--prev { left: 0; }
    .app-nav--next { right: 0; }
}

/* ---------------------------------------------------------------- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .72rem 1.4rem;
    font-family: var(--font-sans);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .15s ease, box-shadow .25s ease;
    white-space: nowrap;
}

.btn svg { width: 1.05rem; height: 1.05rem; }

.btn-gate {
    background-color: var(--agri-yellow);
    color: var(--brand-700);
}

.btn-gate:hover {
    background-color: var(--brand-700);
    color: var(--agri-yellow);
    box-shadow: 0 12px 28px -14px rgba(8, 28, 21, .55);
}

.btn-gate:active { transform: translateY(1px); }

/* ------------------------------------------ Responsif kartu expandable --- */
@media (max-width: 767px) {
    .app-card { width: 240px; height: 380px; }
    .app-card.is-active { width: 290px; }
    .app-card__desc { padding: 1rem 1.1rem; transform: translateY(calc(100% - 3rem)); }
    .app-card__title { font-size: 1.25rem; }
    .app-card__text { font-size: .85rem; }
}

/* Di layar besar, aktif bisa lebih lebar lagi agar teks lega. */
@media (min-width: 1024px) {
    .app-card.is-active { width: 560px; }
}

/* ---------------------------------------------------------------- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    background: #fff;
}

.footer__bottom {
    padding-block: 1.4rem;
    font-size: .8rem;
    color: var(--muted-foreground);
}

/* ------------------------------------------------------ Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .app-card,
    .app-card__bg,
    .app-card__desc,
    .app-card__body { transition: none; }
}
