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

:root {
    --bg-color: #081b29;
    --second-bg-color: #112e42;
    --text-color: #ededed;
    --main-color: #00abf0;
}

/* reserve space for fixed header when jumping to anchors */
html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;   /* match your header height */
    overflow-x: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

*::selection {
    background: var(--main-color);
    color: var(--bg-color);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

/* small generic btn fallback (used by success page too) */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--main-color);
    color: var(--bg-color);
    border: .2rem solid var(--main-color);
    border-radius: .8rem;
    font-weight: 600;
    transition: .3s;
}
.btn:hover { background: transparent; color: var(--main-color); }

/*───────────────────*/
/*   HEADER & NAV    */
/*───────────────────*/
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    z-index: 100;
    transition: .3s;
}

.header.sticky {
    background: var(--bg-color);
    padding: 0.5rem 9%; /* Reduced padding when sticky */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Add shadow for visibility */
}

.logo {
    position: relative;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.navbar {
    position: relative;
    display: flex;
}

.navbar a {
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--text-color);
    margin-left: 3.5rem;
    transition: .3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

#menu-icon {
    display: none;
    font-size: 3.6rem;
    color: var(--text-color);
    cursor: pointer;
}

#menu-icon.bx-x {
    /* Style to transform menu icon to 'X' (optional customization) */
    transform: rotate(90deg); /* Example: rotate to suggest 'X' */
}

/* MOBILE FIXES */
@media (max-width: 768px) {
    #menu-icon {
        display: block;
    }
    .navbar {
        position: fixed;
        inset: 6.4rem 0 auto 0; /* Adjusted to match header height (64px) */
        display: none;
        background: var(--bg-color);
        padding: 1rem 5vw;
        width: 100%;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }
    .navbar.active {
        display: block;
    }
    .navbar a {
        display: block;
        padding: 0.8rem 0;
        font-size: clamp(16px, 4vw, 18px);
        margin-left: 0; /* Remove margin for stacked layout */
    }
    .header {
        padding: 1rem 5vw; /* Reduced padding on mobile */
    }
}

/*───────────────────*/
/*   SECTION BASE    */
/*───────────────────*/
section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
    position: relative;
    scroll-margin-top: 8rem; /* fallback for older browsers */
}

@media (max-width: 768px) {
    section {
        padding: 6rem 5vw 1rem; /* Reduced padding for mobile */
    }
}

/*───────────────────*/
/*      HOME         */
/*───────────────────*/
.home {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 9%;
    background: url('/static/images/home.jpg') no-repeat center/cover;
}

.home-content {
    max-width: 60rem;
    z-index: 2;
}

.home-content h1 {
    display: inline-block;
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
}

.home-content h1 span {
    color: var(--main-color);
}

.text-animate {
    position: relative;
    width: 32.8rem;
}

.text-animate h3 {
    font-size: 3.2rem;
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: .7px var(--main-color);
    background-image: linear-gradient(var(--main-color), var(--main-color));
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-position: -33rem 0;
}

.home.show-animate .text-animate h3 {
    animation: homeBgText 6s linear infinite;
    animation-delay: 2s;
}

.home-content p {
    font-size: 1.6rem;
    margin: 2rem 0 4rem;
}

.btn-box {
    display: flex;
    justify-content: space-between;
    width: 34.5rem;
    height: 5rem;
    position: relative;
}

.btn-box .btn {
    width: 15rem;
    height: 100%;
    background: var(--main-color);
    color: var(--bg-color);
    border: .2rem solid var(--main-color);
    border-radius: .8rem;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: .1rem;
    position: relative;
    overflow: hidden;
    transition: .5s;
}

.btn-box .btn:nth-child(2) {
    background: transparent;
    color: var(--main-color);
}

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

.btn-box .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--bg-color);
    z-index: -1;
    transition: .5s;
}
.btn-box .btn:hover::before {
    width: 100%;
}

.home-sci {
    position: absolute;
    bottom: 4rem;
    width: 17rem;
    display: flex;
    justify-content: space-between;
}

.home-sci a {
    width: 4rem;
    height: 4rem;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--main-color);
    position: relative;
    overflow: hidden;
    transition: .5s;
}
.home-sci a:hover {
    color: var(--bg-color);
}

.home-sci a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--main-color);
    z-index: -1;
    transition: .5s;
}
.home-sci a:hover::before {
    width: 100%;
}

.home-imgHover {
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    pointer-events: none;
    transition: 3s;
}
.home-imgHover:hover {
    background: var(--bg-color);
    opacity: .6;
}

@media (max-width: 768px) {
    .home {
        padding: 0 5vw;
    }
    .home-content h1 {
        font-size: clamp(3.5rem, 6vw, 5.6rem);
    }
    .text-animate h3 {
        font-size: clamp(2rem, 4vw, 3.2rem);
    }
    .home-content p {
        font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    }
    .btn-box {
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: 1rem;
    }
    .btn-box .btn {
        width: 100%;
        min-height: 4rem;
    }
    .home-imgHover {
        display: none; /* Hide on mobile to avoid overlap */
    }
}

