/* Almost entirely ai generated ;) */

@font-face {
    font-family: "CustomFont";
    src: url("./fonts/customFont.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "CustomJapaneseFont";
    src: url("./fonts/customJapaneseFont.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background: #000;
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-family: "CustomFont", monospace;
    transition: background-color 1800ms cubic-bezier(0.22, 1, 0.36, 1), color 1800ms cubic-bezier(0.22, 1, 0.36, 1);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.05) 0,
            rgba(255, 255, 255, 0.05) 1px,
            rgba(0, 0, 0, 0.05) 1px,
            rgba(0, 0, 0, 0.05) 2px,
            transparent 2px,
            transparent 4px
        );
    opacity: 0.28;
    transition: opacity 1800ms ease, background 1800ms ease, transform 1800ms ease, filter 1800ms ease;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background:
        radial-gradient(
            circle at center,
            transparent 52%,
            rgba(0, 0, 0, 0.22) 78%,
            rgba(0, 0, 0, 0.5) 100%
        );
    transition: opacity 1800ms ease, background 1800ms ease;
}

.intro {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.025) 0%, rgba(0, 0, 0, 0) 48%),
        #000;
    transition: background 1800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.intro::before {
    content: "";
    position: absolute;
    inset: -20% 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 46%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.04) 54%,
        transparent 100%
    );
    opacity: 0.2;
    animation: crt-sweep 8.4s linear infinite;
    transition: opacity 1800ms ease;
}

.intro::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: rgba(255, 255, 255, 0.015);
    opacity: 0.45;
    animation: screen-flicker 6s linear infinite;
    transition: opacity 1800ms ease, background 1800ms ease;
}

.intro-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transform: translateY(-100%);
    will-change: transform;
}

.typing {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 56px;
    font-family: "CustomFont", monospace;
    line-height: 1;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-shadow:
        0 0 7px rgba(255, 255, 255, 0.24),
        0 0 18px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(255, 255, 255, 0.05);
    will-change: transform, opacity;
    transition: color 1800ms ease, text-shadow 1800ms ease;
}

#site {
    display: inline-block;
    position: relative;
    min-height: 1em;
    white-space: pre;
}

#site::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: inherit;
    opacity: 0;
    pointer-events: none;
    clip-path: inset(0 0 48% 0);
    text-shadow:
        0 0 7px rgba(255, 255, 255, 0.18),
        0 0 20px rgba(255, 255, 255, 0.06);
    transition: opacity 200ms ease;
}

#site.glitch-split::before {
    opacity: 0.9;
    animation: split-glitch-top 150ms steps(2, end) 1;
}

.cursor {
    display: inline-block;
    flex: 0 0 auto;
    width: 12px;
    height: 1em;
    margin-left: 8px;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.14);
    animation: blink 1.5s steps(1, end) infinite;
    transition: background-color 1800ms ease, box-shadow 1800ms ease;
}

.loading {
    display: inline-block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 24px;
    font-family: "CustomFont", monospace;
    line-height: 1;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-align: center;
    text-shadow:
        0 0 4px rgba(255, 255, 255, 0.12),
        0 0 10px rgba(255, 255, 255, 0.04);
    will-change: transform, opacity;
    transition: color 1800ms ease, text-shadow 1800ms ease;
}

#loading {
    display: inline-block;
}

.content {
    min-height: 100vh;
    background: #050505;
}

.media-link {
    position: fixed;
    left: 50%;
    bottom: 42px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    color: #d31717;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
    text-shadow:
        0 0 8px rgba(211, 23, 23, 0.24),
        0 0 18px rgba(211, 23, 23, 0.12);
    transition:
        opacity 700ms ease,
        transform 700ms ease,
        color 1200ms ease,
        text-shadow 1200ms ease;
}

.media-link:hover,
.media-link:focus-visible {
    transform: translateX(-50%) translateY(-2px);
}

.media-link-jp {
    display: inline-block;
    font-family: "CustomJapaneseFont", "CustomFont", monospace;
    line-height: 1;
    text-transform: none;
    transform: translateY(-10px);
    animation: media-link-glitch 1.9s steps(3, end) infinite;
    will-change: transform, opacity;
}

.media-link:hover .media-link-jp,
.media-link:focus-visible .media-link-jp {
    animation-duration: 950ms;
}

body.media-link-visible .media-link {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

body.photo-mode .media-link {
    color: #d31717;
    text-shadow:
        0 0 5px rgba(211, 23, 23, 0.16),
        0 0 12px rgba(255, 255, 255, 0.35);
}

body:not(.photo-mode) .media-link {
    text-shadow:
        0 0 10px rgba(211, 23, 23, 0.3),
        0 0 20px rgba(211, 23, 23, 0.2);
}

@media (max-width: 768px) {
    .media-link {
        bottom: 30px;
        font-size: 16px;
        letter-spacing: 0.06em;
        padding: 6px 10px;
    }

    .media-link-jp {
        transform: translateY(-6px);
    }
}

body.photo-mode {
    background: #f6f4ef;
    color: #050505;
}

body.photo-mode::before {
    background:
        radial-gradient(circle at 18% 24%, rgba(0, 0, 0, 0.24) 0 1px, transparent 1.5px),
        radial-gradient(circle at 72% 68%, rgba(0, 0, 0, 0.2) 0 1px, transparent 1.6px),
        radial-gradient(circle at 42% 78%, rgba(0, 0, 0, 0.16) 0 1px, transparent 1.3px),
        radial-gradient(circle at 82% 16%, rgba(0, 0, 0, 0.18) 0 1px, transparent 1.4px),
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.08) 0 1px,
            transparent 1px 5px,
            rgba(0, 0, 0, 0.12) 5px 6px,
            transparent 6px 13px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.05) 0 1px,
            transparent 1px 6px,
            rgba(0, 0, 0, 0.09) 6px 7px,
            transparent 7px 14px
        ),
        linear-gradient(0deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54));
    background-size: 130px 130px, 165px 165px, 95px 95px, 145px 145px, 26px 26px, 32px 32px, 100% 100%;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    opacity: 0.98;
    transform: scale(1.08);
    filter: contrast(1.08) brightness(1.02);
    animation: digital-noise 220ms steps(2, end) infinite, photo-grain-drift 1.35s steps(5, end) infinite;
}

