:root {
    --background: #efeff6;
    --on-background: #1b1c1c;
    --primary: #000000;
    --on-primary: #ffffff;
    --secondary: #5d5f5f;
    --outline-variant: rgba(196, 199, 199, 0.2);
    /* outline-variant/20 */
    --footer-border: rgba(196, 199, 199, 0.1);
    /* outline-variant/10 */
    --surface-container-lowest: #ffffff;
    --on-secondary-fixed-variant: #454747;
    --emerald-500: #10b981;
    --orange-500: #f97316;
    --header-bg: rgba(239, 239, 246, 0.8);

    --font-headline: 'Manrope', sans-serif;
    --font-body: 'Hanken Grotesk', sans-serif;
}

[data-theme="dark"] {
    --background: #181818;
    --on-background: #f1f1f6;
    --primary: #ffffff;
    --on-primary: #1f1f1f;
    --secondary: #a0a2a5;
    --outline-variant: rgba(255, 255, 255, 0.15);
    --footer-border: rgba(255, 255, 255, 0.08);
    --surface-container-lowest: #21222c;
    --on-secondary-fixed-variant: #c0c2c5;
    --emerald-500: #34d399;
    --orange-500: #fb923c;
    --header-bg: rgba(25, 25, 25, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--background);
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
}

body {
    color: var(--on-background);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 96%;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    /* py-3 px-4 */
}

@media (min-width: 768px) {
    .nav-container {
        padding: 24px 16px;
        /* py-md px-margin */
    }
}

.logo {
    font-family: var(--font-headline);
    font-weight: 700;
    letter-spacing: -0.025em;
    /* tracking-tight */
    color: var(--primary);
    font-size: 1.25rem;
    /* text-xl */
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .logo {
        font-size: 32px;
        /* text-headline-md */
        line-height: 1.3;
    }
}

.contact-btn {
    background-color: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
    font-size: 0.875rem;
    /* text-sm */
    text-decoration: none;
    padding: 0.5rem 1rem;
    /* py-2 px-4 */
    border-radius: 0.5rem;
    /* rounded-lg */
    transition: transform 0.2s ease;
    display: inline-block;
}

.tactile-button:active {
    transform: scale(0.95);
}

.contact-btn:hover {
    transform: scale(0.95);
}

@media (min-width: 768px) {
    .contact-btn {
        font-size: 19px;
        /* text-label-md */
        letter-spacing: 0.05em;
        padding: 12px 48px;
        /* py-sm px-lg */
        border-radius: 0.75rem;
        /* rounded-xl */
    }
}

/* Main Content */
.main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 32px 0 32px;
    /* pt-[120px] px-margin */
}

@media (min-width: 768px) {
    .main-container {
        padding-top: 220px;
        /* pt-[220px] */
    }
}

.hero-content {
    width: 100%;
    max-width: 56rem;
    /* max-w-4xl */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    max-width: 1014px;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 36px;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 74px;
        /* text-headline-lg */
        line-height: 1.1;
        letter-spacing: -0.03em;
        margin-bottom: 32px;
    }
}

.animated-text {
    transition: color 1s ease;
    cursor: default;
}

.text-emerald:hover {
    color: var(--emerald-500);
}

.text-muted {
    color: var(--on-secondary-fixed-variant);
}

.text-muted:hover {
    color: var(--orange-500);
}

.emoji-hover {
    display: inline-block;
    transition: transform 1s ease;
    cursor: default;
    user-select: none;
}

.emoji-hover:hover {
    transform: scale(1.1);
}

.font-tight {
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1rem;
    /* text-base */
    color: var(--secondary);
    max-width: 760px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
    .hero-subtitle {
        font-size: 1.125rem;
        /* text-lg */
    }
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 24px;
        /* text-body-lg */
        line-height: 1.6;
        margin-bottom: 64px;
    }
}

/* Social Links */
.social-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* gap-x-2 */
    margin-left: 4px;
    /* ml-xs */
}

@media (min-width: 768px) {
    .social-container {
        gap: 11px;
        /* gap-x-[11px] */
    }
}

