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

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

:root {
    --primary-color: #4a9eff;
    --secondary-color: #6c5ce7;
    --accent-color: #00cec9;

    --bg-color: #0f0f13;
    --card-bg: #1a1a22;

    --text-color: #f5f5f7;
    --text-secondary: #b0b0b0;

    --card-shadow: 0 8px 20px rgba(0, 0, 0, .5);
    --header-h: 64px;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    background-image:
        radial-gradient(circle at top right, rgba(74, 158, 255, .1), transparent 60%),
        radial-gradient(circle at bottom left, rgba(108, 92, 231, .1), transparent 60%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main {
    padding-top: var(--header-h);
}

/* ===== Header / Nav ========================================================= */
header {
    position: fixed;
    inset: 0 auto auto 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(15, 15, 19, .8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    transition: all .3s ease;

    /* 3-col grid keeps nav perfectly centered */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-left {
    justify-self: start;
    display: flex;
    align-items: center;
}

.nav-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .5px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: .5rem 0;
}

#primary-nav {
    justify-self: center;
}

#primary-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    padding: 0 2rem;
    justify-content: flex-end;
}

#primary-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: .5rem 0;
    transition: color .3s ease;
}

#primary-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width .3s ease;
}

#primary-nav a:hover {
    color: var(--primary-color);
}

#primary-nav a:hover::after,
#primary-nav a.active::after {
    width: 100%;
}

#primary-nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-social {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav-social a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: all .3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-social a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    background: rgba(74, 158, 255, .2);
    border-radius: 50%;
    transform: scale(0);
    transition: transform .3s ease, width .3s ease, height .3s ease;
    z-index: -1;
}

.nav-social a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.nav-social a:hover::before {
    width: 40px;
    height: 40px;
    transform: scale(1);
}

/* Theme toggle (right group) */
#theme-toggle {
    margin-left: .5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .15);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
}

#theme-toggle:hover {
    border-color: rgba(255, 255, 255, .3);
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
    font-size: 16px;
    line-height: 1;
}

/* show only the relevant icon */
:root:not([data-theme="light"]) #theme-toggle .icon-sun {
    display: none;
}

:root[data-theme="light"] #theme-toggle .icon-moon {
    display: none;
}

/* ===== Sections / Footer ==================================================== */
section {
    padding: 6rem 2rem;
    position: relative;
}

section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-size: 2.8rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, .05);
    background: rgba(10, 10, 15, .5);
}

/* ===== Hero ================================================================= */
#hero {
    min-height: calc(100svh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 0 2rem;
  position: relative;
}

#hero::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, rgba(15, 15, 19, 0) 0%, rgba(15, 15, 19, .6) 60%, var(--bg-color) 100%);
    pointer-events: none;
    z-index: 1;
}

#animation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-top: 0;
    color: #fff;
    animation: fadeIn 1.5s ease-out;
}

.hero-content h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    z-index: 2;
}

.hero-content p {
    font-size: 1.4rem;
    opacity: .95;
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-color);
    font-weight: 300;
    letter-spacing: 1px;
    animation: fadeIn 1.5s ease-out .5s both;
    position: relative;
    z-index: 2;
    text-shadow: 0 4px 12px rgba(0, 0, 0, .5);
    padding: .5rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    background: rgba(10, 10, 15, .3);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== About ================================================================ */
#about {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.about-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 4rem;
}

.about-text {
    flex: 1;
    z-index: 1;
}

.about-visual {
    flex: 1;
    position: relative;
}

#about-animation {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.about-card {
    background: #202020;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
    transition: transform .3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
}

.about-card h3 {
    color: #e0e0e0;
    margin-bottom: 1rem;
}

/* Skills (About) */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-start;
}

.skill-tag {
    background: rgba(51, 89, 128, .3);
    color: var(--text-color);
    padding: .5rem 1rem;
    border-radius: 20px;
    font-size: .9rem;
    transition: all .3s ease;
    border: 1px solid rgba(74, 158, 255, .3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
    display: inline-flex;
    align-items: center;
    margin: .2rem;
}

.skill-tag:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(45deg, rgba(74, 158, 255, .2), rgba(108, 92, 231, .2));
    border-color: rgba(74, 158, 255, .6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .3), 0 0 5px rgba(74, 158, 255, .5);
}

