:root {
    --bg: #0a0a0a;
    --card-bg: #171717;
    --border: #262626;
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --accent: #3b82f6;
    --grid-color: rgba(255, 255, 255, 0.05);
    --sidebar-w: 280px;
    --mobile-bar-h: 52px;
}

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

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    padding-left: var(--sidebar-w);
}

@media (max-width: 639px) {
    body {
        padding-left: 0;
        padding-top: var(--mobile-bar-h);
    }
}

/* --- BACKGROUND GRID EFFECT (Rahasia Temanmu) --- */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Membuat pola kotak-kotak */
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px; /* Ukuran kotak */
    
    /* Membuat efek vignette (gelap di pinggir) */
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; color: white; }

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.role { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.bio { color: var(--text-muted); max-width: 500px; margin-bottom: 2rem; }

/* --- PROFILE BADGE --- */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.pulse {
    width: 8px; height: 8px; background: #4ade80; border-radius: 50%;
    box-shadow: 0 0 0 rgba(74, 222, 128, 0.4);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* --- SOCIAL LINKS --- */
.social-links { display: flex; gap: 1rem; margin-bottom: 4rem; }
.social-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
}
.social-btn:hover { border-color: var(--text-muted); background: #262626; }
.social-btn i { width: 18px; }

/* --- BENTO GRID LAYOUT (3-col asymmetric) --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
}

/* Hover gradient border */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-2px); border-color: rgba(59,130,246,0.3); }

/* About Me: span 2 cols, Tech Stack: 1 col */
.card-large { grid-column: span 2; }
.card-tech  { grid-column: span 1; }

/* Skills: 1 col, Certificates: span 2 cols */
.card-skills { grid-column: span 1; }
.card-cert   { grid-column: span 2; }

/* Skills Card */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.skill-item i {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

/* Certificates Card */
.card-cert h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-cert h3 i {
    width: 22px;
    height: 22px;
    color: var(--accent);
}
.cert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}
.cert-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    background: #1e1e1e;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.cert-name {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}
.cert-issuer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tags Styling */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tags span {
    font-size: 0.75rem; background: #262626; padding: 4px 10px; border-radius: 4px; color: #d4d4d8;
}

/* --- SECTION TITLE WITH ACCENT UNDERLINE --- */
.section-title {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    display: inline-block;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* --- SCROLL ANIMATIONS --- */
.animate-ready {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* --- EXPERIENCE TIMELINE --- */

.timeline-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}
.timeline-date { color: var(--text-muted); font-size: 0.9rem; font-family: 'Space Grotesk', sans-serif; padding-top: 5px; }
.company { color: var(--accent); display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }
.tech-tags { display: flex; gap: 8px; margin-top: 1rem; }
.tech-tags span { font-size: 0.75rem; color: var(--text-muted); border: 1px solid var(--border); padding: 2px 8px; border-radius: 12px; }

/* --- CONTACT SECTION --- */
.contact-section {
    margin-bottom: 4rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.contact-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.contact-card > p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.08);
    margin-bottom: 2rem;
    transition: all 0.2s;
}

.contact-email:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.contact-email i {
    width: 18px;
    height: 18px;
}

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contact-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.2s;
}

.contact-social-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background: #262626;
}

.contact-social-btn i {
    width: 16px;
    height: 16px;
}

.site-footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 2rem 0; opacity: 0.5; }

/* --- HEADER LAYOUT WITH PHOTO --- */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
.header-text { flex: 1; }
.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    flex-shrink: 0;
    position: relative;
    background: var(--card-bg);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.profile-photo:hover {
    border-color: var(--accent);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.2);
}
.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- PROJECTS SECTION --- */
.projects-section { margin-bottom: 4rem; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transition: border-color 0.25s, transform 0.25s;
    position: relative;
    overflow: hidden;
}

/* Gradient border on hover */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.45), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.project-card:hover::before { opacity: 1; }
.project-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Date + type */
.project-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.project-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
}

.project-card > p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
    flex-grow: 1;
}

/* Tech badges */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.project-tags span {
    font-size: 0.68rem;
    color: #888;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* Action buttons */
.project-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    flex-wrap: wrap;
}

.project-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.775rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 11px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.project-action-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
}

.project-action-btn.btn-detail {
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.25);
    margin-left: auto;
}

.project-action-btn.btn-detail:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--accent);
}

.project-action-btn i { width: 14px; height: 14px; }

/* --- ABOUT ME CARD SECTION (Home) --- */
.about-card-section { margin-bottom: 3rem; }
.about-card-section .card { grid-column: unset; }

/* --- TOOLS & SKILLS SECTION --- */
.tools-skills-section { margin-bottom: 4rem; }
.tools-logo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.75rem;
}
.tool-logo-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 0.75rem;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; transition: border-color 0.2s, transform 0.2s;
}
.tool-logo-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-4px); }
.tool-logo-card img { width: 32px; height: 32px; }
.tool-logo-card span { font-size: 0.78rem; color: var(--text-main); font-weight: 500; }

