/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ================= TOKENS ================= */
:root {
    --cream: #f7f2ea;
    --cream-deep: #ede2cd;
    --frame-placeholder: #e8d9c3;
    --ink: #241b15;
    --umber: #6b5745;
    --clay: #b54f2a;
    --line: rgba(36, 27, 21, 0.12);
    --shadow: 0 20px 45px -12px rgba(36, 27, 21, 0.32), 0 6px 14px rgba(36, 27, 21, 0.1);
    --card-dark: #2a1c13;
    --transition-smooth: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ================= BODY ================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--cream);
    color: var(--umber);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ================= SPLASH SCREEN (VIDEO) ================= */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #F6EFE6 0%, #F1E6D6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-logo-img {
    width: min(42vw, 190px);
    height: auto;
    display: block;
    /* forwards = state di keyframe 100% tetap "nempel" sampai elemen dihapus JS */
    animation: splash-logo-sequence 2.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity, filter;
}

@keyframes splash-logo-sequence {
    /* fase 1: fade in + scale in (0% - 22%) */
    0% {
        opacity: 0;
        transform: scale(0.8);
        filter: drop-shadow(0 0 0 rgba(181, 79, 42, 0));
    }
    22% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(181, 79, 42, 0));
    }
    /* fase 2: glow muncul + floating pelan (22% - 75%) */
    38% {
        filter: drop-shadow(0 0 16px rgba(181, 79, 42, 0.42));
        transform: scale(1.045) translateY(-6px);
    }
    56% {
        transform: scale(1.045) translateY(0);
    }
    75% {
        filter: drop-shadow(0 0 16px rgba(181, 79, 42, 0.42));
        transform: scale(1.045) translateY(-6px);
    }
    /* fase 3: scale turun dikit + fade out (75% - 100%) */
    88% {
        transform: scale(0.96) translateY(0);
        opacity: 1;
        filter: drop-shadow(0 0 0 rgba(181, 79, 42, 0));
    }
    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

.splash-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* logo dinaikkan z-index-nya biar selalu di atas ring & glow */
.splash-logo-img {
    position: relative;
    z-index: 3;
}

/* --- GLOW BLUR DI BELAKANG LOGO --- */
.splash-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 240px;
    height: 240px;
    margin: -120px 0 0 -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(181, 79, 42, 0.3) 0%, rgba(181, 79, 42, 0) 72%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    animation: splash-glow-pulse 2.3s ease-in-out forwards;
}

@keyframes splash-glow-pulse {
    0%, 18% { opacity: 0; transform: scale(0.65); }
    45% { opacity: 1; transform: scale(1.08); }
    75% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 0; transform: scale(0.85); }
}

/* --- RING / LINGKARAN YANG MEMBESAR LALU MENGHILANG --- */
.splash-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    margin: -35px 0 0 -35px;
    border-radius: 50%;
    border: 1.5px solid rgba(181, 79, 42, 0.5);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: splash-ring-expand 1.7s cubic-bezier(0.25, 0.65, 0.35, 1) infinite;
}

.splash-ring--2 {
    animation-delay: 0.55s;
}

.splash-ring--3 {
    animation-delay: 1.1s;
}

@keyframes splash-ring-expand {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    12% {
        opacity: 0.55;
        transform: scale(0.7);
    }
    100% {
        opacity: 0;
        transform: scale(2.9);
    }
}

@media (prefers-reduced-motion: reduce) {
    .splash-glow,
    .splash-ring {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .splash-logo-img {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ================= SPA VIEW LAYERS ================= */
.view-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
    display: none;
    background: var(--cream);
}

.view-layer.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
    z-index: 1;
}

#home-view.fade-out {
    transform: scale(0.98);
    opacity: 0;
    pointer-events: none;
}

#detail-view {
    z-index: 10;
    transform: translateY(100%);
    background: var(--cream);
    display: block;
    visibility: hidden;
    position: fixed;
    overflow-y: auto;
}

