@import url('https://fonts.googleapis.com/css2?family=Fragment+Mono&family=Inter:wght@100..900&family=Noto+Sans+JP:wght@100..900&display=swap');

/*ライトモードの場合は、次の変数が適用される*/
:root {
    --main-text: #0d0d0d;
    --main-bg: #f8f8f8dd;
    --backdrop: #f4f4f44e;
    --highlight-bg: #00000018;
    --selection-bg: #0000000d;
    --main-selection-bg: #00000018;
    --primary-border-color: #00000033;
    --secondary-border-color: #00000020;
}

@media (prefers-color-scheme: dark) {
    :root {
        --main-text: #f4f4f4;
        --main-bg: #373737d2;
        --backdrop: #0000004e;
        --highlight-bg: #ffffff18;
        --selection-bg: #ffffff0d;
        --main-selection-bg: #ffffff19;
        --primary-border-color: #ffffff5b;
        --secondary-border-color: #ffffff41;
    }

    .light-mode {
        filter: brightness(740%);
    }
}

body {
    font-family: "Inter", "Noto Sans JP", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    color: var(--main-text);
    background: transparent;
}

*:focus-visible {
    outline: #0a80ff71 4px solid;
}

ul {
    list-style: none;
}

form {
    width: 100%;
}

#searcher {
    position: absolute;
    top: 50px;
    width: fit-content;
    left: calc(50% - 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    border-radius: 14px;
    backdrop-filter: blur(30px);
}

#searcher form{
    box-shadow: 0px 20px 40px -12px #00000056, 0 0px 50px rgba(0, 0, 0, 0.169);
    border-radius: 14px;
    border: 1px solid var(--primary-border-color);
    background-color: var(--main-bg);
    transition: transform 0.12s;
    width: 600px;
}

.progressive-blur {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: all 0.2s linear;
}

.progressive-blur::before {
    position: absolute;
    transition: all 0.2s linear;
    z-index: -1;
    height: 500px;
    inset: 0;
    content: "";
    backdrop-filter: blur(0.25rem);
    mask-image: linear-gradient(to top,
            rgb(0 0 0 / 0%) 0%,
            rgb(0 0 0 / 4.9%) 7.75%,
            rgb(0 0 0 / 10.4%) 11.25%,
            rgb(0 0 0 / 45%) 23.55%,
            rgb(0 0 0 / 55%) 26.45%,
            rgb(0 0 0 / 89.6%) 38.75%,
            rgb(0 0 0 / 95.1%) 42.25%,
            rgb(0 0 0 / 100%) 50%);
}

.progressive-blur::after {
    background: linear-gradient(180deg, #aeb2b730, transparent);
    position: absolute;
    transition: all 0.2s linear;
    height: 250px;
    z-index: -1;
    inset: 0;
    bottom: 25%;
    content: "";
    backdrop-filter: blur(0.5rem);
    mask-image: linear-gradient(to top,
            rgb(0 0 0 / 0%) 0%,
            rgb(0 0 0 / 4.9%) 15.5%,
            rgb(0 0 0 / 10.4%) 22.5%,
            rgb(0 0 0 / 45%) 47.1%,
            rgb(0 0 0 / 55%) 52.9%,
            rgb(0 0 0 / 89.6%) 77.5%,
            rgb(0 0 0 / 95.1%) 91.9%,
            rgb(0 0 0 / 100%) 100%);
}

#searcher.hide+.progressive-blur::before {
    backdrop-filter: blur(0rem);
}

#searcher.hide+.progressive-blur::after {
    backdrop-filter: blur(0rem);
    background: none;
}

#search-bar {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
}

#search-bar img.left-icon {
    width: 24px;
    flex-shrink: 0;
    box-sizing: content-box;
    padding: 0 12px;
    padding-right: 6px;
    opacity: 0.9;
    border-radius: 6px;
}

#search-bar img.right-icon {
    width: 38px;
    margin-right: 10px;
}

#search-bar .search-box {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
}

#search-bar input {
    width: 100%;
    height: 34px;
    font-size: 20px;
    padding: 0px;
    padding-right: 0;
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
}

#search-bar ::placeholder {
    color: var(--main-text);
    opacity: 0.54;
}

#suggest ul {
    border-top: 1px solid var(--secondary-border-color);
    display: flex;
    flex-direction: column;
    padding: 10px;
}

#suggest button {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 8px 28px;
    border-radius: 6px;
    font-size: 16px;
    gap: 6px;
    position: relative;
}

#suggest button img.icon {
    width: 28px;
    flex-shrink: 0;
    margin-left: -20px;
    box-sizing: content-box;
}

#suggest button img.icon.hide {
    visibility: hidden;
    height: 26px;
    width: 20px;
}

#suggest button:hover {
    background-color: var(--selection-bg);
}

#suggest button.selected {
    background: var(--main-selection-bg);
    outline: none;
    transition: none;
}

::selection {
    background-color: var(--main-selection-bg);
}

#suggest ul span:empty {
    display: none;
}

#suggest ul button p.title {
    padding: 3px 5px;
}

#suggest ul button .caption {
    font-size: 16px;
    width: 32px;
    opacity: 0.7;
    position: absolute;
    letter-spacing: -0.06rem;
    right: 0;
    font-family: "Fragment Mono", monospace;
}

#bottom-bar {
    display: flex;
    align-items: center;
    justify-content: end;
    padding: 2px;
    gap: 4px;
    border-top: 1px solid var(--secondary-border-color);
}

#bottom-bar .border {
    width: 2px;
    border-radius: 10px;
    height: 16px;
    background-color: var(--primary-border-color);
}

#bottom-bar .option {
    font-size: 14px;
    padding: 6px 10px;
}

#bottom-bar button.option:hover {
    background-color: var(--highlight-bg);
    border-radius: 5px;
}

span.key {
    padding: 4px;
    background-color: var(--highlight-bg);
    border-radius: 5px;
    font-size: 13px;
    opacity: 0.9;
}

body.ja .lang-jp {
    display: initial;
}

body.ja .lang-en {
    display: none;
}

body.en .lang-jp {
    display: none;
}

body.en .lang-en {
    display: initial;
}


body.macos .macos {
    display: initial;
}

body.macos .windows {
    display: none;
}

body.windows .macos {
    display: none;
}

body.windows .windows {
    display: initial;
}
