/* =====================================================
   TERY: COLLAPSE
   ORIENTATION SCREEN
   V2
===================================================== */


/* =====================================================
   OVERLAY
===================================================== */

#tery-orientation-overlay {
    position: fixed;
    inset: 0;

    z-index: 9999999;

    display: none;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    min-height: 100dvh;

    padding:
        max(18px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(18px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));

    background:
        radial-gradient(
            circle at 50% 30%,
            #222a2b 0%,
            #121718 52%,
            #080b0c 100%
        );

    color: #e5e5df;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: none;

    touch-action: pan-y;

    -webkit-overflow-scrolling: touch;
}


/* =====================================================
   PORTRAIT
===================================================== */

@media (orientation: portrait) {

    #tery-orientation-overlay {
        display: flex !important;
    }

}


/* =====================================================
   LANDSCAPE
===================================================== */

@media (orientation: landscape) {

    #tery-orientation-overlay {
        display: none !important;
    }

}


/* =====================================================
   CONTENT
===================================================== */

.tery-orientation-content {
    width: min(400px, 92vw);

    max-width: 100%;

    margin: auto;

    display: flex;
    flex-direction: column;

    align-items: center;

    text-align: center;
}


/* =====================================================
   BRAND
===================================================== */

.tery-orientation-brand {
    margin-bottom: 14px;

    font-size: 23px;

    font-weight: 900;

    letter-spacing: 1.4px;

    color: #d87522;

    text-shadow:
        0 2px 0 #000;
}


.tery-orientation-brand span {
    color: #deded7;
}


/* =====================================================
   PHONE AREA
===================================================== */

.tery-orientation-phone {
    width: 210px;
    height: 135px;

    flex-shrink: 0;

    margin-bottom: 10px;

    display: flex;

    align-items: center;
    justify-content: center;
}


.tery-phone-animation {
    position: relative;

    width: 180px;
    height: 130px;

    display: flex;

    align-items: center;
    justify-content: center;
}


/* =====================================================
   PHONE
===================================================== */

.tery-phone-device {
    position: absolute;

    width: 56px;
    height: 100px;

    padding:
        7px
        5px
        6px;

    border:
        3px solid #d0d3d2;

    border-radius: 11px;

    background:
        linear-gradient(
            180deg,
            #242b2c,
            #151a1b
        );

    box-shadow:
        0 8px 22px
        rgba(0, 0, 0, .45);

    transform-origin:
        center center;

    animation:
        teryPhoneTurn
        2.8s
        ease-in-out
        infinite;
}


/* =====================================================
   SPEAKER
===================================================== */

.tery-phone-speaker {
    width: 16px;
    height: 3px;

    margin:
        0 auto 5px;

    border-radius: 3px;

    background: #777e7f;
}


/* =====================================================
   SCREEN
===================================================== */

.tery-phone-screen {
    width: 100%;

    height:
        calc(100% - 8px);

    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 6px;

    padding: 8px;

    border:
        1px solid #3c4547;

    border-radius: 5px;

    background:
        radial-gradient(
            circle at center,
            #263033,
            #111617
        );

    overflow: hidden;
}


.tery-phone-screen-line {
    width: 100%;
    height: 5px;

    border-radius: 4px;

    background: #d87522;

    opacity: .78;
}


.tery-phone-screen-line.short {
    width: 65%;

    align-self: center;

    background: #778082;
}


/* =====================================================
   ARROW
===================================================== */

.tery-phone-arrow {
    position: absolute;

    right: 3px;
    top: 36px;

    color: #f19a37;

    font-size: 42px;

    font-weight: 700;

    line-height: 1;

    text-shadow:
        0 0 14px
        rgba(241, 154, 55, .28);

    animation:
        teryArrowMove
        2.8s
        ease-in-out
        infinite;
}


/* =====================================================
   PHONE ROTATION
===================================================== */

@keyframes teryPhoneTurn {

    0% {
        transform:
            rotate(0deg)
            scale(1);
    }

    22% {
        transform:
            rotate(0deg)
            scale(1);
    }

    55% {
        transform:
            rotate(90deg)
            scale(1.04);
    }

    80% {
        transform:
            rotate(90deg)
            scale(1.04);
    }

    100% {
        transform:
            rotate(0deg)
            scale(1);
    }

}


/* =====================================================
   ARROW ANIMATION
===================================================== */

@keyframes teryArrowMove {

    0% {
        opacity: 0;

        transform:
            rotate(-35deg)
            scale(.78);
    }

    15% {
        opacity: .35;
    }

    35% {
        opacity: 1;

        transform:
            rotate(10deg)
            scale(1);
    }

    55% {
        opacity: 1;

        transform:
            rotate(80deg)
            scale(1.08);
    }

    75% {
        opacity: .25;

        transform:
            rotate(105deg)
            scale(.9);
    }

    100% {
        opacity: 0;

        transform:
            rotate(105deg)
            scale(.78);
    }

}


