/* =========================================================
   BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #08080d;
    --text: #ffffff;
    --muted: #aaa8b9;
    --dim: #6d6a7c;

    --glass: rgba(255,255,255,.055);
    --border: rgba(255,255,255,.105);

    --purple: #b9a5ff;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 30px 20px;

    overflow-x: hidden;

    position: relative;

    background:
        radial-gradient(
            ellipse 70% 45% at 50% -10%,
            rgba(157,135,225,.24),
            transparent 70%
        ),
        radial-gradient(
            ellipse 55% 45% at 100% 100%,
            rgba(106,86,163,.09),
            transparent 70%
        ),
        radial-gradient(
            ellipse 50% 40% at 0% 70%,
            rgba(91,75,135,.07),
            transparent 70%
        ),
        linear-gradient(
            180deg,
            #11101a 0%,
            #0b0b11 45%,
            #07070b 100%
        );
}


/* =========================================================
   BACKGROUND ATMOSPHERE
========================================================= */

body::before {
    content: "";

    position: fixed;

    inset: -30%;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(205,191,255,.055),
            transparent 28%
        ),
        radial-gradient(
            circle at 20% 70%,
            rgba(170,150,240,.035),
            transparent 25%
        ),
        radial-gradient(
            circle at 80% 75%,
            rgba(170,150,240,.035),
            transparent 25%
        );

    animation:
        atmosphereMove
        18s
        ease-in-out
        infinite
        alternate;
}


body::after {
    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    opacity: .32;

    background-image:
        radial-gradient(
            circle,
            rgba(255,255,255,.75) .7px,
            transparent .9px
        );

    background-size: 82px 82px;

    mask-image:
        linear-gradient(
            to bottom,
            black 0%,
            rgba(0,0,0,.65) 40%,
            transparent 88%
        );

    animation:
        starsDrift
        24s
        linear
        infinite;
}

@keyframes atmosphereMove {
    0% {
        transform:
            translate3d(-1%,-1%,0)
            scale(1);
    }

    50% {
        transform:
            translate3d(1%,1%,0)
            scale(1.04);
    }

    100% {
        transform:
            translate3d(-1%,1%,0)
            scale(1.02);
    }
}

@keyframes starsDrift {
    from {
        transform:
            translate3d(0,0,0);
    }

    to {
        transform:
            translate3d(41px,82px,0);
    }
}


/* =========================================================
   MAIN
========================================================= */

.container {
    width: 100%;
    max-width: 520px;

    position: relative;

    z-index: 2;
}


/* =========================================================
   HEADER
========================================================= */

.header {
    text-align: center;

    margin-bottom: 28px;

    animation:
        headerEnter
        1.1s
        cubic-bezier(.16,1,.3,1)
        both;
}

.sparkle {
    position: relative;

    width: 42px;
    height: 42px;

    margin: 0 auto 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 25px;

    color: #fff;

    text-shadow:
        0 0 8px rgba(255,255,255,.75),
        0 0 25px rgba(185,165,255,.65),
        0 0 55px rgba(185,165,255,.3);

    animation:
        sparkleFloat
        3.6s
        ease-in-out
        infinite;
}

.sparkle::before {
    content: "";

    position: absolute;

    inset: 6px;

    border-radius: 50%;

    border: 1px solid rgba(255,255,255,.10);

    animation:
        sparkleRing
        3s
        ease-in-out
        infinite;
}

.sparkle::after {
    content: "";

    position: absolute;

    inset: -7px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(185,165,255,.12),
            transparent 70%
        );

    filter: blur(7px);

    pointer-events: none;
}

h1 {
    margin: 0;

    font-size: 30px;
    line-height: 1.15;

    font-weight: 700;

    letter-spacing: -.8px;

    text-shadow:
        0 3px 25px rgba(0,0,0,.35);

    animation:
        titleReveal
        1s
        .08s
        cubic-bezier(.16,1,.3,1)
        both;
}

.header p {
    margin: 11px 0 0;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.5;

    animation:
        subtitleReveal
        .9s
        .2s
        cubic-bezier(.16,1,.3,1)
        both;
}


/* =========================================================
   CARD
========================================================= */

.card {
    position: relative;

    padding: 22px;

    border-radius: 25px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.075),
            rgba(255,255,255,.035) 45%,
            rgba(255,255,255,.025)
        );

    border:
        1px solid var(--border);

    backdrop-filter:
        blur(25px)
        saturate(120%);

    -webkit-backdrop-filter:
        blur(25px)
        saturate(120%);

    box-shadow:
        0 30px 90px rgba(0,0,0,.48),
        0 8px 30px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.075),
        inset 0 -1px 0 rgba(0,0,0,.15);

    overflow: hidden;

    transition:
        transform .7s cubic-bezier(.16,1,.3,1),
        box-shadow .7s ease,
        border-color .7s ease;
}