/* Hover level tooltip */
.tool-logo-card { position: relative; }
.tool-logo-card::after {
    content: attr(data-level);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #111; color: #ededed; border: 1px solid var(--border);
    font-size: 0.68rem; font-weight: 500; padding: 4px 10px;
    border-radius: 6px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.tool-logo-card:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
body.light-mode .tool-logo-card::after { background: #fff; color: #111; }

/* Invert dark logos (e.g. GitHub) in dark mode */
.invert-dark img { filter: invert(1); }
body.light-mode .invert-dark img { filter: none; }

/* --- SERVICES SECTION --- */
.services-section { margin-bottom: 4rem; }
.services-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}
.service-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 14px; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 0.75rem;
    transition: border-color 0.25s, transform 0.25s;
    position: relative; overflow: hidden;
}
.service-card::before {
    content: ''; position: absolute; inset: 0; border-radius: 14px; padding: 1px;
    background: linear-gradient(135deg, rgba(59,130,246,0.45), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-2px); }
.service-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2);
    display: flex; align-items: center; justify-content: center;
}
.service-icon i { width: 20px; height: 20px; color: var(--accent); }
.service-card h3 { font-size: 1rem; margin: 0; }
.service-card > p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; flex-grow: 1; }
.service-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.service-tags span {
    font-size: 0.68rem; color: #888;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    padding: 2px 8px; border-radius: 4px;
}

/* --- VIEW ALL BUTTON --- */
.view-all-wrap { text-align: center; margin-top: 1.5rem; }
.view-all-btn {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 500;
    padding: 10px 20px; border-radius: 10px;
    border: 1px solid rgba(59,130,246,0.25); background: rgba(59,130,246,0.06);
    transition: all 0.2s;
}
.view-all-btn:hover { background: rgba(59,130,246,0.12); border-color: var(--accent); transform: translateY(-1px); }
.view-all-btn i { width: 16px; height: 16px; }

/* --- GITHUB ACTIVITY SECTION --- */
.github-activity-section { margin-bottom: 4rem; }
.github-activity-content {
    display: flex; flex-direction: column; gap: 1.5rem;
}
.github-contrib-graph {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 14px; padding: 1.25rem; overflow-x: auto;
}
.github-contrib-graph img { width: 100%; display: block; border-radius: 4px; }
.github-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
.gh-stat-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 1.25rem 1rem;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center; transition: border-color 0.2s, transform 0.2s;
}
.gh-stat-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-2px); }
.gh-stat-card i { width: 20px; height: 20px; color: var(--accent); }
.gh-stat-value {
    font-size: 1.5rem; font-weight: 700; color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
}
.gh-stat-label { font-size: 0.72rem; color: var(--text-muted); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .header-top { flex-direction: column-reverse; align-items: center; text-align: center; }
    .profile-photo { width: 110px; height: 110px; }
    .bio { margin-left: auto; margin-right: auto; }
    .social-links { justify-content: center; flex-wrap: wrap; }
    .bento-grid { grid-template-columns: 1fr; }
    .card-large, .card-tech, .card-skills, .card-cert { grid-column: span 1; }
    .projects-grid { grid-template-columns: 1fr; }
    .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; }
    .timeline-date { margin-bottom: 0.5rem; }
    .contact-card { padding: 1.75rem 1.25rem; }
    .services-grid { grid-template-columns: 1fr; }
    .tools-logo-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .github-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   LIGHT MODE
   ============================================ */
body.light-mode {
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --text-main: #111111;
    --text-muted: #6b7280;
    --grid-color: rgba(0, 0, 0, 0.04);
}

body.light-mode h1 {
    background: linear-gradient(135deg, #111111 0%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode h2,
body.light-mode h3 {
    color: #111111;
}

body.light-mode .sidebar {
    background: #ffffff;
}

body.light-mode .sidebar-mobile-overlay {
    background: rgba(245, 245, 245, 0.97);
}

body.light-mode .tags span {
    background: #eeeeee;
    color: #555555;
}

body.light-mode .project-tags span {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #666666;
}

body.light-mode .cert-item {
    background: #f0f0f0;
    border-color: #e0e0e0;
}

body.light-mode .profile-badge {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.15);
}

body.light-mode .social-btn {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #333333;
}

body.light-mode .social-btn:hover {
    background: #f0f0f0;
}

body.light-mode .tech-tags span {
    color: #555555;
    border-color: #e0e0e0;
}

body.light-mode .contact-card {
    background: var(--card-bg);
}

body.light-mode .contact-card::before {
    background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.05) 0%, transparent 60%);
}

body.light-mode .contact-social-btn {
    color: #555555;
    border-color: #e0e0e0;
}

body.light-mode .contact-social-btn:hover {
    background: #f0f0f0;
}

body.light-mode .section-title::after {
    background: var(--accent);
}

body.light-mode .project-card::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), transparent 60%);
}

body.light-mode .service-tags span {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #666666;
}

body.light-mode .service-card::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), transparent 60%);
}

body.light-mode .github-contrib-graph {
    background: var(--card-bg);
}