/* * Global */

*,
*::before,
*::after {
    box-sizing: border-box;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* * Variables (Dark Mode) */

:root {
    --background: #121212;
    --text: #f5f5f5;
    --text-muted: #d9d9d9;

    --accent: #82caff;
    --accent-muted: #62b0dc;

    --surface: #181818;
    --border: #242424;
    --image-border: #303030;

    --grid-opacity: 3.5%;
}

/* * Light Mode */

:root.light {
    --background: #f5f5f5;
    --text: #121212;
    --text-muted: #444444;

    --accent: #62b0dc;
    --accent-muted: #82caff;

    --surface: #ffffff;
    --border: #d6d6d6;
    --image-border: #cccccc;

    --grid-opacity: 10%;
}

/* * Scrollbar */

html {
    scroll-behavior: smooth;
    scrollbar-color: color-mix(in srgb, var(--accent) 20%, transparent)
        var(--background);
    overflow-x: hidden;
}

html::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html::-webkit-scrollbar-track {
    background: var(--background);
}

html::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 20px;
    border: 2px solid var(--background);
}

html::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

/* * Animations */

@keyframes spin {
    from {
        rotate: 0deg;
    }

    to {
        rotate: 360deg;
    }
}

/* * Body */

body {
    background-color: var(--background);
    background-image:
        linear-gradient(
            to right,
            color-mix(in srgb, var(--accent) var(--grid-opacity), transparent)
                1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            color-mix(in srgb, var(--accent) var(--grid-opacity), transparent)
                1px,
            transparent 1px
        );
    background-size: 80px 80px;
    animation: quietGridScroll 25s linear infinite;

    transition:
        background-color 0.5s ease,
        color 0.3s ease;

    color: var(--text);
    line-height: 1.5;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;

    padding: 2rem;
    margin: 0;
    overflow-x: hidden;
}

@keyframes quietGridScroll {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 80px 80px;
    }
}

/* * Responsive Layout */

@media (max-width: 750px) {
    body {
        padding: 1rem;
    }

    section {
        padding: 1.5rem;
    }

    #interests > ul {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    #header-right {
        width: 100%;
        transform: none;
    }

    #prof-row {
        gap: 16px;
    }

    #prof-row h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    nav > ul {
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        padding: 1rem 0 0;
    }
}

/* * Reduced Motion */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* * Typography */

h1,
h2,
h3,
h4 {
    line-height: 1.2;
}

/* * Reading Progress */

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 4px;

    z-index: 9999;
}

/* * Now Playing */

#now-playing {
    position: fixed;
    bottom: 15px;
    right: 15px;
    margin: 0;

    font-family: monospace;
    font-size: 11px;

    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;

    padding: 4px 8px;

    z-index: 9998;

    opacity: 1;
    transition:
        transform 0.2s,
        opacity 0.2s;
}

#now-playing:hover {
    transform: translateY(-4px);
    opacity: 0.75;
}

/* * Disc */

#disc {
    position: fixed;
    bottom: 15px;
    left: 15px;

    width: 80px;
    height: 80px;

    border-radius: 50%;
    border: 2px solid var(--border);

    background: var(--surface);

    z-index: 9999;
    image-rendering: pixelated;
    transition: transform 0.2s ease;

    animation: spin 4s linear infinite;
    animation-play-state: paused;
}

#disc:hover {
    transform: scale(1.15);
    cursor: pointer;
}

#disc.spinning {
    animation-play-state: running;
}

/* * Site Notice */

.site-notice {
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;

    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--text-muted);
}

.site-notice kbd {
    padding: 2px 6px;

    border: 1px solid var(--border);
    border-radius: 4px;

    background: var(--background);
    color: var(--text);

    font-family: monospace;
}

/* * Page Layout */

main {
    max-width: 900px;
    margin: 0 auto;
}

/* * Header */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

/* * Profile */

#header-right {
    transform: translateY(-10px);
}

#prof-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
}

header img {
    width: 80px;
    height: 80px;

    border-radius: 50%;
    border: 2px solid var(--image-border);

    transition: transform 0.2s ease;
}

header img:hover {
    transform: scale(1.15);
    cursor: pointer;
}

#pfp-icon {
    animation: spin 5s linear infinite;
    animation-play-state: paused;
}

#pfp-icon.spinning {
    animation-play-state: running;
}

header div {
    text-align: center;
}

header > p {
    color: var(--text-muted);
    font-size: 1.25rem;
}

header > h1 {
    font-size: 3rem;
}

/* * Sections */

section {
    scroll-margin-top: 2rem;
    margin-bottom: 4rem;

    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

section:hover {
    border-color: #303030;
}

section > h2 {
    color: var(--accent);
}

section > h3 {
    color: var(--accent-muted);
}

section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

section h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;

    color: var(--text-muted);
}

section p {
    margin-top: 0;
    margin-bottom: 1rem;

    max-width: 70ch;
}