/* Stats (About) */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    background: rgba(26, 26, 34, .7);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow: var(--card-shadow);
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: .7;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .5);
    border-color: rgba(255, 255, 255, .1);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: .5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== Contact ============================================================= */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-content {
    background: rgba(26, 26, 34, .7);
    padding: 3.5rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, .05);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.contact-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(108, 92, 231, .1), transparent 70%),
        radial-gradient(circle at bottom left, rgba(74, 158, 255, .1), transparent 70%);
    pointer-events: none;
}

.contact-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    transition: all .4s cubic-bezier(.175, .885, .32, 1.275);
    padding: 1.5rem;
    border-radius: 15px;
    background: rgba(0, 0, 0, .2);
    border: 1px solid transparent;
}

.contact-method:hover {
    transform: translateY(-8px);
    color: var(--primary-color);
    background: rgba(26, 26, 34, .8);
    border-color: rgba(74, 158, 255, .3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .3), 0 0 10px rgba(74, 158, 255, .2);
}

.contact-method i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: .8;
    transition: opacity .3s ease;
}

.contact-method:hover i {
    opacity: 1;
}

.contact-method span {
    font-weight: 500;
    font-size: 1.1rem;
}

/* ===== Timeline / Entries (Experience, Education, Projects) ================ */
.entries {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    gap: 1.75rem;
    padding: 0 1rem;
}

.entry {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.25rem 2rem;
    align-items: start;
}

.entry+.entry {
    padding-top: 1.75rem;
    border-top: 1px dashed rgba(255, 255, 255, .12);
}

.entry-date {
    font-size: .9rem;
    color: var(--text-secondary);
    margin-top: .25rem;
    white-space: nowrap;
}

.entry-body {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.entry-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .2px;
}

.entry-title a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .25);
    text-underline-offset: 2px;
}

.entry-title a:hover {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

.entry-meta {
    color: var(--text-secondary);
    font-size: .95rem;
}

.entry-points {
    margin: .25rem 0 0 0;
    padding-left: 1.2rem;
    color: #cfcfcf;
}

.entry-points li {
    margin: .25rem 0;
}

/* Soft tags (for entries) */
.entry-tags {
    display: flex;
    gap: .4rem .6rem;
    flex-wrap: wrap;
    margin-top: .25rem;
}

.entry-tags .tag {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, .18);
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    line-height: 1.2;
    color: var(--text-secondary);
    background: transparent;
    box-shadow: none;
}

#experience h2,
#education h2,
#projects h2 {
    margin-bottom: 4.75rem;
}

/* ===== Light Theme (variable overrides + specific tweaks) =================== */
:root[data-theme="light"] {
    --primary-color: #2558ff;
    --secondary-color: #7b61ff;
    --accent-color: #00a3a0;

    --bg-color: #ffffff;
    --card-bg: #f7f7fb;

    --text-color: #0f0f13;
    --text-secondary: #555a66;

    --card-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

:root[data-theme="light"] body {
    background-image:
        radial-gradient(circle at top right, rgba(37, 88, 255, .08), transparent 60%),
        radial-gradient(circle at bottom left, rgba(123, 97, 255, .08), transparent 60%);
}

:root[data-theme="light"] header {
    background: rgba(255, 255, 255, .85);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
}

:root[data-theme="light"] footer {
    background: rgba(255, 255, 255, .65);
    border-top: 1px solid rgba(0, 0, 0, .06);
    color: var(--text-secondary);
}

:root[data-theme="light"] #hero::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .7) 60%, var(--bg-color) 100%);
}

