:root {
    --pixel-black: #0f0f1e;
    --pixel-purple: #7c3aed;
    --pixel-pink: #ec4899;
    --pixel-cyan: #06b6d4;
    --pixel-yellow: #fbbf24;
    --pixel-green: #10b981;
    --pixel-white: #f8fafc;
    --pixel-gray: #94a3b8;
    --pixel-dark-gray: #1e293b;
    --scanline-opacity: 0.08;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--pixel-black);
    color: var(--pixel-white);
    overflow-x: hidden;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* CRT Screen Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 9999;
    opacity: var(--scanline-opacity);
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }

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

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 4px solid var(--pixel-purple);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-button {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: var(--pixel-cyan);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.back-button:hover {
    color: var(--pixel-pink);
    transform: translateX(-5px);
}

.logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    color: var(--pixel-pink);
    text-shadow: 2px 2px 0 var(--pixel-purple);
}

/* Hero Section */
.hero {
    padding: 120px 2rem 80px;
    background:
        radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
}

.project-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 3rem;
    color: var(--pixel-pink);
    margin-bottom: 1rem;
    text-shadow:
        3px 3px 0 var(--pixel-purple),
        6px 6px 0 rgba(124, 58, 237, 0.3);
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {

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

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

.project-subtitle {
    font-size: 1.8rem;
    color: var(--pixel-cyan);
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tag {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    padding: 0.8rem 1.5rem;
    background: var(--pixel-purple);
    color: var(--pixel-white);
    border: 2px solid var(--pixel-cyan);
}

.project-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.project-link {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    padding: 1.2rem 2.5rem;
    background: transparent;
    border: 3px solid var(--pixel-cyan);
    color: var(--pixel-cyan);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.project-link:hover {
    background: var(--pixel-cyan);
    color: var(--pixel-black);
    transform: translateY(-3px);
}

.project-link.primary {
    background: var(--pixel-pink);
    border-color: var(--pixel-pink);
    color: var(--pixel-black);
}

.project-link.primary:hover {
    background: var(--pixel-purple);
    border-color: var(--pixel-purple);
}

/* Main Content */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 6rem 80px;
}

section {
    margin-bottom: 5rem;
}

.section-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.7rem;
    color: var(--pixel-yellow);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--pixel-purple);
}

.text-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--pixel-gray);
    margin-bottom: 2rem;
    font-weight: 400;
}

.text-content-emotionmodel {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--pixel-gray);
    margin-bottom: 0rem;
    font-weight: 400;
}

.text-content strong {
    color: var(--pixel-white);
    font-weight: 600;
    font-size: 1.1rem;
}

.text-content-emotionmodel strong {
    color: var(--pixel-white);
    font-weight: 600;
    font-size: 1.3rem;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.media-grid-ephos {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 3rem;
}

.media-item {
    background: var(--pixel-dark-gray);
    border: 4px solid var(--pixel-purple);
    padding: 1.5rem;
    position: relative;
}

.media-item::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, var(--pixel-purple), var(--pixel-pink), var(--pixel-cyan));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.media-item:hover::before {
    opacity: 0.3;
}

.media-container {
    width: 100%;
    background: var(--pixel-black);
    border: 3px solid var(--pixel-cyan);
    margin-bottom: 1rem;
}

.media-container img {
    width: 100%;
    height: auto;
    display: block;
}

.media-caption {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85rem;
    color: var(--pixel-cyan);
    text-align: center;
}

/* Feature List */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--pixel-dark-gray);
    padding: 2rem;
    border: 4px solid var(--pixel-cyan);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--pixel-pink);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    color: var(--pixel-cyan);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.feature-card p {
    font-size: 1.3rem;
    color: var(--pixel-gray);
    line-height: 1.6;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--pixel-dark-gray);
    padding: 2rem;
    border: 4px solid var(--pixel-green);
    text-align: center;
}

.stat-number {
    font-family: 'Press Start 2P', monospace;
    font-size: 2.5rem;
    color: var(--pixel-green);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.2rem;
    color: var(--pixel-gray);
}

/* Challenge/Solution Boxes */
.challenge-solution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.challenge-box,
.solution-box {
    background: var(--pixel-dark-gray);
    padding: 2rem;
    border: 4px solid var(--pixel-pink);
}

.solution-box {
    border-color: var(--pixel-green);
}

