 /* Reset and Base Styles */
 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Roboto', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    scroll-behavior: smooth;
}

html {
    --s: 18px;
    --_g: #0000 83%,#ffffff 85% 99%,#0000 101%;
    background:
        radial-gradient(22% 24% at right, var(--_g)) calc(var(--s)/ 2) var(--s),
        radial-gradient(22% 24% at left, var(--_g)) calc(var(--s)/-2) var(--s),
        radial-gradient(24% 22% at top, var(--_g)) 0 calc(var(--s)/ 2),
        radial-gradient(24% 22% at bottom, var(--_g)) 0 calc(var(--s)/-2)
        #024379;
    background-size: calc(2*var(--s)) calc(2*var(--s));
}

/* Dark Mode */
body.dark-mode {
    color: #ecf0f1;
    background-color: #1a1a1a;
}

body.dark-mode .header,
body.dark-mode .footer {
    background-color: #1c2526;
}

body.dark-mode .section {
    background-color: #2c2c2c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .contact-info {
    background: #3a3a3a;
}

body.dark-mode .nav-links a,
body.dark-mode .logo a,
body.dark-mode .logo-subtitle {
    color: #ecf0f1;
}

body.dark-mode .nav-links a:hover,
body.dark-mode .nav-links a.active {
    background-color: #3498db;
    color: #fff;
}

body.dark-mode .contact-info p,
body.dark-mode .contact-info a {
    color: #ecf0f1;
}

body.dark-mode .section h2 {
    color: #ecf0f1;
}

body.dark-mode .map-caption {
    color: #bdc3c7;
}

body.dark-mode .hamburger span {
    background-color: #ecf0f1;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #03121e;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

#loader {
    position: relative;
    width: clamp(100px, 15vw, 150px);
    height: clamp(100px, 15vw, 150px);
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #3498db;
    animation: spin 2s linear infinite;
    will-change: transform;
}

#loader:before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #d4a017;
    animation: spin 3s linear infinite;
    will-change: transform;
}

#loader:after {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #2c3e50;
    animation: spin 1.5s linear infinite;
    will-change: transform;
}

#loader-text {
    margin-top: 1.5rem;
    color: #d4a017;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    text-align: center;
    text-transform: uppercase;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Main Content */
#main-content {
    display: none;
}

/* Header */
.header {
    background-color: #2c3e50;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo a {
    color: #ecf0f1;
    font-family: 'Playfair Display', serif;
    /* font-size: clamp(1.5rem, 2.5vw, 1.8rem); */
    font-size: clamp(1.725rem, 2.875vw, 2.07rem);
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo a:hover {
    color: #3498db;
}

.logo-subtitle {
    color: #d4a017;
    font-size: 0.8rem;
    font-family: 'Roboto', sans-serif;
    margin-top: 2px;
    text-align: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    transition: max-height 0.3s ease;
}

.nav-links a {
    color: #ecf0f1;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    background-color: #3498db;
    color: #fff;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: #ecf0f1;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgb(169, 163, 163, 0.283), rgb(0, 0, 0)), url('b1.jpg') center/cover no-repeat;
    padding: 8rem 2rem;
    min-height: 70vh;
    text-align: center;
    color: #fff;
    position: relative;
}

.hero-content {
    max-width: 1500px;
    margin: 0 auto;
    margin-top: 8%;
}

.title {
    font-family: 'Playfair Display', serif;
    /* font-size: clamp(2rem, 5vw, 3.5rem); */
    font-size: clamp(2.3rem, 5.75vw, 4.025rem);
    line-height: 1.3;
}

.title span {
    color: #3498db;
}

.corner-img {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    height: clamp(150px, 30vw, 300px);
    z-index: 1;
    object-fit: contain;
}

/* White Background Div */
.white-bg {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 1rem auto;
}

/* Section Animations */
.section__container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 3rem 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section__container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* About Section */
.intro__container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.intro__image {
    width: 40%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.intro__image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4/3;
}

.intro__image:hover {
    transform: translateY(-5px);
}

.intro__content {
    width: 60%;
}

.section__header {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: #2c3e50;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.75rem;
}

.intro__description {
    list-style: none;
    font-size: 1.15rem;
    color: #555;
    font-family: 'Roboto', sans-serif;
}

.intro__description li {
    margin-bottom: 0.85rem;
    padding-left: 1.75rem;
    position: relative;
}

.intro__description li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3498db;
    font-size: 1.3rem;
}

/* Qualifications and Awards */
.journey__container {
    background-color: #fff;
    padding: 3rem 1rem;
    margin: 0 auto; /* Center the container horizontally */
    max-width: 1200px; /* Optional: Set a max-width for better control */
}

.journey__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    justify-content: center; /* Center the grid content */
}

.journey__column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.journey__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center; /* Center the title text and icon */
}

.journey__title i {
    color: #3498db;
}

.journey__card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-left: 2px solid #3498db;
    transition: background-color 0.3s ease;
}

.journey__card:hover {
    background-color: #f8f9fa;
}

.journey__card span i {
    color: #3498db;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.journey__card h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.journey__card p {
    font-size: 1rem;
    color: #555;
}