#detail-view.active {
    visibility: visible;
    transform: translateY(0);
}

/* ================= HERO ================= */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 3rem 1.5rem 1.75rem;
    text-align: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('../assets/img/foto-warung.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse 80% 70% at center,
            rgba(247, 242, 234, 0.96) 0%,
            rgba(247, 242, 234, 0.92) 45%,
            rgba(247, 242, 234, 0.86) 75%,
            rgba(237, 226, 205, 0.9) 100%
        );
    z-index: -1;
}

.hero-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(36, 27, 21, 0.14);
    margin: 0 auto 1.1rem;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.1rem;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.hero-tagline {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--clay);
    margin-top: 0.4rem;
}

.hero-rule {
    width: 34px;
    height: 2px;
    background: var(--line);
    margin: 1.15rem auto;
}

.hero-meta {
    font-size: 0.76rem;
    color: var(--umber);
    letter-spacing: 0.02em;
}

/* ================= QUICK NAV ================= */
.quick-nav {
    margin-top: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0.4rem;
}

.quick-nav::-webkit-scrollbar {
    display: none;
}

.quick-nav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 40px;
    padding: 0 1.3rem;
    border-radius: 999px;
    background: #f2f2f2;
    color: #555555;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    border: none;
    box-shadow: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.nav-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: inherit;
}

.quick-nav a:hover,
.quick-nav a:focus-visible {
    background: #e7e0d6;
    color: var(--clay);
    transform: scale(1.04);
}

.quick-nav a.is-active {
    background: linear-gradient(155deg, #d89b63 0%, #b56a35 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px -6px rgba(181, 106, 53, 0.55);
}

.quick-nav a.is-active:hover {
    transform: scale(1.04);
}

@media (max-width: 340px) {
    .quick-nav a {
        height: 38px;
        padding: 0 1.1rem;
        font-size: 0.74rem;
    }
}

/* ================= CATEGORY SECTION ================= */
.cat-section {
    padding: 2.5rem 0 2.1rem;
    scroll-margin-top: 1rem;
}

.cat-section.tone-deep {
    background: var(--cream-deep);
}

.cat-head {
    padding: 0 1.5rem;
    max-width: 640px;
    margin: 0 auto 1.4rem;
}

.cat-eyebrow {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--clay);
    margin-bottom: 0.5rem;
}

.cat-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--ink);
}

.cat-tagline {
    margin-top: 0.35rem;
    font-size: 0.86rem;
    color: var(--umber);
}

/* ================= CAROUSEL ================= */
.carousel-track {
    display: flex;
    list-style: none;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 0 9% 0.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 6px;
}

.scene {
    flex: 0 0 82%;
    scroll-snap-align: center;
    transform: scale(1);
    opacity: 1;
    will-change: transform, opacity;
}

.scene-frame {
    aspect-ratio: 4 / 4.3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.scene-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: drop-shadow(0 14px 16px rgba(36, 27, 21, 0.35));
}

.scene-frame img.img-shrink-sm {
    object-fit: contain;      /* seluruh foto ditampilkan utuh, tidak dipotong */
    object-position: center bottom;  /* ditengahkan, bukan center top lagi */
    transform: scale(1);   /* size preference kamu tetap jalan di atas ini */
    transform-origin: center;
}

.scene-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--ink);
}

.scene-tag {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clay);
    border: 1px solid var(--clay);
    border-radius: 999px;
    padding: 0.16rem 0.55rem;
}

.scene-desc {
    margin-top: 0.4rem;
    font-size: 0.83rem;
    color: var(--umber);
    line-height: 1.5;
    max-width: 34ch;
    margin-inline: auto;
}

.scene-price {
    margin-top: 0.6rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--clay);
}

/* ================= SCENE CARD ================= */
.menu-card-clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.menu-card-clickable:active {
    transform: scale(0.96);
}

