/* =============================================
   PORTOFOLIO SECTION - Semanggi Landscape
   Scroll-storytelling + grid portofolio
   ============================================= */

/* =============================================
   DESIGN TOKENS
   Hanya aktif pada halaman portofolio (body.pf-body)
   ============================================= */
body.pf-body {
    --bg-dark: hsl(158, 30%, 7%);
    --bg-dark-soft: hsl(158, 30%, 10%);
    --text-light: hsl(60, 15%, 95%);
    --text-muted: hsl(60, 12%, 72%);
    --accent: hsl(160, 65%, 45%);
    --accent-soft: hsla(160, 65%, 45%, 0.14);
    --accent-sand: hsl(35, 45%, 68%);
    --pf-font-heading: 'Fraunces', Georgia, serif;
    --pf-font-body: 'Work Sans', system-ui, sans-serif;

    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--pf-font-body);
}

body.pf-body main {
    /* layout memakai warna text gelap; pastikan area cerita tetap gelap */
    color: var(--text-light);
}

.pf-page {
    max-width: 100%;
    overflow-x: clip;
}

/* =============================================
   INDEX PAGE
   ============================================= */
.pf-index {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 24px 96px;
}

.pf-index-header {
    text-align: center;
    padding: 48px 0 64px;
}

.pf-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 100px;
    border: 1px solid var(--accent-soft);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pf-index-title {
    font-family: var(--pf-font-heading);
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.15;
    margin: 22px auto 0;
    max-width: 18ch;
}

.pf-index-desc {
    margin: 18px auto 0;
    max-width: 56ch;
    color: var(--text-muted);
    line-height: 1.7;
}

.pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.pf-tile {
    display: flex;
    flex-direction: column;
    background: var(--bg-dark-soft);
    border: 1px solid hsla(158, 30%, 20%, 0.8);
    border-radius: 22px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

@media (hover: hover) {
    .pf-tile:hover {
        transform: translateY(-6px);
        border-color: hsla(160, 65%, 45%, 0.5);
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    }
}

.pf-tile-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: hsl(158, 30%, 12%);
}

.pf-tile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

@media (hover: hover) {
    .pf-tile:hover .pf-tile-media img {
        transform: scale(1.05);
    }
}

.pf-tile-placeholder {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(120% 120% at 20% 10%, hsla(160, 65%, 45%, 0.35), transparent 60%),
        linear-gradient(160deg, hsl(158, 30%, 14%), hsl(158, 30%, 7%));
}

.pf-tile-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 24px 26px;
}

.pf-tile-title {
    font-family: var(--pf-font-heading);
    font-weight: 600;
    font-size: 1.35rem;
    line-height: 1.3;
}

.pf-tile-desc {
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

.pf-tile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pf-tile-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pf-tile-meta svg {
    color: var(--accent);
    width: 14px;
    height: 14px;
}

.pf-tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.pf-tag {
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
}

.pf-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
}

/* =============================================
   SHOW PAGE - INTRO
   ============================================= */
.pf-intro {
    min-height: calc(100svh - 90px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 64px 24px 40px;
    position: relative;
}

.pf-page-title {
    font-family: var(--pf-font-heading);
    font-weight: 600;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.1;
    max-width: 22ch;
    margin: 0;
}

.pf-page-title::after {
    content: '↓';
    display: block;
    margin-top: 28px;
    color: var(--accent);
    font-size: 1.6rem;
    font-family: var(--pf-font-body);
    font-weight: 400;
    animation: pf-arrow-bounce 2s ease-in-out infinite;
}

@keyframes pf-arrow-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.55; }
    50% { transform: translateY(10px); opacity: 1; }
}

.pf-intro-desc {
    margin: 26px auto 0;
    max-width: 60ch;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.75;
}

.pf-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 28px;
    margin-top: 36px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pf-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pf-meta svg {
    color: var(--accent);
    width: 16px;
    height: 16px;
}

