@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+JP&family=Noto+Sans+JP:wght@100..900&display=swap');

:root {
    --primary-color: #f73878;
    --secondary-color: #5c00dd;

    --primary-color-light: #ff9baa;
    --secondary-color-light: #a36df2;

    --primary-color-dark: #231117;
    --secondary-color-dark: #191928;

    --background-color: #0c080e;
    --background-color-light: #16101a;
    --background-gradient: linear-gradient(145deg, var(--secondary-color-dark) 0%, var(--background-color-light) 50%, var(--primary-color-dark) 100%);

    --text-color: #fff;
    --text-color-light: rgba(255, 255, 255, 0.8);
    --text-color-lighter: rgba(255, 255, 255, 0.6);

    --font-family: "Noto Sans JP", "Roboto", Helvetica, Arial, sans-serif;

    --spacing-1: 0.5rem;
    --spacing-2: 1rem;
    --spacing-3: 2rem;

    --border-divider: 2px solid var(--background-color-light)
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}


#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    opacity: 0.75;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color-light), var(--secondary-color-light));
    z-index: 9999;
    border-bottom-right-radius: 4px;
    transition: width 0.25s cubic-bezier(0.2, 0.8, 0.3, 1.4);
}

html,
body {
    scroll-behavior: smooth;

    width: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--text-color);
    font-size: 1rem;

    @media screen and (max-width: 640px) {
        font-size: 1rem;
    }

    @media screen and (max-width: 480px) {
        font-size: 0.9rem;
    }
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    background: var(--background-color);
    overflow-x: hidden;
}

main,
main>div {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
}

main {
    min-height: 100vh;
    margin-bottom: var(--spacing-3);
}

* {
    box-sizing: border-box;
}

section {
    position: relative;
    width: 100%;
    max-width: 960px;

    @media screen and (max-width: 1080px) {
        max-width: 720px;
    }

    @media screen and (max-width: 768px) {
        max-width: 100% !important;
        padding: 0 var(--spacing-3) !important;
        border-radius: 0px !important;
    }
}

.row {
    display: flex;
    flex-direction: rows;
    gap: var(--spacing-3);

    :first-child {
        margin-top: 0;
    }

    &>* {
        flex: 1;
    }

    @media screen and (max-width: 768px) {
        flex-direction: column;
    }
}

section div p:first-child {
    margin-top: 0 !important;
}

figure {
    margin: 0;
    padding: 0;

    &>* {
        border-radius: var(--spacing-1);
    }
}

figure>* {
    width: 100%;
}

figure :not(.rigid) {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ===== Text ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-color);
    margin: 0;

}

h1 {
    font-size: 3.25em;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

h2 {
    font-weight: 700;
    font-size: 2.25em;
    line-height: 1.25;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h6 {
    font-size: 0.9em;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--text-color-lighter);
    margin: 0;
}

.post-content h2, .post-content h3  {
    position: relative;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: var(--border-divider);

    i {
        position: absolute;
        top: 50%;
        left: -1.25rem;
        transform: translate(-100%, -50%);
        text-align: end;
        scale: 1.1;
        opacity: 0.25;

        @media screen and (max-width: 768px) {
            display: none;
        }
    }
}

p {
    color: var(--text-color-light);
    font-size: 1.1em;
    font-weight: 400;

    line-height: 1.7;
    margin: 0;
    margin: 1rem 0;
}

a {
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;

    &:hover {
        text-decoration: underline;
    }
}

b {
    color: var(--text-color);
}

i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    scale: 1.25;
    color: inherit;
}

i.fa-brands {
    scale: 1.5;
    margin-right: 0.25rem;
    margin-left: -0.25rem;
}


/* ===== Lists ===== */
ul,
ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
    color: var(--text-color-light);
    font-size: 1.1em;
    line-height: 1.7;

    li {
        margin: 0;
        margin-bottom: 0.25rem;
    }

    p {
        font-size: 1em;
        margin: 0;
        margin-left: -1.5rem;
    }
}

ul li::marker {
    color: var(--primary-color);
    font-size: 1.2em;
}

ol li::marker {
    color: var(--primary-color);
    font-weight: 600;
}


/* ===== Buttons ===== */
.button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-1);
    gap: var(--spacing-1);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-align: center;
    text-shadow: 2px 2px 0px var(--background-color);
    color: var(--text-color);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 33%, transparent 65%);
    border-radius: var(--spacing-1);
    cursor: pointer;
    background-size: 300% 100%;
    transition: background-position 0.6s cubic-bezier(0.25, 1, 0.75, 1), border-color 0.6s cubic-bezier(0.25, 1, 0.75, 1), color 0.6s cubic-bezier(0.25, 1, 0.75, 1);
    border: 1px solid var(--primary-color);
    background-position: right;

    &:hover {
        text-decoration: none;
        background-position: left;
        border: 1px solid transparent;
        color: var(--text-color);
    }
}

.button-group {
    display: flex;
    flex-direction: row !important;
    gap: var(--spacing-2);
}

.button-group>* {
    flex: 1;
}


/* ===== Code Blocks ===== */
pre {
    background: var(--background-color-light) !important;
    padding: 1rem;
    border-radius: var(--spacing-1);
    overflow-x: scroll;
    margin: var(--spacing-2) 0 !important;
}

code {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 1em;
    text-align: left;
    background: none;
    padding: 0;
    color: #ccc;
    background: none;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.5;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

code .input {
    color: #8ef;
}

pre.collapsible {
    max-height: 300px;
    overflow: hidden !important;
    position: relative;
    cursor: pointer;
    transition: max-height 0.4s ease;
}

pre.collapsible.expanded {
    max-height: none;
    overflow: auto;
}

pre.collapsible::after {
    content: "Show more ↓";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(to top, var(--background-color-light), transparent);
    color: var(--text-color-lighter);
    cursor: pointer;
    font-size: 0.9em;
}

pre.collapsible.expanded::after {
    content: "Show less ↑";
    background: none;
}

pre[data-header] {
    position: relative;
    border-radius: var(--spacing-1);
}

pre[data-header]::before {
    content: attr(data-header);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 400;
    text-align: right;
    color: #ccc;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
    border-top-left-radius: var(--spacing-1);
    border-top-right-radius: var(--spacing-1);
    font-family: var(--font-family);
    user-select: none;
}


@keyframes backgroundScroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(32px, 32px);
    }
}


/* ===== Animation ===== */
@keyframes backgroundScroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(32px, 32px);
    }
}