/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-dark: #0f0f0f;       
    --text-main: #ffffff;
    --text-muted: #8b8b8b;
    --accent-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.05);
    --progress-bg: #333333;
    --progress-fill: #e0e0e0;
    --font-display: 'Playfair Display', serif;
    --font-ui: 'Inter', sans-serif;

    --gem-quartz: #F2F2F2;
    --gem-citrine: #F6C453;
    --gem-sapphire: #3E7BFA;
    --gem-emerald: #2ECC71;
    --gem-ruby: #E63950;
    --gem-diamond: #FFFFFF;

    /* Shared accent gradient — used sparingly on buttons, hovers, focus rings */
    --accent-1: #6C63FF;
    --accent-2: #00D9C0;
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --accent-glow: rgba(108, 99, 255, 0.35);
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-ui);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

body.no-scroll { 
    overflow: hidden; 
    height: 100vh; 
    position: fixed; 
    width: 100%; 
}

.active-view { 
    display: block; 
    animation: fadeIn 0.5s ease; 
    width: 100%; 
    min-height: 100vh; 
}
.active-view.player-body { display: flex; align-items: center; justify-content: center; }
.active-view.vibe-body { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.active-view.preface-body { display: flex; align-items: center; justify-content: center; }
.active-view.next-sim-body { display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }

.hidden-view { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Rapid-flash hover shake effect on the hero image (Simulation trigger) */
@keyframes shakeScreen {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-4px, 3px); }
    40%  { transform: translate(4px, -3px); }
    60%  { transform: translate(-3px, -4px); }
    80%  { transform: translate(3px, 4px); }
    100% { transform: translate(0, 0); }
}
body.shake {
    animation: shakeScreen 0.12s linear infinite;
}

/* =========================================
   PREFACE / AGE-GATE SCREEN
   ========================================= */
.preface-body {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.preface-content-wrapper {
    max-width: 520px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.preface-image-container {
    width: 100%;
    max-width: 520px;
    height: 420px;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
    margin: 0 auto;
    background: #000;
}

.preface-visual {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    opacity: 0.92;
    transition: opacity 0.6s ease, transform 0.8s ease;
}

.preface-content-wrapper:hover .preface-visual {
    opacity: 1;
    transform: scale(1.03);
}

.preface-title {
    font-family: var(--font-ui);
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin: 0;
    color: #ffffff;
    opacity: 0.95;
}

.preface-warning {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: #aaaaaa;
    line-height: 1.55;
    margin: 0;
    border-left: 3px solid #ff4444;
    padding-left: 18px;
    text-align: left;
}

.preface-question {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.45;
    margin: 12px 0 20px 0;
}

.preface-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 10px;
}

.preface-btn {
    flex: 1;
    max-width: 240px;
    padding: 16px 24px;
    border-radius: 30px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s ease;
}

.enter-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.enter-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-3px);
}

.exit-btn {
    background: transparent;
    color: #aaaaaa;
    border: 1px solid rgba(255,255,255,0.15);
}

.exit-btn:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* =========================================
   2. HOMEPAGE STYLES
   ========================================= */
.hero-section { 
    display: flex; 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center; 
    min-height: 100vh; 
    padding: 80px; 
    max-width: 1600px; 
    margin: 0 auto; 
    gap: 60px; 
}
.hero-content-left { flex: 1; text-align: left; z-index: 2; max-width: 600px; }
.main-title, .sub-title { 
    display: block; 
    font-size: clamp(4rem, 8vw, 7rem); 
    margin: 0; 
    line-height: 0.9; 
    font-weight: 700; 
    letter-spacing: -0.03em; 
    color: var(--text-main); 
}
.clock-container-left { display: block; margin: 30px 0; opacity: 0.8; }
#digital-clock { height: 50px; width: 100%; max-width: 350px; filter: invert(1); display: block; }

.footer-link-container { 
    text-align: left; 
    margin-top: 40px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}
