/* Base styles */

:root {
    /* Custom color palette: deep forest green and vibrant amber/gold */
    --bg-dark: #0A1314;
    /* Very deep, dark forest green/black */
    --bg-medium: #162529;
    /* Rich dark green/teal for card backgrounds */
    --bg-light: #2C3E42;
    /* Mid-tone deep teal for nested elements */
    --text-light: #E8F2F3;
    /* Soft off-white for main text */
    --text-medium: #9EA8AA;
    /* Muted grey/green for secondary text */
    --primary-color: #FFC107;
    /* Vibrant amber/gold for highlights */
    --primary-dark: #E0A800;
    /* Richer, slightly darker amber */
    --primary-darker: #B8860B;
    /* Deep gold/brownish for hover states */
    --accent-glow: rgba(255, 193, 7, 0.4);
    /* Glow effect from primary color */
    --card-shadow: rgba(0, 0, 0, 0.3);
    --border-color: rgba(255, 193, 7, 0.2);
    --nav-bg: rgba(22, 37, 41, 0.95);
    --nav-scrolled-bg: rgba(10, 19, 20, 0.98);
}

body.light-mode {
    --bg-dark: #f0f0f0;
    --bg-medium: #ffffff;
    --bg-light: #e6e6e6;
    --text-light: #1A1A1A;
    --text-medium: #555555;
    --primary-color: #007BFF;
    --primary-dark: #0056b3;
    --primary-darker: #004085;
    --accent-glow: rgba(0, 123, 255, 0.4);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --border-color: rgba(0, 123, 255, 0.2);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-scrolled-bg: rgba(255, 255, 255, 0.95);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.7;
    scroll-behavior: smooth;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #001f24 50%, var(--bg-dark) 100%);
    background-size: 200% 200%;
    animation: gradientBackground 15s ease infinite;
    z-index: -1;
    opacity: 0.8;
    transition: background 0.5s ease;
}

body.light-mode::before {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #d4e7ff 50%, var(--bg-dark) 100%);
    background-size: 200% 200%;
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.contact-form-container {
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 100px 0;
    opacity: 0;
    transform: translateY(60px) rotateX(-15deg) scale(0.95);
    transform-origin: center bottom;
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

section.is-visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
}

h1,
h2,
h3 {
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.05em;
}


/* This is the corrected h2 rule.
`display: block;` makes it a full-width element, allowing `text-align: center;` to work.
*/

h2 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    display: block;
    /* Ensures h2 takes up the full width to be centered */
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--accent-glow);
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-dark);
    margin: 15px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

p {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    font-size: 1.125rem;
    color: var(--text-medium);
}

.navbar {
    position: fixed;
    width: 100%;
    z-index: 1000;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 16px var(--card-shadow);
    padding: 1rem 1.5rem;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.4s ease-in-out;
}

.navbar.hidden-nav {
    transform: translateY(-100%);
}

.navbar.scrolled {
    background-color: var(--nav-scrolled-bg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

body.light-mode .navbar.scrolled {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-links li a {
    color: var(--text-light);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease, transform 0.2s ease, text-shadow 0.3s ease;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease-out;
    box-shadow: 0 0 8px var(--accent-glow);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--primary-color);
    transform: translateY(-2px);
    text-shadow: 0 0 10px var(--accent-glow);
}

.mode-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    margin-left: 20px;
}

.mode-toggle-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.navbar-controls {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    position: relative;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary-color);
    position: absolute;
    left: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.menu-toggle.active .hamburger {
    background-color: transparent;
}

.menu-toggle.active .hamburger::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .hamburger::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

.btn {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background-image: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
    color: var(--bg-dark);
    font-weight: 700;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 15px var(--card-shadow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.btn:hover {
    background-image: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3), 0 0 25px var(--accent-glow);
}

.btn-outline {
    background: none;
    border: 2px solid var(--primary-dark);
    color: var(--primary-color);
    border-radius: 0.5rem;
    box-shadow: none;
    padding: 0.7rem 2rem;
    font-weight: 600;
}

.btn-outline:hover {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

body.light-mode .btn-outline:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

#home {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: transparent;
    z-index: 1;
}

#hero-title span {
    display: inline-block;
    overflow: hidden;
    border-right: .15em solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .03em;
    font-size: 50px;
    animation: typing 3s steps(10, end) forwards, blink-caret .60s step-end infinite;
}

@media (max-width: 768px) {
    #hero-title span {
        animation: typing-mobile 3.5s steps(30, end) forwards, 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(--primary-color);
    }
}

#home .hero-content {
    max-width: 960px;
    margin: 0 auto;
    animation: fadeInScale 1.2s ease-out forwards;
    position: relative;
    z-index: 10;
}

#home h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
}

