/* +++ GLOBAL VARIABLES +++ */
:root {
    --col-bg-low: #eae6e2;
    --col-bg-mid: rgb(240, 240, 235);
    --col-bg-high: #f8f8f0;
    --col-bg-img: #f8f8f0;

    --col-text-low: rgb(35, 35, 35);
    --col-text-high: rgb(0, 0, 0);

    --gradient: linear-gradient(45deg, rgb(0, 0, 255), rgb(255, 0, 140));
}

/* MATHJAX STYLE */
.MathJax {
    color: var(--col-text-low);
    font-size: 18px !important;
    font-weight: 400 !important;
}

mjx-container[jax='CHTML'][display='true'] {
    margin-block: 22px;
}

/* +++ BASIC GLOBAL STYLE +++ */
html {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    color: var(--col-text-high);
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto Slab', serif;
    background: var(--col-bg-low);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#page {
    flex: 1;
}

.japanese {
    font-family: 'Noto Sans JP', sans-serif;
}

/* +++ CENTERED COLUMN LAYOUT +++ */
.wrapper {
    width: 100%;
}

.content {
    height: 100%;
    max-width: min(90%, 800px);
    margin-inline: auto;
}

/* +++ GENERAL HEADER STYLE +++ */
#header {
    font-family: 'Noto Sans JP', sans-serif;
    height: 50px;
    background: var(--col-bg-high);
    border-bottom: 1px solid black;
    position: sticky;
    top: 0;
    z-index: 100;
    user-select: none;
    overflow: hidden;
}

#header .content *:not(#actions *) {
    height: 100%;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

#header a {
    font-style: normal;
    text-decoration: none;
    color: var(--col-text-high);
}

#page {
    /* 100vh - footer - header */
    min-height: calc(100vh - 150px - 51px);
}

/* +++ LOGO STYLE +++ */
#logo {
    font-family: 'Roboto Slab';
    margin-right: 30px;
}

#logo h3 {
    margin: 0;
    font-size: 34px;
    line-height: 1;
}

#logo span {
    font-family: 'Times New Roman';
    font-variant-caps: normal;
    font-size: 60px;
    padding-bottom: 12.5px;
    padding-right: 5px;
}

/* +++ NAVIGATION STYLE +++ */
#navigation ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#navigation a {
    padding-inline: 10px;
    font-size: 18px;
    font-weight: 400;
}

#navigation a:hover {
    /* SCSS: @extend .fancy; */
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
}

/* +++ ACTIONS STYLE +++ */
#actions {
    float: right;
}

/* +++ BUTTON STYLE +++ */
/* TWO VARIANTS: SPAN OR A INSIDE */
button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    padding: 0;
    display: inline-flex;
    font-size: 16px;
    background: var(--col-bg-high);
    border-radius: 5px;
}

button span,
button a {
    padding: 7.5px;
    border-radius: 5px;
    font-style: normal;
    font-weight: 400;
    color: var(--col-text-high);
    line-height: 1;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

#page button span,
#page button a {
    color: var(--col-text-low);
}

button:hover span,
button:hover a {
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

button:hover span:not(.plain),
button:hover a:not(.plain) {
    /* SCSS: @extend .fancy; */
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
}

/* TABLE STYLE */
table {
    border-spacing: 0;
    border-collapse: separate;
    color: var(--col-text-low);
    margin-block: 24px;
    background: var(--col-bg-mid);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    width: fit-content;
    margin-inline: auto;
}

th,
td {
    text-align: center;
    padding-block: 10px;
    padding-inline: 20px;
}

th.red,
td.red {
    background-color: rgba(225, 60, 35, 0.85);
}

th.green,
td.green {
    background-color: rgba(50, 210, 55, 0.7);
}

th.yellow,
td.yellow {
    background-color: rgba(235, 220, 35, 0.8);
}

table th:not(:last-child),
table td:not(:last-child) {
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

table tr:not(:last-child) th,
table tr:not(:last-child) td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

/* +++ SECTION STYLE +++ */
.section {
    margin-bottom: 15px;
}

.section:last-child {
    margin-bottom: 0;
}

/* .section:hover > .title {
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
} */

.subtitle {
    font-variant: normal;
    font-weight: 200;
    font-size: 14px;
    margin-top: -25px;
    margin-bottom: 30px;
}

/* +++ HEADINGS STYLE +++ */
h1,
h2,
h3 {
    font-variant: small-caps;
    font-weight: 400;
    z-index: 5;
}

h1 {
    font-size: 50px;
    margin-block: 28px;
}

h2 {
    font-size: 34px;
    margin-block: 24px;
}

h2.title {
    margin-bottom: -10px;
}

/* +++ PAGE CONTENT STYLE +++ */
#page p {
    font-size: 16px;
    color: var(--col-text-low);
    letter-spacing: 1px;
    margin-block: 24px;
    line-height: 1.5;
}

#page p:not(.card p) {
    text-align: justify;
    /*text-align: left;*/
}