.description, .back-link, .simulation-nav a {
    font-family: var(--font-ui);
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    width: fit-content;
    cursor: pointer;
    position: relative;
    padding-bottom: 2px;
}
.description::after, .back-link::after, .simulation-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.description:hover, .back-link:hover, .simulation-nav a:hover {
    color: var(--text-main);
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.description:hover::after, .back-link:hover::after, .simulation-nav a:hover::after {
    transform: scaleX(1);
}
.link-arrow { 
    opacity: 0; 
    transform: translateX(-10px); 
    transition: all 0.3s ease; 
    margin-left: 10px; 
    font-size: 1.2rem; 
}
.description:hover .link-arrow { 
    opacity: 1; 
    transform: translateX(0); 
}

.hero-image-right { 
    flex: 1; 
    height: 70vh; 
    min-height: 500px; 
    width: 100%; 
    max-width: 600px; 
    overflow: hidden; 
    border-radius: 12px; 
    position: relative; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.6); 
}
.hero-image-right img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    opacity: 0.9; 
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.2s; 
}
.hero-image-right:hover img { 
    transform: scale(1.04); 
    opacity: 1; 
}

/* =========================================
   3. PLAYER VIEW STYLES
   ========================================= */
.player-center-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

#music-player-container {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.player-visuals {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.album-art-large {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #333, #111);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.album-art-large.yellow-mode {
    background: linear-gradient(135deg, #FFD700, #B8860B);
}

.album-art-large.white-mode {
    background: linear-gradient(135deg, #FFFFFF, #CCCCCC);
}

.album-art-large.rose-mode {
    background: linear-gradient(135deg, #E8B4BC, #7A3B4E);
}

.track-details {
    text-align: center;
    margin-bottom: 30px;
}

.song-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.song-artist, .song-album, .song-year {
    color: var(--text-muted);
    margin: 5px 0;
    font-size: 0.9rem;
}

.progress-area {
    margin: 30px 0;
}

.progress-bar-container {
    background: var(--progress-bg);
    height: 4px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin-bottom: 10px;
}

.progress-bar-fill {
    background: var(--accent-gradient);
    height: 100%;
    border-radius: 4px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--text-main);
    border-radius: 50%;
    cursor: pointer;
}

.track-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: monospace;
}

.bottom-controls {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.05);
}

.main-btn {
    background: rgba(255, 255, 255, 0.15);
    width: 60px;
    height: 60px;
}

.track-select-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin: 30px 0;
    max-height: 340px;
    overflow-y: auto;
    padding: 4px 14px 4px 4px;
}

.track-select-grid::-webkit-scrollbar {
    width: 6px;
}

.track-select-grid::-webkit-scrollbar-track {
    background: transparent;
}

.track-select-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.album-group-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.album-group-name {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-main);
}

.album-group-meta {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-group-tracks {
    display: flex;
    flex-direction: column;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    padding: 9px 10px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

.track-row-num {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    min-width: 20px;
}

.track-row-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-row:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.track-row.active {
    background: var(--card-bg);
    color: var(--text-main);
}

.track-row.active .track-row-num {
    color: var(--accent-2);
    opacity: 1;
}

.player-footer {
    text-align: center;
    margin-top: 30px;
}

.player-footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.player-footer-home-link {
    margin: 0 auto;
}

/* =========================================
   4. VIBLOG STYLES
   ========================================= */
.viblog-wrapper {
    max-width: 720px;
    width: 100%;
    padding: 40px;
}

.viblog-header {
    font-family: var(--font-display);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4px;
    color: var(--text-main);
}

.viblog-subtitle {
    display: block;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 44px;
}

#viblog-feed {
    display: flex;
    flex-direction: column;
}

.viblog-entry {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.entry-toggle {
    display: flex;
    align-items: baseline;
    gap: 18px;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 20px 4px;
    text-align: left;
    font-family: inherit;
    transition: opacity 0.2s ease;
}

.entry-toggle:hover {
    opacity: 0.7;
}

.entry-date {
    flex: none;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 4px;
}

.entry-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.4;
}

.entry-chevron {
    flex: none;
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}

.viblog-entry.expanded .entry-chevron {
    transform: rotate(45deg);
}

.entry-body-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.viblog-entry.expanded .entry-body-wrap {
    max-height: 3000px;
}

.entry-body {
    color: #ccc;
    line-height: 1.7;
    margin: 0 4px 16px;
}

.entry-image {
    max-width: 100%;
    border-radius: 12px;
    margin: 0 4px 20px;
    display: block;
}

.viblog-footer {
    text-align: center;
    margin-top: 40px;
}

/* =========================================
   5. LIBRARY STYLES
   ========================================= */
.library-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
}