#home h1 span {
    color: var(--primary-color);
}

#home p {
    font-size: 1.6rem;
    color: var(--text-medium);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#about .about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#about .box {
    position: relative;
    width: 20rem;
    height: 25rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.bg {
    width: 100%;
    height: 100%;
    position: absolute;
    background-image: url("main.jpg");
    background-size: cover;
    background-position: center;
    transition: 1s;
    border-radius: 10px;
    box-shadow: 0 10px 10px;
    z-index: 1;
}

.box:hover .bg {
    transform: perspective(20px) rotateX(2deg) translateY(-50px);
}

.bird {
    position: absolute;
    width: 23rem;
    height: 30rem;
    border-radius: 50%;
    background-size: 100%;
    background-repeat: no-repeat;
    background-image: url("removebg-preview.png");
    background-position: center;
    animation: none;
    transition: 1s;
    z-index: 2;
}

.box:hover .bird {
    transform: translateY(-200px) translateX(-10px);
}

#skills {
    background-color: var(--bg-medium);
    border-radius: 1.5rem;
    margin: 4rem auto;
    box-shadow: 0 15px 30px var(--card-shadow);
    padding: 5rem 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    text-align: center;
}

.skill-item {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--border-color) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
    z-index: 0;
}

.skill-item:hover::before {
    transform: scale(1);
    opacity: 1;
}

.skill-item:hover {
    box-shadow: 0 10px 25px var(--card-shadow), 0 0 20px var(--accent-glow);
    transform: translateY(-8px);
    border-color: var(--primary-color);
    transform: perspective(20px) rotateX(2deg) translateY(+20px);
    z-index: 900000;
}

.skill-item h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

.skill-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

#projects {
    background-color: var(--bg-medium);
}

.projects-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 100px;
}

.box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50vh;
    width: 70vw;
    max-width: 400px;
    max-height: 500px;
    background: var(--bg-dark);
    padding: 20px;
    margin: 20px;
    border-radius: 10px;
}

.box .content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    color: #ffffff;
    letter-spacing: 0.2rem;
    padding: 20px;
    text-align: center;
}

.box .content h1 {
    font-size: clamp(1.7rem, 5vw, 2.1rem);
    text-shadow: 0px 0px 10px rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

.box .content h3 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    line-height: 2.5rem;
}

.box .content p {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
}

.box .glass {
    position: absolute;
    top: 0px;
    left: 0px;
    height: 100%;
    width: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: block;
    pointer-events: none;
}

.box::before,
.box::after {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    border-radius: 10px;
}

.box:nth-child(1):before,
.box:nth-child(1):after {
    background: conic-gradient(from var(--angle), #0c63e7, var(--bg-dark), #d11149, var(--bg-dark), #0c63e7);
}

.box:nth-child(2):before,
.box:nth-child(2):after {
    background: conic-gradient(from var(--angle), #f35807, var(--bg-dark), #36d709, var(--bg-dark), #f35807);
}

.box:nth-child(3):before,
.box:nth-child(3):after {
    background: conic-gradient(from var(--angle), #dfff00, var(--bg-dark), #9600ff, var(--bg-dark), #dfff00);
}

.box:nth-child(4):before,
.box:nth-child(4):after {
    background: conic-gradient(from var(--angle), #00d2ff, var(--bg-dark), #928DAB, var(--bg-dark), #00d2ff);
}

.box::after {
    z-index: -2;
    filter: blur(20px);
}

.box::before,
.box::after {
    animation: glowing-border 3.5s linear infinite;
}

.box::after {
    animation: glowing-border 3.5s linear infinite, blur-effect 3.5s linear infinite;
}

@property --angle {
    syntax: "<angle>";
    initial-value: 53deg;
    inherits: false;
}

@keyframes glowing-border {
    from {
        --angle: 53deg;
    }
    to {
        --angle: 413deg;
    }
}

@keyframes blur-effect {
    from {
        filter: blur(20px);
    }
    to {
        filter: blur(19px);
    }
}

#contact {
    background-color: var(--bg-medium);
    border-radius: 1.5rem;
    margin: 4rem auto;
    box-shadow: 0 15px 30px var(--card-shadow);
    padding: 5rem 2rem;
}

.contact-form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--bg-light);
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form label {
    display: block;
    color: var(--text-light);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    margin: 0;
    background-color: var(--bg-dark);
    border: 1px solid var(--text-medium);
    border-radius: 0.5rem;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form button {
    width: auto;
    align-self: center;
    padding: 0.9rem 2.5rem;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.footer {
    background-color: var(--bg-medium);
    color: var(--text-medium);
    padding: 4rem 1rem;
    border-top: 1px solid rgba(255, 193, 7, 0.1);
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    justify-items: center;
    text-align: center;
}

.footer-col h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    position: relative;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.footer-col h3::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-dark);
    margin-top: 8px;
    border-radius: 2px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a,
.contact-info a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 400;
    font-size: 1.1rem;
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: left;
    gap: 10px;
}

.footer-links a:hover,
.contact-info a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-links a i,
.contact-info a i {
    width: 20px;
    text-align: left;
    color: var(--primary-color);
}

.footer-social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-social-links a {
    color: var(--text-medium);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-4px) scale(1.1);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 193, 7, 0.1);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-medium);
}

