/* ========== Variables & Theme ========== */
:root {
    --bg-color: #000000;
    /* Deep Black */
    --light-navy: #0f0f0f;
    /* Lighter Black/Grey for Cards */
    --lightest-navy: #1f1f1f;
    /* Borders / Hover states */
    --navy-shadow: rgba(0, 0, 0, 0.9);

    --accent: #ffcc00;
    /* Vibrant Yellow */
    --accent-tint: rgba(255, 204, 0, 0.15);

    --text-main: #ffffff;
    /* Pure White */
    --text-sec: #a0a0a0;
    /* Muted Grey */

    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;

    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --light-navy: #f5f5f5;
    --lightest-navy: #e0e0e0;
    --navy-shadow: rgba(0, 0, 0, 0.1);

    --text-main: #111111;
    --text-sec: #444444;
    --accent-tint: rgba(255, 204, 0, 0.3);
}

/* ========== Global Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-sec);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    /* This ensures NO GAPS between sections, they just stack naturally with the same body background */
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: var(--transition);
}

/* ========== Animated Background ========== */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: drift 20s infinite alternate ease-in-out;
}

.sphere-1 {
    width: 50vw;
    height: 50vw;
    background: #ffcc00;
    top: -10vw;
    left: -10vw;
}

.sphere-2 {
    width: 60vw;
    height: 60vw;
    background: #ff8c00;
    bottom: -20vw;
    right: -10vw;
    animation-direction: alternate-reverse;
    animation-duration: 25s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(15vw, 15vh) scale(1.2);
    }
}

/* ========== Shared Layout ========== */
.section {
    /* Reduced padding instead of margins ensures no white gaps */
    padding: 60px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    width: 85%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Shared Titles */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.right-aligned {
    justify-content: flex-end;
}

.section-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.5rem;
    margin-right: 15px;
    font-weight: 400;
}

.right-aligned .section-num {
    margin-right: 0;
    margin-left: 15px;
}

.section-title {
    color: var(--text-main);
    font-size: 2vw;
    font-weight: 600;
    white-space: nowrap;
    min-width: fit-content;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.8rem;
    }
}

.line {
    height: 1px;
    background-color: var(--lightest-navy);
    flex-grow: 1;
    margin-left: 20px;
}

.right-aligned .line {
    margin-left: 0;
    margin-right: 20px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 30px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn:hover {
    background: var(--accent-tint);
    transform: translateY(-3px) translateZ(0);
    box-shadow: 0 4px 10px rgba(255, 204, 0, 0.2);
}

.pulse-glow {
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
    }

    to {
        box-shadow: 0 0 25px rgba(255, 204, 0, 0.6);
    }
}

/* ========== Navbar ========== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background-color: var(--bg-color);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    height: 70px;
    box-shadow: 0 10px 30px -10px var(--navy-shadow);
    border-bottom: 1px solid var(--lightest-navy);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    margin: 0 auto;
    height: 100%;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.logo:hover {
    border-bottom-color: rgba(255, 204, 0, 0.55);
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.28);
}

.logo-bracket {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
}

.logo-text {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logo-slash {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 2px 0 1px;
}

.dot {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: capitalize;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}



.lang-switcher {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border: 1px solid var(--lightest-navy);
    background: color-mix(in srgb, var(--bg-color) 80%, var(--light-navy) 20%);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 204, 0, 0.08);
}

.lang-btn {
    border: 0;
    background: transparent;
    color: var(--text-sec);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    letter-spacing: 0.03em;
    transition: var(--transition);
    cursor: pointer;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    color: #111111;
    background: var(--accent);
    box-shadow: 0 6px 15px rgba(255, 204, 0, 0.35);
}

[data-theme="light"] .lang-btn.active {
    color: #ffffff;
    background: #111111;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    border: 1px solid var(--lightest-navy);
    border-radius: 999px;
    padding: 4px;
    background: color-mix(in srgb, var(--bg-color) 85%, var(--light-navy) 15%);
    transition: var(--transition);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.12);
}

.theme-track {
    width: 46px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5px;
    background: rgba(255, 204, 0, 0.14);
    transition: var(--transition);
}

[data-theme="light"] .theme-track {
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.08);
}

#theme-icon {
    color: var(--accent);
    font-size: 0.95rem;
    transition: var(--transition);
}

[data-theme="light"] #theme-icon {
    color: var(--text-main);
}

/* ========== Hero Section ========== */
.hero-section {
    padding-top: 120px;
    min-height: 100vh;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    max-width: 600px;
    flex: 1;
}

.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.floating-img {
    width: 100%;
    max-width: 450px;
    position: relative;
    animation: floating 6s ease-in-out infinite;
}

.dev-img {
    width: 100%;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.floating-img:hover .dev-img {
    transform: scale(1.05) translateY(-5px) rotate(1deg);
    box-shadow: 0 15px 45px rgba(255, 204, 0, 0.5);
}

.img-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: radial-gradient(circle, var(--accent-tint) 0%, transparent 70%);
    filter: blur(20px);
    z-index: 1;
    border-radius: 50%;
    animation: pulseBg 4s infinite alternate;
}

@keyframes floating {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes pulseBg {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

/* Typing & Glitch Effects */
.typing-anim {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent);
    width: fit-content;
    animation: typing 3s steps(30, end) infinite alternate, blink-caret .75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent);
    }
}