#page p > a {
    text-decoration: underline;
    font-style: normal;
    color: var(--col-text-low);
}

#page p > a:hover {
    /* SCSS: @extend .fancy; */
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
}

#page img:not(.card img, .featured-card img, .project-card img, .tier-item img, .bare) {
    object-fit: fill;
    max-width: calc(95% - 42px);
    background: var(--col-bg-mid);
    /* padding: 20px; */
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    display: block;
    margin-inline: auto;
}

#page img.bare {
    display: block;
    margin-inline: auto !important;
}

#page input {
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
    background: var(--col-bg-high);
    font-size: 16px;
    font-family: 'Roboto Slab', serif;
    color: var(--col-text-low);
    padding: 5px;
    line-height: 1;
}

#page input:hover {
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

#page input:focus {
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.3);
    outline: none;
}

#page ul {
    color: var(--col-text-low);
    font-size: 16px;
    letter-spacing: 1px;
    line-height: 2;
}

#page canvas {
    background: var(--col-bg-mid);
    padding-inline: 15px;
    padding-top: 15px;
    padding-bottom: 5px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    margin-block: 24px;
    margin-inline: auto;
    width: 800px !important;
}

/* +++ GENERIC CLASSES +++ */
.centered {
    width: fit-content;
    margin-inline: auto;
}

.shadowed {
    text-shadow: 5px 5px 4px rgba(0, 0, 0, 0.25);
}

.fancy {
    /* SCSS: @extend .fancy; */
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
}

.quote {
    font-style: italic;
    font-size: 22px !important;
    margin-inline: 100px;
    text-align: center;
}

.formula {
    background: var(--col-bg-mid);
    width: fit-content;
    margin-block: 24px;
    margin-inline: auto;
    padding-block: 5px;
    padding-inline: 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

/* +++ HIGHLIGHT.JS +++ */
.hljs {
    font-size: 16px;
    background: var(--col-bg-high);
}

code {
    max-width: min-content;
    padding: 20px !important;
}

pre {
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    position: relative;
    max-width: min-content;
    margin-inline: auto;
    overflow: hidden !important;
    margin-block: 24px;
}

pre > span {
    font-size: 14px;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    padding-block: 5px;
    padding-inline: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 5px;
    color: var(--col-text-low);
}

/* REMOVE NUMBER INPUT ARROWS */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* +++ MATHJOKE STYLE +++ */
#joke {
    margin-top: 40px !important;
    margin-bottom: 40px;
}

#math-joke {
    margin-inline: auto;
    width: fit-content;
    margin-top: 35px;
    background: var(--col-bg-mid);
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    border-radius: 5px;
    padding: 15px;
    cursor: pointer;
}

#math-joke .MathJax {
    font-size: 25px !important;
    line-height: 1;
}

#expl-cont {
    display: flex;
    align-items: center;
    max-width: 800px;
    margin-inline: auto;
}

#nerd {
    white-space: nowrap;
    font-size: 30px;
    padding: 10px;
    letter-spacing: -10px;
    user-select: none;
    margin-top: -2.5px;
    cursor: help;
}