#autoscroll-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    gap: 10px;
    background-color: var(--nav-bg);
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease-in-out;
}

#autoscroll-controls button {
    background-color: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

#autoscroll-controls button:hover {
    background-color: var(--primary-darker);
    transform: translateY(-2px);
}

#autoscroll-controls button i {
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .navbar {
        padding: 1rem 3rem;
    }
    #home h1 {
        font-size: 5.5rem;
    }
    #home p {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 3.5rem;
    }
    .contact-form button {
        align-self: center;
    }
    #about .about-content img {
        width: 200px;
        height: 200px;
    }
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        text-align: center;
    }
    .footer-col:first-child,
    .footer-col:last-child {
        text-align: center;
    }
    .footer-links ul,
    .contact-info {
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .navbar {
        padding: 1rem;
    }
    .navbar .container {
        flex-wrap: nowrap;
    }
    .menu-toggle {
        display: block;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        background-color: var(--nav-scrolled-bg);
        backdrop-filter: blur(12px);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .nav-links.active {
        transform: translateX(0);
    }
    .nav-links li {
        margin: 1.5rem 0;
    }
    .nav-links li a {
        font-size: 1.5rem;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    #home h1 {
        font-size: 2.8rem;
    }
    #home p {
        font-size: 1rem;
    }
    h2 {
        font-size: 2rem;
    }
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    #autoscroll-controls {
        flex-direction: column;
        bottom: 10px;
        right: 10px;
        padding: 8px 10px;
    }
    #autoscroll-controls button {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    .footer-col {
        text-align: center;
    }
    .footer-links ul,
    .contact-info {
        align-items: center;
    }
    .navbar-controls {
        display: flex;
        align-items: center;
    }
}

@media (max-width: 1024px) {
    .projects-container {
        gap: 80px;
    }
    .box {
        width: 35vw;
        height: 45vh;
    }
    .box .content h1 {
        font-size: clamp(1.5rem, 5vw, 1.7rem);
    }
    .box .content p,
    .box .content h3 {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    .projects-container {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }
    .box {
        width: 80vw;
        height: auto;
        max-width: 500px;
        min-height: 300px;
    }
    .box .content {
        padding: 10px 15px;
    }
    .box .content h1 {
        font-size: clamp(1.3rem, 3vw, 1.4rem);
    }
    .box .content p,
    .box .content h3 {
        font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    }
}

@media (max-width: 480px) {
    .box {
        width: 90vw;
        height: 35vh;
        padding: 10px;
    }
    .projects-container {
        gap: 30px;
    }
    .content {
        gap: 5px;
        padding: 10px;
    }
    .content h1 {
        font-size: 1.3rem;
    }
    .content p,
    .content h3 {
        font-size: 1rem;
    }
    .btn,
    .btn-outline {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}


/*--------------------------------------------------------------
# Portfolio Section
--------------------------------------------------------------*/


/* General styling for the section */

.portfolio {
    padding: 60px 0;
    overflow: hidden;
}

.section-title {
    text-align: center;
    padding-bottom: 30px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 20px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    display: block;
    width: 50px;
    height: 3px;
    background: #0d6efd;
    /* Bootstrap primary blue */
    bottom: 0;
    left: calc(50% - 25px);
}


/*
 Key changes for equal height start here
*/

.portfolio .portfolio-item {
    position: relative;
    overflow: hidden;
    height: 100%;
    /* Make the item fill its column's height */
    display: flex;
    /* Use flexbox to manage content */
    flex-direction: column;
}

.portfolio .portfolio-item img {
    width: 100%;
    height: 250px;
    /* <-- KEY: Set a fixed height for all images */
    object-fit: cover;
    /* <-- KEY: Ensures the image covers the area without distortion */
    transition: transform 0.3s ease;
}

.portfolio .portfolio-item:hover img {
    transform: scale(1.1);
}


/* Styling for the info overlay */

.portfolio .portfolio-item .portfolio-info {
    opacity: 0;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.3s ease;
    color: #fff;
}

.portfolio .portfolio-item:hover .portfolio-info {
    opacity: 1;
}

.portfolio .portfolio-item .portfolio-info h4 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.portfolio .portfolio-item .portfolio-info p {
    color: #fff;
    font-size: 14px;
    margin-bottom: 15px;
}

.portfolio .portfolio-item .portfolio-info .preview-link,
.portfolio .portfolio-item .portfolio-info .details-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    margin: 0 4px;
    transition: background-color 0.3s;
}

.portfolio .portfolio-item .portfolio-info .preview-link:hover,
.portfolio .portfolio-item .portfolio-info .details-link:hover {
    background-color: var(--primary-darker);
}

.portfolio .portfolio-item img {
    height: 250px;
    object-fit: cover;
}


/*--------------------------------------------------------------
# Clients Section
--------------------------------------------------------------*/

.clients {
    padding: 60px 0;
}

.swiper-slide {
    text-align: center;
    font-size: 50px;
    /* Make icons bigger */
    color: #b1b1b1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.swiper-slide i:hover {
    color: var(--primary-darker);
    /* Add a hover effect */
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-darker) !important;
}