/* top reflection */

.card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 8%;

    width: 84%;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.24),
            transparent
        );

    pointer-events: none;
}


/* ambient glow */

.card::after {
    content: "";

    position: absolute;

    width: 330px;
    height: 230px;

    top: -190px;
    left: 50%;

    transform: translateX(-50%);

    background:
        radial-gradient(
            circle,
            rgba(185,165,255,.20),
            transparent 68%
        );

    filter: blur(35px);

    pointer-events: none;
}


/* =========================================================
   CODE SCREEN
========================================================= */

#codeScreen {
    position: relative;

    z-index: 2;

    animation:
        codeEnter
        .9s
        .15s
        cubic-bezier(.16,1,.3,1)
        both;
}

.input-area {
    display: flex;

    gap: 10px;
}

input {
    flex: 1;

    min-width: 0;

    padding: 14px 16px;

    border-radius: 13px;

    border:
        1px solid rgba(255,255,255,.095);

    background:
        rgba(0,0,0,.24);

    color: white;

    font-family: inherit;
    font-size: 15px;

    outline: none;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.025);

    transition:
        border-color .3s ease,
        box-shadow .3s ease,
        background .3s ease,
        transform .3s ease;
}

input::placeholder {
    color: #777487;
}

input:hover {
    border-color:
        rgba(255,255,255,.16);
}

input:focus {
    border-color:
        rgba(190,175,255,.62);

    background:
        rgba(0,0,0,.32);

    box-shadow:
        0 0 0 4px rgba(170,145,255,.075),
        0 0 28px rgba(170,145,255,.10),
        inset 0 1px 1px rgba(255,255,255,.035);

    transform:
        translateY(-1px);
}


/* =========================================================
   UNLOCK BUTTON
========================================================= */

#unlockBtn {
    position: relative;

    padding: 0 22px;

    border: none;

    border-radius: 13px;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #eeeeef
        );

    color: #101014;

    font-family: inherit;

    font-weight: 650;

    font-size: 14px;

    cursor: pointer;

    overflow: hidden;

    box-shadow:
        0 7px 22px rgba(255,255,255,.075),
        inset 0 1px 0 rgba(255,255,255,.8);

    transition:
        transform .25s cubic-bezier(.16,1,.3,1),
        box-shadow .25s ease,
        filter .25s ease;
}

#unlockBtn::before {
    content: "";

    position: absolute;

    top: -30%;
    left: -80%;

    width: 55%;
    height: 160%;

    background:
        linear-gradient(
            100deg,
            transparent,
            rgba(255,255,255,.75),
            transparent
        );

    transform: skewX(-18deg);

    transition:
        left .6s ease;
}

#unlockBtn:hover {
    transform:
        translateY(-2px);

    filter:
        brightness(1.025);

    box-shadow:
        0 10px 30px rgba(255,255,255,.14),
        0 0 25px rgba(185,165,255,.07),
        inset 0 1px 0 rgba(255,255,255,.8);
}

#unlockBtn:hover::before {
    left: 150%;
}

#unlockBtn:active {
    transform:
        scale(.965);
}


/* =========================================================
   ERROR
========================================================= */

.error {
    display: none;

    margin: 12px 2px 0;

    color: #ff9eae;

    font-size: 13px;

    animation:
        errorShake
        .38s
        cubic-bezier(.36,.07,.19,.97);
}


/* =========================================================
   PHOTO SCREEN
========================================================= */

#photoScreen {
    display: none;

    position: relative;

    z-index: 2;
}

#photoScreen.show {
    display: block;

    animation:
        screenReveal
        .9s
        cubic-bezier(.16,1,.3,1)
        both;
}


/* =========================================================
   PHOTO
========================================================= */

.photo-wrapper {
    position: relative;

    overflow: hidden;

    border-radius: 18px;

    background: #07070b;

    border:
        1px solid rgba(255,255,255,.10);

    box-shadow:
        0 24px 65px rgba(0,0,0,.48),
        0 4px 18px rgba(0,0,0,.28),
        0 0 0 1px rgba(255,255,255,.018);

    opacity: 0;

    transform:
        translateY(30px)
        scale(.86)
        rotate(-.7deg);

    animation:
        photoReveal
        1.15s
        .08s
        cubic-bezier(.16,1,.3,1)
        forwards;
}


/* photo halo */

.photo-wrapper::before {
    content: "";

    position: absolute;

    inset: -50px;

    background:
        radial-gradient(
            circle,
            rgba(190,170,255,.28),
            transparent 66%
        );

    filter:
        blur(28px);

    z-index: -1;
}


/* photo shine */