.glitch {
    position: relative;
    color: var(--text-main);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 81px, 0);
    }

    10% {
        clip: rect(62px, 9999px, 86px, 0);
    }

    20% {
        clip: rect(27px, 9999px, 96px, 0);
    }

    30% {
        clip: rect(4px, 9999px, 15px, 0);
    }

    40% {
        clip: rect(16px, 9999px, 11px, 0);
    }

    50% {
        clip: rect(31px, 9999px, 7px, 0);
    }

    60% {
        clip: rect(21px, 9999px, 32px, 0);
    }

    70% {
        clip: rect(78px, 9999px, 31px, 0);
    }

    80% {
        clip: rect(55px, 9999px, 50px, 0);
    }

    90% {
        clip: rect(38px, 9999px, 49px, 0);
    }

    100% {
        clip: rect(69px, 9999px, 18px, 0);
    }
}

.greeting {
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.main-name {
    color: var(--text-main);
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
}

.sub-title {
    color: var(--text-sec);
    font-size: clamp(30px, 6vw, 60px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 30px;
}

.hero-desc {
    max-width: 540px;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-down i {
    font-size: 1.5rem;
    color: var(--accent);
}

@keyframes bounce {

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

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-7px);
    }
}

/* ========== About Section ========== */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.about-image-wrapper {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.about-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    background-color: var(--light-navy);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
    transition: var(--transition);
    z-index: 5;
}

.about-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 10px;
    top: 20px;
    left: 20px;
    z-index: -1;
    transition: var(--transition);
}

.icon-placeholder {
    font-size: 5rem;
    color: var(--accent);
}

.about-image-wrapper:hover .about-image {
    transform: translate(-5px, -5px);
}

.about-image-wrapper:hover .about-image::before {
    transform: translate(10px, 10px);
}

.personal-info {
    margin-top: 30px;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.personal-info li {
    font-size: 1.05rem;
    font-family: var(--font-mono);
    color: var(--text-sec);
}

.personal-info strong {
    color: var(--text-main);
    display: inline-block;
    min-width: 90px;
}

/* ========== Skills Section ========== */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.skill-card {
    flex: 1 1 200px;
    max-width: 250px;
    background-color: var(--light-navy);
    padding: 30px;
    border-radius: 8px;
    transition: var(--transition);
    box-shadow: 0 10px 30px -15px var(--navy-shadow);
    border: 1px solid transparent;
}

.skill-card:hover {
    transform: translateY(-7px);
    border-color: var(--accent);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent);
}

.skill-info h3 {
    color: var(--text-main);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.skill-info p {
    font-size: 0.95rem;
}

/* ========== Certificates Section ========== */
.cert-section {
    padding-bottom: 60px;
}

.cert-desc {
    font-size: 1.1rem;
    margin-bottom: 40px;
    text-align: center;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.cert-card {
    display: block;
    position: relative;
    background-color: var(--light-navy);
    border-radius: 8px;
    padding: 30px 25px;
    transition: var(--transition);
    overflow: hidden;
}

.cert-card:hover {
    transform: translateY(-5px);
    background-color: var(--lightest-navy);
}

.cert-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: var(--accent);
}

.link-icon {
    font-size: 1.2rem;
    color: var(--text-sec);
    transition: var(--transition);
}

.cert-card:hover .link-icon {
    color: var(--accent);
}

.cert-card h3 {
    color: var(--text-main);
    font-size: 1.4rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.cert-platform {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.cert-detail {
    font-size: 0.95rem;
}

/* ========== Contact Section ========== */
.contact-section {
    padding-bottom: 80px;
}

.center-aligned {
    justify-content: center;
}

.contact-wrapper {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-desc {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.direct-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.direct-contact p {
    font-size: 1.1rem;
    font-family: var(--font-mono);
}

.direct-contact i {
    color: var(--accent);
    margin-right: 8px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    width: 100%;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--light-navy);
    border: 1px solid var(--lightest-navy);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-sec);
    opacity: 0.7;
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: 0.4s;
}

.contact-form input:focus~.focus-border,
.contact-form textarea:focus~.focus-border {
    width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: transparent;
    background-color: #1a1a1a;
}

.submit-btn {
    margin-top: 20px;
    align-self: center;
    padding: 15px 40px;
}

/* ========== Footer ========== */
footer {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--bg-color);
    border-top: 1px solid var(--light-navy);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--text-sec);
    transition: var(--transition);
}

.social-icon:hover {
    color: var(--accent);
    transform: translateY(-5px);
}

.footer-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-sec);
}

.footer-link:hover {
    color: var(--accent);
}

.footer-code {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--lightest-navy);
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ========== Scroll Animations ========== */
[data-scroll] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1), transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}

[data-scroll].scrolled {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-image-wrapper {
        margin-top: 40px;
        width: 100%;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image-wrapper {
        margin: 40px auto;
    }
}

/* ========== Snake Game ========== */
.snake-container {
    background-color: var(--light-navy);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
}

canvas#snake-game {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.snake-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
}

/* ========== Custom Cursor ========== */
a,
button,
.btn {
    cursor: none;
}

.custom-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.15), 0 0 14px rgba(255, 204, 0, 0.55);
    transition: width 0.2s, height 0.2s, background-color 0.2s, opacity 0.2s;
}

.cursor-follower {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 204, 0, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0;
    backdrop-filter: blur(1px);
    transition: width 0.2s, height 0.2s, background-color 0.2s, opacity 0.2s;
    transition-timing-function: ease-out;
}

.custom-cursor.active {
    width: 0px;
    height: 0px;
    background-color: transparent;
}

.cursor-follower.active {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 204, 0, 0.1);
}

html.touch-device * {
    cursor: auto !important;
}

html.touch-device .custom-cursor,
html.touch-device .cursor-follower {
    display: none !important;
}

@media (pointer: coarse) {
    * {
        cursor: auto !important;
    }

    .custom-cursor,
    .cursor-follower {
        display: none !important;
    }
}