body.photo-mode::after {
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 58%),
        radial-gradient(circle at center, rgba(0, 0, 0, 0.08) 78%, rgba(0, 0, 0, 0.18) 100%);
    opacity: 0.9;
}

body.photo-mode .intro {
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.98) 0%, rgba(242, 240, 234, 0.94) 58%, rgba(229, 226, 218, 0.88) 100%);
}

body.photo-mode .intro::before,
body.photo-mode .intro::after {
    opacity: 0;
    animation: none;
}

body.photo-mode .typing,
body.photo-mode .loading {
    color: #050505;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.2),
        0 0 14px rgba(255, 255, 255, 0.52);
}

body.photo-mode #site::before {
    content: attr(data-text);
    text-shadow: none;
    mix-blend-mode: multiply;
}

body.photo-mode #site.photo-glitch-split::before {
    opacity: 0.88;
    animation: photo-split-glitch-top 210ms steps(3, end) 1;
}

body.photo-mode .cursor {
    background: #050505;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

body.photo-mode .content {
    background: #f6f4ef;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    50.01%, 100% {
        opacity: 0;
    }
}

@keyframes crt-sweep {
    0% {
        transform: translateY(-60%);
    }
    100% {
        transform: translateY(60%);
    }
}

@keyframes screen-flicker {
    0%, 96%, 100% {
        opacity: 0.45;
    }
    97% {
        opacity: 0.25;
    }
    98% {
        opacity: 0.5;
    }
    99% {
        opacity: 0.32;
    }
}

@keyframes split-glitch-top {
    0% {
        transform: translateX(0);
    }
    12% {
        transform: translateX(-16px);
    }
    24% {
        transform: translateX(11px);
    }
    38% {
        transform: translateX(-13px);
    }
    52% {
        transform: translateX(9px);
    }
    68% {
        transform: translateX(-8px);
    }
    82% {
        transform: translateX(4px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes photo-split-glitch-top {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    18% {
        transform: translateX(-9px);
        opacity: 0.9;
    }
    34% {
        transform: translateX(7px);
        opacity: 0.72;
    }
    51% {
        transform: translateX(-6px);
        opacity: 0.85;
    }
    76% {
        transform: translateX(4px);
        opacity: 0.58;
    }
    100% {
        transform: translateX(0);
        opacity: 0;
    }
}

@keyframes digital-noise {
    0% {
        transform: translate3d(-0.5%, -0.6%, 0) scale(1.08);
        filter: contrast(1.03) brightness(1.01);
    }
    25% {
        transform: translate3d(0.3%, 0.4%, 0) scale(1.1);
        filter: contrast(0.98) brightness(1.04);
    }
    50% {
        transform: translate3d(-0.2%, 0.2%, 0) scale(1.09);
        filter: contrast(1.04) brightness(0.99);
    }
    75% {
        transform: translate3d(0.45%, -0.3%, 0) scale(1.11);
        filter: contrast(1.01) brightness(1.02);
    }
    100% {
        transform: translate3d(-0.4%, 0.1%, 0) scale(1.08);
        filter: contrast(1.03) brightness(1.01);
    }
}

@keyframes photo-grain-drift {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }
    20% {
        background-position: -9px 5px, 8px -6px, -5px 7px, 7px 3px, 2px -1px, -3px 2px, 0 0;
    }
    40% {
        background-position: 6px -7px, -10px 4px, 4px -6px, -8px -2px, -2px 3px, 2px -2px, 0 0;
    }
    60% {
        background-position: -4px 8px, 6px 6px, -8px -3px, 5px -7px, 3px 1px, -2px -3px, 0 0;
    }
    80% {
        background-position: 10px -3px, -7px -8px, 7px 5px, -4px 8px, -1px -2px, 3px 2px, 0 0;
    }
    100% {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }
}

@keyframes media-link-glitch {
    0%, 74%, 100% {
        transform: translateY(-10px) translateX(0);
        opacity: 1;
    }
    76% {
        transform: translateY(-10px) translateX(-2px);
        opacity: 0.88;
    }
    80% {
        transform: translateY(-9px) translateX(1.5px);
        opacity: 1;
    }
    84% {
        transform: translateY(-11px) translateX(-1px);
        opacity: 0.9;
    }
    89% {
        transform: translateY(-10px) translateX(2px);
        opacity: 0.96;
    }
    94% {
        transform: translateY(-11px) translateX(-0.5px);
        opacity: 1;
    }
}
