:root {
    --bg: #070a12;
    --surface: #0c0d12;
    --text: #e2e8f0;
    --muted: #868e9c;
    --accent: #ff2c2c; /* Keeping Jester's red */
    --accent-dim: #2a0a0d;
    --gold: #f2c42e;
    --blue-retro: #8585d4;
    --line: #3f444d;
    --headerfooter: #0e1321;
    --lines: #f2c42e;
}

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    line-height: 1.6;
    overflow-x: hidden; /* Hides decorations that overflow off-screen */
    padding-bottom: 60px; /* Space for fixed footer */
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(800px, 90%);
    margin: auto;
}

/* RETRO HEADER */
header {
    border-bottom: 3px solid var(--lines);
    padding: 15px 0;
    position: sticky;
    top: 0;
    background: var(--headerfooter);
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.15em;
    color: var(--accent);
}

.logo::before {
    content: "[ ";
    color: var(--text);
}

.logo::after {
    content: " ]";
    color: var(--text);
}

/* ONION LIVE COUNTER */
.onion-counter {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
    max-width: 320px;
    line-height: 1.3;
}

.onion-counter span {
    color: var(--gold);
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--blue-retro);
    font-weight: bold;
    padding: 2px 8px;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: #fff;
    border-color: var(--line);
    background-color: #161922;
}

/* HERO SECTION */
.hero {
    padding: 60px 0 30px 0;
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

/* "NOT" highlighting matching your raw badge style */
.hero h1 span {
    color: var(--accent);
    padding: 0px 10px;
    display: inline-block;
}

.hero p {
    max-width: 550px;
    color: var(--muted);
    font-size: 1rem;
    border-left: 3px solid var(--accent);
    padding-left: 15px;
    margin-top: 20px;
}

/* SECTIONS */
section {
    padding: 15px 0;
}

.section-title {
    text-transform: uppercase;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    border-bottom: 2px dashed var(--line);
}

/* PROJECTS (WORK) */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.project {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 10px;
    background: var(--surface);
    border: 2px solid var(--line);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.project:hover {
    border-color: var(--accent);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000;
}

.project:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}

/* CLIP-PATH DIAMOND IMAGE PREVIEW */
.project-img-wrapper {
    width: 95px;
    height: 95px;
    flex-shrink: 0;
    background: var(--gold); /* Acts as the border color */
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img-wrapper img {
    width: calc(100% - 4px); /* Creates a clean 2px red border frame */
    height: calc(100% - 4px);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    object-fit: cover;
    image-rendering: pixelated;
}

.project-info {
    flex-grow: 1;
}

.project h3 {
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 4px;
}

.project p {
    color: #ede9b9;
    font-size: 0.95rem;
}

/* ABOUT */
.about {
    max-width: 650px;
    font-size: 1rem;
    line-height: 1.7;
    background: var(--surface);
    border: 2px solid var(--line);
    padding: 20px;
}

/* LINKS */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 650px;
}

.link-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 5px;
    border-bottom: 1px dashed var(--line);
    transition: padding-left 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

/* For links that copy on click */
.link-item.copyable {
    cursor: copy;
}

.link-item:hover {
    border-bottom-style: solid;
    border-bottom-color: var(--accent);
    padding-left: 8px;
}

.link-label {
    font-weight: bold;
    color: var(--blue-retro);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.link-item:hover .link-label {
    color: var(--accent);
}

.link-dots {
    flex-grow: 1;
    border-bottom: 1px dotted var(--line);
    margin: 0 15px;
    align-self: center;
    opacity: 0.5;
}

.link-url {
    color: var(--muted);
    font-size: 0.95rem;
    text-align: right;
    transition: color 0.2s ease;
}

.link-item:hover .link-url {
    color: #fff;
}

/* TOAST NOTIFICATION */
.toast-notification {
    position: fixed;
    bottom: 80px;
    right: -300px;
    background-color: var(--surface);
    border: 2px solid var(--accent);
    color: var(--text);
    padding: 12px 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
    right: 30px;
}

.toast-accent {
    color: var(--accent);
}

/* FOOTER */
footer {
    border-top: 3px solid var(--lines);
    width: 100%;
    position: fixed;
    bottom: 0;
    background-color: var(--headerfooter);
    color: var(--blue-retro);
    padding: 8px 0;
    font-size: 0.85rem;
    z-index: 1000;
}

footer .container {
    text-align: center;
}

/* MOBILE RESPONSIVENESS */
@media(max-width:700px) {
    nav {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .onion-counter {
        text-align: center;
        max-width: 100%;
    }

    .hero {
        padding: 50px 0;
    }

    .project {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
        padding: 15px;
    }

    .project-img-wrapper {
        margin: 5px 0 10px 0;
    }

    .link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        border-bottom-style: solid;
    }

    .link-dots {
        display: none;
    }

    .toast-notification.show {
        right: 5%;
        left: 5%;
        width: 90%;
        text-align: center;
    }

    /* Hide decorations on mobile so they don't break mobile layouts */
    .page-decoration {
        display: none;
    }
}

/* --- DECORATION STYLES --- */

main {
    position: relative; /* Acts as the "anchor" for decorations */
    z-index: 1;
}

.page-decoration {
    position: absolute;
    z-index: -1; /* Placed cleanly behind content */
    pointer-events: none;
}

.page-decoration img {
    opacity: 0.8;
    image-rendering: pixelated;
    width: 380px;
}

/* decor-1 (Left Side of central content container) */
.decor-1 {
    top: 180px;
    right: 100%;          /* Pins the RIGHT edge of image to the LEFT edge of content */
    margin-right: 30px;    /* Slight overlap with central column */
    transform: rotate(-12deg);
}

/* decor-2 (Right Side of central content container) */
.decor-2 {
    top: 900px;
    left: 100%;            /* Pins the LEFT edge of image to the RIGHT edge of content */
    margin-left: -50px;    /* Slight overlap with central column */
    transform: rotate(10deg);
}

/* decor-3 (Left Side of central content container, further down) */
.decor-3 {
    top: 800px;
    right: 100%;
    margin-right: 20px;
    transform: rotate(-20deg) scale(1.8);
}

/* decor-4 (Right Side of central content container) */
.decor-4 {
    top: 800px;
    left: 100%;            /* Pins the LEFT edge of image to the RIGHT edge of content */
    margin-left: -40px;    /* Slight overlap with central column */
    transform: rotate(10deg);
    opacity: 1.0;
}

/* decor-5 (Right Side of central content container) */
.decor-5 {
    top: 100px;
    left: 100%;            /* Pins the LEFT edge of image to the RIGHT edge of content */
    margin-left: -40px;    /* Slight overlap with central column */
    transform: rotate(-10deg);
}

/* decor-6 (currently unused — kept in case a 6th decoration image is added) */
.decor-6 {
    top: 300px;
    left: 100%;            /* Pins the LEFT edge of image to the RIGHT edge of content */
    margin-left: 20px;     /* Slight overlap with central column */
    transform: rotate(8deg);
}

/* PROJECT PAGE (gallery.html) */
.project-page {
    padding: 50px 0;
}

.project-page .decor-3 {
    top: 1600px;
}

.project-header {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin-bottom: 40px;
}

.project-header h1 {
    color: var(--gold);
    font-size: 2.5rem;
}

.project-description {
    background: var(--surface);
    border: 2px solid var(--line);
    padding: 20px;
    margin-bottom: 40px;
}

.back {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--blue-retro);
}

.back:hover {
    color: white;
}

/* GALLERY (tank/touhou grid) */
.tank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.tank-card {
    background: var(--surface);
    border: 2px solid var(--line);
    padding: 15px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
    display: flex;
    flex-direction: column;
}

.tank-card:hover {
    border-color: var(--gold);
    transform: translate(-2px, -2px);
}

.tank-card:active {
    transform: translate(2px, 2px);
}

.tank-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border: 2px solid var(--line);
    margin-bottom: 12px;
    image-rendering: pixelated;
}