.photo-wrapper::after {
    content: "";

    position: absolute;

    top: -20%;
    bottom: -20%;

    left: -100%;

    width: 42%;

    background:
        linear-gradient(
            100deg,
            transparent 0%,
            rgba(255,255,255,.04) 35%,
            rgba(255,255,255,.27) 50%,
            rgba(255,255,255,.04) 65%,
            transparent 100%
        );

    transform:
        skewX(-17deg);

    pointer-events: none;

    animation:
        photoShine
        1.3s
        .65s
        cubic-bezier(.2,.7,.3,1)
        forwards;
}

.photo-wrapper img {
    display: block;

    width: 100%;
    height: auto;

    max-height: 65vh;

    object-fit: contain;

    transition:
        transform .8s cubic-bezier(.16,1,.3,1),
        filter .8s ease;
}

.photo-wrapper:hover img {
    transform:
        scale(1.012);
}


/* =========================================================
   PERSONAL NOTE
========================================================= */

.personal-note {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 17px 5px 0;

    opacity: 0;

    transform:
        translateY(9px);

    animation:
        noteReveal
        .7s
        .48s
        cubic-bezier(.16,1,.3,1)
        forwards;
}

.personal-note p {
    margin: 0;

    flex: 1;

    text-align: center;

    color: #bcb8ca;

    font-size: 13px;

    line-height: 1.5;

    font-style: italic;

    letter-spacing: .05px;
}

.note-line {
    flex: 1;

    height: 1px;

    background:
        linear-gradient(
            to right,
            transparent,
            rgba(255,255,255,.13)
        );
}

.note-line:last-child {
    background:
        linear-gradient(
            to left,
            transparent,
            rgba(255,255,255,.13)
        );
}


/* =========================================================
   ACTION BUTTONS
========================================================= */

.actions {
    display: flex;

    gap: 10px;

    margin-top: 15px;

    opacity: 0;

    transform:
        translateY(14px);

    animation:
        actionsReveal
        .7s
        .62s
        cubic-bezier(.16,1,.3,1)
        forwards;
}

.action-btn {
    position: relative;

    flex: 1;

    padding: 13px;

    border-radius: 12px;

    border:
        1px solid transparent;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #eeeeef
        );

    color: #111116;

    font-family: inherit;

    font-weight: 600;

    font-size: 14px;

    cursor: pointer;

    box-shadow:
        0 6px 20px rgba(0,0,0,.18),
        inset 0 1px 0 rgba(255,255,255,.8);

    transition:
        transform .25s cubic-bezier(.16,1,.3,1),
        box-shadow .25s ease,
        filter .25s ease;
}

.action-btn:hover {
    transform:
        translateY(-2px);

    filter:
        brightness(1.025);

    box-shadow:
        0 10px 28px rgba(255,255,255,.11),
        0 4px 15px rgba(0,0,0,.22);
}

.action-btn:active {
    transform:
        scale(.97);
}

.action-btn.secondary {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.095),
            rgba(255,255,255,.055)
        );

    color: white;

    border:
        1px solid rgba(255,255,255,.11);

    box-shadow:
        0 6px 20px rgba(0,0,0,.16),
        inset 0 1px 0 rgba(255,255,255,.055);
}

.action-btn.secondary:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.13),
            rgba(255,255,255,.07)
        );
}


/* =========================================================
   STATUS
========================================================= */

.status {
    min-height: 16px;

    margin: 9px 0 0;

    text-align: center;

    color: #9995aa;

    font-size: 12px;

    animation:
        fadeIn
        .4s
        ease
        both;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
    text-align: center;

    margin-top: 23px;

    color: #686577;

    font-size: 12px;

    letter-spacing: .1px;

    animation:
        fadeIn
        1s
        .55s
        ease
        both;
}

footer::before {
    content: "";

    display: block;

    width: 34px;
    height: 1px;

    margin:
        0 auto 12px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.12),
            transparent
        );
}


/* =========================================================
   CONFETTI
========================================================= */

#confetti-container {
    position: fixed;

    inset: 0;

    pointer-events: none;

    overflow: hidden;

    z-index: 20;
}

.confetti {
    position: absolute;

    top: -20px;

    width: 7px;
    height: 11px;

    opacity: 0;

    filter:
        drop-shadow(
            0 0 4px
            rgba(255,255,255,.15)
        );

    animation:
        confettiFall
        var(--duration)
        cubic-bezier(.15,.7,.3,1)
        var(--delay)
        forwards;
}


/* =========================================================
   CARD REVEAL
========================================================= */

