:root {
    --bg-body: #000000;
    --border-color: #262626;
    --cell-bg: #050505;

    --text-white: #ededed;
    --text-muted: #888;
    --accent: #ff5e00;

    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    background-color: var(--bg-body);
    color: var(--text-white);
    font-family: var(--font-main);
    width: 100%; overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex; justify-content: center; align-items: center;
    padding: 40px 20px;
}

/* --- GRID CONTAINER --- */
.grid-container {
    display: grid;
    background-color: var(--border-color);
    gap: 1px;
    border: 1px solid var(--border-color);

    /* 3 Columns */
    grid-template-columns: 320px 400px 300px;
    /* 3 Rows */
    grid-template-rows: 280px 340px 220px;

    width: max-content;
    max-width: 100%;

    animation: borderReveal 1.5s ease-out forwards;
    background-color: transparent;
}

@keyframes borderReveal {
    0% { background-color: transparent; border-color: transparent; }
    100% { background-color: var(--border-color); border-color: var(--border-color); }
}

/* --- CELL BASICS --- */
.cell {
    background-color: var(--cell-bg);
    padding: 28px;
    position: relative;
    display: flex; flex-direction: column;
    overflow: hidden;
    opacity: 0; animation: powerOn 0.6s ease-out forwards;
}

.cell:hover { background-color: #000000; z-index: 2; }

@keyframes powerOn {
    0% { opacity: 0; filter: brightness(0); }
    100% { opacity: 1; filter: brightness(1); }
}

.hero-cell { animation-delay: 0.1s; }
.stack-cell { animation-delay: 0.2s; }
.history-cell { animation-delay: 0.3s; }
.project-cell { animation-delay: 0.15s; }
.oss-cell { animation-delay: 0.45s; }
.blog-cell { animation-delay: 0.5s; }

/* --- TYPOGRAPHY --- */
.cell-label {
    font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 1px; color: #555; margin-bottom: 16px; font-weight: 500;
}
.text-orange { color: var(--accent); }
.text-white { color: #fff; font-weight: 600; }
.text-green { color: #42b883; }
.text-yellow { color: #fbbf24; }
.text-blue { color: #38bdf8; }

/* --- HERO --- */
.hero-cell { grid-column: span 2; justify-content: space-between; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.profile-img { width: 64px; height: 64px; border-radius: 5px; border: 2px solid #222; filter: grayscale(30%) brightness(0.7); }
.status-badge {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 0.7rem; color: #4ade80;
    background: rgba(74, 222, 128, 0.1); padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(74, 222, 128, 0.2);
}
.pulsing-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 5px #4ade80; }
.hero-content h1 { font-size: 2rem; font-weight: 700; margin: 10px 0; letter-spacing: -0.03em; }
.hero-content .bio { font-size: 1rem; color: var(--text-muted); line-height: 1.6; max-width: 550px; }
.hero-actions { margin-top: 20px; display: flex; align-items: center; gap: 15px; }
.btn-primary { background: #fff; color: #000; padding: 10px 20px; border-radius: 6px; font-weight: 600; text-decoration: none; font-size: 0.9rem; transition: 0.2s; }
.btn-primary:hover { background: #e0e0e0; }
.socials a { color: #666; font-size: 1.4rem; margin-right: 15px; transition: 0.2s; }
.socials a:hover { color: #fff; }

/* --- STACK --- */
.stack-group { margin-bottom: 20px; }
.stack-group:last-child { margin-bottom: 0; }
.stack-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack-item { font-family: var(--font-mono); font-size: 0.75rem; color: #ccc; display: flex; align-items: center; gap: 8px; }
.stack-divider { height: 1px; background: #222; margin: 15px 0; width: 100%; }

/* --- EXPERIENCE --- */
.history-cell { grid-column: 1; grid-row: span 2; }
.timeline-container { flex: 1; overflow-y: auto; padding-right: 10px; }
.timeline-item { display: flex; gap: 15px; margin-bottom: 24px; }
.timeline-left { display: flex; flex-direction: column; align-items: center; width: 12px; flex-shrink: 0; }
.dot { width: 8px; height: 8px; background: #111; border: 1px solid #444; border-radius: 50%; }
.dot.active { background: var(--accent); border-color: var(--accent); }
.line { width: 1px; flex: 1; background: #333; margin-top: 4px; min-height: 20px; }
.line.short { background: linear-gradient(to bottom, #333 0%, transparent 100%); flex: 0; height: 30px; }
.timeline-content .date { font-family: var(--font-mono); font-size: 0.65rem; color: #555; margin-bottom: 2px; }
.timeline-content h4 { font-size: 0.9rem; font-weight: 600; color: #eee; margin-bottom: 2px; }
.timeline-content .company { font-size: 0.75rem; margin-bottom: 4px; }
.timeline-content p { font-size: 0.8rem; color: #888; line-height: 1.4; }

/* --- FEATURED PROJECT --- */
.project-cell { grid-column: span 2; padding: 0; }
.image-cycler { position: absolute; inset: 0; z-index: 1; }
.image-cycler img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0;
    transition: opacity 0.5s ease;
    filter: grayscale(100%) brightness(0.4);
}
/* Show first image by default */
.image-cycler img:nth-child(1) { opacity: 1; }

/* Hover effects */
.project-cell:hover .image-cycler img { filter: grayscale(75%) brightness(0.4); }
.project-cell:hover .image-cycler img:nth-child(1) { animation: cycle1 6s infinite; }
.project-cell:hover .image-cycler img:nth-child(2) { animation: cycle2 6s infinite; }

/* FIX: 2-Step Cycle Animation (50/50 Split) */
@keyframes cycle1 {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes cycle2 {
    0%, 45% { opacity: 0; }
    50%, 95% { opacity: 1; }
    100% { opacity: 0; }
}

.project-overlay { position: absolute; inset: 0; z-index: 2; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.9)); pointer-events: none; }
.project-overlay a { pointer-events: auto; }
.project-header { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-btn { width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; backdrop-filter: blur(5px); transition: 0.2s; }
.icon-btn:hover { background: var(--accent); }
.project-info h3 { font-size: 1.6rem; color: #fff; margin-bottom: 5px; }
.project-info p { color: #ccc; font-size: 0.9rem; max-width: 450px; margin-bottom: 15px; }
.tags span { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 4px 8px; font-size: 0.7rem; margin-right: 5px; display: inline-block; border-radius: 4px; }

/* --- OPEN SOURCE --- */
.oss-list {
    display: flex; flex-direction: column; gap: 12px;
    overflow-y: auto; padding-right: 5px; flex: 1;
}

.oss-card {
    display: block; text-decoration: none;
    background: #0f0f0f; border: 1px solid #222;
    padding: 12px 16px; border-radius: 8px;
    transition: border-color 0.2s, background-color 0.2s;
}

.oss-card:hover {
    border-color: var(--accent);
    background: #141414;
}

.oss-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.repo-name { font-size: 0.75rem; color: #999; display: flex; align-items: center; gap: 6px; }

.pr-badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.pr-badge.merged { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.pr-badge.closed { background: rgba(115, 115, 115, 0.15); color: #9ca3af; border: 1px solid rgba(115, 115, 115, 0.3); }

.pr-title { font-size: 0.85rem; color: #eee; font-weight: 500; margin-bottom: 4px; }
.pr-meta { font-size: 0.7rem; color: #555; font-family: var(--font-mono); }

/* --- BLOGS --- */
.blog-wrapper { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 5px; flex: 1; }
.blog-card { text-decoration: none; display: block; border-left: 2px solid #222; padding-left: 12px; transition: 0.2s; }
.blog-card:hover { border-left-color: var(--accent); padding-left: 16px; }
.blog-card h4 { font-size: 0.85rem; font-weight: 400; color: #ccc; line-height: 1.4; margin-bottom: 4px; }
.blog-card:hover h4 { color: #fff; }
.blog-date { font-family: var(--font-mono); font-size: 0.65rem; color: #555; display: block; text-transform: uppercase; }

/* --- SCROLLBAR --- */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #444; }

/* --- MOBILE --- */
@media (max-width: 1050px) {
    body { display: block; height: auto; }
    .grid-container {
        display: flex; flex-direction: column;
        width: 100%; max-width: 600px; margin: 0 auto;
        background: transparent; border: none; gap: 20px;
    }
    .cell { border: 1px solid var(--border-color); width: 100%; }
    .hero-cell, .project-cell, .history-cell { grid-column: auto; grid-row: auto; }
    .history-cell { height: 450px; }
    .project-cell { height: 300px; }
}