.social-link {
    width: 2.25rem;
    /* w-9 */
    height: 2.25rem;
    /* h-9 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    /* rounded-lg */
    border: 1px solid var(--outline-variant);
    background-color: var(--surface-container-lowest);
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: inherit;
}

.social-link:hover {
    transform: scale(0.95);
}

.social-link.linkedin:hover {
    color: #0a66c2;
}

.social-link.instagram:hover .social-icon {
    fill: url(#instagram-gradient);
}

@media (min-width: 768px) {
    .social-link {
        width: 42px;
        /* w-[42px] */
        height: 42px;
        /* h-[42px] */
        border-radius: 11px;
        /* rounded-[11px] */
    }
}

.social-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: fill 0.2s ease;
}

@media (min-width: 768px) {
    .social-icon {
        width: 21px;
        height: 21px;
    }
}

/* Footer */
.footer {
    width: 100%;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 96%;
    margin: 80px auto 0 auto;
    /* mt-xl */
    padding: 48px 16px;
    /* py-lg px-margin */
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 19px;
    /* text-label-md */
    letter-spacing: 0.05em;
    color: var(--secondary);
    border-top: 1px solid var(--footer-border);
    transition: border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.copyright {
    margin-bottom: 24px;
    /* mb-md */
}

@media (min-width: 768px) {
    .copyright {
        margin-bottom: 0;
    }
}

/* Falling Word Effect */
.falling-word {
    display: inline-block;
    cursor: pointer;
}

.falling-word.is-falling {
    animation: fallAndReturn 4.5s linear forwards;
}

@keyframes fallAndReturn {
    0% {
        transform: translateY(0);
        opacity: 1;
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
        /* ease-in */
    }

    20% {
        transform: translateY(100vh);
        opacity: 1;
    }

    20.1% {
        transform: translateY(-100vh);
        opacity: 0;
    }

    80% {
        transform: translateY(-100vh);
        opacity: 0;
    }

    80.1% {
        transform: translateY(-100vh);
        opacity: 1;
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1);
        /* ease-out */
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Nav Actions Container */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .nav-actions {
        gap: 1rem;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    background: none;
    border: 1px solid var(--outline-variant);
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    background-color: var(--surface-container-lowest);
    transition: transform 0.2s ease, border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.theme-toggle:hover {
    transform: scale(0.95);
    background-color: var(--outline-variant);
}

@media (min-width: 768px) {
    .theme-toggle {
        width: 42px;
        height: 42px;
    }
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .theme-toggle svg {
        width: 21px;
        height: 21px;
    }
}

/* Sun/Moon Icon Transitions */
html:not([data-theme="dark"]) .sun-icon {
    transform: rotate(0) scale(1);
    opacity: 1;
}

html:not([data-theme="dark"]) .moon-icon {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

html[data-theme="dark"] .sun-icon {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}

html[data-theme="dark"] .moon-icon {
    transform: rotate(0) scale(1);
    opacity: 1;
}

/* Photobooth Navigation Link */
.photobooth-nav-link {
    color: var(--on-background);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.photobooth-nav-link:hover {
    background-color: var(--outline-variant);
    transform: scale(0.96);
}

@media (min-width: 768px) {
    .photobooth-nav-link {
        font-size: 17px;
        letter-spacing: 0.02em;
        padding: 8px 16px;
    }
}

/* Photobooth Section */
.photobooth-section {
    width: 100%;
    max-width: 1000px;
    margin: 80px auto 120px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-margin-top: 100px;
}

.pb-section-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--secondary);
    margin-bottom: 28px;
    text-align: center;
}

/* Photobooth Content Layout & Note */
.pb-content-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

@media (min-width: 900px) {
    .pb-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
    }
}

/* Note with Curved Arrow */
.pb-note-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--on-background);
    max-width: 320px;
    padding: 0 16px;
    margin-bottom: 10px;
}

@media (min-width: 900px) {
    .pb-note-container {
        position: absolute;
        right: calc(50% + 260px);
        top: 60px;
        width: 320px;
        max-width: 320px;
        padding: 0;
        margin-bottom: 0;
    }
}

.pb-note-text {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--on-background);
    letter-spacing: -0.01em;
    opacity: 0.9;
    white-space: nowrap;
}

