/* Global Styles */

* {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ff0000"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') 12 12, auto !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background-color: #000;
    color: #ccc;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    /* Dreamcore Bloom */
    text-shadow: 0 0 2px rgba(138, 86, 172, 0.3);
}

/* Sensory Overlays (Dreamcore/Traumacore) */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    background:
        /* Subtle Scanlines */
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.03) 0px, rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 2px),
        /* Soft Vignette */
        radial-gradient(circle at center, transparent 60%, rgba(20, 0, 40, 0.15) 100%);
    background-size: 100% 2px, 100% 100%;
}

/* Persistent Noise Grain */
body::after {
    content: "";
    position: fixed;
    inset: -200%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grain 8s steps(10) infinite;
}

/* Animations - Keeping functional but removing style-heavy ones */

@keyframes pulse-grayscale {
    0% {
        filter: grayscale(100%) contrast(120%);
    }

    50% {
        filter: grayscale(0%) contrast(100%);
    }

    100% {
        filter: grayscale(100%) contrast(120%);
    }
}

@keyframes flicker {

    /* Subtle flicker is okay for monitors, but keeping it minimal */
    0% {
        opacity: 1;
    }

    5% {
        opacity: 0.8;
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes breathe {

    0%,
    100% {
        letter-spacing: 2px;
    }

    50% {
        letter-spacing: 3.5px;
        opacity: 0.8;
    }
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -10%);
    }

    20% {
        transform: translate(-15%, 5%);
    }

    30% {
        transform: translate(7%, -25%);
    }

    40% {
        transform: translate(-5%, 25%);
    }

    50% {
        transform: translate(-15%, 10%);
    }

    60% {
        transform: translate(15%, 0%);
    }

    70% {
        transform: translate(0%, 15%);
    }

    80% {
        transform: translate(3%, 35%);
    }

    90% {
        transform: translate(-10%, 10%);
    }
}

