@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/*light and dark mode themes and colours*/
:root {
    --sat: env(safe-area-inset-top);
    --sar: env(safe-area-inset-right);
    --sab: env(safe-area-inset-bottom);
    --sal: env(safe-area-inset-left);

    --accent-color: #fa5252;
    --highlight-color: rgba(255, 50, 60, 0.8);

    --maxwidth: 180vh;
}

:root,
:root.light {
    --text-color: #161616;
    --bg-color: #fff;
    --link-hover-color: rgba(255, 50, 60, 0.4);
    --scrollbar-color: rgba(0, 0, 0, 0.25);

    --nav-color: #ffffffA5;

    --settings-shadow: 0 0 1rem #0f0f0f;

    --button-background: #f0f0f0;
    --button-border: 1px solid rgba(100, 100, 100, 0.2);
    --button-outline: 2px solid rgba(0, 0, 0, 0.5);

    --SNS-color-date: rgba(0, 0, 0, 0.75);
    --SNS-color-extra: #000000A5;
    --SNS-border: 1px solid rgba(0, 0, 0, 0.4);

    --ambient-canvas-opacity: 0;
    --ambient-saturation: 0;
}

:root.dark {
    --text-color: rgba(255, 255, 255, 0.9);
    --bg-color: #0a0a0a;
    --link-hover-color: rgba(255, 255, 255, 0.9);
    --scrollbar-color: rgba(255, 255, 255, 0.25);

    --nav-color: rgba(0, 0, 0, 0.6);

    --settings-shadow: 0 0 1rem #e9e9e986;

    --button-background: rgba(0, 0, 0, 0.4);
    --button-border: 1px solid rgba(255, 255, 255, 0.2);
    --button-outline: 2px solid rgba(255, 255, 255, 0.5);

    --SNS-color-date: rgba(255, 255, 255, 0.75);
    --SNS-color-extra: #ffffffA5;
    --SNS-background: rgba(0, 0, 0, 0.2);
    --SNS-border: 1px solid rgba(255, 255, 255, 0.2);

    --ambient-canvas-opacity: 0.8;
    --ambient-saturation: 1.5;
}

:root {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

::-webkit-scrollbar {
    width: 14px;
    height: 14px;
    display: block;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 20px;
    border: 4px solid transparent;
    background-clip: content-box;
}

/*body and text*/
/*adjust mobile text inflation*/
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media screen and (orientation:landscape) {
    html {
        -webkit-text-size-adjust: 85%;
        text-size-adjust: 85%;
    }
}

body {
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    word-wrap: break-word;
    overflow-x: hidden;
}

@supports(padding: max(0px)) {
    body {
        padding-left: max(0, env(safe-area-inset-left));
        padding-right: max(0, env(safe-area-inset-right));
        padding-bottom: max(0, env(safe-area-inset-bottom));
    }
}

.main {
    padding: 25px;
    margin: 0 auto;
    margin-top: 30px;
    max-width: var(--maxwidth);
    display: flex;
    flex-direction: row;
    justify-content: center;
}

/*nav*/
.navigationBar {
    position: fixed;
    top: 0;
    height: 50px;
    width: 100%;
    display: block;
    background-color: rgba(0, 0, 0, 0);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1;
    display: flex;
}

.navigationBar.solid {
    background-color: var(--nav-color);
}

.navigationRight {
    justify-content: flex-end
}

.navText {
    padding: 15px 15px 30px 30px;
}

#settingsBox {
    position: fixed;
    left: 50%;
    top: 47%;
    transform: translate(-50%, -50%) scale(1);
    max-height: 80%;
    width: 80%;
    max-width: 600px;
    padding: 15px;
    background-color: var(--nav-color);
    border-radius: 15px;
    z-index: 10;
    box-shadow: var(--settings-shadow);
    animation: boxPopUp 0.15s cubic-bezier(0.22, 0.61, 0.36, 1);
    overflow-y: auto;
    transition: color 0.2s ease-out;
    transition: background-color 0.2s ease-out;
}

.backgroundBlur {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    background-color: var(--nav-color);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: fadeIn .13s ease-in-out;
}

.settingsTitle {
    font-weight: 600;
    text-align: center;
}

.settingSubheading {
    font-weight: 600;
    margin-top: 10px;
}

.settingsCloseButton {
    position: absolute;
    float: right;
    top: 15px;
    right: 15px;
}

.settingsExtraInfo {
    font-weight: normal;
    color: var(--SNS-color-extra);
}

.settingsOption {
    float: right;
    margin-left: 50px;
}

.hideSettings {
    animation: boxClose 0.1s ease-in-out !important;
    opacity: 0;
    visibility: hidden;
}

@keyframes boxPopUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95)
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes BGBlurOn {
    0% {
        opacity: 0;
        transform: scale(0.95)
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes boxClose {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        visibility: visible;
    }

    99% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
        visibility: visible;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
        visibility: hidden;
    }
}

.mainVideo {
    border-radius: 15px;
    backdrop-filter: grayscale(0);
}

.videoArea {
    max-width: 70%;
    overflow: hidden;
}

.sideBar {
    min-width: 250px;
    width: 100%;
    max-width: calc(100px + 15vw);
    /* height: 40vw; */
    max-height: 75vh;
    padding-left: 1em;
    overflow-y: scroll;

    --mask: linear-gradient(to bottom,
            rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) 95%,
            rgba(0, 0, 0, 0) 100%, rgba(0, 0, 0, 0) 0) 100%;
    -webkit-mask: var(--mask);
    mask: var(--mask);
}