/* Gallery Container */
.gallery-container {
    padding: 3rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    color: #2c3e50;
    margin-bottom: 2rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

/* Scrolling Wrapper */
.scrolling-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.scrolling-content {
    display: flex;
    animation: scroll 50s linear infinite;
    will-change: transform;
}

.scrolling-content.paused {
    animation-play-state: paused;
}

/* Gallery Grid */
.gallery-grid {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
}

.book-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-link {
    text-decoration: none;
    display: block;
}

.book-card {
    position: relative;
    width: clamp(140px, 35vw, 180px);
    height: clamp(210px, 52.5vw, 270px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    background: #fff;
}

.book-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.book-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-title {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: #fff;
    text-align: center;
    margin: 0;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}



.control-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.control-btn:focus {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}
/* Scroll Animation */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Responsive Design */
@media (max-width: 992px) {
    .gallery-container {
        padding: 2rem 0.75rem;
    }

    .gallery-title {
        font-size: clamp(1.5rem, 3vw, 2rem);
    }

    .book-card {
        width: clamp(120px, 30vw, 150px);
        height: clamp(180px, 45vw, 225px);
    }

    .book-title {
        font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        gap: 1rem;
    }

    .book-card {
        width: clamp(100px, 25vw, 130px);
        height: clamp(150px, 37.5vw, 195px);
    }

    .book-title {
        font-size: clamp(0.75rem, 1.6vw, 0.85rem);
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .gallery-container {
        padding: 1.5rem 0.5rem;
    }

    .gallery-title {
        font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    }

    .book-card {
        width: clamp(90px, 22vw, 110px);
        height: clamp(135px, 33vw, 165px);
    }

    .book-title {
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    }

    .gallery-controls {
        margin-top: 1rem;
        gap: 0.75rem;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Video Section */
.video-section {
    padding: 3rem 1rem;
    text-align: center;
}

.video-container {
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
}

.video {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Published Books */
.published-books {
    padding: 3rem 1rem;
    margin: 0;
}

.published-books table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.published-books th, .published-books td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.published-books th {
    background-color: #2c3e50;
    color: #ecf0f1;
    font-weight: 700;
}

.published-books tr:nth-child(even) {
    background-color: #f8f9fa;
}

.published-books tr:hover {
    background-color: #e8ecef;
}

/* Timeline */
.timeline-container {
    padding: 3rem 1rem;
    background-color: #fff;
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3498db;
}

.timeline li {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    font-size: 1.1rem;
    color: #555;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -0.4rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    background-color: #3498db;
    border-radius: 50%;
}

.timeline .year {
    font-weight: 700;
    color: #2c3e50;
    margin-right: 0.5rem;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 1rem;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 2rem;
}

.contact-info, .developer-info, .social-media {
    flex: 1;
    min-width: 200px;
}

.footer h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.footer p, .footer a {
    font-size: 1rem;
    color: #bdc3c7;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.footer a:hover {
    color: #3498db;
}

.social-icon {
    font-size: 1.8rem;
    color: #bdc3c7;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: #3498db;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.back-to-top:hover {
    background-color: #2980b9;
}

/* Responsive Preloader */
@media (max-width: 992px) {
    #loader {
        width: clamp(80px, 12vw, 120px);
        height: clamp(80px, 12vw, 120px);
    }
    #loader:before { top: 4px; left: 4px; right: 4px; bottom: 4px; }
    #loader:after { top: 12px; left: 12px; right: 12px; bottom: 12px; }
    #loader-text { margin-top: 1.2rem; font-size: clamp(1rem, 2.5vw, 1.3rem); }
}

@media (max-width: 768px) {
    #loader {
        width: clamp(60px, 10vw, 100px);
        height: clamp(60px, 10vw, 100px);
    }
    #loader:before { top: 3px; left: 3px; right: 3px; bottom: 3px; }
    #loader:after { top: 10px; left: 10px; right: 10px; bottom: 10px; }
    #loader-text { margin-top: 1rem; font-size: clamp(0.9rem, 2.5vw, 1.1rem); }
}

@media (max-width: 576px) {
    #loader {
        width: clamp(50px, 8vw, 80px);
        height: clamp(50px, 8vw, 80px);
    }
    #loader:before { top: 2px; left: 2px; right: 2px; bottom: 2px; }
    #loader:after { top: 8px; left: 8px; right: 8px; bottom: 8px; }
    #loader-text { margin-top: 0.8rem; font-size: clamp(0.8rem, 2vw, 1rem); }
}

/* Responsive Design */
@media (max-width: 992px) {
    .navbar {
        position: relative;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #2c3e50;
        padding: 0;
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
        max-height: 400px;
        padding: 1rem;
    }

    .nav-links a {
        padding: 0.8rem;
        font-size: 1.1rem;
    }

    .hero {
        padding: 4rem 1rem;
        min-height: 50vh;
    }

    .hero-content {
        margin-top: 0;
    }

    .corner-img {
        width: clamp(100px, 20vw, 180px);
        height: clamp(120px, 25vw, 240px);
        bottom: 0.75rem;
        left: 0.75rem;
    }

    .intro__container, .journey__grid {
        flex-direction: column;
        text-align: center;
        grid-template-columns: 1fr;
    }

    .intro__image, .intro__content {
        width: 100%;
        max-width: 600px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .gallery-grid img {
        width: 150px;
        height: 225px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 1rem;
        min-height: 40vh;
    }

    .title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .corner-img {
        width: clamp(80px, 15vw, 120px);
        height: clamp(90px, 20vw, 180px);
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .section__header {
        font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    }

    .intro__description li {
        font-size: 1rem;
    }

    .journey__title {
        font-size: 1.3rem;
    }

    .journey__card h4 {
        font-size: 1.1rem;
    }

    .journey__card p {
        font-size: 0.9rem;
    }

    .published-books th, .published-books td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .gallery-grid img {
        width: 120px;
        height: 180px;
    }

    .timeline li {
        font-size: 1rem;
    }

    .logo a {
        font-size: clamp(1.2rem, 2vw, 1.5rem);
    }

    .logo-subtitle {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 2rem 1rem;
        min-height: 30vh;
    }

    .title {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
    }

    .corner-img {
        width: clamp(60px, 12vw, 100px);
        height: clamp(75px, 15vw, 150px);
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .section__header {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }

    .gallery-grid img {
        width: 100px;
        height: 150px;
    }
}