/* ---------- Local Font Import START ---------- */
@font-face {
  font-family: 'BPDots';
  src: url('/font/BPdots.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Praktika';
  src: url('/font/Praktika-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Praktika';
  src: url('/font/Praktika-LightItalic.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/font/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/font/JetBrainsMono-Italic-VariableFont_wght.ttf') format('truetype');
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Epunda Sans';
    src: url('/font/EpundaSans-VariableFont_wght.ttf') format('truetype');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Epunda Sans';
    src: url('/font/EpundaSans-Italic-VariableFont_wght.ttf') format('truetype');
    font-style: italic;
    font-display: swap;
}
/* ---------- Local Font Import END ---------- */

/* ---------- CSS Variables START ---------- */
:root {
    color-scheme: dark;

    --bg-main: #090909;
    --bg-sidebar: #121212;
    --bg-content: #161616;
    --stroke: #1c1826; 

    --text: #5a4f6a;
    --link: #7a6f9b;
    --link-underline: rgba(122, 111, 155, 0.4);
    --link-hover: #b7a7e0;
    --link-active: #d5c9ff;
    --title-shadow: rgba(90, 79, 106, 0.5);

    --content-panel: rgba(22, 22, 22, 0.5);
    --parallax-tint: #1c1826;
    --tint-blend: multiply;
    
    --bg-codebox: rgba(18, 18, 18, 0.85);
    --bg-codebox-hover: rgba(183, 167, 224, 0.9);
    --copy-btn-hover-bg: rgba(24, 24, 38, 0.3);
    --copy-btn-hover-text: #6f6390;

    --bg-mini-player: rgba(22, 22, 22, 0.55);

    /* Mobile Variables */
    --bg-menu-toggle: rgba(0, 0, 0, 0.35);
    --bg-menu-overlay: rgba(0, 0, 0, 0.45);

    /* AJAX */
    --panel-ms: 600ms;
    --fade-ms: 250ms;

    /* Font Variables */
    --font-title: 'BPDots', monospace;
    --font-nav: 'Praktika', sans-serif;
    --font-body: 'Epunda Sans', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}
/* ---------- CSS Variables END ---------- */

/* ---------- Light Mode START ---------- */
html[data-theme="light"] {
    color-scheme: light;
    --bg-main: #9B9B9B;
    --bg-sidebar: #9E9E9E;
    --bg-content: #A0A0A0;
    --stroke: #5a4f6a;
    
    --text: #1c1826;
    --link: #4e3f66;
    --link-underline: rgba(78, 63, 102, 0.45);
    --link-hover: #3a2f50;
    --link-active: #271f39;
    --title-shadow: rgba(28, 24, 38, 0.25);

    --content-panel: rgba(255, 255, 255, 0.4);
    --parallax-tint: #9E9E9E;
    --tint-blend: multiply;

    --bg-codebox: rgba(255, 255, 255, 0.8);
    --bg-codebox-hover: rgba(255, 255, 255, 0.92);
    --copy-btn-hover-bg: rgba(90, 79, 106, 0.12);
    --copy-btn-hover-text: #3a2f50;

    --bg-mini-player: rgba(255, 255, 255, 0.4);
    
    /* Mobile Variables */
    --bg-menu-toggle: rgba(255, 255, 255, 0.35);
    --bg-menu-overlay: rgba(255, 255, 255, 0.45);

    /* Font Variables */
    --font-title: 'BPDots', monospace;
    --font-nav: 'Praktika', sans-serif;
    --font-body: 'Epunda Sans', sans-serif;
}
/* ---------- Light Mode END ---------- */

/* ---------- Reduced Motion START ---------- */
@media (prefers-reduced-motion: reduce) {
    :root { --panel-ms: 0ms; --fade-ms: 0ms; }
}
/* ---------- Reduced Motion END ---------- */

/* ---------- Main Structure START ---------- */
html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg-main);
    color: var(--text);
    font-family: "Inter", "Segoe UI", sans-serif;
    line-height: 1.5;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text);
}

p {
    letter-spacing: 0.02rem;
    font-size: large;
}

hr {
    border: none;
    border-top: 2px solid var(--stroke);
    margin: 1rem 0;
}

.site-title {
    font-family: var(--font-title);
    text-transform: lowercase;
    text-shadow: var(--title-shadow);
}

.site {
    display: grid;
    place-items: center;
    height: 100vh;
}

.main-container {
    display: flex;
    width: 1280px;
    height: 720px;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-content);
    border: 2px solid var(--stroke);
    box-sizing: border-box;
    overflow: hidden;
}
/* ---------- Main Structure END ---------- */