.tank-title {
    color: var(--gold);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.tank-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.loading-text {
    text-align: center;
    color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
    padding: 40px 0;
}

/* STEAM-STYLE LIGHTBOX MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 10, 18, 0.95); /* Deep dark background */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: min(1000px, 95%);
    background: var(--surface);
    border: 2px solid var(--gold);
    padding: 20px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--text);
    padding: 5px 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 3px 3px 0px #000;
}

.modal-close:hover {
    background: #fff;
    color: #000;
}

.modal-title {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.4rem;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px;
}

.modal-viewer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image-wrapper {
    width: 100%;
    max-height: 50vh;
    display: flex;
    justify-content: center;
    background: #000;
    border: 2px solid var(--line);
}

.modal-image-wrapper img {
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
}

.modal-description {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: #090c14;
    border: 1px solid var(--line);
    color: #ede9b9;
    font-size: 0.95rem;
    max-height: 120px;
    overflow-y: auto;
}

.modal-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.modal-btn {
    background: var(--surface);
    border: 2px solid var(--muted);
    color: var(--text);
    padding: 8px 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.1s;
}

.modal-btn:hover {
    background: var(--accent-dim);
    color: #fff;
	border: 2px solid var(--accent);
}

.modal-counter {
    color: var(--muted);
    font-size: 0.9rem;
}
