/* Reactor Page Styles - High Contrast & Readability Fix */

/* Mobile/PC display utilities */
.sp-only { display: none; }
.pc-only { display: inline; }
@media (max-width: 768px) {
    .sp-only { display: inline !important; }
    .pc-only { display: none !important; }
}

:root {
    --accent-color: #00ffff; /* Cyber cyan */
    --accent-secondary: #ff00ff; /* Neon magenta */
    --bg-dark: #000000;
    --text-main: #ffffff;
    --font-display: 'Michroma', sans-serif;
    --font-main: 'Noto Sans JP', sans-serif;
    --card-bg: rgba(20, 20, 20, 0.95);
}

/* Force Dark Mode for this page */
body.theme-dark {
    background-color: #000000 !important;
    color: #ffffff !important;
    overflow-x: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Ensure all text is visible on dark background */
.reactor-hero p, 
.section-full p, 
.section p,
h1, h2, h3, h4, h5, h6, li, span, div {
    color: #ffffff;
}

/* =========================================
   Hero Section (The Singularity)
   ========================================= */
.reactor-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 10;
    background: #000; /* Fallback */
    padding-top: 80px; /* Header space */
}

.hero-container {
    text-align: center;
    z-index: 10;
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
}

.hero-glitch-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.glitch-text {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 8rem);
    color: #fff;
    line-height: 1;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.hero-copy {
    background: rgba(0, 0, 0, 0.7); /* Improved readability */
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    display: inline-block;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.hero-jp-copy {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.4;
    margin-bottom: 1.5rem;
    color: #fff !important;
    text-shadow: 0 0 10px rgba(0,0,0,1);
}

/* =========================================
   Common Section Styles
   ========================================= */
.section-full {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 100px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.section-content {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
}

.bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 20vw;
    color: rgba(255, 255, 255, 0.05); /* Very subtle */
    white-space: nowrap;
    z-index: 1;
    pointer-events: none;
    line-height: 1;
}

/* =========================================
   Concept Section (Game Changer)
   ========================================= */
.concept-section {
    background-color: #050505;
}

.concept-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.concept-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3; /* Darkened for text readability */
    filter: grayscale(0.8) contrast(1.2);
}

/* Overlay gradient to help text readability */
.concept-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.3) 100%);
}

.concept-card {
    background: var(--card-bg);
    padding: 4rem;
    max-width: 700px;
    margin-left: 0; /* Align left */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 5px solid var(--accent-color);
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    border-radius: 4px;
}

.jp-lead {
    color: #fff !important;
    text-shadow: 0 2px 4px #000;
}

.jp-desc {
    color: #e0e0e0 !important; /* Brighter grey */
    font-size: 1.05rem;
    font-weight: 500; /* Bolder */
}

/* =========================================
   Logic Section (The Logic)
   ========================================= */
.logic-section {
    background: #080808;
    flex-direction: column;
    padding: 100px 0;
}

.logic-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
}

.logic-header h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    color: #fff;
}

.card-stack-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 600px; /* Increased height for expansion */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.logic-card {
    position: absolute; /* Default to absolute for stack effect */
    width: 320px;
    height: 480px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    cursor: pointer; /* Clickable cursor */
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth transition */
}

.logic-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Expanded State */
.logic-card.expanded {
    z-index: 100 !important;
    transform: translate(-50%, -50%) scale(1.3) !important;
    left: 50% !important;
    top: 50% !important;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9), 0 0 40px rgba(0, 255, 255, 0.2);
    border-color: var(--accent-color);
    width: 400px; /* Make it slightly wider when expanded */
    height: 520px;
}

/* Dim other cards when one is expanded */
.card-stack-container.has-expanded .logic-card:not(.expanded) {
    opacity: 0.3;
    filter: blur(2px);
    pointer-events: none;
}

.logic-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.logic-img {
    height: 180px;
    width: 100%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.logic-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logic-content {
    padding: 1.5rem;
    flex: 1;
    background: #1a1a1a; /* Solid background */
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logic-content h3 {
    color: var(--accent-color) !important;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.logic-content p {
    color: #ddd !important;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Hint Text */
.click-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-stack-container:hover .click-hint {
    opacity: 1;
}

/* =========================================
   Flow Section (How It Works)
   ========================================= */
.flow-section {
    background: #000;
}

.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%; /* Center by default */
    top: 0;
    bottom: 0;
    width: 4px; /* Thicker */
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%);
}

.timeline-progress {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 0%;
    background: var(--accent-color);
    transform: translateX(-50%);
    box-shadow: 0 0 15px var(--accent-color);
    z-index: 1;
}

.flow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6rem;
    position: relative;
    width: 100%;
}

.flow-item:nth-child(odd) {
    flex-direction: row;
}
.flow-item:nth-child(even) {
    flex-direction: row-reverse;
}

.flow-content {
    width: 42%; /* Slightly less than half */
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.flow-content h3 {
    color: #fff !important;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.flow-content p {
    color: #ccc !important;
    margin-bottom: 0;
}

.flow-num {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.flow-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #000;
    border: 4px solid #333; /* Default inactive */
    border-radius: 50%;
    z-index: 2;
}

.flow-item.active .flow-marker {
    background: #000;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

/* =========================================
   Capabilities Section
   ========================================= */
.capabilities-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.cap-item {
    display: flex;
    align-items: center;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    gap: 1.5rem;
    border-radius: 8px;
}

.cap-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 50%; /* Circle images */
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
}

.cap-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cap-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #fff !important;
}

.cap-text p {
    font-size: 0.9rem;
    color: #aaa !important;
    line-height: 1.4;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    /* Hero */
    .hero-glitch-wrapper { margin-bottom: 1rem; }
    .glitch-text { font-size: 3.5rem; }
    .hero-copy { padding: 1.5rem; width: 100%; }
    .hero-jp-copy { font-size: 1.5rem; }

    /* Concept */
    .concept-card { 
        padding: 2rem; 
        border-left-width: 3px;
    }
    .concept-bg::after {
        background: rgba(0,0,0,0.7); /* Darker overlay on mobile */
    }

    /* Logic - Stack to Vertical List */
    .card-stack-container {
        height: auto;
        flex-direction: column;
        gap: 2rem;
        display: block; /* Disable flex centering */
    }

    .logic-card {
        position: relative; /* Reset position */
        width: 100%;
        max-width: 100%;
        height: auto;
        margin-bottom: 20px;
        transform: none !important; /* Disable GSAP transforms if any remain */
        left: auto !important;
        top: auto !important;
        cursor: default; /* Remove pointer on mobile as they are already visible */
    }
    
    .logic-card.expanded {
        /* Disable expansion on mobile */
        transform: none !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .logic-img { height: 200px; }
    
    .click-hint { display: none; }

    /* Flow - Vertical Left Aligned */
    .timeline-line, .timeline-progress {
        left: 20px;
        transform: none;
    }

    .flow-item {
        flex-direction: column !important;
        align-items: flex-start;
        margin-bottom: 3rem;
        padding-left: 50px; /* Space for line */
    }

    .flow-marker {
        left: 20px;
        top: 0; /* Align to top */
        transform: translateX(-50%);
    }

    .flow-content {
        width: 100%;
    }
    
    /* Capabilities */
    .capabilities-list {
        grid-template-columns: 1fr; /* Single column */
    }
    
    .cap-item {
        flex-direction: column;
        text-align: center;
    }
}