.pb-note-arrow {
    width: 145px;
    height: 65px;
    color: var(--on-background);
    margin-top: 8px;
    margin-left: 125px;
    opacity: 0.85;
}

/* Main Column Container */
.pb-main-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
}

/* Main Photobooth Frame (9:16 Portrait Aspect Ratio Container) */
.photobooth-frame {
    position: relative;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 9 / 16;
    background-color: #121214;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--outline-variant);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Top Section (Light Grey Header / Live Stream Space) */
.pb-top-section {
    position: relative;
    height: 50%;
    width: 100%;
    background-color: #dcdce2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pb-top-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #555;
    text-align: center;
    padding: 24px;
}

.pb-placeholder-icon {
    width: 48px;
    height: 48px;
    opacity: 0.6;
}

.pb-placeholder-text {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.pb-video-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera stream during live preview */
}

.pb-user-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none; /* Unmirrored/normal orientation for captured photo */
}

/* Countdown & Slot Status Overlay */
.pb-overlay-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.pb-countdown-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-headline);
    font-size: 72px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 20;
    pointer-events: none;
    animation: pulseCount 0.8s ease infinite alternate;
}

@keyframes pulseCount {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
    to { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* Camera Flash Animation */
.pb-flash {
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
}

.pb-flash.active {
    animation: flashAnim 0.4s ease-out;
}

@keyframes flashAnim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Bottom Section (Meme Container - 50% height) */
.pb-bottom-section {
    position: relative;
    height: 50%;
    width: 100%;
    background-color: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-meme-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Change Meme Button Icon (Pojok Kanan Atas Kolom Meme) */
.pb-change-meme-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.pb-change-meme-btn:hover {
    background: rgba(0, 0, 0, 0.92);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(0.95) rotate(90deg);
}

/* Aesthetic Filter Options */
.filter-bw {
    filter: grayscale(100%) contrast(145%) brightness(92%);
}

.filter-vintage {
    filter: sepia(50%) contrast(120%) brightness(95%) hue-rotate(-10deg);
}

.filter-normal {
    filter: none;
}

.pb-slot-empty-text {
    font-size: 11px;
    font-weight: 600;
    color: #666672;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Caption Overlay on Bottom Left Photo */
.pb-slot-caption {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: -0.01em;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Controls Toolbar */
.pb-controls-container {
    width: 100%;
    max-width: 440px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pb-primary-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.pb-btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, background-color 0.3s ease, opacity 0.2s ease;
    text-decoration: none;
}

.pb-btn:active {
    transform: scale(0.96);
}

.pb-btn-primary {
    flex: 1;
    background-color: var(--primary);
    color: var(--on-primary);
}

.pb-btn-primary:hover {
    opacity: 0.9;
}

.pb-btn-secondary {
    background-color: var(--surface-container-lowest);
    color: var(--on-background);
    border: 1px solid var(--outline-variant);
}

.pb-btn-secondary:hover {
    background-color: var(--outline-variant);
}

.pb-secondary-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.pb-filter-select {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    background-color: var(--surface-container-lowest);
    color: var(--on-background);
    border: 1px solid var(--outline-variant);
    padding: 8px 12px;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

/* Hidden canvas for native 1080x1920 export */
#pb-render-canvas {
    display: none;
}

/* IG Share Guide Toast / Modal */
.pb-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e1e24;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    font-size: 13px;
    z-index: 999;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    max-width: 90%;
    width: 400px;
    text-align: center;
}

.pb-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pb-toast-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}

.pb-toast-desc {
    color: #aaaaaa;
    line-height: 1.4;
}

/* Meme Picker Component Styles */
.pb-meme-picker {
    width: 100%;
    max-width: 440px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pb-picker-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary);
}

.pb-meme-options {
    display: flex;
    gap: 10px;
    width: 100%;
}

.pb-meme-thumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background-color: var(--surface-container-lowest);
    border: 2px solid var(--outline-variant);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.pb-meme-thumb.active {
    border-color: var(--primary);
    background-color: var(--outline-variant);
}

.pb-meme-thumb img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.pb-meme-thumb span {
    font-size: 13px;
    font-weight: 600;
    color: var(--on-background);
}