/* ---------- Sidebar Structure START ---------- */
.sidebar {
    position: relative;
    width: 25%;
    background: var(--bg-sidebar);
    border-right: 2px solid var(--stroke);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
    text-align: center;
}

.profile-img {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid var(--stroke);
    object-fit: cover;
    margin-bottom: 1.25rem;
}

.profile {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile .site-title {
    font-size: 2rem;
    margin: 0.5rem 0;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 1px;
    text-align: center;
}

.profile hr {
    width: 80%;
}

.center-fix {
    position: relative;
    left: 0.075em;
}

.nav {
    font-family: var(--font-nav);
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.nav li {
    margin: 0.9rem 0;
}

.nav a {
    position: relative;
    color: var(--text);
    text-decoration: none;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    padding: 0 0.25em;
    transition: color 0.15s ease, transform 0.15s ease;
}

.nav a::before,
.nav a::after {
    content: "";
    opacity: 0;
    position: relative;
    color: var(--text);
    transition: transform 0.1s ease;
}

.nav a::before {
    content: "[";
    margin-right: 0.15em;
    transform: translateX(-0.25em);
}

.nav a::after {
    content: "]";
    margin-right: 0.15em;
    transform: translateX(0.25em);
}

.nav a:hover::before,
.nav a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.version {
    position: absolute;
    top: 16px;
    left: 10px;
    font-size: x-small;
    letter-spacing: .25em;
}

.version a{
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.version a:hover,
.version a:focus {
    color: var(--link-hover)
}

.version a:active {
    color: var(--link-active);
}

.theme-btn {
    display: inline-grid;
    place-items: center;
    position: absolute;
    right: 10px;
    top: 10px;
    margin-left: 10px;
    width: 24px;
    height: 24px;
    color: var(--text);
    cursor: pointer;
    line-height: 1;
    border: none;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
}


.theme-btn:hover {
    outline: 1px solid var(--stroke);
}

/* ---------- Sidebar Structure END ---------- */

/* ---------- Content Structure START ---------- */

.content {
    position: relative;
    width: 75%;
    height: 100%;
    background: var(--bg-content);
    display: block;
    box-sizing: border-box;
    overflow: hidden;
}

.content-panel {
    position: absolute;
    inset: 0;
    background: var(--content-panel);
    backdrop-filter: blur(4px);
    transform-origin: left;
    transition: transform var(--panel-ms) cubic-bezier(0.77, 0, 0.175, 1);
    overflow-y: auto;
    height: 100%;
    z-index: 10;
}

.content-panel.is-open {
    transform: scaleX(1);
}

.content-panel.is-closed {
    transform: scaleX(0);
    pointer-events: none;
}

.content-panel .inner {
    opacity: 1;
    transition: opacity var(--fade-ms) ease;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
    color: var(--text);
}

.content-panel .inner.is-dim {
    opacity: 0;
}

.content>* {
    position: relative;
    z-index: 1;
}

.content a{
 color: var(--link);
 text-decoration: none;
 border-bottom: 1px dotted var(--link-underline);
 transition: color 0.2s ease, border-color 0.2s ease;   
}

.content a:hover,
.content a:focus {
    color: var(--link-hover);
}

.content a:active {
    color: var(--link-active);
}

/* Button Group */
.content .button-group img {
    margin-right: 10px;
}

.content .button-group a {
    border-bottom: 0px;
}

/* Center Align Text Box */
.center-align {
    text-align: center;
}

/* Right Align Text Box */
.right-align {
    text-align: right;
}

/* About Icons */
.icon svg {
    width: 2rem;
    height: 2rem;
    color: var(--text);
    margin-right: 10px;
}

.icon a{
    border-bottom: 0px;
}

/* Code Box */
#codebox {
    display: block;
    background: var(--bg-codebox);
    border: 1px solid var(--stroke);
    color: var(--text);
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.6;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: scroll;
    width: fit-content;
    max-width: 200px;
    max-height: 100px;
    margin: 1rem 0;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#codebox:hover {
    border-color: var(--bg-codebox-hover)
}

#codebox code {
    color: var(--bg-codebox-hover);
}

pre {
    background: var(--bg-codebox);
    border: 1px solid var(--stroke);
    border-radius: 6px;
    overflow-x: auto;
    padding: 10px;
}

.copy-btn {
    background: none;
    border: 1px solid var(--stroke);
    color: var(--text);
    font-size: 0.75rem;
    text-transform: lowercase;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    color: var(--copy-btn-hover-text);
    border-color: var(--bg-codebox-hover);
    background: var(--copy-btn-hover-bg);
}

/* ---------- Content Structure END ---------- */

/* ---------- Parallax Background START ---------- */

.parallax {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.layer { /*Governs each layer of the parallax */
    position: absolute;
    width: 400%;
    height: 100%;
    background-repeat: repeat-x;
    background-size: 25% 100%;
    animation: slide linear infinite;
}

.sky  { bottom: 0; background-image: url("/img/layers/7_sky.webp"); animation-duration: 160s; opacity: 0.8; }
.bg2  { bottom: 0; background-image: url("/img/layers/6_background2_new.webp"); animation-duration: 120s; opacity: 0.85; }
.bg1  { bottom: 0; background-image: url("/img/layers/5_background_new.webp"); animation-duration: 90s;  opacity: 0.9; }
.mid3 { bottom: 0; background-image: url("/img/layers/4_midground3.webp"); animation-duration: 60s;  opacity: 0.95; }
.mid2 { bottom: 0; background-image: url("/img/layers/3_midground2.webp"); animation-duration: 40s;  opacity: 1; }
.mid1 { bottom: 0; background-image: url("/img/layers/2_midground.webp"); animation-duration: 25s;  opacity: 1; }
.fg   { bottom: 0; background-image: url("/img/layers/1_foreground.webp"); animation-duration: 15s;  opacity: 1; }

@keyframes slide {
  from { transform: translateX(0%); }
  to   { transform: translateX(-50%); }
}

.content > *:not(.parallax) {
    position: relative;
    z-index: 1;
}

.tint {
    position: absolute;
    inset: 0;
    background: var(--parallax-tint);
    mix-blend-mode: var(--tint-blend);
    opacity: 1;
    pointer-events: none;
    z-index: 10;
}

/* ---------- Parallax Background END ---------- */

/* ---------- Mini Player START ---------- */

.mini-player {
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: auto auto auto minmax(120px, 1fr) auto;
    gap: 4px;
    align-items: center;
    padding: 4px 6px;
    background: var(--bg-mini-player);
    border: 2px solid var(--stroke);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1;
    max-width: none;
}

.mini-player .mp-btn {
    all: unset;
    cursor: pointer;
    padding: 4px 6px;
    border: 1px solid var(--stroke);
    border-radius: 6px;
    color: var(--text);
}

.mini-player .mp-title {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--stroke);
    border-radius: 6px;
    padding: 4px 8px;
    opacity: .95;
}

.mini-player .mp-text {
    display: inline-block;
    white-space: nowrap;
    transform: translateX(0);
}

.mini-player.mp-scroll .mp-text {
    animation: mp-marquee var(--mq, 10s) linear infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mini-player.mp-scroll .mp-text {
        animation: none;
    }
}

/* Marquee definition */
@keyframes mp-marquee{
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(-100% + 1ch)); }
}