@keyframes mainscroll {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 0% 1000px;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Shared Components */

.back-link {
    display: block;
    margin-top: 32px;
    text-align: center;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    border: none;
    padding: 10px;
    transition: all 0.2s ease;
    background: transparent;
    border-radius: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    letter-spacing: 1px;
}

.back-link:hover,
.back-link:focus {
    color: #8a56ac;
    /* Rich Violet */
    background-color: transparent;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(138, 86, 172, 0.4);
    outline: none;
    cursor: pointer;
}

/* Page: Index (index.html) */

.index-body {
    background-image: url('ezgif-6333e41df1be8e7c.gif');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    background-attachment: scroll;
    animation: mainscroll 40s linear infinite;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 50px 0;
    -moz-osx-font-smoothing: initial;
}

@media (min-width: 900px) {
    .index-body {
        background-attachment: fixed;
    }
}

.module {
    text-align: center;
    width: 100%;
    max-width: 300px;
    padding: 20px;
    margin: 20px;
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.module:hover {
    border-color: rgba(138, 86, 172, 0.4);
    box-shadow: 0 0 15px rgba(138, 86, 172, 0.2);
}

.module img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #333;
    margin-bottom: 15px;
    animation: bounce 4s infinite ease-in-out;
}

.module-label {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
    font-family: 'Courier New', Courier, monospace;
}

.module-label a {
    color: #ccc;
    text-decoration: none;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.module-label a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(138, 86, 172, 0.8);
}

.module.large {
    max-width: 600px;
}

.module-section-title {
    color: #8a56ac;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 3px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(138, 86, 172, 0.3);
    padding-bottom: 5px;
    text-align: left;
}

.module-content {
    text-align: left;
    color: #aaa;
    font-size: 0.85rem;
}

.status {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.links a {
    display: block;
    color: #ccc;
    text-decoration: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 0;
    transition: all 0.3s ease;
    /* Smooth hover */
    font-size: 0.9rem;
    background: transparent;
    text-align: center;
    letter-spacing: 2px;
    text-transform: lowercase;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.links a:focus,
.links a:hover {
    background-color: transparent;
    color: #fff;
    border-color: #8a56ac;
    letter-spacing: 4px;
    text-shadow: 0 0 8px rgba(138, 86, 172, 0.6);
    outline: none;
}

.footer {
    margin-top: 28px;
    font-size: 0.75rem;
    color: #555;
    text-transform: lowercase;
}

/* Page: About (about.html) */

.about-body {
    background-image: url('ezgif-628a3f1d0b46ba33.gif');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    background-attachment: scroll;
    animation: mainscroll 50s linear infinite;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 50px 0;
    line-height: 1.5;
}

@media (min-width: 900px) {
    .about-body {
        background-attachment: fixed;
    }
}

.about-terminal {
    width: 100%;
    max-width: 640px;
    margin: 20px;
    padding: clamp(30px, 5vw, 60px);
    background: rgba(5, 5, 5, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
    border-radius: 6px;
    animation: float 7s infinite ease-in-out;
}

.about-title {
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin: 0 0 32px;
    color: #eee;
    letter-spacing: 4px;
    /* Wide kerning */
    text-transform: uppercase;
    font-weight: 400;
}

.data-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    border-bottom: none;
    padding-bottom: 4px;
    align-items: center;
}

.label {
    color: #888;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.value {
    color: #ccc;
    text-align: right;
}

.bio-text {
    margin-top: 28px;
    font-size: 0.9rem;
    color: #aaa;
}

.bio-text p {
    margin: 0 0 12px;
}

.hidden-link {
    color: #555;
    text-decoration: underline;
    font-size: 0.8rem;
    margin-top: 14px;
    display: inline-block;
    transition: color 0.18s ease;
}

.hidden-link:hover,
.hidden-link:focus {
    color: #b388eb;
    background: #000;
    text-decoration: none;
    outline: none;
    text-shadow: 0 0 4px rgba(138, 86, 172, 0.4);
}

/* Page: Audio (audio.html) */

.audio-body {
    background-image: url('ezgif-6f6714c532319119.gif');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    background-attachment: scroll;
    animation: mainscroll 60s linear infinite reverse;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 50px 0;
}

.audio-container {
    width: 100%;
    max-width: 550px;
    text-align: center;
    background: rgba(5, 5, 5, 0.96);
    padding: 60px 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
    border-radius: 6px;
    animation: float 9s infinite ease-in-out;
}

.audio-title {
    font-size: 1em;
    letter-spacing: 4px;
    margin-bottom: 30px;
    color: #eee;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    font-weight: 400;
}

.embed-wrapper {
    border: 1px solid #444;
    margin-bottom: 30px;
    filter: grayscale(100%);
    transition: none;
}

.embed-wrapper:hover {
    filter: none;
    outline: 1px solid #fff;
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-link {
    display: block;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 0;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.85em;
    background: transparent;
    letter-spacing: 1px;
}

.music-link:hover {
    border-color: #8a56ac;
    color: #fff;
    background-color: transparent;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(138, 86, 172, 0.6);
}

.audio-back-link {
    display: block;
    margin-top: 50px;
    color: #666;
    text-decoration: underline;
    font-size: 0.8em;
}

.audio-back-link:hover {
    color: #fff;
    background: #1a0a20;
    text-decoration: none;
    outline: 1px solid #8a56ac;
}

/* Page: Psych Eval (psych_eval.html) */

.psych-body {
    background-color: #000;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 50px 0;
    animation: none;
    text-shadow: none;
    overflow-x: hidden;
}

.psych-body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('GnU-HStbcAA4QFh.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    z-index: -1;
    pointer-events: none;
    animation: mainscroll 120s linear infinite;
}

.psych-body::after {
    /* Removed scanlines */
    content: none;
}

.crt-overlay,
.scan-bar {
    display: none;
}

.report {
    width: 100%;
    max-width: 820px;
    margin: 28px 12px;
    padding: clamp(30px, 4.5vw, 60px);
    background-color: rgba(5, 5, 5, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    border-radius: 6px;
    animation: float 10s infinite ease-in-out;
}

.psych-title {
    font-size: 1.2rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 24px;
    color: #eee;
    letter-spacing: 4px;
    font-weight: 400;
}

.header-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 12px;
    color: #ccc;
    font-size: 0.9em;
}

.header-info div {
    min-width: 140px;
}

.section-title {
    display: block;
    font-weight: 400;
    background-color: transparent;
    color: #8a56ac;
    /* Subtle accent */
    padding: 4px 0;
    margin-top: 28px;
    margin-bottom: 12px;
    text-transform: uppercase;
    font-size: 0.85em;
    border: none;
    letter-spacing: 3px;
    border-bottom: 1px solid rgba(138, 86, 172, 0.3);
    border-radius: 0;
}

.diagnosis-list {
    list-style: none;
    padding: 0;
    border: none;
    background-color: transparent;
    margin: 0 0 20px 0;
}

.diagnosis-list li {
    margin-bottom: 10px;
    color: #bbb;
    font-size: clamp(0.9rem, 2.2vw, 0.98rem);
}

.diagnosis-list li::before {
    content: "> ";
    color: #888;
}

.scale-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
    align-items: center;
    color: #aaa;
}

.score-high {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-shadow: none;
}

.med-category {
    font-size: 0.78em;
    color: #555;
    margin-top: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.warning-box {
    border: 1px solid rgba(255, 50, 50, 0.3);
    background-color: rgba(20, 0, 0, 0.4);
    color: #dea;
    padding: 14px;
    font-size: 0.85em;
    margin-top: 24px;
    box-shadow: none;
    border-radius: 4px;
    letter-spacing: 1px;
}

.footer-nav {
    margin-top: 28px;
    text-align: right;
}

.psych-report a {
    color: #888;
    text-decoration: underline;
    transition: 0.24s;
    font-size: 0.95em;
}

.psych-report a:hover,
.psych-report a:focus {
    color: #fff;
    background-color: #1a0a20;
    text-shadow: 0 0 4px rgba(138, 86, 172, 0.4);
    letter-spacing: normal;
    outline: 1px solid #8a56ac;
    text-decoration: none;
}

/* Page: Not Found (not_found.html) */

.not-found-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1rem;
}

/* Responsive Overrides & Utilities */

/* Responsive Overrides & Utilities */

@media (max-width: 768px) {

    /* Tablet & Large Mobile */
    .audio-container {
        padding: 40px 24px;
        max-width: 90%;
    }

    .embed-wrapper iframe {
        height: 380px !important;
    }

    .psych-title {
        font-size: 1.1rem;
    }

    .header-info div {
        flex: 1 1 45%;
    }
}

@media (max-width: 480px) {

    /* Mobile Standard */
    body {
        min-height: 100dvh;
        /* Better mobile viewport handling */
    }

    .index-container {
        margin: 12px;
        padding: 30px 16px;
    }

    .index-title {
        letter-spacing: 3px;
        font-size: 1.4rem;
    }

    .links a {
        padding: 14px;
        font-size: 0.95rem;
    }

    /* About Page Mobile */
    .about-terminal {
        margin: 10px;
        padding: 24px 16px;
    }

    .about-title {
        letter-spacing: 3px;
        font-size: 1rem;
    }

    .data-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 0.9rem;
    }

    .value {
        text-align: left;
        padding-left: 10px;
        color: #ddd;
    }

    /* Audio Page Mobile */
    .audio-container {
        padding: 30px 16px;
        margin: 12px;
    }

    .embed-wrapper iframe {
        height: 300px !important;
    }

    /* Psych Eval Mobile */
    .report {
        margin: 10px;
        padding: 20px 14px;
    }

    .psych-title {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .header-info {
        flex-direction: column;
        gap: 8px;
    }

    .scale-row {
        font-size: 0.85rem;
    }

    /* Global Mobile Cleanups */
    .back-link,
    .audio-back-link {
        margin-top: 30px;
        padding: 14px;
    }
}

@media (max-width: 320px) {

    /* Small Mobile */
    .index-title {
        letter-spacing: 1px;
    }

    .status {
        margin-bottom: 12px;
    }

    .header-info {
        font-size: 0.85em;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }

    .glitch-img {
        animation: none;
    }

    .psych-body,
    .psych-body::before {
        animation: none;
    }
}

/* Scrollbar Styles */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 4px;
}