/* ==========================================================================
   BERANDA — SECTION 3D (program, galeri, angka)
   Taruh di public/css/public-home-3d.css
   ========================================================================== */

.hm3 {
    --tosca: #14b8bd;
    --tosca-dark: #0f9ea3;
    --tosca-deep: #0b7f84;
    --tosca-soft: #e6f7f8;
    --ink: #141b28;
    --muted: rgba(20, 27, 40, .62);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

.hm3-sec { padding: 56px 0; overflow-x: clip; }
.hm3-sec + .hm3-sec { padding-top: 24px; }

.hm3-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--tosca-dark);
    background: rgba(20, 184, 189, .12);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.hm3-title {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 8px;
}

.hm3-lead {
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
    margin: 0;
    max-width: 460px;
}

.hm3-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tosca-dark);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1.5px solid rgba(20, 184, 189, .35);
    transition: background .2s, color .2s, border-color .2s;
}

.hm3-link:hover { background: var(--tosca); border-color: var(--tosca); color: #fff; }

/* ==========================================================================
   1. BADGE STRIP
   ========================================================================== */

.hm3-strip { padding: 28px 0 8px; }

.hm3-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(20, 27, 40, .07);
    overflow: hidden;
}

.hm3-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    position: relative;
}

.hm3-badge + .hm3-badge::before {
    content: '';
    position: absolute;
    left: 0; top: 22%; bottom: 22%;
    width: 1px;
    background: rgba(20, 27, 40, .08);
}

.hm3-badge-ic {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--tosca-dark);
    background: var(--tosca-soft);
    transform: perspective(200px) rotateY(0deg);
    transition: transform .5s var(--ease), background .3s, color .3s;
}

.hm3-badge:hover .hm3-badge-ic {
    transform: perspective(200px) rotateY(180deg);
    background: var(--tosca);
    color: #fff;
}

.hm3-badge-ic i { display: block; transition: transform .5s var(--ease); }
.hm3-badge:hover .hm3-badge-ic i { transform: rotateY(180deg); }

/* ==========================================================================
   2. PROGRAM — POSTER 3D DI ATAS PANGGUNG
   Bagus untuk 1 program maupun banyak (yang banyak bisa digeser).
   ========================================================================== */

.hm3-prog {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 1.5fr;
    gap: 40px;
    align-items: center;
}

.hm3-prog > * { min-width: 0; }
.hm3-prog-copy .hm3-lead { margin-bottom: 24px; }

.hm3-prog-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hm3-arrow {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20, 27, 40, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, transform .2s, opacity .2s;
}

.hm3-arrow:hover:not(:disabled) { background: var(--tosca); color: #fff; transform: translateY(-2px); }
.hm3-arrow:disabled { opacity: .35; cursor: default; }
.hm3-arrow[hidden] { display: none; }

/* panggung */
.hm3-stage {
    position: relative;
    padding: 18px 0 34px;
}

/* alas panggung: elips tosca tipis di bawah poster */
.hm3-stage::after {
    content: '';
    position: absolute;
    left: 6%; right: 6%; bottom: 8px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(20, 184, 189, .22), rgba(20, 184, 189, 0) 70%);
    pointer-events: none;
}

.hm3-track {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 24px 16px 20px;
    margin: -24px -16px -20px;
    scroll-padding-left: 16px;
    perspective: 1200px;
}

.hm3-track::-webkit-scrollbar { display: none; }

/* kalau postenya sedikit, taruh di tengah panggung */
.hm3-track.is-few { justify-content: center; }

.hm3-poster {
    flex: 0 0 236px;
    scroll-snap-align: start;
    text-decoration: none;
    color: var(--ink);
    display: block;
}

.hm3-poster-frame {
    position: relative;
    aspect-ratio: 4/5;
    border-radius: 18px;
    overflow: hidden;
    background: var(--tosca-soft);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .8) inset,
        0 22px 40px -12px rgba(20, 27, 40, .28);
    transform: rotateY(var(--ry, -10deg)) rotateX(4deg);
    transform-origin: center bottom;
    transition: transform .55s var(--ease), box-shadow .3s ease;
}