.mini-player .mp-ghost{
  position:absolute;
  width:0; height:0; border:0; padding:0; margin:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path: inset(50%);
  opacity:0; pointer-events:none;
}

/* ---------- Music Player END ---------- */

/* ---------- SoundCloud Embed Widget Customization START ---------- */

.soundcloud-container {
    background-color: var(--stroke);
    filter:
        invert(100%)
        hue-rotate(180deg);
    opacity: 0.6;
}

/* ---------- SoundCloud Embed Widget Customization END ---------- */

/* ---------- Mobile Design START ---------- */

.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    font-size: 26px;
    line-height: 1;
    background: none;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    color: var(--text);
    background-color: var(--bg-menu-toggle);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-menu-overlay);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        margin: 0;
        border-right: none;
        border-bottom: 2px solid var(--stroke);
    }
    
    .content {
        width: 100%;
    }

    html.js-enabled .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: .5ch;
    }
    html.js-enabled .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: 264px;
        transform: translateX(-100%);
        transition: transform .32s cubic-bezier(.4,0,.2,1);
        z-index: 1000;
        border-right: 2px solid var(--stroke);
        border-bottom: none;
    }

    html.js-enabled .menu-overlay {
        display: block;
    }

    html.menu-open .sidebar {
        transform: translateX(0);
    }

    html.menu-open .menu-overlay {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.js-enabled .sidebar {
        transition: none !important;
    }

    .menu-overlay {
        transition: none !important;
    }
}

/* ---------- Mobile Design END ---------- */