/* --- Stats Section --- */

.stats-section {
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.stats-image img {
    width: 100%;
    border-radius: 10px;
}

.stats-content h2 {
    font-weight: 700;
    font-size: 34px;
    margin-bottom: 20px;
}

.stats-content p {
    margin-bottom: 30px;
    color: #6c757d;
    /* A neutral color for the paragraph */
}

.stats-counters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-item i {
    font-size: 36px;
    color: var(--primary-darker);
    /* A nice highlight color like in the image */
}

.stat-item .counter {
    font-size: 36px;
    font-weight: 700;
}

.stat-item p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}


/* Responsive adjustments */

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stats-counters {
        grid-template-columns: 1fr;
    }
    .stats-content h2 {
        font-size: 28px;
    }
}


/* --- Team Section --- */

.team.section {
    padding: 60px 0;
    text-align: center;
}


/* Section Title Styling (Optional, but good practice) */

.section-title {
    padding-bottom: 30px;
    text-align: center;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 15px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-darker);
    /* Or your theme's primary color */
    bottom: 0;
    left: calc(50% - 25px);
}

.section-title p {
    margin-bottom: 0;
    color: #6c757d;
}


/* Team Grid Layout */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.team-member {
    position: relative;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 0;
    border-radius: 10px;
    background: #fff;
    /* For light mode */
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease;
}

.dark-mode .team-member {
    background: #1e1e1e;
    /* Dark mode background */
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.team-member:hover {
    transform: translateY(-5px);
}

.team-member .member-img {
    position: relative;
    overflow: hidden;
}

.team-member .member-img .img-fluid {
    width: 100%;
}

.team-member .social {
    position: absolute;
    left: 0;
    bottom: -50px;
    /* Hidden by default */
    width: 100%;
    height: 50px;
    background: rgba(20, 20, 20, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: bottom 0.3s ease-in-out;
}

.team-member:hover .social {
    bottom: 0;
    /* Slides up on hover */
}

.team-member .social a {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 10px;
    font-size: 18px;
    transition: color 0.3s;
}

.team-member .social a:hover {
    color: #fff;
}

.team-member .member-info {
    padding: 25px 15px;
}

.team-member .member-info h4 {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 18px;
}

.team-member .member-info span {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #6c757d;
}

.dark-mode .team-member .member-info span {
    color: #a0a0a0;
}


/* --- Stories Video Scroller Section --- */


/* --- Stories Video Scroller Section (UPDATED) --- */


/* --- Stories Video Scroller Section (UPDATED) --- */

.stories-section {
    padding-top: 0;
    /* Removed the top space */
    padding-bottom: 10px;
}

.scroller__inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    /* This ensures no gap between video columns */
    animation: scroll 60s linear infinite;
}

.scroller {
    max-height: 70vh;
    /* Reduced height to prevent it from taking too much space */
    overflow: hidden;
    -webkit-mask: linear-gradient( to bottom, transparent, black 20%, black 80%, transparent);
    mask: linear-gradient( to bottom, transparent, black 20%, black 80%, transparent);
}

.scroller:hover .scroller__inner {
    animation-play-state: paused;
    /* Pause animation on hover */
}

@keyframes scroll {
    to {
        transform: translateY(-50%);
    }
}

.video-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    /* Vertical video aspect ratio */
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures video covers the container */
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    font-weight: 600;
    font-size: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.video-item:hover .video-overlay {
    opacity: 1;
    transform: translateY(0);
}


/* Responsive adjustments */

@media (max-width: 992px) {
    .scroller__inner {
        grid-template-columns: repeat(3, 1fr);
        /* 3 videos on tablets */
    }
}

@media (max-width: 768px) {
    .scroller__inner {
        grid-template-columns: repeat(2, 1fr);
        /* 2 videos on mobile */
    }
}