#explanation {
    line-height: 1.5;
    letter-spacing: 1.5px;
    filter: blur(4px);
    cursor: help;
    padding: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: justify;
    color: var(--col-text-low);
}

#explanation:hover,
#nerd:hover ~ #explanation {
    filter: none;
}

/* +++ INTRO STYLE +++ */
.intro {
    line-height: 1.5;
    letter-spacing: 1.5px;
    max-width: 800px;
    margin-inline: auto;
    margin-bottom: 30px;
    padding: 10px;
}

/* +++ FOOTER STYLE +++ */
#footer {
    background-color: rgb(180, 180, 180);
    margin: 0;
    margin-top: 45px;
    height: 100px;
    user-select: none;
    position: relative;
    overflow: hidden;
}

#footer-text {
    position: absolute;
    z-index: 1;
    z-index: 5;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    letter-spacing: 0.5px;
    color: rgb(255, 255, 255);
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.5;
    letter-spacing: 1.5px;
    font-weight: 350;
    width: max-content;
}

/* +++ PI STYLE +++ */
.shadow-pi {
    display: inline-block;
    position: absolute;
    user-select: none;
    color: black;
    font-family: 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 0;
    opacity: 0;
    animation: fadeInOut;

    /* do not change */
    padding: 0.3rem 0.17rem 0.54rem 0.17rem;
}

@keyframes fadeInOut {
    40% {
        opacity: 0.25;
    }
    80% {
        opacity: 0.25;
    }
    100% {
        opacity: 0;
    }
}

/* +++ PROJECT STYLE +++ */
.project-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-block: 40px;
}

.project-card {
    height: 180px;
    border-radius: 5px;
    background: var(--col-bg-mid);
    cursor: pointer;
    transition: ease-in-out 25ms;
    overflow: hidden;
    display: flex;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 15ms ease;
}

.project-card:hover {
    transform: scale(1.01);
}

.project-image {
    height: 100%;
    width: 250px;
    object-fit: cover;
    border-right: 1px solid rgba(0,0,0,0.75);
    background: var(--col-bg-mid);
}

.project-right {
    padding-top: 20px;
    padding-bottom: 15px;
    padding-inline: 30px;
    display: flex;
    flex-direction: column;
    background: var(--col-bg-mid);
}

.project-title {
    font-variant: small-caps;
    font-weight: 450;
    font-size: 26px;
    line-height: 1.2;
    text-align: left;
    display: block;
    opacity: 0.85;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: rgba(0,0,0,0.75);

    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.project-card:hover::before {
    background: var(--gradient);
}

.project-card:hover .project-title {
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
}

.project-describtion {
    margin: 0px !important;
    margin-top: 12px !important;
    text-align: justify !important;
    font-weight: 350;
    flex: 1;
}

.project-keywords {
    font-family: 'Roboto Slab', serif;
    font-size: 12px;
    color: var(--col-text-low);
    letter-spacing: 1px;
    font-weight: 350;
}

.link-to-projects-cont {
    display: flex;
    justify-content: right;
}

#link-to-projects {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--col-text-low);
    letter-spacing: 1px;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    border-radius: 5px;
    transition: transform 15ms ease;
    position: relative;
    padding: 10px;
    padding-inline: 8px;
    background: var(--col-bg-mid);
}

/* #link-to-projects:hover {
    transform: scale(1.03)
} */

#link-to-projects:hover > span {
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;
}

#link-to-projects::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: rgba(0,0,0,0.75);

    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

#link-to-projects:hover::before {
    background: var(--gradient);
}


/* OTHER ADDITIONS */

#cat {
    cursor: grab;
    transition: all 200ms ease-in-out;
    margin-top: 30px;
    user-select: none;
}

#cat:hover {
    transform: scale(1.2);
}

div.img-title {
    text-align: center;
    color: var(--col-text-low);
    font-size: 12px;
    letter-spacing: 1px;
    font-style: italic;
    margin-top: 5px;
}

robot {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    outline: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 1px;
    color: black;
}

fun {
    cursor: pointer;
}