/* =====================================================
   TITLE
===================================================== */

.tery-orientation-title {
    margin-bottom: 6px;

    color: #f19a37;

    font-size: 21px;

    font-weight: 900;
}


/* =====================================================
   TEXT
===================================================== */

.tery-orientation-text {
    max-width: 320px;

    margin-bottom: 15px;

    color: #a4aaaa;

    font-size: 12px;

    line-height: 1.4;
}


/* =====================================================
   STEPS
===================================================== */

.tery-orientation-steps {
    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 6px;
}


.tery-orientation-step {
    min-height: 44px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding:
        7px
        10px;

    border:
        1px solid #394246;

    border-radius: 5px;

    background:
        linear-gradient(
            180deg,
            #202728,
            #14191a
        );

    text-align: left;
}


.tery-step-number {
    width: 27px;
    height: 27px;

    flex:
        0 0 27px;

    display: grid;

    place-items: center;

    border:
        1px solid #9a5a22;

    border-radius: 50%;

    background: #352316;

    color: #f19a37;

    font-size: 12px;

    font-weight: 900;
}


.tery-step-text {
    color: #d1d4d4;

    font-size: 11px;

    line-height: 1.3;
}


.tery-step-text strong {
    color: #f19a37;
}


/* =====================================================
   AUTOROTATE BUTTON EXAMPLE
===================================================== */

.tery-auto-rotate-example {
    min-width: 116px;

    margin-top: 13px;

    padding:
        8px
        15px;

    border:
        2px solid #d87522;

    border-radius: 9px;

    background:
        linear-gradient(
            180deg,
            #343b3c,
            #202627
        );

    color: #e6e6df;

    font-size: 10px;

    font-weight: 700;

    box-shadow:
        0 0 18px
        rgba(216, 117, 34, .15);
}


.tery-auto-rotate-icon {
    margin-bottom: 2px;

    color: #f19a37;

    font-size: 25px;

    line-height: 1;
}


/* =====================================================
   HINT
===================================================== */

.tery-orientation-hint {
    margin-top: 11px;

    color: #737b7c;

    font-size: 9px;

    line-height: 1.35;
}


/* =====================================================
   SMALL ANDROID / SMALL PORTRAIT
===================================================== */

@media
    (orientation: portrait)
    and
    (max-height: 760px) {

    #tery-orientation-overlay {
        align-items: flex-start;

        padding-top:
            max(
                12px,
                env(safe-area-inset-top)
            );

        padding-bottom:
            max(
                12px,
                env(safe-area-inset-bottom)
            );
    }


    .tery-orientation-content {
        width:
            min(
                380px,
                92vw
            );
    }


    .tery-orientation-brand {
        margin-bottom: 7px;

        font-size: 20px;
    }


    .tery-orientation-phone {
        width: 180px;
        height: 100px;

        margin-bottom: 4px;
    }


    .tery-phone-animation {
        width: 170px;
        height: 110px;

        transform:
            scale(.78);
    }


    .tery-orientation-title {
        font-size: 18px;
    }


    .tery-orientation-text {
        margin-bottom: 8px;

        font-size: 10px;
    }


    .tery-orientation-steps {
        gap: 4px;
    }


    .tery-orientation-step {
        min-height: 38px;

        padding:
            5px
            8px;
    }


    .tery-step-number {
        width: 24px;
        height: 24px;

        flex-basis: 24px;

        font-size: 11px;
    }


    .tery-step-text {
        font-size: 10px;
    }


    .tery-auto-rotate-example {
        margin-top: 7px;

        padding:
            6px
            12px;
    }


    .tery-auto-rotate-icon {
        font-size: 21px;
    }


    .tery-orientation-hint {
        margin-top: 6px;

        font-size: 8px;
    }

}


/* =====================================================
   VERY SMALL PORTRAIT
===================================================== */

@media
    (orientation: portrait)
    and
    (max-height: 620px) {

    .tery-orientation-brand {
        display: none;
    }


    .tery-orientation-phone {
        height: 88px;
    }


    .tery-phone-animation {
        transform:
            scale(.68);
    }


    .tery-orientation-title {
        font-size: 17px;
    }


    .tery-orientation-text {
        max-width: 280px;
    }


    .tery-orientation-step {
        min-height: 34px;
    }


    .tery-auto-rotate-example {
        margin-top: 5px;
    }

}


/* =====================================================
   REDUCED MOTION
===================================================== */

@media
    (prefers-reduced-motion: reduce) {

    .tery-phone-device,
    .tery-phone-arrow {
        animation: none;
    }


    .tery-phone-device {
        transform:
            rotate(90deg);
    }


    .tery-phone-arrow {
        opacity: 1;

        transform:
            rotate(80deg);
    }

}