.library-title {
    font-family: var(--font-display);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-main);
}

.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.book-item {
    display: block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.book-item img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.book-item:hover {
    transform: translateY(-10px);
}

.book-item:hover img {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.simulation-nav {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 40px 0 20px;
}

/* =========================================
   6. RESEARCH STYLES
   ========================================= */
.research-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
}

.research-section {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.research-content-left {
    flex: 2;
}

.research-image-right {
    flex: 1;
}

.research-image-right img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.paper-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 40px 0;
}

.paper-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.paper-item:hover {
    transform: translateX(10px);
    border-color: rgba(108, 99, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.paper-id {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.paper-title {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 1rem;
    margin: 0;
    color: var(--text-main);
}

.paper-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.paper-item:hover .paper-arrow {
    transform: translateX(5px);
    color: var(--text-main);
}

/* =========================================
   7. ORACLE STYLES
   ========================================= */
.oracle-container {
    max-width: 800px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.oracle-header {
    text-align: center;
    margin-bottom: 30px;
}

.oracle-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin: 0;
    background: linear-gradient(135deg, #fff, var(--accent-1) 140%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.oracle-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

.oracle-signal {
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 8px;
    opacity: 0.55;
    font-family: var(--font-ui);
    min-height: 1em;
}

.chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    margin-bottom: 20px;
}

.chat-message {
    margin-bottom: 20px;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.chat-message.user {
    background: var(--accent-gradient);
    margin-left: auto;
    text-align: right;
}

.chat-message.oracle {
    background: rgba(255, 255, 255, 0.1);
    margin-right: auto;
    border-left: 3px solid var(--accent-1);
}

.chat-message.oracle.corrupted {
    border-left: 3px solid #ff4466;
    color: #ffd9e0;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
    animation: fadeIn 0.3s ease, corruptFlicker 1.1s ease-in-out 1;
}

@keyframes corruptFlicker {
    0%, 100% { opacity: 1; }
    8%  { opacity: 0.3; }
    16% { opacity: 1; }
    24% { opacity: 0.4; }
    32% { opacity: 1; }
    68% { opacity: 0.5; }
    76% { opacity: 1; }
}

.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 18px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-1);
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
    display: flex;
    gap: 15px;
}

#user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 30px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#user-input:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#send-btn {
    background: var(--accent-gradient);
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.oracle-footer {
    text-align: center;
    margin-top: 30px;
}

/* =========================================
   8. AFFIRMATION / MATRIX RAIN STYLES - OPTIMIZED
   ========================================= */
.next-sim-body {
    position: relative;
    overflow: hidden;
}

.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    contain: layout style paint;
}

.matrix-drop {
    position: absolute;
    top: -80px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 8px currentColor;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    animation: matrixFall linear forwards;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    8% {
        opacity: 0.85;
    }
    92% {
        opacity: 0.75;
    }
    100% {
        transform: translateY(calc(100vh + 150px));
        opacity: 0;
    }
}

.affirmation-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    text-align: center;
    padding: 40px 20px;
    max-width: 640px;
    width: 100%;
}

.gallery-art {
    width: 100%;
    max-width: 360px;
    max-height: 55vh;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px var(--accent-glow);
}

.affirmation-text-container {
    padding: 0 10px;
}

.affirmation-main-text {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    line-height: 1.3;
    margin: 0;
    background: linear-gradient(135deg, #fff, var(--accent-2) 140%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.affirmation-back-link {
    font-family: var(--font-ui);
    color: var(--text-muted);
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    cursor: pointer;
}

.affirmation-back-link:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Rarity styles - gemstone tiers, rarest = diamond find */
.gem-quartz   { color: var(--gem-quartz); text-shadow: 0 0 6px rgba(242, 242, 242, 0.55); }
.gem-citrine  { color: var(--gem-citrine); text-shadow: 0 0 9px var(--gem-citrine); }
.gem-sapphire { color: var(--gem-sapphire); text-shadow: 0 0 11px var(--gem-sapphire); }
.gem-emerald  { color: var(--gem-emerald); text-shadow: 0 0 13px var(--gem-emerald); }
.gem-ruby     { color: var(--gem-ruby); text-shadow: 0 0 15px var(--gem-ruby), 0 0 30px var(--gem-ruby); }
.gem-diamond  {
    color: #ffffff;
    font-weight: 700;
}

/* Drops with a secondary glow animation must keep matrixFall running
   alongside it - the `animation` shorthand replaces the whole stack,
   so these combos are declared explicitly rather than relying on
   .glow-pulse / .gem-diamond alone (which would freeze the drop
   off-screen forever). JS sets per-drop timing as comma-separated
   values matching this animation-name order. */
.matrix-drop.glow-pulse {
    animation: matrixFall linear forwards, glowPulse 1.9s ease-in-out infinite alternate;
}

.matrix-drop.gem-diamond {
    animation: matrixFall linear forwards, diamondShimmer 1.6s ease-in-out infinite;
}

@keyframes glowPulse {
    from { filter: brightness(1); text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
    to   { filter: brightness(1.45); text-shadow: 0 0 20px currentColor, 0 0 42px currentColor; }
}

@keyframes diamondShimmer {
    0%, 100% { text-shadow: 0 0 10px #fff, 0 0 22px #bfe9ff, 0 0 42px var(--accent-2); filter: brightness(1); }
    50%      { text-shadow: 0 0 16px #fff, 0 0 32px #ffd9f7, 0 0 58px var(--accent-1); filter: brightness(1.55); }
}
/* =========================================
   9. VIBE NOTES STYLES
   ========================================= */
.notes-container {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
}

.notes-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0;
    color: var(--text-main);
}

.new-note-btn {
    background: var(--accent-gradient);
    color: #000;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 0 25px var(--accent-glow);
    transition: all 0.3s ease;
    font-family: var(--font-ui);
}

.new-note-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px var(--accent-glow);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.note-card {
    background: #161616;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
}

.note-card:hover {
    transform: translateY(-10px);
    border-color: rgba(108, 99, 255, 0.4);
    box-shadow: 0 25px 50px var(--accent-glow);
}

.note-card .note-color {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 8px;
}

.note-card h3 {
    margin: 8px 0 12px 0;
    color: #fff;
    font-size: 1.35rem;
    font-family: var(--font-display);
}

.note-card p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 15px;
    font-family: var(--font-ui);
}

.note-card .note-image {
    width: 100%;
    border-radius: 14px;
    margin: 15px 0;
    max-height: 220px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.note-card .note-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    transition: opacity 0.2s;
}

.note-card:hover .note-actions {
    opacity: 1;
}

/* Touch devices never fire :hover, so without this the Delete button on
   every note card stayed permanently invisible (opacity: 0) and completely
   unreachable on mobile - there was no other way to delete a note. */
@media (hover: none), (max-width: 768px) {
    .note-card .note-actions {
        opacity: 1;
    }
}

.delete-btn {
    background: #ff3366;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-ui);
}

.delete-btn:hover {
    background: #ff5555;
    transform: scale(1.05);
}

.notes-footer {
    text-align: center;
    margin-top: 40px;
}

.note-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: #111;
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 620px;
    border: 1px solid #333;
}

.note-title-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    margin-bottom: 20px;
    outline: none;
    font-family: var(--font-display);
}

#note-content {
    width: 100%;
    min-height: 220px;
    background: #1f1f1f;
    border: 1px solid #444;
    color: #eee;
    padding: 18px;
    border-radius: 16px;
    resize: vertical;
    font-family: var(--font-ui);
    font-size: 1.05rem;
}

.image-upload-area {
    margin: 15px 0;
}

.image-upload-area label {
    display: block;
    margin: 10px 0 8px;
    color: #0ff;
    font-weight: 600;
    cursor: pointer;
}

#note-image-upload {
    display: none;
}

