/* ==========================================================================
   HEARTSCRIPT STUDIOS - GLOBAL DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-color: #05070B;
    --text-color: #FFFFFF;
    --accent-purple: #BD3BF2;
    --accent-cyan: #00F2FE;
    --card-bg: rgba(12, 16, 23, 0.45);
    --border-color: rgba(0, 242, 254, 0.3);
    --text-muted: #D1D1D6;
    --success-green: #10B981;
    --warning-amber: #F59E0B;
    --danger-red: #EF4444;
    --glow-cyan: rgba(0, 242, 254, 0.25);
    --glow-purple: rgba(189, 59, 242, 0.35);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

@keyframes bgGlowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #05070B, #0A0E17, #05070B);
    background-size: 200% 200%;
    animation: bgGlowShift 20s ease infinite;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* --- Ambient Background Logo Spiral --- */
@keyframes ambientSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.08); }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

@keyframes spinTextRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.background-logo-spiral {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(700px, 85vw);
    height: min(700px, 85vw);
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    animation: ambientSpin 35s linear infinite;
}

.rotating-text-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: spinTextRing 25s linear infinite reverse;
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.normal-text-svg {
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.8));
    opacity: 1;
    transform: scale(1);
}

.pain-text-svg {
    filter: drop-shadow(0 0 18px rgba(255, 30, 56, 0.9));
    opacity: 0;
    transform: scale(0.85);
}