fun:not(.stop) span {
    width: fit-content;
    background: var(--gradient);
    background-clip: text;
    color: transparent !important;

    white-space: pre;
    display: inline-block;
    animation: sin-wave 1.1s linear infinite;
    animation-delay: calc(var(--i) * 0.075s);
}

@keyframes sin-wave {
    0% { transform: translateY(0px); }
    12% { transform: translateY(-3px); }
    25% { transform: translateY(-5px); }
    37% { transform: translateY(-3px); }
    50% { transform: translateY(0px); }
    62% { transform: translateY(3px); }
    75% { transform: translateY(5px); }
    87% { transform: translateY(3px); }
    100% { transform: translateY(0px); }
}

p.proof {
    border-inline: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding-inline: 30px;
}

p.proof > qed {
    float: right;
}

fire {
    --duration: 2s;

    /* glow settings */
    --radius: 4px;
    --offset: 3px;
    --c1: #ffd966;
    --c2: #ff7b00;
    --c3: #ff2a00;

    /* jitter settings */
    --jitter-y: 2px;
    --jitter-rot: 5deg;
    --jitter-scale: 0.15;
    --jitter-base: 0.8s;
    --jitter-step: 0.03s;

    cursor: pointer;
}

fire:not(.stop) {
    font-weight: 500;
}

fire:not(.stop) span {
    white-space: pre;
    display: inline-block;
    border-radius: 20px;

    animation: burn var(--duration) steps(2, end) infinite both,
        jitter calc(var(--jitter-base) + (var(--i) * var(--jitter-step)))
            steps(3, end) infinite;

    animation-delay: calc(var(--i) * -0.13s);
}

@keyframes burn {
    0%,
    100% {
        text-shadow: 0 0 calc(var(--radius) / 6) white,
            0 calc(-1 * var(--offset)) var(--radius) var(--c1),
            calc(-1 * var(--offset)) var(--offset) var(--radius) var(--c2),
            var(--offset) var(--offset) var(--radius) var(--c3);
        filter: brightness(1.2);
    }

    33% {
        text-shadow: 0 0 calc(var(--radius) / 6) white,
            0 calc(-1 * var(--offset)) var(--radius) var(--c2),
            calc(-1 * var(--offset)) var(--offset) var(--radius) var(--c3),
            var(--offset) var(--offset) var(--radius) var(--c1);
        filter: brightness(1);
    }

    66% {
        text-shadow: 0 0 calc(var(--radius) / 6) white,
            0 calc(-1 * var(--offset)) var(--radius) var(--c3),
            calc(-1 * var(--offset)) var(--offset) var(--radius) var(--c1),
            var(--offset) var(--offset) var(--radius) var(--c2);
        filter: brightness(1.3);
    }
}

@keyframes jitter {
    0% {
        transform: translateY(0) rotate(0);
    }
    25% {
        transform: translateY(calc(var(--jitter-y) * -0.5))
            rotate(calc(var(--jitter-rot) * -1))
            scale(calc(1 + var(--jitter-scale)));
    }
    45% {
        transform: translateY(calc(var(--jitter-y) * 1))
            rotate(calc(var(--jitter-rot) * 0.6));
    }
    75% {
        transform: translateY(calc(var(--jitter-y) * -1))
            rotate(calc(var(--jitter-rot) * -0.4))
            scale(calc(1 - var(--jitter-scale)));
    }
    100% {
        transform: translateY(0) rotate(0);
    }
}

censor {
    background: rgb(20, 20, 20);
    color: transparent;
    user-select: none;
    border-radius: 1px;
    cursor: help;
    transition: 75ms ease;
}

censor:hover {
    background: none;
    color: inherit;
}

#disclaimer {
    background-color: #ff1b3d;
    width: 550px;
    margin-inline: auto;
    padding-block: 15px;
    padding-inline: 20px;
    margin-top: 30px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.75);
    animation: warn 1000ms ease-in-out infinite;
}

#disclaimer p {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    color: white;
    font-weight: 450;
}

@keyframes warn {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.section > :last-child,
.content > :last-child {
    margin-bottom: 0 !important;
}