.scene-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: -28%;
    position: relative;
    z-index: 1;
    padding: calc(28% + 0.3rem) 1.05rem 1.1rem 1.2rem;
    background: linear-gradient(155deg, #362619 0%, #1d130c 100%);
    border-radius: 22px;
    box-shadow: 0 16px 32px -12px rgba(36, 27, 21, 0.5);
    text-align: left;
}

.scene-card-main {
    min-width: 0;
    flex: 1;
}

.scene-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.scene-card .scene-name {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.scene-card-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #241b15;
    background: #f2c063;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    white-space: nowrap;
}

.scene-rating {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    margin-top: 0.45rem;
}

.star-icon {
    width: 14px;
    height: 14px;
    fill: #ffffff;
    flex-shrink: 0;
}

.rating-value {
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #f4ece0;
}

.scene-card .scene-desc {
    margin-top: 0.5rem;
    font-size: 0.76rem;
    color: rgba(244, 236, 224, 0.68);
    line-height: 1.45;
    max-width: 24ch;
    margin-inline: 0;
    text-align: left;
}

.scene-card .scene-price {
    margin-top: 0.65rem;
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.love-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--clay);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.love-btn:active {
    transform: scale(0.88);
}

.love-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.love-btn.is-loved {
    background: #2a1c13;
}

.love-btn.is-loved .love-icon {
    fill: #ff5d8f;
    stroke: #ff5d8f;
}

@media (max-width: 340px) {
    .scene-card .scene-name {
        font-size: 1.05rem;
    }
}

/* ================= CAROUSEL NAV ================= */
.carousel-nav {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
}

.progress-track {
    flex: 1;
    height: 2px;
    background: var(--line);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.progress-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 20%;
    background: var(--clay);
    border-radius: 2px;
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.counter {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--umber);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ================= INFO WARUNG ================= */
.info-outer {
    padding-bottom: 2.75rem;
}

.info-list {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.info-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.86rem;
    color: var(--umber);
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
}

.info-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
    margin-top: 0.15rem;
}

.info-row:first-child {
    border-top: none;
}

/* ================= FOOTER ================= */
footer {
    text-align: center;
    padding: 1.75rem 1.5rem 2.5rem;
    font-size: 0.7rem;
    color: var(--umber);
    letter-spacing: 0.02em;
}

/* ================= RESPONSIVE ================= */
@media (min-width: 640px) {
    .scene {
        flex-basis: 400px;
    }
    .carousel-track {
        padding-inline: calc((100% - 400px) / 2);
    }
}

@media (min-width: 900px) {
    .carousel-track {
        max-width: 900px;
        margin: 0 auto;
    }
}

@media (max-width: 340px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .cat-title {
        font-size: 1.7rem;
    }
}

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

/* ================= DETAIL PAGE UI ================= */
.detail-header-actions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none;
}

.action-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(247, 242, 234, 0.9);
    backdrop-filter: blur(8px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background 0.2s ease;
}

.action-btn:active {
    transform: scale(0.9);
}

.detail-hero {
    position: relative;
    padding-top: 15vh;
    padding-bottom: 3rem;
}

.detail-curve {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 35vh;
    background: linear-gradient(155deg, #362619 0%, #1d130c 100%);
    border-radius: 0 0 45% 45%;
    z-index: 0;
}

.detail-img-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.detail-img-wrapper img {
    width: 240px;
    height: 240px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 6px solid var(--cream);
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

#detail-view.active .detail-img-wrapper img {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.detail-content {
    padding: 0 1.5rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.detail-rating-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f2c063;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1rem;
}

.text-clay {
    fill: var(--ink);
}

.detail-title-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-title-flex h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
    margin: 0;
}

.detail-price-tag {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--clay);
    background: #ede2cd;
    padding: 0.4rem 1rem;
    border-radius: 12px;
    white-space: nowrap;
}

.detail-divider {
    height: 1px;
    background: rgba(36, 27, 21, 0.1);
    margin: 1.5rem 0;
}

.detail-about h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.detail-about p {
    font-size: 0.9rem;
    color: var(--umber);
    line-height: 1.6;
}