.background-logo-spiral img {
    width: 42%;
    height: 42%;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.normal-watermark-logo {
    border: 2px solid var(--accent-purple);
    filter: drop-shadow(0 0 60px var(--accent-purple)) brightness(1.4);
    opacity: 1;
    transform: scale(1);
}

.pain-watermark-logo {
    border: 2px solid #FF1E38;
    filter: drop-shadow(0 0 70px #FF1E38) brightness(1.25);
    opacity: 0;
    transform: scale(0.85);
}

.site-header, 
.main-wrapper, 
.site-footer {
    position: relative;
    z-index: 2;
}

/* --- Universal Header & Navigation --- */
.site-header {
    background-color: rgba(5, 7, 11, 0.85);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.brand-logo-container:hover { 
    opacity: 0.85; 
}

@keyframes logoEntrance {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 1.5px solid var(--accent-purple);
    box-shadow: 0 0 15px var(--glow-purple);
    animation: logoEntrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-text-group { 
    display: flex; 
    flex-direction: column; 
}

.brand-top-row { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.brand-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #FFFFFF 40%, #D1D1D6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 25px rgba(189, 59, 242, 0.4);
    text-transform: uppercase;
}

.studios-tag {
    font-size: 8px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1.5px solid var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(189, 59, 242, 0.1);
}

.brand-subtext {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-menu { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-wrap: wrap; 
}

.nav-item { 
    display: flex; 
    flex-direction: column; 
    text-decoration: none; 
    padding: 6px 12px; 
    border-radius: 8px; 
    border: 1px solid transparent; 
    transition: all 0.25s ease; 
}

.nav-item:hover { 
    border-color: rgba(189, 59, 242, 0.4); 
    background: rgba(189, 59, 242, 0.05); 
}

.nav-item.active { 
    border-color: var(--accent-purple); 
    background: rgba(189, 59, 242, 0.08); 
    box-shadow: inset 0 -2px 0 var(--accent-cyan), 0 0 12px rgba(189, 59, 242, 0.2); 
}

.nav-title { 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700; 
    font-size: 12px; 
    color: var(--text-color); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.nav-icon { 
    font-size: 11px; 
    color: var(--accent-cyan); 
}

.nav-caption { 
    font-size: 8px; 
    color: var(--text-muted); 
    margin-top: 1px; 
}

.header-right { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.status-pill { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 6px 14px; 
    border-radius: 20px; 
    background: rgba(16, 185, 129, 0.05); 
    border: 1px solid rgba(16, 185, 129, 0.3); 
    font-size: 9px; 
    font-family: 'Montserrat', sans-serif; 
}

.status-dot { 
    width: 7px; 
    height: 7px; 
    border-radius: 50%; 
    background-color: var(--success-green); 
    box-shadow: 0 0 8px var(--success-green); 
}

.status-text { 
    color: var(--success-green); 
    font-weight: 600; 
    text-transform: uppercase; 
}

.header-cta-btn { 
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)); 
    color: #05070B; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 800; 
    font-size: 10px; 
    letter-spacing: 1px; 
    padding: 9px 18px; 
    border-radius: 6px; 
    text-decoration: none; 
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3); 
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-cta-btn:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 25px var(--glow-cyan);
}

/* --- Universal Main Layout & AdSense Placeholders --- */
.main-wrapper { 
    max-width: 1280px; 
    width: 100%; 
    margin: 25px auto; 
    padding: 0 15px; 
    flex-grow: 1; 
}

.adsense-placeholder { 
    background-color: var(--card-bg); 
    border: 1px dashed #3A4659; 
    border-radius: 8px; 
    padding: 15px; 
    text-align: center; 
    color: #506982; 
    font-size: 11px; 
    letter-spacing: 1.5px; 
    text-transform: uppercase; 
    margin-bottom: 20px; 
    backdrop-filter: blur(8px); 
}

/* --- Universal Manifesto / Content Blocks --- */
.manifesto-block {
    background: linear-gradient(135deg, rgba(12, 16, 23, 0.78), rgba(5, 7, 11, 0.85));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 242, 254, 0.35);
    border-radius: 18px;
    padding: clamp(25px, 4vw, 40px);
    margin-bottom: 35px;
    box-shadow: 0 12px 45px rgba(0,0,0,0.6), inset 0 0 15px rgba(0, 242, 254, 0.05);
}

.manifesto-block h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    color: #FFF;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.manifesto-block h1 span {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.manifesto-block p {
    color: var(--text-color);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 18px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.manifesto-block h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: var(--accent-cyan);
    margin-top: 25px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Universal Footer --- */
.site-footer { 
    background-color: rgba(11, 13, 18, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color); 
    padding: 30px 15px; 
    width: 100%; 
    margin-top: auto; 
}

.footer-content { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    text-align: center; 
}

.footer-credits { 
    font-size: 11px; 
    color: #D1D1D6; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
    text-shadow: 0 0 8px rgba(255,255,255,0.2); 
}

.footer-links a { 
    color: #A1A1A6; 
    text-decoration: none; 
    margin: 0 8px; 
    font-size: 12px; 
    letter-spacing: 0.5px; 
    transition: color 0.3s ease; 
}

.footer-links a:hover { 
    color: var(--accent-cyan); 
    text-shadow: 0 0 8px var(--accent-cyan); 
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .nav-container { flex-direction: column; gap: 12px; text-align: center; }
    .nav-menu { justify-content: center; }
    .header-right { justify-content: center; flex-wrap: wrap; }
}

/* ==========================================================================
   HEARTSCRIPT STUDIOS: MULTIVERSE "PAIN MODE" ENGINE
   ========================================================================== */

/* 1. NEON RED HEADER TOGGLE BUTTON (Exact Twin of DIRECT NODE button) */
.pain-mode-btn {
    background: linear-gradient(135deg, #FF1E38, #990018);
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(255, 30, 56, 0.45);
    transition: all 0.3s ease;
    line-height: 1;
}

.pain-mode-btn:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 25px rgba(255, 30, 56, 0.8), 0 0 40px rgba(255, 30, 56, 0.5);
    transform: translateY(-1px);
}

.pain-pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #FFFFFF;
}

.pain-pulse-dot.active {
    background-color: #FFFFFF;
    box-shadow: 0 0 12px #FFFFFF, 0 0 20px #FF1E38;
    animation: painHeartbeat 1.2s infinite;
}

@keyframes painHeartbeat {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* 2. THE CRIMSON UNIVERSE COLOR OVERRIDES (SLOW BLEED TRANSITION) */
html {
    transition: background-color 1.5s cubic-bezier(0.25, 1, 0.5, 1), 
                border-color 1.5s ease, 
                box-shadow 1.5s ease;
}

/* Explicitly override hardcoded body gradient for Pain Mode */
html[data-theme="pain"] body {
    background: linear-gradient(135deg, #080203, #160408, #080203) !important;
}

html[data-theme="pain"] {
    --accent-cyan: #FF1E38 !important;
    --accent-purple: #FF6B6B !important;
    --glow-cyan: rgba(255, 30, 56, 0.45) !important;
    --border-color: rgba(255, 30, 56, 0.35) !important;
    background-color: #080203 !important;
}

html[data-theme="pain"] .main-wrapper,
html[data-theme="pain"] .site-header,
html[data-theme="pain"] .panel-header-badge,
html[data-theme="pain"] .tool-tabs .tab-btn.active,
html[data-theme="pain"] .asset-card,
html[data-theme="pain"] .manifesto-block {
    border-color: rgba(255, 30, 56, 0.35) !important;
}

/* Spread a subtle red radial bleed across the screen */
html[data-theme="pain"] body::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 150vw;
    height: 150vh;
    background: radial-gradient(circle, rgba(255, 30, 56, 0.12) 0%, rgba(8, 2, 3, 0) 65%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    animation: bleedExpand 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes bleedExpand {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 3. THE BLEEDING HEART (bh.png) & ROTATING MESSAGE SWITCH */
html[data-theme="pain"] .normal-text-svg,
html[data-theme="pain"] .normal-watermark-logo {
    opacity: 0 !important;
    transform: scale(1.15);
    pointer-events: none;
}

html[data-theme="pain"] .pain-text-svg,
html[data-theme="pain"] .pain-watermark-logo {
    opacity: 1 !important;
    transform: scale(1);
}

/* 4. HEADER LOGO SWAP FOR PAIN / BLEED MODE */
html[data-theme="pain"] .brand-logo-container .logo-img {
    content: url("../../bh.png") !important;
    border-color: #FF1E38 !important;
    box-shadow: 0 0 18px rgba(255, 30, 56, 0.7) !important;
    transform: scale(1.05);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Mobile Header Screen Coverage Fix */
@media screen and (max-width: 768px) {
    header, .site-header, .header-container { 
        height: auto !important;
        position: relative !important;
        padding-bottom: 15px;
    }
}