.hm3-poster:nth-child(even) .hm3-poster-frame { --ry: 10deg; }
.hm3-track.is-single .hm3-poster-frame { --ry: -12deg; }

.hm3-poster:hover .hm3-poster-frame,
.hm3-poster:focus-visible .hm3-poster-frame {
    transform: rotateY(0deg) rotateX(0deg) translateY(-8px);
    box-shadow: 0 30px 50px -14px rgba(15, 158, 163, .38);
}

.hm3-poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* kilau kaca lewat saat hover */
.hm3-poster-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 130% 0;
    transition: background-position .9s var(--ease);
    pointer-events: none;
}

.hm3-poster:hover .hm3-poster-frame::after { background-position: -30% 0; }

.hm3-poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    line-height: 1.3;
    background: var(--accent, var(--tosca-deep));
}

.hm3-poster-fallback em { font-style: normal; font-size: 42px; line-height: 1; }

.hm3-poster-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding: 0 4px;
}

.hm3-poster-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.hm3-poster-go {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tosca-soft);
    color: var(--tosca-dark);
    font-size: 15px;
    transition: background .2s, color .2s, transform .2s;
}

.hm3-poster:hover .hm3-poster-title { color: var(--tosca-dark); }
.hm3-poster:hover .hm3-poster-go { background: var(--tosca); color: #fff; transform: translateX(3px); }

/* ==========================================================================
   3. GALERI — TUMPUKAN FOTO 3D
   ========================================================================== */

.hm3-gallery {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 32px;
    align-items: center;
}

.hm3-gallery-copy .hm3-lead { margin-bottom: 22px; }

.hm3-gallery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.hm3-gallery-meta span {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tosca-dark);
    background: var(--tosca-soft);
    padding: 5px 12px;
    border-radius: 999px;
}

.hm3-stack {
    position: relative;
    height: 380px;
    perspective: 1200px;
}

.hm3-stack-floor {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(18deg);
    transition: transform .6s var(--ease);
}

.hm3-stack:hover .hm3-stack-floor { transform: rotateX(8deg); }

.hm3-photo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56%;
    aspect-ratio: 4/3;
    margin: 0;
    padding: 8px 8px 30px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(20, 27, 40, .16);
    transform:
        translate(-50%, -50%)
        translate(var(--x, 0px), var(--y, 0px))
        rotate(var(--r, 0deg))
        translateZ(var(--z, 0px));
    transition: transform .6s var(--ease), box-shadow .3s ease;
    cursor: zoom-in;
}

.hm3-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    background: var(--tosca-soft);
}

.hm3-photo figcaption {
    position: absolute;
    left: 12px; right: 12px; bottom: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* posisi tumpukan (maks 5 foto) */
.hm3-photo:nth-child(1) { --r: -2deg; --z: 40px; z-index: 5; }
.hm3-photo:nth-child(2) { --r: 7deg;  --x: 34px;  --y: -14px; --z: 20px; z-index: 4; }
.hm3-photo:nth-child(3) { --r: -9deg; --x: -38px; --y: -10px; --z: 0px;  z-index: 3; }
.hm3-photo:nth-child(4) { --r: 12deg; --x: 60px;  --y: 10px;  --z: -20px; z-index: 2; }
.hm3-photo:nth-child(5) { --r: -14deg; --x: -62px; --y: 14px; --z: -40px; z-index: 1; }

/* hover: tumpukan melebar */
.hm3-stack:hover .hm3-photo:nth-child(1) { --r: 0deg; --y: 10px; }
.hm3-stack:hover .hm3-photo:nth-child(2) { --r: 9deg;  --x: 110px; --y: -24px; }
.hm3-stack:hover .hm3-photo:nth-child(3) { --r: -10deg; --x: -110px; --y: -22px; }
.hm3-stack:hover .hm3-photo:nth-child(4) { --r: 14deg;  --x: 140px; --y: 44px; }
.hm3-stack:hover .hm3-photo:nth-child(5) { --r: -15deg; --x: -140px; --y: 48px; }

.hm3-photo:hover { box-shadow: 0 26px 50px rgba(15, 158, 163, .28); z-index: 9 !important; --z: 80px !important; }

/* ==========================================================================
   4. ANGKA — PANEL HOLO TOSCA
   ========================================================================== */

.hm3-stats-sec { padding-bottom: 72px; }

.hm3-stats {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 28px;
    padding: 48px 40px 56px;
    background: linear-gradient(160deg, #14b8bd 0%, #0f9ea3 55%, #0b7f84 100%);
    color: #fff;
    perspective: 1200px;
}

.hm3-stats::before {
    content: '';
    position: absolute;
    left: -30%; right: -30%; bottom: -20%;
    height: 70%;
    background-image:
        linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px);
    background-size: 46px 46px;
    transform: perspective(420px) rotateX(70deg);
    transform-origin: top center;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 65%);
            mask-image: linear-gradient(to bottom, transparent, #000 65%);
    animation: hm3-floor 8s linear infinite;
    z-index: -1;
}

.hm3-stats::after {
    content: '';
    position: absolute;
    width: 520px; height: 520px;
    left: 50%; top: -260px;
    margin-left: -260px;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%);
    z-index: -1;
}

