@import url('https://fonts.googleapis.com/css2?family=Righteous&family=Poppins:wght@300;400;500;600;700&display=swap');

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --pink:   #CA3EA7;
    --red:    #E4454A;
    --dark:   #16222D;
    --bg:     #23282E;
    --color:  #eee;
    --header: 60px;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--color);
    background: var(--bg);
    overflow: hidden;
}

a { text-decoration: none; cursor: pointer; font-weight: 600; }

.text-gradient {
    background: linear-gradient(to right, var(--red), var(--pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ─── Loader ─── */
.loader_bg {
    position: fixed; inset: 0;
    background: #333;
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.loader {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 6px solid transparent;
    border-top-color: #2EE3E8;
    border-bottom-color: var(--pink);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Header ─── */
header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header);
    z-index: 200;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px;
    background: rgba(22, 34, 45, 0.96);
    backdrop-filter: blur(12px);
}

.logo {
    font-family: 'Righteous', sans-serif;
    font-size: 1.5em;
    background: linear-gradient(to right, var(--red), var(--pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav { display: flex; align-items: center; gap: 10px; }

nav a {
    color: var(--color);
    font-size: 0.85em;
    padding: 6px 14px;
    border-radius: 20px;
    transition: background 0.25s, color 0.25s;
    font-weight: 500;
}
nav a:hover, nav a.active {
    background: linear-gradient(to right, var(--red), var(--pink));
    -webkit-text-fill-color: white;
    color: white;
}

/* ─── Hamburger ─── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 300;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 24px; height: 2.5px;
    background: var(--color);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Tabs Wrapper ─── */
#tabs-wrapper {
    position: fixed;
    top: var(--header);
    left: 0; right: 0;
    bottom: 0;
}

.tab {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.tab.active {
    opacity: 1;
    pointer-events: auto;
}

.tab .container {
    width: 1140px;
    max-width: 100%;
    min-height: 100%;
    padding: 50px 30px 60px;
    margin: auto;
}

/* ─── Intro ─── */
#intro { background: var(--dark); }
#intro .container {
    display: flex; align-items: center; justify-content: center;
    text-align: center;
}
#intro .content { max-width: 800px; }

#intro .name, #intro .job {
    font-family: 'Righteous', sans-serif;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    line-height: 1.05;
    word-break: break-word;
}
#intro .name { margin-bottom: 4px; }

#intro .des {
    margin-top: 1.5em;
    line-height: 1.8;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    opacity: 0.85;
}
#intro .des a { margin-top: 1em; display: inline-block; font-size: 1.05em; }

/* ─── Education ─── */
#education {
    background: linear-gradient(135deg, #212632 0%, #242A34 50%, #3C4C5A 100%);
}
#education .container {
    display: flex; align-items: center;
}
#education .timeline-track {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 40px 0;
}
#education .timeline-track::-webkit-scrollbar { height: 4px; }
#education .timeline-track::-webkit-scrollbar-track { background: transparent; }
#education .timeline-track::-webkit-scrollbar-thumb { background: #444B57; border-radius: 2px; }

#education .list {
    display: flex;
    gap: 30px;
    position: relative;
    width: max-content;
    padding: 0 20px;
}

#education .list::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 2px;
    background: #444B57;
    z-index: 0;
}

#education .item {
    display: grid;
    grid-template-rows: 1fr 50px 1fr;
    gap: 15px;
    width: 190px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

#education .item i {
    background: #444B57;
    width: 50px; height: 50px;
    border-radius: 50%;
    font-size: 1.3em;
    display: flex; align-items: center; justify-content: center;
    color: var(--dark);
    border: 3px solid #2EE3E8;
    justify-self: center;
}

#education .item .time {
    display: flex; align-items: flex-end;
    font-size: 0.8em;
    opacity: 0.65;
    font-weight: 600;
}

#education .item .content .job { font-size: 0.95em; font-weight: 600; }
#education .item .content .company { color: var(--red); font-size: 0.8em; font-weight: 500; }
#education .item .content .des { font-size: 0.75em; opacity: 0.65; margin-top: 4px; line-height: 1.5; }