.modal-image-preview img {
    max-width: 100%;
    border-radius: 16px;
    margin-top: 10px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.save-btn, .cancel-btn {
    flex: 1;
    padding: 14px;
    border-radius: 30px;
    font-family: var(--font-ui);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.save-btn {
    background: var(--accent-gradient);
    color: #000;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.cancel-btn {
    background: transparent;
    color: #8b8b8b;
    border: 1px solid rgba(255,255,255,0.2);
}

.cancel-btn:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* =========================================
   10. PDF READER OVERLAY
   ========================================= */
#pdf-reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.close-reader-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 700;
    transition: all 0.3s ease;
    z-index: 10001;
}

.close-reader-btn:hover {
    background: #ff4444;
    transform: scale(1.05);
}

#pdf-frame {
    width: 90%;
    height: 90%;
    border: none;
    background: white;
    border-radius: 12px;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        padding: 40px;
        text-align: center;
    }
    
    .hero-content-left {
        text-align: center;
    }
    
    .footer-link-container {
        align-items: center;
    }
    
    .research-section {
        flex-direction: column;
    }
    
    .research-image-right {
        order: -1;
    }
}

@media (max-width: 768px) {
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .notes-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .new-note-btn {
        width: 100%;
    }
    
    .preface-image-container {
        height: 300px;
    }
    
    .player-center-wrapper {
        padding: 20px;
    }
    
    #music-player-container {
        padding: 20px;
    }
    
    .track-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .bookshelf-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .paper-item {
        flex-direction: column;
        text-align: center;
    }
    
    .oracle-container {
        margin: 20px;
        padding: 20px;
    }
    
    .chat-message {
        max-width: 90%;
    }
}