:root[data-theme="light"] .about-card {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

:root[data-theme="light"] .contact-content {
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    border: 1px solid rgba(0, 0, 0, .06);
}

:root[data-theme="light"] .stat-item {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

:root[data-theme="light"] .entry+.entry {
    border-top: 1px dashed rgba(0, 0, 0, .16);
}

:root[data-theme="light"] .skill-tag {
    background: rgba(37, 88, 255, .08);
    border: 1px solid rgba(37, 88, 255, .25);
    box-shadow: none;
}

:root[data-theme="light"] .entry-title a {
    text-decoration-color: rgba(0, 0, 0, .25);
}

:root[data-theme="light"] #theme-toggle {
    border-color: rgba(0, 0, 0, .15);
}

:root[data-theme="light"] #theme-toggle:hover {
    border-color: rgba(0, 0, 0, .3);
}

/* Light-mode text tones */
:root[data-theme="light"] .hero-content h1 {
    color: var(--text-color);
    font-weight: 800;
}

:root[data-theme="light"] .entry-title,
:root[data-theme="light"] .about-card h3 {
    color: var(--text-color);
}

:root[data-theme="light"] .entry-points,
:root[data-theme="light"] .entry-points li {
    color: var(--text-color);
}

:root[data-theme="light"] .entry-meta {
    color: #2a2f3a;
}

:root[data-theme="light"] .hero-content p {
    text-shadow: none;
    background: #000;
    color: #f0f0f0;
}

/* ===== Responsive =========================================================== */
/* Tablet */
@media (max-width:1024px) {
    section {
        padding: 3rem 1rem;
    }

    .about-container {
        flex-direction: column;
    }

    .about-visual {
        height: 300px;
    }

    .contact-methods {
        gap: 2.5rem;
    }
}

/* Small tablets / large phones */
@media (max-width:768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-container {
        flex-direction: column;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }
}

/* Entries stack date on top for narrow widths */
@media (max-width:720px) {
    .entry {
        grid-template-columns: 1fr;
    }

    .entry-date {
        order: -1;
    }
}

/* Phone squeeze (no hamburger) + hide About animation */
@media (max-width:600px) {

    .about-visual,
    #about-animation {
        display: none !important;
    }

    #about {
        min-height: auto;
    }

    .about-container {
        gap: 1.25rem;
        padding: 1rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    header {
        padding: .5rem .75rem;
    }

    .nav-name {
        display: none;
    }

    /* give nav links room */

    /* keep centered nav tight on a single row */
    #primary-nav {
        padding: 0 .25rem;
    }

    #primary-nav ul {
        flex-wrap: nowrap;
        gap: .75rem;
        padding: 0;
        white-space: nowrap;
    }

    #primary-nav a {
        padding: .35rem 0;
        font-size: .9rem;
        letter-spacing: 0;
    }

    #primary-nav a::after {
        height: 1px;
    }

    /* social icons hidden on phones but keep toggle in place */
    .nav-social {
        display: flex;
    }

    .nav-social a {
        display: none;
    }

    #theme-toggle {
        width: 28px;
        height: 28px;
        margin-left: .25rem;
    }

    /* contact: 3-up compact grid */
    .contact-methods {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: .5rem;
        margin-top: 1rem;
    }

    .contact-method {
        padding: .6rem;
        border-radius: 12px;
        background: rgba(0, 0, 0, .25);
        box-shadow: none;
        transform: none !important;
    }

    .contact-method:hover {
        transform: none;
        box-shadow: none;
        border-color: rgba(74, 158, 255, .25);
    }

    .contact-method i {
        font-size: 1.4rem;
        margin-bottom: .35rem;
    }

    .contact-method span {
        font-size: .85rem;
        line-height: 1.1;
    }

    .contact-content {
        padding: 1.25rem;
    }
}

/* Smaller phones */
@media (max-width:480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .skill-tag {
        font-size: .8rem;
        padding: .4rem .8rem;
    }

    .contact-content {
        padding: 1.5rem;
    }
}

/* Ultra-small */
@media (max-width:420px) {
    header {
        padding: .45rem .5rem;
    }

    #primary-nav {
        padding: 0 .2rem;
    }

    #primary-nav ul {
        gap: .5rem;
    }

    #primary-nav a {
        font-size: .8rem;
    }
}

@media (max-width:360px) {
    #primary-nav ul {
        gap: .4rem;
    }

    #primary-nav a {
        font-size: .75rem;
    }
}