#education .item:nth-child(even) .content { grid-row: 1; display: flex; flex-direction: column; justify-content: flex-end; }
#education .item:nth-child(even) .time    { grid-row: 3; align-items: flex-start; }
#education .item:nth-child(odd)  .time    { grid-row: 1; }
#education .item:nth-child(odd)  .content { grid-row: 3; }

/* ─── Skills ─── */
#skill {
    background: linear-gradient(135deg, #3A2530 0%, #171514 50%, #412726 100%);
}
#skill .container { display: flex; align-items: center; justify-content: center; }

#skill .list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
    max-width: 1000px;
}

#skill .item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 28px 18px;
    transition: transform 0.25s;
}
#skill .item:hover { transform: translateY(-4px); }

/* Checkerboard pattern for 4-col grid */
#skill .item:nth-child(odd)  { background: rgba(63,37,37,0.6); }
#skill .item:nth-child(even) { background: transparent; }
/* Flip every other row so it truly alternates */
#skill .item:nth-child(4n+2),
#skill .item:nth-child(4n+4) { background: transparent; }
#skill .item:nth-child(4n+1),
#skill .item:nth-child(4n+3) { background: rgba(63,37,37,0.6); }

/* Font Awesome icon styling */
#skill .item i {
    width: 52px; height: 52px;
    background: #eee;
    color: var(--pink);
    font-size: 1.6em;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Custom Skill Icons (PNG/SVG from Simple Icons CDN) */
#skill .item .skill-icon {
    width: 52px;
    height: 52px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    padding: 8px;
    overflow: hidden;
}

#skill .item .skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#skill .item .name { font-size: 0.95em; font-weight: 600; margin-top: 10px; }
#skill .item .des  { font-size: 0.75em; opacity: 0.7; margin-top: 6px; line-height: 1.5; }


/* ─── Contact ─── */
#contact { background: #242330; }
#contact .container {
    display: flex; align-items: center; justify-content: center;
    text-align: center;
}
#contact .content {
    display: flex; flex-direction: column;
    align-items: center; gap: 20px;
}
#contact .thank {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-family: 'Righteous', sans-serif;
}
#contact .des {
    max-width: 480px;
    line-height: 1.8;
    opacity: 0.8;
    font-size: 0.95em;
}
#contact .des a { margin-top: 10px; display: inline-block; }

#contact .list {
    display: flex; flex-wrap: wrap;
    justify-content: center; gap: 12px 30px;
    margin-top: 10px;
}
#contact .list .item {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9em;
    opacity: 0.85;
}
#contact .list .item i { color: var(--pink); }

/* ─── Mobile nav overlay ─── */
.nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 240;
}
.nav-overlay.open { display: block; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    body { overflow: hidden; }

    .hamburger { display: flex; }

    nav {
        position: fixed;
        top: 0; right: -100%;
        width: min(75vw, 280px);
        height: 100dvh;
        background: rgba(22, 34, 45, 0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 30px 20px;
        transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
        z-index: 250;
    }
    nav.open { right: 0; }
    nav a {
        font-size: 1.1em;
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }

    #skill .list { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
    /* Reset checkerboard, apply simple 2-col alternating */
    #skill .item:nth-child(4n+1),
    #skill .item:nth-child(4n+2),
    #skill .item:nth-child(4n+3),
    #skill .item:nth-child(4n+4) { background: transparent; }
    #skill .item:nth-child(odd)  { background: rgba(63,37,37,0.6); }
    #skill .item:nth-child(even) { background: transparent; }

    #project .list { grid-template-columns: 1fr; }
    #project .item img { height: 180px; }
}

@media (max-width: 480px) {
    header { padding: 0 15px; }

    #skill .list { grid-template-columns: repeat(2, 1fr); }
    /* Keep same 2-col alternating at smallest size */
    #skill .item:nth-child(odd)  { background: rgba(63,37,37,0.6); }
    #skill .item:nth-child(even) { background: transparent; }
}