.challenge-box h3,
.solution-box h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.challenge-box h3 {
    color: var(--pixel-pink);
}

.solution-box h3 {
    color: var(--pixel-green);
}

.challenge-box p,
.solution-box p {
    font-size: 1.1rem;
    color: var(--pixel-gray);
    line-height: 1.8;
    font-weight: 400;
}

/* Code Block */
.code-block {
    background: var(--pixel-black);
    border: 3px solid var(--pixel-purple);
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.code-block pre {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: var(--pixel-green);
    line-height: 1.6;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--pixel-purple);
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -3.6rem;
    top: 0.5rem;
    width: 20px;
    height: 20px;
    background: var(--pixel-pink);
    border: 4px solid var(--pixel-black);
}

.timeline-item h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    color: var(--pixel-yellow);
    margin-bottom: 0.5rem;
}

.timeline-item p {
    font-size: 1.1rem;
    color: var(--pixel-gray);
    line-height: 1.8;
    font-weight: 400;
}

/* Footer */
footer {
    background: var(--pixel-dark-gray);
    border-top: 4px solid var(--pixel-purple);
    padding: 3rem 2rem;
    text-align: center;
}

footer p {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    color: var(--pixel-gray);
}

img {
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 968px) {
    .project-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .challenge-solution {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline-dot {
        left: -2.6rem;
    }
}

@media (max-width: 640px) {
    .project-title {
        font-size: 1.5rem;
    }

    .project-links {
        flex-direction: column;
    }

    .project-link {
        width: 100%;
        text-align: center;
    }
}

/* ===== PHONE RESPONSIVE FIXES ===== */

@media (max-width: 480px) {

    /* Navigation */
    nav {
        padding: 1rem 1rem;
        gap: 0.5rem;
    }

    .back-button {
        font-size: 0.55rem;
    }

    .logo {
        font-size: 0.6rem;
    }

    /* Hero */
    .hero {
        padding: 90px 1.2rem 50px;
    }

    .project-title {
        font-size: 1.1rem;
        line-height: 1.5;
    }

    .project-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .tag {
        font-size: 0.55rem;
        padding: 0.6rem 1rem;
    }

    .project-link {
        font-size: 0.65rem;
        padding: 0.9rem 1.5rem;
    }

    /* Content area */
    .content {
        padding: 0 1.2rem 60px;
    }

    section {
        margin-bottom: 3rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Text */
    .text-content,
    .text-content-emotionmodel {
        font-size: 1rem;
    }

    .text-content-emotionmodel strong {
        font-size: 1.1rem;
    }

    /* Inline h3 headings (Technical Implementation) */
    h3[style] {
        font-size: 0.85rem !important;
        margin: 1.5rem 0 0.8rem !important;
    }

    /* Lists */
    ul[style],
    ol[style] {
        font-size: 1rem !important;
        margin-left: 1.2rem !important;
    }

    /* Feature cards */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-card h3 {
        font-size: 0.85rem;
    }

    .feature-card p {
        font-size: 1rem;
    }

    .feature-icon {
        font-size: 2rem;
    }

    /* Architecture image */
    .code-block {
        padding: 1rem;
    }

    .code-block img {
        width: 100%;
        height: auto;
    }

    /* Media */
    .media-item {
        padding: 1rem;
    }

    .media-caption {
        font-size: 0.6rem;
    }

    /* Challenge / Solution — stack vertically */
    .challenge-solution {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .challenge-box,
    .solution-box {
        padding: 1.2rem;
    }

    .challenge-box h3,
    .solution-box h3 {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .challenge-box p,
    .solution-box p {
        font-size: 1rem;
    }

    /* Timeline */
    .timeline {
        padding-left: 1.8rem;
    }

    .timeline::before {
        width: 3px;
    }

    .timeline-dot {
        left: -2.2rem;
        width: 16px;
        height: 16px;
        top: 0.3rem;
    }

    .timeline-item {
        margin-bottom: 2rem;
    }

    .timeline-item h3 {
        font-size: 0.75rem;
        line-height: 1.6;
    }

    .timeline-item p {
        font-size: 1rem;
    }

    /* Footer */
    footer {
        padding: 2rem 1rem;
    }

    footer p {
        font-size: 0.5rem;
        line-height: 2;
    }
}