@import url("style.css");

body {
    align-items: center;
}

main {
    display: grid;
    gap: 18px;
}

#nickname {
    margin: 0;
    padding-block: 6px;
    margin-bottom: 14px;
    background: 0;
    outline-width: 1px;
    outline-color: var(--border-color);
    box-shadow: 0px 0px 10px var(--shadow);
}
#nickname:hover{
    outline-color: var(--border-hover);
}

#info {
    grid-template-rows: auto;
    margin-bottom: 0;
}

#pfp { grid-row: auto; }
.links { min-height: 180px; }
.link { min-height: 180px; }

.tetoring {
    grid-column: 1 / -1;
    height: auto;
    margin: 0;
}

#blinks {
    display: flex;
    position: fixed;
    bottom: 12px;
    gap: 10px;
}


.\38 8x31 {
    display: flex;
    image-rendering: pixelated;
    height: 31px;
    width: 88px;
}
.\38 8x31:hover{
    cursor: pointer;
}


#video-wrapper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -100;
}

#background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
}

/*body:has(.prev:hover) *:not(main, html, body, .tetoring, .prev, .next, .ring, #info, #background, #video-wrapper){
    filter: blur(2px);
}
body:has(.next:hover) *:not(main, html, body, .tetoring, .prev, .next, .ring, #info, #background, #video-wrapper){
    filter: blur(2px);
}*/

@media (max-width: 760px) {
    .links { min-height: 190px; }
    .link { min-height: 90px; }
}

@media (max-width: 520px) {
    body { align-items: start; }
    main { gap: 12px; }

    #info {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    #pfp {
        width: min(160px, 45vw);
        height: min(160px, 45vw);
    }

    .links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: 0;
    }

    .link { min-height: 90px; }
    .tetoring { grid-column: auto; }
    .\38 8x31 { position: static; margin-bottom: 12px;}
}

@media (max-width: 380px) {
    .links { grid-template-columns: 1fr; }
}

.eyes-pop {
    position: fixed;
    z-index: 30;
    pointer-events: none;
    user-select: none;
    translate: -50% -50%;
    font-size: var(--size, 2rem);
    animation: eyes-fall var(--dur, 1.3s) forwards;
}

.eyes-pop img {
    display: block;
    width: 1em;
    height: 1em;
    object-fit: contain;
}

@keyframes eyes-fall {
    0% {
        opacity: 1;
        animation-timing-function: ease-out;
        transform: translate(0) rotate(0);
    }
    22% {
        opacity: 1;
        animation-timing-function: cubic-bezier(.5, 0, .85, .5);
        transform: translate(calc(var(--drift) * .25), var(--hop)) rotate(calc(var(--rot) * .2));
    }
    to {
        opacity: 0;
        transform: translate(var(--drift), 110vh) rotate(var(--rot));
    }
}

@media (prefers-reduced-motion: reduce) {
    .eyes-pop {
        display: none;
        animation: none;
    }
}


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

.video-controls {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 20;
    width: min(300px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: rgba(23, 18, 38, .58);
    box-shadow: 0 0 10px var(--shadow);
    backdrop-filter: blur(10px) saturate(120%);
    color: var(--text-color);
    font-size: clamp(14px, 1.25vw, 18px);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.video-controls:hover,
.video-controls:focus-within {
    border-color: var(--border-hover);
    background: rgba(23, 18, 38, .72);
    box-shadow: 0 0 30px var(--shadow);
}

.video-controls__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px 12px 18px;
}

.video-controls__eyebrow {
    color: var(--text-muted);
    font-size: .72em;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.video-controls__title {
    font-size: 1em;
    line-height: 1.2;
}

.video-controls__toggle,
.video-button,
.icon-button {
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease;
}

.video-controls__toggle {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: rgba(13, 11, 20, .48);
}

.video-controls__toggle-icon {
    width: 9px;
    height: 9px;
    border-left: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: translateY(2px) rotate(45deg);
    transition: transform .2s ease;
}

.video-controls.is-collapsed .video-controls__toggle-icon {
    transform: translateY(-2px) rotate(225deg);
}

.video-controls__panel {
    display: grid;
    gap: 12px;
    max-height: 260px;
    padding: 0 14px 14px;
    opacity: 1;
    transition: max-height .25s ease, padding .25s ease, opacity .15s ease;
}

.video-controls.is-collapsed .video-controls__panel {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.video-control {
    display: grid;
    gap: 7px;
    color: var(--text-color);
    font-weight: 700;
}

.video-control > span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.video-control output {
    color: var(--text-muted);
    font-weight: 400;
}

.video-control input {
    width: 100%;
}

.video-control input[type="range"] {
    --range-progress: 50%;
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 999px;
    outline: 0;
    background: linear-gradient(
        90deg,
        var(--accent-hover) 0 var(--range-progress),
        rgba(243, 240, 255, .18) var(--range-progress) 100%
    );
    /* box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .05); */
    cursor: pointer;
}

.video-control input[type="range"]::-webkit-slider-thumb {
    width: 17px;
    height: 17px;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    background: var(--accent-hover);
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, .38), 0 0 0 3px rgba(217, 70, 239, .18); */
    transition: transform .15s ease, box-shadow .15s ease;
}

.video-control input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    background: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .38), 0 0 0 3px rgba(217, 70, 239, .18);
    transition: transform .15s ease, box-shadow .15s ease;
}