.pf-back svg {
    width: 15px;
    height: 15px;
}

.pf-back {
    position: absolute;
    top: 28px;
    left: 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.25s ease;
}

@media (hover: hover) {
    .pf-back:hover {
        color: var(--accent);
    }
}

/* =============================================
   SHOW PAGE - STORY SECTIONS
   Sticky full-viewport image + kartu konten di atasnya
   ============================================= */
.pf-story {
    position: relative;
}

.pf-section {
    position: relative;
    --scale: 0.1;
}

.image-container {
    position: relative;
    height: 130vh;
    min-height: 560px;
}

.image-container img {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    object-fit: cover;
    display: block;
    z-index: -2;
}

.image-container .pf-tile-placeholder {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    z-index: -2;
}

.image-container::after {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    height: 100vh;
    height: 100svh;
    margin-top: -100vh;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        hsla(158, 30%, 7%, 0.42) 52%,
        hsl(158, 30%, 7%) 100%
    );
}

/* Kartu konten: ditarik ke atas menimpa gambar */
.content.pf-card {
    position: relative;
    z-index: 1;
    margin-top: -45vh;
    margin-left: auto;
    margin-right: auto;
    max-width: 860px;
    width: calc(100% - 48px);
    background: hsla(158, 30%, 7%, 0.92);
    border-radius: 28px 28px 0 0;
    padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 60px);
    transform-origin: top;
    transform: scaleY(1);
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.pf-section.is-hidden .content.pf-card {
    transform: scaleY(var(--scale));
}

.pf-stage-index {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-sand);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.pf-stage-index::before {
    content: '';
    width: 34px;
    height: 2px;
    background: var(--accent-sand);
    border-radius: 2px;
}

.pf-stage-title {
    font-family: var(--pf-font-heading);
    font-weight: 600;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.2;
    margin: 16px 0 0;
}

.pf-stage-desc {
    margin: 18px 0 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.8;
}

/* =============================================
   SHOW PAGE - CTA PENUTUP
   ============================================= */
.pf-cta {
    position: relative;
    text-align: center;
    padding: 120px 24px 140px;
}

.pf-cta-title {
    font-family: var(--pf-font-heading);
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    max-width: 24ch;
    margin: 0 auto;
}

.pf-cta-desc {
    color: var(--text-muted);
    max-width: 52ch;
    margin: 18px auto 0;
    line-height: 1.7;
}

.pf-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.pf-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.pf-btn-accent {
    background: var(--accent);
    color: hsl(158, 30%, 7%);
}

.pf-btn-ghost {
    border: 1px solid hsla(160, 65%, 45%, 0.45);
    color: var(--accent);
}

.pf-btn-icon {
    width: 18px;
    height: 18px;
}

@media (hover: hover) {
    .pf-btn-accent:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px hsla(160, 65%, 45%, 0.35);
    }
    .pf-btn-ghost:hover {
        background: var(--accent-soft);
    }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .pf-index {
        padding: 12px 18px 72px;
    }

    .pf-index-header {
        padding: 36px 0 44px;
    }

    .pf-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pf-intro {
        padding: 48px 18px 32px;
    }

    .pf-back {
        position: static;
        margin-bottom: 28px;
        align-self: flex-start;
    }

    .image-container {
        height: 100vh;
        height: 100svh;
        min-height: 0;
    }

    .image-container img {
        height: 100vh;
        height: 100svh;
    }

    .image-container::after {
        height: 100vh;
        height: 100svh;
    }

    .content.pf-card {
        width: calc(100% - 28px);
        margin-top: -35vh;
        border-radius: 22px 22px 0 0;
        padding: 26px 22px;
    }

    .pf-cta {
        padding: 90px 18px 110px;
    }
}

/* =============================================
   PREFERS-REDUCED-MOTION
   Matikan animasi & transform reveal
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .pf-page-title::after {
        animation: none;
    }

    .content.pf-card {
        transform: none !important;
        transition: none !important;
    }
}