@keyframes hm3-floor { to { background-position: 0 46px, 0 0; } }

.hm3-stats-head { text-align: center; margin-bottom: 34px; }
.hm3-stats-head h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin: 0 0 6px; color: #fff; }
.hm3-stats-head p { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .82); }

.hm3-stats-rig {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    transform-style: preserve-3d;
    transform: rotateX(var(--hm3-rx, 0deg)) rotateY(var(--hm3-ry, 0deg));
    transition: transform .5s var(--ease);
}

.hm3-stat {
    position: relative;
    padding: 26px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    box-shadow: 0 20px 40px rgba(6, 60, 64, .25);
    transform: translateZ(30px);
    animation: hm3-bob 6s ease-in-out infinite;
}

.hm3-stat:nth-child(2) { animation-delay: -2s; }
.hm3-stat:nth-child(3) { animation-delay: -4s; }

@keyframes hm3-bob { 50% { translate: 0 -8px; } }

.hm3-stat-ic {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--tosca-deep);
    background: #fff;
    margin-bottom: 18px;
}

.hm3-stat-num {
    display: block;
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.hm3-stat-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .86);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    .hm3-prog { grid-template-columns: 1fr; gap: 24px; }
    .hm3-track.is-few { justify-content: flex-start; }
    .hm3-track.is-single { justify-content: center; }

    .hm3-badges { grid-template-columns: repeat(2, 1fr); }
    .hm3-badge:nth-child(3)::before { display: none; }
    .hm3-badge:nth-child(n+3) { border-top: 1px solid rgba(20, 27, 40, .08); }

    .hm3-gallery { grid-template-columns: 1fr; text-align: center; }
    .hm3-gallery .hm3-lead { margin-left: auto; margin-right: auto; }
    .hm3-gallery-meta { justify-content: center; }

    .hm3-stats { padding: 36px 20px 40px; }
    .hm3-stats-rig { grid-template-columns: 1fr; gap: 14px; }
    .hm3-stat { transform: none; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; text-align: left; }
    .hm3-stat-ic { grid-row: span 2; margin: 0; }
    .hm3-stat-num { margin-bottom: 2px; }
}

@media (max-width: 640px) {
    .hm3-sec { padding: 40px 0; }
    .hm3-badge { padding: 14px; font-size: 13px; gap: 10px; }
    .hm3-badge-ic { flex-basis: 34px; height: 34px; font-size: 16px; }

    .hm3-poster { flex-basis: 200px; }

    .hm3-stack { height: 300px; }
    .hm3-photo { width: 72%; }
    .hm3-stack:hover .hm3-photo:nth-child(n) { --x: 0px; --y: 0px; }
}

@media (prefers-reduced-motion: reduce) {
    .hm3 *, .hm3 *::before, .hm3 *::after { animation: none !important; transition: none !important; }
}