/*───────────────────*/
/*  PROFESSIONAL     */
/*    PROJECTS       */
/*───────────────────*/
.projects {
    padding: 10rem 9% 6rem;
    background: var(--bg-color);
    position: relative;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    position: relative;
}

.section-title .highlight {
    color: var(--main-color);
}

.section-subtitle {
    font-size: 1.6rem;
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.8;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.project-item {
    background: var(--second-bg-color);
    border: .2rem solid var(--main-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 171, 240, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-item:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 60px rgba(0, 171, 240, 0.2);
    border-color: var(--main-color);
}

.project-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 171, 240, 0.9), rgba(8, 27, 41, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 16px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--main-color);
    color: var(--bg-color);
    border-color: var(--main-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--main-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border-color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.project-info {
    padding: 32px;
}

.project-category {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--main-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.project-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.3;
}

.project-description {
    font-size: 1.6rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 24px;
    opacity: 0.9;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    background: var(--bg-color);
    color: var(--main-color);
    border: 1px solid var(--main-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--main-color);
    color: var(--bg-color);
}

/* Projects Responsive Design */
@media (max-width: 768px) {
    .projects {
        padding: 6rem 5vw 4rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .project-item {
        margin: 0 10px;
    }
    
    .section-title {
        font-size: clamp(3.5rem, 6vw, 5rem);
    }
    
    .section-subtitle {
        font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    }
    
    .project-info {
        padding: 24px;
    }
    
    .project-title {
        font-size: clamp(1.8rem, 4vw, 2.2rem);
    }
    
    .project-description {
        font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    }
    
    .project-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 1.6rem;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .project-image {
        height: 220px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/*───────────────────*/
/*      ABOUT        */
/*───────────────────*/
.about {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    background: var(--second-bg-color);
    padding-bottom: 6rem;
}

.heading {
    font-size: 5rem;
    text-align: center;
    position: relative;
}
.heading span {
    color: var(--main-color);
}

.about-img {
    position: relative;
    width: 25rem;
    height: 25rem;
    border-radius: 50%;
}

.about-img img {
    width: 90%;
    border-radius: 50%;
    border: .2rem solid var(--main-color);
}

.circle-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 98%;
    height: 98%;
    border-left: .2rem solid var(--main-color);
    border-right: .2rem solid var(--main-color);
    border-top: .2rem solid var(--second-bg-color);
    border-bottom: .2rem solid var(--second-bg-color);
    border-radius: 50%;
    animation: aboutSpinner 8s linear infinite;
}

.about-content {
    text-align: center;
}
.about-content h3 {
    font-size: 2.6rem;
    position: relative;
}
.about-content p {
    font-size: 1.6rem;
    margin: 2rem 0 3rem;
}
.btn-box.btns {
    width: 15rem;
}

@media (max-width: 768px) {
    .about-img {
        width: 20rem;
        height: 20rem;
    }
    .about-content h3 {
        font-size: clamp(2rem, 4vw, 2.6rem);
    }
    .about-content p {
        font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    }
}

/*───────────────────*/
/*    EDUCATION      */
/*───────────────────*/
.education {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 5rem;
}

.education-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5rem;
}

.education-column {
    flex: 1 1 40rem;
}

.education-column .title {
    display: inline-block;
    font-size: 2.5rem;
    margin: 0 0 1.5rem 2rem;
    position: relative;
}

.education-box {
    position: relative;
    border-left: .2rem solid var(--main-color);
}

.education-box .education-content {
    padding-left: 2rem;
    position: relative;
}

.education-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1.1rem;
    width: 2rem;
    height: 2rem;
    background: var(--main-color);
    border-radius: 50%;
}

.education-content .content {
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.education-content .content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    z-index: -1;
    transition: .5s;
}
.education-content .content:hover::before {
    width: 100%;
}

.education-content .year {
    font-size: 1.5rem;
    color: var(--main-color);
    padding-bottom: .5rem;
}
.education-content .content h3 {
    font-size: 2rem;
    margin-bottom: .5rem;
}
.education-content .content p {
    font-size: 1.6rem;
}

@media (max-width: 768px) {
    .education-row {
        flex-direction: column;
    }
    .education-content .year {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
    }
    .education-content .content h3 {
        font-size: clamp(1.8rem, 4vw, 2rem);
    }
}

/*───────────────────*/
/*      SKILLS       */
/*───────────────────*/
.skills {
    background: var(--second-bg-color);
    padding-bottom: 7rem;
}
.skills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5rem;
}
.skills-column {
    flex: 1 1 40rem;
}

.skills-column .title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.skills-box .skills-content {
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    padding: 2rem;
    position: relative;
}

.skills-content .progress {
    margin-bottom: 1.5rem;
}

.progress h3 {
    font-size: 1.8rem;
    margin-bottom: .5rem;
}

.progress .bar {
    width: 100%;
    background: var(--bg-color);
    height: .8rem;
    border-radius: .4rem;
    overflow: hidden;
}
.bar span {
    display: block;
    height: 100%;
    background: var(--main-color);
}

@media (max-width: 768px) {
    .skills-row {
        flex-direction: column;
    }
    .progress h3 {
        font-size: clamp(1.6rem, 4vw, 1.8rem);
    }
}

/*───────────────────*/
/*      CONTACT      */
/*───────────────────*/
.contact {
    background: var(--bg-color);
    padding: 6rem 9% 8rem;
}

.contact .heading {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-form {
    max-width: 900px;
    margin: 0 auto;
    background: var(--second-bg-color);
    border: .2rem solid var(--main-color);
    border-radius: .8rem;
    padding: 2rem;
}

.contact .input-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
    margin-bottom: 1.6rem;
}

.contact .input-field {
    position: relative;
}

.contact input,
.contact textarea {
    width: 100%;
    padding: 1.2rem 1.4rem;
    border-radius: .6rem;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1.6rem;
}

.contact input::placeholder,
.contact textarea::placeholder {
    color: #9ecde4;
}

.textarea-field {
    margin-bottom: 1.6rem;
}

.contact textarea {
    min-height: 14rem;
    resize: vertical;
}

/* fancy focus underline using the extra span in your HTML */
.contact .input-field .focus,
.contact .textarea-field .focus {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: .2rem;
    background: var(--main-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
}

.contact .input-field input:focus ~ .focus,
.contact .textarea-field textarea:focus ~ .focus {
    transform: scaleX(1);
}

.contact .btn-box.btns {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.contact .btn-box .btn {
    padding: 1.1rem 2.4rem;
    font-size: 1.7rem;
}

/* responsive */
@media (max-width: 768px) {
    .contact {
        padding: 4rem 5vw 6rem;
    }
    .contact .input-box {
        grid-template-columns: 1fr;
    }
    .contact input,
    .contact textarea {
        font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    }
}

/*───────────────────*/
/*  CONTACT SUCCESS  */
/*───────────────────*/
.contact-success {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 9%;
    background: var(--second-bg-color);
}

.contact-success .container {
    max-width: 50rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.contact-success .heading {
    font-size: 5rem;
    margin-bottom: 1rem;
}
.contact-success .heading span {
    color: var(--main-color);
}

.contact-success .success-message {
    font-size: 2.4rem;
    line-height: 1.4;
    color: var(--text-color);
    max-width: 40rem;
    margin: 0 auto;
}

.contact-success .back-home {
    margin-top: 1.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .contact-success .heading {
        font-size: clamp(3.5rem, 6vw, 5rem);
    }
    .contact-success .success-message {
        font-size: clamp(2rem, 4vw, 2.4rem);
    }
}

/*───────────────────*/
/*   FOOTER (basic)  */
/*───────────────────*/
.footer {
    padding: 2rem 9%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer .footer-text p {
    font-size: 1.4rem;
}
.footer .footer-iconTop a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    color: var(--main-color);
}

@media (max-width: 768px) {
    .footer {
        padding: 2rem 5vw;
        flex-direction: column;
        gap: 1rem;
    }
    .footer .footer-text p {
        font-size: clamp(1.2rem, 3vw, 1.4rem);
    }
}

/*───────────────────*/
/*   KEYFRAMES       */
/*───────────────────*/
@keyframes homeBgText {
    0%, 10%, 100% { background-position: -33rem 0; }
    65%, 85% { background-position: 0 0; }
}

@keyframes aboutSpinner {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animation and Show Classes */
.animate {
    animation: animate 1s linear infinite;
}

.show-animate {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease;
}

.active-nav {
    display: none; /* Adjust if you want a visual indicator */
}

@keyframes animate {
    0% {
        opacity: 0;
        transform: rotateY(90deg);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: rotateY(0deg);
        filter: blur(0);
    }
}

/* === FINAL MOBILE OVERRIDES (keep at very bottom) === */
@media screen and (max-width: 768px) {
  /* spacing */
  section { padding: 6rem 5vw 1rem !important; }
  .home   { padding: 0 5vw !important; }
  .projects { padding: 6rem 5vw 4rem !important; } /* Override for projects */

  /* make headings truly smaller on phones */
  .home-content h1 { font-size: clamp(2.2rem, 8vw, 3.6rem) !important; }  /* 22–36px */
  .text-animate h3 { font-size: clamp(1.6rem, 5.5vw, 2.4rem) !important; }/* 16–24px */
  .home-content p  { font-size: clamp(1.4rem, 4vw, 1.6rem) !important; }

  /* buttons stack */
  .btn-box { flex-direction: column !important; gap: 1rem !important; width: 100% !important; height: auto !important; }
  .btn-box .btn { width: 100% !important; min-height: 4rem !important; }

  /* header/nav */
  #menu-icon { display: block !important; }
  .navbar { position: fixed !important; inset: 6.4rem 0 auto 0 !important; display: none; width: 100%; }
  .navbar.active { display: block !important; }
  .navbar a { display:block !important; margin-left:0 !important; padding:.8rem 0 !important; }

  /* visuals */
  .home-imgHover { display: none !important; }
}
