:root {
    --primary-color: #d9004d;
    --bg-dark: #191919;
    --bg-darker: #101010;
    --text-light: #fcfc;
    --text-white: white;
    --border-radius: 30px;
    --transition: 0.4s;
}

/* Dark mode preference - currently supporting dark only */
@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f5f5f5;
        --bg-darker: #e0e0e0;
        --text-light: #1a1a1a;
        --text-white: #1a1a1a;
    }
}

html{
    scroll-behavior: smooth;
}
::selection {
    background: var(--primary-color);
    color: var(--text-white);
}
::-moz-selection {
    background: var(--primary-color);
    color: var(--text-white);
}
section, div[id] {
    scroll-margin-top: 80px;
}
*, *::before, *::after{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body{
    font-family: 'Josefin Sans', sans-serif;
}

/* Fix for Font Awesome icons */
i[class^="fa"] {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands' !important;
    font-style: normal;
}
.hero {
    height: 100vh;
    min-height: 600px;
    width: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url(../images/1.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}
nav{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 8%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(16, 16, 16, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.logo{
    color: var(--text-white);
    font-size: 35px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.logo:hover{
    transform: scale(1.05);
}
span{
    color: var(--primary-color);
}
nav ul li{
    list-style-type: none;
    display: inline-block;
    padding: 10px 25px;
}
nav ul li a{
    color: var(--text-white);
    text-decoration: none;
    font-weight: bold;
    text-transform: capitalize;
    cursor: pointer;
    transition: color var(--transition);
}
nav ul li a:hover{
    color: var(--primary-color);
    transition: var(--transition);
}
nav ul li a:focus{
    color: var(--primary-color);
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}
.btn{
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    border: 2px solid transparent;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: var(--border-radius);
    transition: transform var(--transition);
    user-select: none;
}
.btn:hover{
    transform: scale(1.2);
}
.btn:focus-visible{
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}
.content{
    position: absolute;
    top: 55%;
    left: 8%;
    transform: translateY(-50%);
    padding-top: 80px;
}
h1{
    color: var(--text-white);
    margin: 20px 0px 20px;
    font-size: 75px;
    letter-spacing: 2px;
}
h3{
    color: var(--text-white);
    font-size: 25px;
    margin-bottom: 50px;

}
h4{
    color: var(--text-light);
    letter-spacing: 2px;
    font-size: 20px;

}
.newsletter form{
    width: 380px;
    max-width: 100%;
    position: relative;


}
.newsletter form input:first-child{
    display: inline-block;
    width: 100%;
    padding: 14px 130px 14px 15px;
    border: 2px solid var(--primary-color);
    outline: none;
    border-radius: var(--border-radius);
}
.newsletter form input:last-child{
    position: absolute;
    display: inline-block;
    outline: none;
    border: none;
    padding: 10px 30px;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: 0px 0px 5px #000,0px 0px 15px #858585;
    top: 6px;
    right:6px;
}
/* second part */
.about{
    width: 100%;
    padding: 100px 0px;
    background-color: var(--bg-dark);
}
.about img{
    height: auto;
    width: 430px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 10px;
    background-color: #2a2a2a;
    min-height: 300px;
}
.about-text{
    width: 550px;

}
.main{
    width: 1130px;
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-around;

}
.about-text h2{
    color: var(--text-white);
    font-size: 75px;
    text-transform: capitalize;
    margin-bottom: 20px;

}
.about-text h5{
    color: var(--text-white);
    letter-spacing: 2px;
    font-size: 25px;
    margin-bottom: 25px;
    text-transform: capitalize;
}
.about-text p{
    color: var(--text-light);
    letter-spacing: 1px;
    line-height: 28px;
    font-size: 18px;
    margin-bottom: 45px;
}
button{
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    font-weight: bold;
    padding: 13px 30px;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}
button:hover{
    background-color: transparent;
    border: 2px solid var(--primary-color);
    cursor: pointer;
}

button:active{
    transform: scale(0.98);
}

button:focus-visible{
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}
/* services section */
.service{
    background: var(--bg-darker);
    width: 100%;
    padding: 100px 0px;

}
/* skills section */
.skills{
    background: var(--bg-dark);
    width: 100%;
    padding: 100px 0px;

}
/* Skills cards specific styles */
.skills .card i.fab {
    font-size: 50px;
    display: block;
    text-align: center;
    margin: 25px 0px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.skills .card:hover i.fab {
    transform: scale(1.2);
}

/* Skill card specific hover */
.skills .card {
    background: linear-gradient(145deg, #1a1a1a, #222222);
}
.title h2{
   color: var(--text-white);
   font-size: 75px;
   width: 1130px;
   max-width: 95%;
   margin: 30px auto;
   text-align: center;
}
.box{
    display: flex;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    gap: 15px;
    flex-wrap: wrap;
}
.card{
    height: 400px;
    width: 335px;
    padding: 20px 35px;
    margin: 15px;
    background: var(--bg-dark);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    backdrop-filter: blur(10px);
}
.card:hover{
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(217, 0, 77, 0.3);
}

/* Add focus-within for better keyboard navigation */
.card:focus-within{
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(217, 0, 77, 0.3);
}
.card i{
    font-size: 50px;
    display: block;
    text-align: center;
    margin: 25px 0px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}
.card:hover i{
    transform: scale(1.1);
}
 h5{
    color: var(--text-white);
    font-size: 23px;
    margin-bottom: 15px;
}
.pra{
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pra p{
    color: var(--text-light);
    font-size: 16px;
    line-height: 27px;
    margin-bottom: 25px;
    flex-grow: 1;
    overflow-wrap: break-word;
}
.card .button{
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    font-weight: bold;
    padding: 9px 22px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(217, 0, 77, 0.3);
}
.card .button:hover{
    background: transparent;
    border: 2px solid var(--primary-color);
    cursor: pointer;
}
/* Contact me */
.contact-me{
    width: 100%;
    height: 290px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

/* Add transition to contact section */
.contact-me{
    transition: background-color 0.3s ease;
}
.contact-me p{
    color: var(--text-white);
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center;
    max-width: 800px;
}
.contact-me .button-two{
    background-color: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    font-weight: bold;
    padding: 13px 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}
.contact-me .button-two:hover{
    background: transparent;
    border: 2px solid var(--primary-color);
    cursor: pointer;
}
/* Footer */
footer{
    position: relative;
    width: 100%;
    min-height: 400px;
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 60px;
}
footer p:nth-child(1){
    font-size: 30px;
    color: var(--text-white);
    margin-bottom: 20px;
    font-weight: bold;
}
footer p:nth-child(2){
    color: var(--text-white);
    font-size: 17px;
    width: 540px;
    max-width: 90%;
    text-align: center;
    line-height: 26px;
    padding: 0 20px;
}
.social{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.social a{
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 50%;
    margin: 22px 10px;
    color: var(--text-white);
    text-decoration: none;
    font-size: 20px;
    transition: transform 0.3s ease;
}
.social a:hover{
    transform: scale(1.3);
    transition: .3s;
}
.end{
    margin-top: 30px;
    color: var(--primary-color);
    font-size: 14px;
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}
.skip-link:focus {
    top: 0;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
    }
}
@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
    }
    
    h1 {
        font-size: 50px;
    }
    
    .main {
        flex-direction: column;
        text-align: center;
    }
    
    .about img {
        width: 300px;
        margin-bottom: 30px;
    }
    
    .about-text {
        width: 100%;
    }
    
    .about-text h2 {
        font-size: 50px;
    }
    
    .title h2 {
        font-size: 50px;
    }
    
    .box {
        flex-direction: column;
        align-items: center;
    }
    
    .card {
        width: 90%;
        max-width: 400px;
    }
    
    /* Mobile Navigation */
    nav {
        padding: 15px 5%;
        flex-wrap: wrap;
    }
    
    nav ul {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: rgba(16, 16, 16, 0.98);
        padding: 20px 0;
        text-align: center;
    }
    
    nav ul.active {
        display: block;
    }
    
    nav ul li {
        display: block;
        padding: 12px 0;
    }
    
    .btn {
        display: none;
    }
    
    .logo {
        font-size: 28px;
    }
    
    h1 {
        font-size: 42px;
        padding-right: 5%;
        padding-left: 5%;
    }
    
    h3 {
        font-size: 20px;
        padding: 0 5%;
    }
    
    h4 {
        font-size: 18px;
        padding: 0 5%;
    }
    
    .content {
        left: 0;
        right: 0;
        padding: 0 5%;
        top: 50%;
    }
    
    .about {
        padding: 60px 5%;
    }
    
    .about-text h2 {
        font-size: 42px;
    }
    
    .about-text h5 {
        font-size: 20px;
    }
    
    .service, .skills {
        padding: 60px 5%;
    }
    
    .title h2 {
        font-size: 42px;
    }
    
    .contact-me {
        padding: 40px 5%;
        height: auto;
        min-height: 250px;
    }
    
    .contact-me p {
        font-size: 24px;
    }
    
    footer {
        padding: 40px 5% 60px;
        min-height: auto;
    }
    
    footer p:nth-child(1) {
        font-size: 24px;
    }
    
    footer p:nth-child(2) {
        font-size: 15px;
        width: 100%;
        padding: 0;
    }
    
    .social a {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 15px 8px;
    }
    
    .newsletter form {
        width: 100%;
    }
    
    .newsletter form input:first-child {
        width: 100%;
        padding-right: 15px;
    }
    
    .newsletter form input:last-child {
        position: relative;
        width: 100%;
        margin-top: 10px;
        right: 0;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    nav {
        padding: 20px 5%;
    }
    
    nav ul li {
        padding: 10px 15px;
    }
    
    .logo {
        font-size: 30px;
    }
    
    .content {
        left: 5%;
    }
    
    h1 {
        font-size: 60px;
    }
    
    .main {
        width: 95%;
    }
    
    .about-text {
        width: 480px;
    }
    
    .card {
        width: 300px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    h1 {
        font-size: 36px;
        letter-spacing: 1px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    h4 {
        font-size: 16px;
    }
    
    .about-text h2 {
        font-size: 36px;
    }
    
    .title h2 {
        font-size: 36px;
    }
    
    .contact-me p {
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .stats-container {
        gap: 25px;
    }
    
    footer p:nth-child(1) {
        font-size: 22px;
    }
    
    footer p:nth-child(2) {
        font-size: 14px;
    }
    
    /* Touch-friendly improvements */
    button, .btn, .card .button, .contact-me .button-two {
        min-height: 48px;
        min-width: 48px;
    }
    
    nav ul li a {
        padding: 15px 20px;
        display: block;
    }
    
    .card {
        min-height: 380px;
        padding: 25px;
    }
    
    .social a {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }
    
    .content {
        top: 45%;
    }
    
    h1 {
        font-size: 32px;
        margin: 10px 0;
    }
    
    h3 {
        font-size: 16px;
        margin-bottom: 20px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero {
        background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url(../images/1.jpg);
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
    
    .scroll-top {
        bottom: calc(30px + env(safe-area-inset-bottom));
        right: calc(30px + env(safe-area-inset-right));
    }
}

/* Print styles */
@media print {
    nav, .scroll-top, .newsletter {
        display: none;
    }
    
    .hero {
        height: auto;
        min-height: auto;
        padding: 50px 0;
        background: none;
        color: black;
    }
    
    body {
        color: black;
        background: white;
    }
}

/* Animation styles */
.animate-in {
    opacity: 1;
    transform: translateY(0);
}

section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.loaded section {
    opacity: 1;
    transform: translateY(0);
}

.card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(217, 0, 77, 0.4);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(217, 0, 77, 0.6);
}

/* Stats Section */
.stats {
    background: var(--bg-dark);
    padding: 60px 20px;
}

.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: var(--text-white);
}

.stat-number {
    display: block;
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Improved newsletter form */
.newsletter {
    margin-top: 30px;
}

.newsletter form {
    display: flex;
    gap: 10px;
    width: 450px;
    max-width: 100%;
}

.newsletter form input[type="email"] {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--text-white);
    font-size: 16px;
    outline: none;
    font-family: 'Josefin Sans', sans-serif;
}

.newsletter form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.newsletter form button {
    padding: 14px 30px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: var(--text-white);
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Josefin Sans', sans-serif;
}

.newsletter form button:hover {
    background: transparent;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .stats-container {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    .newsletter form {
        flex-direction: column;
        width: 100%;
    }
    
    .newsletter form button {
        width: 100%;
    }
}