.video-control input[type="range"]:hover::-webkit-slider-thumb,
.video-control input[type="range"]:focus-visible::-webkit-slider-thumb {
    transform: scale(1.14);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .38), 0 0 0 5px rgba(217, 70, 239, .22);
}

.video-control input[type="range"]:hover::-moz-range-thumb,
.video-control input[type="range"]:focus-visible::-moz-range-thumb {
    transform: scale(1.14);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .38), 0 0 0 5px rgba(217, 70, 239, .22);
}

.video-buttons,
.range-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.video-button {
    flex: 1;
    min-height: 36px;
    border-radius: 12px;
    background: rgba(13, 11, 20, .48);
    font-weight: 700;
}

.icon-button {
    flex: 0 0 42px;
    min-height: 36px;
    padding: 0;
    border-radius: 12px;
    background: rgba(13, 11, 20, .48);
    font-size: 1rem;
}

.video-controls__toggle:hover,
.video-button:hover,
.icon-button:hover,
.video-button.is-active {
    border-color: var(--accent-hover);
    background: rgba(217, 70, 239, .2);
}

.video-controls__toggle:hover,
.video-button:hover,
.icon-button:hover { transform: translateY(-1px); }
.video-button.is-active { color: #fff; }

.video-controls__toggle:focus-visible,
.video-button:focus-visible,
.icon-button:focus-visible,
.video-control input:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 2px;
}

.range-with-button input { min-width: 0; }

@media (max-width: 760px) {
    body {
        align-items: start;
        row-gap: 12px;
    }

    /* На узких экранах панель участвует в потоке страницы, а не перекрывает контент. */
    .video-controls {
        position: static;
        width: min(420px, calc(100vw - 24px));
        margin: 12px auto 0;
    }

    main {
        padding-top: 0;
        padding-bottom: 12px;
    }

    #blinks {
        position: static;
        margin-bottom: 12px;
    }
}

@media (max-width: 520px) {
    .video-controls {
        width: calc(100vw - 20px);
        max-width: none;
        border-radius: 20px;
    }

    .video-controls__header {
        min-height: 58px;
        padding: 10px 12px 10px 16px;
    }

    .video-controls__panel { gap: 10px; }
    .video-button { min-height: 40px; }
    .icon-button { min-height: 40px; }
}

@media (max-width: 350px) {
    .video-controls__header { gap: 8px; }
    .video-controls__title { font-size: .94em; }
    .video-controls__panel { padding-inline: 12px; }
    .video-buttons { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .video-controls,
    .video-controls__toggle-icon,
    .video-controls__panel,
    .video-controls__toggle,
    .video-button,
    .icon-button {
        transition: none;
    }
}

/* Анимация первого появления страницы. */
.video-controls,
#nickname,
#info,
#blinks {
    animation: page-enter .55s cubic-bezier(.22, .8, .28, 1) both;
}

.video-controls { animation-delay: .08s; }
#nickname { animation-delay: .16s; }
#info { animation-delay: .26s; }
#blinks { animation-delay: .38s; }

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-controls,
    #nickname,
    #info,
    #blinks {
        animation: none;
    }
}