#commentsBox {
    max-width: calc(100px + 15vw);
}

@media screen and (max-width: 950px) {
    .main {
        padding: 0;
        display: block;
    }

    .mainVideo {
        border-radius: 0;
    }

    .videoArea {
        max-width: 100%;
        padding-top: 20px;
    }

    .underVideoStats {
        padding: 5px 15px 0 15px;
    }

    .sideBar {
        min-width: unset;
        height: unset;
        max-height: 100%;
        padding-left: unset;
        overflow-y: unset;
        -webkit-mask: unset;
        mask: unset;
        padding: 0 15px 0 15px;
    }

    #commentsBox {
        width: 100%;
        max-width: unset;
    }

    .switchCommentsLayout {
        display: none;
    }
}

@media screen and (max-height: 350px) {
    .main {
        padding: 0;
        display: block;
    }

    .mainVideo {
        border-radius: 0;
    }

    .videoArea {
        max-width: 100%;
        padding-top: 20px;
    }

    .underVideoStats {
        padding: 5px 15px 0 15px;
    }

    .sideBar {
        min-width: unset;
        height: unset;
        max-height: 100%;
        padding-left: unset;
        overflow-y: unset;
        -webkit-mask: unset;
        mask: unset;
        padding: 0 15px 0 15px;
    }

    #commentsBox {
        width: 100%;
        max-width: unset;
    }

    .switchCommentsLayout {
        display: none;
    }
}

@media (prefers-reduced-motion) {
    body {
        transition: none;
    }
}

/*button*/
button {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--button-background);
    border-radius: 5px;
    font-size: 15px;
    color: var(--accent-color);
    border: var(--button-border);
    cursor: pointer;
    transition: transform 0.1s, color 0.08s linear;
}

button:active {
    transform: scale(0.95);
}

@media (prefers-reduced-motion) {
    button:active {
        transform: none;
    }
}

button:hover,
button:focus {
    color: var(--text-color) !important;
    outline: var(--button-outline);
}

/*accent colours*/
::selection {
    /*mouse highlight colour*/
    background-color: var(--highlight-color);
}

a:link {
    color: var(--accent-color);
    transition: color 0.08s;
}

a:visited {
    color: #fa9696;
}

a:hover {
    color: var(--link-hover-color);
}

a:focus {
    border-radius: 5px;
    outline: 2px solid rgba(255, 255, 255, 0.8);
}

@media (prefers-reduced-motion) {
    a:link {
        transition: none;
    }
}

summary {
    cursor: pointer;
}

dialog {
    z-index: 10;
    position: fixed;
    top: 10px;
    min-width: 300px;
    border-radius: 15px;
}


/*video*/
video {
    width: 100%;
    height: auto;
}

.ambientWrapper {
    position: absolute;
    top: 100px;
    width: calc(80vw - 200px);
    height: auto;
    aspect-ratio: 16 / 9;
    z-index: -5;
    transform: scale(1.8, 2.8);
}

.ambientWrapper::after {
    box-shadow: inset 0 0 8vw 11.5vw var(--bg-color), inset 0 0 2vw 5vw var(--bg-color);
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.ambientCanvas {
    width: calc(80vw - 200px);
    height: auto;
    aspect-ratio: 16 / 9;
    opacity: var(--ambient-canvas-opacity);
    filter: saturate(var(--ambient-saturation));
}

@media screen and (max-width: 950px) {
    .ambientWrapper {
        width: 100%;
        height: 65vw;
        top: 0;
        transform: scale(1.5, 5);
    }

    .ambientWrapper::after {
        box-shadow: inset 0 0 15vw 20vw var(--bg-color), inset 0 0 12vw 5vw var(--bg-color);
    }

    .ambientCanvas {
        width: 100%;
        height: 65vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ambientCanvas {
        display: none !important;
    }
}

/*comments*/
a[href^="https://youtube.com"]::after {
    content: "";
    width: 1em;
    height: 1.1em;
    margin: 0 0.2em 0 0.1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath d='M9 2v1h3.3L6 9.3l.7.7L13 3.7V7h1V2ZM4 4c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V7l-1 1v4c0 .6-.4 1-1 1H4c-.6 0-1-.4-1-1V6c0-.6.4-1 1-1h4l1-1Z' style='fill:%23f66'/%3E%3C/svg%3E");
    background-size: contain;
    display: inline-block;
    vertical-align: sub;
}

.SNSPost {
    position: relative;
    min-height: 50px;
    padding: 15px 0;
    border-radius: 15px;
}

.SNSReplies {
    margin-left: 50px;
}

.SNSArea {
    margin-right: 10px;
    margin-bottom: 5px;
}

.SNSUserInfo {
    padding: 5px;
}

.SNSExtraInfo {
    color: var(--SNS-color-extra);
}

.SNSAlignRight {
    position: absolute;
    text-align: right;
    color: var(--SNS-color-extra);
    top: 10px;
    right: 10px;
}

#SNSDate {
    color: var(--SNS-color-date);
}

.SNSIcon {
    border-radius: 10px;
    height: 50px;
    width: 50px;
    float: left;
    margin-right: 10px;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    0% {
        opacity: 0
    }

    100% {
        opacity: 1
    }
}