/* =========================================================================
   1. VARIABLES & RESET (DARK MODE - JAVA THEME)
   ========================================================================= */
:root {
    /* Backgrounds */
    --bg-primary: #0a0a0a;
    /* Deep Black */
    --bg-secondary: #111111;
    /* Off-Black */
    --bg-card: #1a1a1a;
    /* Dark Grey */
    --bg-card-hover: #222222;
    /* Lighter Grey */

    /* Accents */
    --primary: #f89820;
    /* Java Orange */
    --primary-dark: #e67e22;
    --coffee-brown: #6f4e37;
    --coffee-light: #a67c52;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-muted: #7a7a7a;

    /* Borders & Shadows */
    --border: #2a2a2a;
    --shadow-glow: 0 0 20px rgba(248, 152, 32, 0.15);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    --h1-size: 3.5rem;
    --h2-size: 2.5rem;
    --h3-size: 1.5rem;

    /* Layout */
    --container-width: 1200px;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Grid Pattern Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(248, 152, 32, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(248, 152, 32, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* =========================================================================
   JAVA LOGO ANIMATION
   ========================================================================= */
.nav__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.java-logo-icon {
    width: 40px;
    height: 40px;
    animation: floatLogo 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(248, 152, 32, 0.3));
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(-2deg);
    }

    50% {
        transform: translateY(0px) rotate(0deg);
    }

    75% {
        transform: translateY(-3px) rotate(2deg);
    }
}

.java-steam {
    animation: steamRise 2s ease-in-out infinite;
    opacity: 0;
}

.steam-1 {
    animation-delay: 0s;
}

.steam-2 {
    animation-delay: 0.3s;
}

.steam-3 {
    animation-delay: 0.6s;
}

@keyframes steamRise {
    0% {
        opacity: 0;
        transform: translateY(0px);
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f89820 0%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================================================================
   SPRING LEAVES BG
   ========================================================================= */
.spring-leaves-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.spring-leaf {
    position: absolute;
    animation: floatLeaf 15s ease-in-out infinite;
}

.leaf-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.leaf-2 {
    top: 60%;
    right: 10%;
    animation-delay: 3s;
}

.leaf-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 6s;
}

@keyframes floatLeaf {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(10px, -15px) rotate(5deg);
    }

    50% {
        transform: translate(-5px, -25px) rotate(-3deg);
    }

    75% {
        transform: translate(15px, -10px) rotate(8deg);
    }
}

@media (max-width: 768px) {
    .spring-leaf {
        opacity: 0.5 !important;
    }

    .leaf-2,
    .leaf-3 {
        display: none;
    }
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.section {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(248, 152, 32, 0.4);
    transform: translateY(-2px);
    background: #ffa030;
    border-color: #ffa030;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px rgba(248, 152, 32, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Section Titles */
.section-title {
    font-size: var(--h2-size);
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: -0.02em;
    position: relative;
}

.section-title span {
    color: var(--primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 1rem auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(248, 152, 32, 0.5);
}

/* =========================================================================
   2. HEADER & NAV
   ========================================================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    background: transparent;
}

header.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.8rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.java-icon {
    width: 32px;
    height: 32px;
    fill: var(--primary);
    transition: filter 0.3s ease;
}

.nav__logo:hover .java-icon {
    filter: drop-shadow(0 0 5px var(--primary));
}

.nav-list {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.5rem;
}

/* =========================================================================
   3. HERO SECTION
   ========================================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0;
    background: radial-gradient(circle at top, #1a1a1a 0%, #0a0a0a 100%);
    overflow: hidden;
}

.coffee-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.coffee-icon {
    position: absolute;
    color: var(--coffee-brown);
    opacity: 0.05;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-40px) rotate(10deg);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-greeting {
    font-size: 1.25rem;
    color: var(--primary);
    font-family: var(--font-code);
    margin-bottom: 1rem;
    display: block;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-name {
    background: linear-gradient(135deg, #f89820 0%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.hero-subtitle-wrapper {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-subtitle {
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    animation: typing 3s steps(30) 0.5s forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.25rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(248, 152, 32, 0.2);
}

/* =========================================================================
   4. ABOUT SECTION
   ========================================================================= */
.about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    border-left: 3px solid var(--primary);
    padding-left: 2rem;
    text-align: justify;
}

.about p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* =========================================================================
   5. STACK SECTION
   ========================================================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.skill-category h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.tech-card i {
    font-size: 2.5rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tech-card span {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tech-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.tech-card:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.tech-card:hover i.fa-java {
    color: #f89820;
}

/* =========================================================================
   6. PROJECTS SECTION
   ========================================================================= */
.projects {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
}

.project-image {
    height: 200px;
    background: var(--bg-primary);
    /* Fallback */
    position: relative;
    overflow: hidden;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tag {
    font-family: var(--font-code);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    border: 1px solid var(--border);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    color: var(--primary);
}

/* =========================================================================
   7. CONTACT SECTION
   ========================================================================= */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.contact-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.contact-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================================================
   8. FOOTER
   ========================================================================= */
footer {
    background: #000;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.coffee-text {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--coffee-light);
    margin-top: 0.5rem;
    display: block;
}

/* =========================================================================
   ANIMATIONS & RESPONSIVE
   ========================================================================= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {

    .skills-grid,
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s ease;
        z-index: 999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-list.show {
        right: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .skills-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .coffee-bg .coffee-icon:nth-child(even) {
        display: none;
    }

    /* Reduce icons on mobile */
}

/* =========================================================================
   10. CURSOR TRAIL (UPDATED - CONTINUOUS)
   ========================================================================= */
.coffee-bean-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    animation: beanAppear 0.3s ease-out forwards;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

@keyframes beanAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }

    to {
        opacity: 0.75;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* =========================================================================
   11. INLINE HEADER LOGO (REFINED)
   ========================================================================= */
.nav__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f89820 0%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.java-logo-inline {
    width: 28px;
    height: 38px;
    filter: drop-shadow(0 0 8px rgba(248, 152, 32, 0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }
}

.steam-line {
    animation: steamFlow 2s ease-in-out infinite;
    opacity: 0;
}

.steam-1 {
    animation-delay: 0s;
}

.steam-2 {
    animation-delay: 0.4s;
}

.steam-3 {
    animation-delay: 0.8s;
}

@keyframes steamFlow {
    0% {
        opacity: 0;
        stroke-dashoffset: 100;
    }

    40% {
        opacity: 0.7;
    }

    80% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        stroke-dashoffset: 0;
    }
}

.nav__logo:hover .java-logo-inline {
    filter: drop-shadow(0 0 15px rgba(248, 152, 32, 0.8));
    animation: logoBounce 0.6s ease-in-out;
}

@keyframes logoBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-8px) scale(1.1);
    }

    50% {
        transform: translateY(-4px) scale(1.05);
    }

    75% {
        transform: translateY(-6px) scale(1.08);
    }
}

@media (max-width: 768px) {
    .java-logo-inline {
        width: 24px;
        height: 32px;
    }

    .logo-text {
        font-size: 1.1rem;
    }
}

/* =========================================================================
   12. JAVA ICONS BACKGROUND
   ========================================================================= */
.java-icons-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.floating-java-icon {
    position: absolute;
    opacity: 0.05;
    animation: floatJavaIcon 20s ease-in-out infinite;
}

.icon-1 {
    top: 5%;
    left: 10%;
    animation-duration: 18s;
    animation-delay: 0s;
}

.icon-2 {
    top: 15%;
    right: 15%;
    animation-duration: 22s;
    animation-delay: 3s;
}

.icon-3 {
    top: 50%;
    left: 5%;
    animation-duration: 25s;
    animation-delay: 6s;
}

.icon-4 {
    bottom: 20%;
    right: 20%;
    animation-duration: 20s;
    animation-delay: 9s;
}

.icon-5 {
    bottom: 30%;
    left: 25%;
    animation-duration: 23s;
    animation-delay: 12s;
}

.icon-6 {
    top: 40%;
    right: 8%;
    animation-duration: 19s;
    animation-delay: 15s;
}

.icon-about-1 {
    top: 10%;
    right: 10%;
    animation-duration: 25s;
}

.icon-about-2 {
    bottom: 15%;
    left: 5%;
    animation-duration: 28s;
}

@keyframes floatJavaIcon {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.04;
    }

    25% {
        transform: translate(30px, -40px) rotate(5deg);
        opacity: 0.06;
    }

    50% {
        transform: translate(-20px, -70px) rotate(-3deg);
        opacity: 0.05;
    }

    75% {
        transform: translate(40px, -50px) rotate(8deg);
        opacity: 0.07;
    }
}

@media (max-width: 768px) {

    .icon-3,
    .icon-5,
    .icon-6 {
        display: none;
    }

    .floating-java-icon {
        opacity: 0.03 !important;
    }
}