/* * Buttons */

button {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--accent);
    font-family: inherit;
    border-radius: 8px;
    padding: 8px 16px;

    transition: transform 0.15s ease;
}

button:hover {
    transform: translateY(-2px) scale(1.05);
    cursor: pointer;
}

button:active {
    transform: translateY(1px);
}

/* * Thoughts */

#thoughts > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 1.5rem;
    padding: 0;
    margin: 0;

    list-style: none;
}

#thoughts > ul > li {
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--accent);
    background: var(--background);
    border-radius: 0 10px 10px 0;

    font-style: italic;
    color: var(--text);

    transition: transform 0.2s ease;
}

#thoughts > ul > li:hover {
    transform: translateY(-4px);
}

#thoughts > ul > li > strong {
    display: block;
    margin-bottom: 0.5rem;

    font-style: normal;
    font-family: monospace;
    color: var(--accent-muted);
}

/* * Rants */

#rants {
    margin-block: 4rem;
}

#rants > div {
    display: grid;
    gap: 1rem;
}

#rants details {
    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#rants details:hover {
    border-color: var(--accent);
}

#rants details:open {
    border-color: var(--accent);
}

#rants summary {
    padding: 1rem 1.25rem;

    cursor: pointer;

    font-weight: 600;
    color: var(--text);

    user-select: none;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

#rants summary:hover {
    color: var(--accent);
    background: var(--surface);
}

#rants summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

#rants details > p,
#rants details > ul,
#rants details > pre {
    margin-inline: 1.5rem;
}

#rants details > p {
    margin-block: 1rem;

    line-height: 1.7;
}

#rants details > ul {
    margin-block: 1rem;
    padding-left: 2rem;

    line-height: 1.7;
}

#rants details > ul > li {
    margin-block: 0.5rem;
}

#rants details > pre {
    margin-block: 1.25rem;
    padding: 1rem;

    border: 1px solid var(--border);
    border-radius: 6px;

    overflow-x: auto;

    background: var(--background);

    line-height: 1.6;
}

#rants details > pre code {
    font-family: monospace;
}

#rants details > :last-child {
    margin-bottom: 2rem;
}

/* * About Me */

dl {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;

    border: 1px solid var(--border);
    border-radius: 8px;

    overflow: hidden;

    margin-top: 12px;
}

dt,
dd {
    margin: 0;
    padding: 12px 16px;
}

dt {
    font-weight: 600;
    border-left: 2px solid var(--border);
}

dd {
    background: var(--background);
}

/* * Caution */

#caution > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;

    padding: 1rem;

    transition:
        transform 150ms ease,
        border-color 150ms ease;
}

#caution > div:hover {
    transform: translateY(-3px);

    border-color: var(--accent);
}

#caution > div + div {
    margin-top: 1rem;
}

/* * Interests */

#interests > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

#interests > ul > li {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;

    transition: transform 0.2s ease;
}

#interests > ul > li:hover {
    transform: translateY(-6px);
}

/* * Fandoms */

#fandoms ul {
    margin: 0;
    padding-left: 1.5rem;
}

#fandoms h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

#fandoms li {
    margin-bottom: 0.35rem;
}

/* * Fun */

#fun {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
}

#fun > article {
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s ease;
}

#fun > article:hover {
    transform: translateY(-3px);
}

#dog-img {
    display: block;
    width: 100%;
    max-width: 500px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 1rem 0;
}

/* * Messages */

#messages form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#messages textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.75rem;
    box-sizing: border-box;

    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 6px;

    resize: vertical;
}

#messages textarea::placeholder {
    opacity: 0.6;
}

#messages button {
    width: fit-content;
    padding: 0.6rem 1rem;

    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 6px;

    cursor: pointer;
}

#messages button:hover {
    opacity: 0.75;
}

/* * Navigation */

nav > ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

nav ul {
    display: flex;
    gap: 12px;
    padding: 1.25rem;
    margin: 0;
}

nav ul li {
    transition: transform 0.2s ease;
}

nav ul:hover li {
    transform: translateX(-10px);
}

nav ul li:hover a {
    color: var(--accent);
    transform: scale(1.1);
}
nav ul li:hover {
    transform: translateX(0);
}

nav ul li:hover ~ li {
    transform: translateX(10px);
}

nav ul:first-child {
    display: flex;
    justify-content: center;
}

/* * Links */

a {
    color: var(--accent);
}

a:hover {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* * Footer */

footer {
    text-align: center;
    padding: 20px 0;
}

footer p {
    font-size: 0.85rem;
}

/* * Responsive Layout */

@media (max-width: 750px) {
    #disc {
        width: 64px;
        height: 64px;
        bottom: 12px;
        left: 12px;
    }

    #now-playing {
        right: 12px;
        bottom: 12px;
        left: 88px;
        max-width: none;
    }

    section {
        margin-bottom: 2.5rem;
    }
}
