* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-brand: #fff;
    --color-text-primary: #fff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-bg: #000;
    --font-sans: 'Instrument Sans', 'Noto Sans KR', sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: #f1f1f1;
}

.ad-container {
    width: 300px;
    height: 600px;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg);
    cursor: pointer;
    -webkit-touch-callout: none;
    user-select: none;
    word-break: keep-all;
}

.ad-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #111;
    pointer-events: none;
    z-index: 99;
}

.frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    will-change: transform;
    backface-visibility: hidden;
}

.scrim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.content {
    position: absolute;
    bottom: 116px;
    left: 0;
    width: 100%;
    padding: 0 24px;
    z-index: 2;
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.center-content {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    align-items: center;
    text-align: center;
}

.badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.01em;
    backdrop-filter: blur(10px);
}

.badge-tag {
    background: #fff;
    color: #000;
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

.kicker {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.persistent-header {
    position: absolute;
    top: 26px;
    left: 0;
    width: 100%;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.persistent-logo {
    width: 72px;
}

.persistent-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.01em;
}

.disclaimer {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 100%;
    padding: 12px 24px;
    font-size: 8.5px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    z-index: 20;
    pointer-events: none;
}

.persistent-cta {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    padding: 0 24px;
    background: var(--color-brand);
    color: #000;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: -0.01em;
    pointer-events: none;
    transition: background 0.2s;
}

.ad-container:hover .persistent-cta {
    background: #f8f8f8;
}

.persistent-cta svg {
    transition: transform 0.2s;
}

.ad-container:hover .persistent-cta svg {
    transform: translateX(4px);
}

/* Base Frame Timeline */
.frame-1 {
    animation: timeline-f1 12s linear forwards;
}

.frame-2 {
    animation: timeline-f2 12s linear forwards;
}

.frame-3 {
    animation: timeline-f3 12s linear forwards;
}

.frame-4 {
    animation: timeline-f4 12s linear forwards;
}

@keyframes timeline-f1 {

    0%,
    22% {
        opacity: 1;
        pointer-events: auto;
        z-index: 10;
    }

    25%,
    100% {
        opacity: 0;
        pointer-events: none;
        z-index: 0;
    }
}

@keyframes timeline-f2 {

    0%,
    22% {
        opacity: 0;
        pointer-events: none;
        z-index: 0;
    }

    25%,
    47% {
        opacity: 1;
        pointer-events: auto;
        z-index: 10;
    }

    50%,
    100% {
        opacity: 0;
        pointer-events: none;
        z-index: 0;
    }
}

@keyframes timeline-f3 {

    0%,
    47% {
        opacity: 0;
        pointer-events: none;
        z-index: 0;
    }

    50%,
    72% {
        opacity: 1;
        pointer-events: auto;
        z-index: 10;
    }

    75%,
    100% {
        opacity: 0;
        pointer-events: none;
        z-index: 0;
    }
}

@keyframes timeline-f4 {

    0%,
    72% {
        opacity: 0;
        pointer-events: none;
        z-index: 0;
    }

    75%,
    100% {
        opacity: 1;
        pointer-events: auto;
        z-index: 10;
    }
}

/* Inner elements animations */
.frame-1 .bg-img {
    transform: scale(1.1);
    animation: zoom-out 3s ease-out 0s both;
}

.frame-2 .bg-img {
    transform: scale(1.05) translate(-2%, 0);
    animation: pan-right 3s ease-out 3s both;
}

.frame-3 .bg-img {
    transform: scale(1.1);
    animation: zoom-out 3s ease-out 6s both;
}

.frame-4 .bg-img {
    transform: scale(1.1);
    animation: zoom-out 3s ease-out 9s both;
}

@keyframes fade-up {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    opacity: 0;
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* specific delays based on timeline */
.frame-1 .fade-up {
    animation-delay: 0.2s;
}

.frame-1 .delay-1 {
    animation-delay: 0.4s;
}

.frame-2 .fade-up {
    animation-delay: 3.2s;
}

.frame-2 .delay-1 {
    animation-delay: 3.4s;
}

.frame-2 .delay-2 {
    animation-delay: 3.6s;
}

.frame-3 .fade-up {
    animation-delay: 6.2s;
}

.frame-3 .delay-1 {
    animation-delay: 6.4s;
}

.frame-3 .delay-2 {
    animation-delay: 6.6s;
}

.frame-4 .fade-up {
    animation-delay: 9.2s;
}

.frame-4 .delay-1 {
    animation-delay: 9.4s;
}

.frame-4 .delay-2 {
    animation-delay: 9.6s;
}

.frame-4 .delay-3 {
    animation-delay: 9.8s;
}

@keyframes zoom-out {
    0% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pan-right {
    0% {
        transform: scale(1.05) translate(-2%, 0);
    }

    100% {
        transform: scale(1.05) translate(2%, 0);
    }
}