.card.reveal {
    animation:
        cardReveal
        .9s
        cubic-bezier(.16,1,.3,1);

    border-color:
        rgba(205,190,255,.27);

    box-shadow:
        0 30px 100px rgba(0,0,0,.52),
        0 0 55px rgba(170,145,255,.13),
        0 0 120px rgba(170,145,255,.045),
        inset 0 1px 0 rgba(255,255,255,.09);
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes headerEnter {
    from {
        opacity: 0;

        transform:
            translateY(-24px)
            scale(.97);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes titleReveal {
    from {
        opacity: 0;

        transform:
            translateY(10px)
            scale(.98);

        filter:
            blur(4px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);

        filter:
            blur(0);
    }
}

@keyframes subtitleReveal {
    from {
        opacity: 0;

        transform:
            translateY(8px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes codeEnter {
    from {
        opacity: 0;

        transform:
            translateY(14px)
            scale(.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes sparkleFloat {
    0%,
    100% {
        transform:
            translateY(0)
            rotate(0deg)
            scale(1);
    }

    50% {
        transform:
            translateY(-6px)
            rotate(8deg)
            scale(1.12);
    }
}

@keyframes sparkleRing {
    0%,
    100% {
        opacity: .15;

        transform:
            scale(.9);
    }

    50% {
        opacity: .45;

        transform:
            scale(1.08);
    }
}

@keyframes screenReveal {
    from {
        opacity: 0;

        transform:
            scale(.96)
            translateY(6px);
    }

    to {
        opacity: 1;

        transform:
            scale(1)
            translateY(0);
    }
}

@keyframes photoReveal {
    0% {
        opacity: 0;

        transform:
            translateY(30px)
            scale(.86)
            rotate(-.7deg);

        filter:
            brightness(.65)
            blur(3px);
    }

    45% {
        opacity: 1;
    }

    68% {
        transform:
            translateY(-3px)
            scale(1.018)
            rotate(.25deg);

        filter:
            brightness(1.03)
            blur(0);
    }

    82% {
        transform:
            translateY(1px)
            scale(.997)
            rotate(-.08deg);
    }

    100% {
        opacity: 1;

        transform:
            translateY(0)
            scale(1)
            rotate(0);

        filter:
            brightness(1)
            blur(0);
    }
}

@keyframes photoShine {
    from {
        left: -100%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        left: 170%;
        opacity: 0;
    }
}

@keyframes noteReveal {
    from {
        opacity: 0;

        transform:
            translateY(9px)
            scale(.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes actionsReveal {
    from {
        opacity: 0;

        transform:
            translateY(14px)
            scale(.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes errorShake {
    0%,
    100% {
        transform:
            translateX(0);
    }

    20% {
        transform:
            translateX(-6px);
    }

    40% {
        transform:
            translateX(5px);
    }

    60% {
        transform:
            translateX(-4px);
    }

    80% {
        transform:
            translateX(3px);
    }
}

@keyframes confettiFall {
    0% {
        opacity: 1;

        transform:
            translate3d(0,-20px,0)
            rotate(0deg)
            scale(1);
    }

    15% {
        opacity: 1;
    }

    100% {
        opacity: 0;

        transform:
            translate3d(var(--x),105vh,0)
            rotate(var(--rotation))
            scale(.7);
    }
}

@keyframes cardReveal {
    0% {
        transform:
            scale(1)
            translateY(0);
    }

    28% {
        transform:
            scale(1.035)
            translateY(-3px);
    }

    55% {
        transform:
            scale(.994)
            translateY(1px);
    }

    78% {
        transform:
            scale(1.008)
            translateY(-1px);
    }

    100% {
        transform:
            scale(1)
            translateY(0);
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 480px) {

    body {
        padding:
            20px 15px;

        align-items: center;
    }

    .container {
        max-width: 100%;
    }

    .header {
        margin-bottom: 22px;
    }

    .sparkle {
        margin-bottom: 9px;

        transform:
            scale(.9);
    }

    h1 {
        font-size: 25px;

        letter-spacing:
            -.55px;
    }

    .header p {
        margin-top: 9px;

        font-size: 14px;
    }

    .card {
        padding: 17px;

        border-radius: 21px;
    }

    .input-area {
        flex-direction: column;
    }

    input {
        padding: 14px;
    }

    #unlockBtn {
        min-height: 46px;

        padding: 13px;
    }

    .photo-wrapper {
        border-radius: 15px;
    }

    .personal-note {
        margin-top: 15px;

        gap: 9px;
    }

    .personal-note p {
        font-size: 12px;
    }

    .actions {
        flex-direction: column;

        gap: 8px;
    }

    .action-btn {
        min-height: 45px;
    }

    footer {
        margin-top: 19px;
    }
}


/* =========================================================
   VERY SMALL SCREENS
========================================================= */

@media (max-width: 350px) {

    body {
        padding:
            16px 11px;
    }

    h1 {
        font-size: 23px;
    }

    .card {
        padding: 14px;
    }

    .personal-note p {
        font-size: 11.5px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;

        animation-iteration-count:
            1 !important;

        scroll-behavior:
            auto !important;
    }
}