@media (max-width: 600px) {
    .note-card {
        padding: 16px;
    }
    
    .preface-image-container {
        height: 260px;
    }
    
    .song-title {
        font-size: 1.5rem;
    }
    
    .affirmation-main-text {
        font-size: 1.2rem;
    }
    
    .gallery-art {
        max-width: 90%;
    }
}

/* =========================================
   EQUATOR STYLES (Simulation 0000)
   ========================================= */
.equator-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
}

.equator-heat-banner {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    padding: 70px 30px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.equator-heat-banner .heat-band {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        #0a1440 0%,
        #1c4b8c 12%,
        #1f9bb0 22%,
        #2ecc71 32%,
        #f6c453 42%,
        #f2892e 48%,
        #e63950 54%,
        #b3122f 60%,
        #e63950 66%,
        #f2892e 72%,
        #f6c453 78%,
        #2ecc71 86%,
        #1f9bb0 92%,
        #1c4b8c 97%,
        #0a1440 100%
    );
    background-size: 100% 220%;
    animation: equator-drift 18s ease-in-out infinite;
}

.equator-heat-banner .heat-shimmer {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0) 3px,
        rgba(255, 255, 255, 0.03) 6px
    );
    mix-blend-mode: overlay;
    animation: equator-shimmer 6s linear infinite;
}

@keyframes equator-drift {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 0% 100%; }
}

@keyframes equator-shimmer {
    0% { transform: translateY(0); }
    100% { transform: translateY(12px); }
}

.equator-title {
    position: relative;
    font-family: var(--font-display);
    font-size: 3rem;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
    margin: 0;
}

.equator-subtitle {
    position: relative;
    font-family: var(--font-ui);
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    margin: 8px 0 0;
    letter-spacing: 0.05em;
}

.equator-content {
    padding: 0 10px;
}

.equator-ode {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    margin: 0 0 28px;
}

.equator-belt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0;
}

.equator-belt-list span {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 6px 16px;
}

.equator-spectrum {
    margin: 30px 0 40px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spectrum-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin: 0 0 16px;
    color: var(--text-main);
}

.equator-spectrum .equator-ode {
    margin: 0;
}

.equator-belt-group {
    margin: 26px 0;
}

.belt-group-title {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

@media (max-width: 768px) {
    .equator-container {
        padding: 20px;
    }
    .equator-heat-banner {
        padding: 50px 20px;
    }
    .equator-title {
        font-size: 2rem;
    }
    .equator-ode {
        font-size: 1rem;
    }
}
