/* Consistent section spacing for all sections */
.section-spacing {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Stanley logo: ensure crisp rendering and professional look */
.stanley-logo-main {
    max-width: 320px;
    width: 100%;
    height: auto;
    image-rendering: auto;
    display: block;
    margin: 0 auto;
}

/* Footer: dark background and white text, professional look */
.footer {
    background: #222 !important;
    color: #fff !important;
    padding: 24px 0 0 0;
}
.footer a,
.footer a:visited {
    color: #fff !important;
    text-decoration: underline;
}
/* Fade-in-up animation for images on scroll */
.fade-in-up {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
    will-change: opacity, transform;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}
/* Reset and Base Styles */
/* Professional Site Loader */
#site-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
    flex-direction: column;
}
/* Remove extra padding and block display from inline links */
.footer-link {
    position: relative;
    text-decoration: none;
    color: #0a3cff;
    font-weight: 600;
    border-radius: 6px;
    padding: 0 2px;
    transition: background 0.18s, color 0.18s;
    display: inline;
}
.section a {
    position: relative;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 500;
    padding: 0;
    display: inline;
    background: none;
}
.section a:hover, .section a:focus {
    text-decoration: underline;
    color: #0a3cff;
}
    .site-loader-spinner {
  width: 64px;
  height: 64px;
  border: 7px solid #e0e7ef;
  border-top: 7px solid #1e40af;
  border-radius: 50%;
  animation: site-spin 1s linear infinite;
  box-shadow: 0 4px 24px rgba(30,64,175,0.10);
  margin: 0 auto;
}
@keyframes site-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loader Brand Details */
.site-loader-brand {
    margin-top: 14px;
    text-align: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.site-loader-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.site-loader-desc {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.85;
}
/* Stanley Loader Animation */
#stanley-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}
#stanley-loader.fade {
    opacity: 0;
    pointer-events: none;
}
.stanley-loader-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.stanley-loader-logo {
    width: 120px;
    height: 120px;
    animation: stanley-spin 1.2s linear infinite;
    border-radius: 50%;
    box-shadow: 0 4px 24px rgba(30,64,175,0.10);
}
@keyframes stanley-spin {
    0% { transform: rotate(0deg) scale(1); }
    80% { transform: rotate(320deg) scale(1.08); }
    100% { transform: rotate(360deg) scale(1); }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    padding-top: 0; /* Prevent content from hiding behind fixed header */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 3001;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30,40,60,0.04);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 6px;                /* small gap between title/subtitle */
}

.brand-title {
    font-size: 14px;         /* smaller, like image */
    font-weight: 700;
    letter-spacing: 0.08em;  /* wide tracking */
    text-transform: uppercase;
    color: #111;
}

.brand-subtitle {
    font-size: 11px;
    color: #111;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nav-links {
    display: flex;
    gap: 34px;               /* spacing between items like screenshot */
    row-gap: 10px;           /* when wrapping onto two lines */
    flex-wrap: wrap;         /* allow wrapping on small widths */
    max-width: 980px;        /* slightly wider block */
    align-content: start;
    justify-content: center; /* centered block of links */
    margin-top: 34px;        /* push links lower like in image */
}

/* Hamburger styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 1100;
}
.hamburger span {
    height: 4px;
    width: 100%;
    background: #111;
    margin: 5px 0;
    border-radius: 2px;
    transition: 0.4s;
    display: block;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-link {
    text-decoration: none;
    color: #111;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.10em;  /* caps + tracking */
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Responsive nav menu */
@media (max-width: 900px) {
  .nav {
    justify-content: flex-start;
  }
  .brand {
    margin-right: auto;
  }
  .hamburger {
    display: flex;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2100;
  }
  .nav-links {
    position: fixed;
    left: 0;
    right: 0;
    top: 60px;
    background: #fff;
    display: block;
    width: 100vw;
    max-width: 100vw;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-radius: 0 0 12px 12px;
    padding: 18px 0 24px 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 2000;
  }
    .nav-links.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .nav-link {
        display: block;
        padding: 16px 28px;
        font-size: 17px;
        border-bottom: 1px solid #eee;
        width: 92%;
        margin: 0 auto 10px auto;
        text-align: left;
        background: #f7f9fc;
        border-radius: 8px;
        color: #1e293b;
        font-weight: 600;
        box-shadow: 0 1px 4px rgba(30,40,60,0.04);
        transition: background 0.18s, color 0.18s, box-shadow 0.18s;
        position: relative;
    }
    .nav-link:last-child {
        border-bottom: none;
    }
    .nav-link:hover,
    .nav-link:focus {
        background: #e0e7ef;
        color: #0a3cff;
        box-shadow: 0 2px 8px rgba(30,64,175,0.08);
        outline: none;
    }
    .nav-link:active {
        background: #d1d5db;
        color: #1e40af;
    }
    .nav {
        align-items: center;
        position: relative;
    }
    /* Center images in mobile nav and sections */
    section img,
    .container img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    /* Center key image classes */
    .stanley-logo-main,
    .book-cover,
    .youtube-logo,
    .circular-logo,
    .badge,
    .character,
    .construction-img,
    .additional-image,
    .youtube-img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Responsive images */
img, .stanley-logo-main, .book-cover, .youtube-logo, .circular-logo, .badge, .character, .construction-img, .additional-image, .youtube-img {
        max-width: 100%;
        height: auto;
}

html {
    scroll-behavior: smooth; /* smooth scroll to anchors */
}

/* Prevent content from hiding behind fixed header when using anchors */
section {
    scroll-margin-top: 110px;
}

/* Stanley Header Section */
.stanley-header {
    background: #fff;
    padding: 40px 0;
    text-align: center;
}

.stanley-logo-container {
    margin-bottom: 30px;
    margin-top: 100px;
}

.stanley-logo-main {
    max-width: 800px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.main-description {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    max-width: 900px;
    margin: 0 auto;
    text-align: justify;
    padding: 0 20px;
}

/* Author Section */
.author-section {
    background: #fff;
    padding: 40px 0;
    text-align: center;
}

.author-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 20px;
    text-decoration: underline;
}

.author-description {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.books-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.books-row-4 {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.books-row-3 {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.books-row-1 {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.book-item {
    flex: none;
}

.book-cover {
    width: 180px;
    height: 230px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.book-cover:hover {
    transform: translateY(-5px);
}

.youtube-item {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Style only image YouTube logos (avoid affecting wrapper divs) */
img.youtube-logo {
    width: 350px;
    height: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

img.youtube-logo:hover {
    transform: scale(1.05);
}

/* Portfolio Section */
.portfolio-section {
    background: #fff;
    padding: 40px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 18px;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.project-item {
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.project-item:hover {
    transform: scale(1.02);
}

.project-large {
    grid-column: span 2;
    grid-row: span 2;
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.project-large .project-image {
    height: 415px;
}

.project-special .project-image {
    height: 150px;
}

/* YouTube Sections */
.youtube-section {
    background: #f8f9fa;
    padding: 80px 0;
    text-align: center;
}

.youtube-section-2 {
    background: #fff;
}

.youtube-content {
    max-width: 900px; /* allow wider content to match unified paragraph width */
    margin: 0 auto;
}

.youtube-logo {
    margin-bottom: 30px;
}

/* Center the YouTube logo block wrapper in YouTube sections */
.youtube-section .youtube-content > .youtube-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 30px;
    width: auto;
    height: auto;
     background-color: transparent; /* remove white box if coming from background */
}

/* Ensure the image in the first YouTube section is centered */
.youtube-section img.youtube-logo {
    display: block;
    margin: 0 auto;
}



/* Make YouTube image larger */
.youtube-img {
    height: 300px; /* larger video preview image */
    width: auto;
    display: block;
    margin: 12px auto;
}

/* Tech Academy Section */
.tech-academy {
    background: #fff;
    padding: 80px 0;
    text-align: center;
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo-circle {
    margin-bottom: 40px;
}

/* Make circular logos bigger */
.circular-logo {
    width: 320px;
    height: 320px;
    border-radius: 60%;
    object-fit: cover;
    border: 3px solid #ddd;
}

.circular-logo {
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s cubic-bezier(0.4,0,0.2,1);
}
.circular-logo:hover {
  transform: scale(1.18) rotate(-2deg);
  box-shadow: 0 8px 32px rgba(30,64,175,0.18);
  z-index: 2;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
}

/* Make badges bigger */
.badge {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    object-fit: cover;
}

/* AaAI Section */
.aaai-section {
    background: #f8f9fa;
    padding: 80px 0;
    text-align: center;
}

/* Athena Section */
.masonry-section {
    background: #f8f9fa;
    padding: 80px 0;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 30px;
}

.character-images {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

/* Make characters larger and remove white square by matching background */
.character {
    width: 300px;
    height: 360px;
    object-fit: contain; /* preserve GIF aspect; avoid cropping */
    background-color: transparent; /* remove white box if coming from background */
    border-radius: 8px;
    box-shadow: none; /* remove framed look */
}

.additional-content {
    margin-top: 40px;
}

.additional-image {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Construction Section */
.construction-section {
    background: #fff;
    padding: 80px 0;
    text-align: center;
}

.construction-images {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.construction-figure { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.construction-img {
    width: 350px;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.image-caption {
    margin-top: 8px;
    font-size: 20px;
    color: #555;
    font-weight:bold;
}

/* Section Description */
.section-description {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    text-align: justify;
    margin: 12px auto; /* tighter spacing */
    max-width: 900px;
    padding: 0 20px;
}

/* Unify paragraph styles across main, section, and author descriptions */
.main-description,
.section-description,
.author-description {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    max-width: 1100px;
    margin: 12px auto; /* tighter spacing */
    text-align: justify;
    padding: 0 20px;
}




/* Provide natural spacing so <br> tags aren't necessary */
p { margin: 0.5rem 0; }

/* Responsive enhancements */
@media (max-width: 1024px) {
  .circular-logo { width: 220px; height: 220px; }
  .badge { width: 120px; height: 120px; }
  .character { width: 240px; height: 300px; }
}

@media (max-width: 768px) {
  .contact-content { grid-template-columns: 1fr; gap: 30px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .main-description, .section-description, .author-description { max-width: 95%; padding: 0 16px; }
  img.youtube-logo, .youtube-img { max-width: 100%; height: auto; }
    .circular-logo { width: 260px; height: 260px; }
  .badge { width: 110px; height: 110px; }
  .character { width: 220px; height: 280px; }

    /* Center all images on small screens */
    img, .stanley-logo-main, .book-cover, .youtube-logo, .circular-logo, .badge, .character, .construction-img, .additional-image, .youtube-img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
  .project-grid { grid-template-columns: 1fr; }
  .nav { height: 60px; }
  .nav-links { gap: 16px; }
    .circular-logo { width: 200px; height: 200px; }

        /* Center all images on extra small screens */
        img, .stanley-logo-main, .book-cover, .youtube-logo, .circular-logo, .badge, .character, .construction-img, .additional-image, .youtube-img {
                display: block;
                margin-left: auto;
                margin-right: auto;
        }
}

/* (reverted) */

/* Contact Section */
.contact-section {
    background: #fff;
    padding: 80px 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
}

/* Make contact text match site-wide description styles */
.contact-item p {
    font-size: 16px;
    color: #333;
    margin: 0.5rem 0;
    text-align: justify;
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-link {
    text-decoration: none;
    color: #1e40af;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid #1e40af;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.social-link:hover {
    background: #1e40af;
    color: white;
    transform: translateY(-2px);
}

.contact-form {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30,64,175,0.3);
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

/* Footer */
.footer {
    background: #ffffff;
    padding: 56px 0 36px;
    border-top: 2px solid #e5e7eb;
    color: #6b7280;
}

.footer-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding-bottom: 8px;
}

.footer-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #111;
}

/* Simple 2-row grid like the screenshot */
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 16px 32px;
    margin-bottom: 12px;
}

/* Professional link styling (site-wide, reused by .nav-link too) */
.footer-link,
.section a {
    position: relative;
    text-decoration: none;
    color: #0a3cff;               /* professional blue */
    font-weight: 600;
    display: inline-block;        /* contain pseudo-element to link width */
    padding: 0;                   /* remove extra clickable padding */
    margin: 0 2px;                /* slight breathing space from surrounding text */
    letter-spacing: normal;       /* ensure no expanded tracking */
    word-spacing: normal;
    transition: color 0.18s ease;
}

/* Subtle underline that scales to the link width (prevents spanning across surrounding text) */
.footer-link::after,
.nav-link::after,
.section a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 2px;
    width: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.18s ease;
}

.footer-link:hover::after,
.nav-link:hover::after,
.section a:hover::after,
.footer-link:focus::after,
.section a:focus::after {
    transform: scaleX(1);
}

.footer-link:hover {
    color: #0f3fbf;
    opacity: 1;
}

/* Accessibility focus */
.nav-link:focus,
.footer-link:focus { outline: 2px solid #1e40af; outline-offset: 2px; }

/* Responsive */
@media (max-width: 992px) {
    .footer-links-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}
@media (max-width: 600px) {
  .footer {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .footer-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .footer-links-grid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100vw;
    box-sizing: border-box;
  }
  .footer-link {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100vw;
    box-sizing: border-box;
  }
}

@media (max-width: 400px) {
  .footer-link {
    font-size: 0.97rem;
    padding: 6px 0;
  }
}
@media (max-width: 1200px) {
  .footer-links-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 16px 24px;
  }
}
@media (max-width: 900px) {
  .footer-links-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  .footer-link {
    width: 100% !important;
    text-align: center !important;
    font-size: 1rem !important;
    padding: 8px 0 !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    background: none !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* Footer copyright */
.footer-copyright {
    font-size: 0.97rem;
    color: #9ca3af;
    margin-top: 10px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 14px;
    }
    
    .stanley-header {
        padding: 30px 0;
    }
    
    .stanley-logo-main {
        max-width: 450px;
    }
    
    .main-description {
        font-size: 15px;
        padding: 0 15px;
    }
    
    .author-section {
        padding: 30px 0;
    }
    
    .author-description {
        font-size: 15px;
        padding: 0 15px;
    }
    
    .books-row {
        gap: 15px;
    }
    
    .books-row-4 {
        max-width: 100%;
    }
    
    .books-row-3 {
        max-width: 100%;
    }
    
    .book-cover {
        width: 140px;
        height: 180px;
    }
    
    .youtube-logo {
        width: 280px;
        height: 160px;
    }
    
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 600px;
    }
    
    .project-large {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .project-large .project-image {
        height: 200px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .circular-logo {
        width: 150px;
        height: 150px;
    }
    
    .badges {
        gap: 40px;
    }
    
    .badge {
        width: 100px;
        height: 100px;
    }
    
    .character-images {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .construction-images {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .construction-img {
        width: 280px;
        height: 320px;
    }
    
    .character {
        width: 180px;
        height: 220px;
    }
    
    .additional-image {
        width: 280px;
        height: 180px;
    }
    
    .geometric-shapes {
        gap: 15px;
    }
    
    .shape {
        width: 50px;
        height: 50px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-form {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .stanley-header {
        padding: 20px 0;
    }
    
    .stanley-logo-main {
        max-width: 320px;
    }
    
    .main-description {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .author-section {
        padding: 20px 0;
    }
    
    .author-title {
        font-size: 1.5rem;
    }
    
    .author-description {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .books-row {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
    
    .books-row-4,
    .books-row-3 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 350px;
    }
    
    .books-row-1 {
        display: flex;
        justify-content: center;
    }
    
    .book-cover {
        width: 120px;
        height: 150px;
    }
    
    .youtube-logo {
        width: 250px;
        height: 140px;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 100%;
    }
    
    .project-large {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .project-large .project-image,
    .project-image {
        height: 180px;
    }
    
    .project-special .project-image {
        height: 180px;
    }
    
    .section-description {
        font-size: 15px;
    }
    
    .youtube-section,
    .alchemon-section,
    .tech-academy,
    .aaai-section,
    .masonry-section,
    .construction-section {
        padding: 60px 0;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .contact-section {
        padding: 60px 0;
    }
    
    .contact-form {
        padding: 25px 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 15px;
    }
    
    .submit-btn {
        padding: 12px 25px;
        font-size: 15px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.project-item,
.character,
.construction-img,
.additional-image {
    transition: opacity 0.5s ease-in-out;
}

/* Hover Effects */
.character:hover,
.construction-img:hover,
.additional-image:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Focus States */
.nav-link:focus,
.footer-link:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Footer: cleaned, consolidated and responsive */
body {
    overflow-x: hidden; /* keep horizontal overflow hidden as a safe default */
}

.footer {
    width: 100%;
    box-sizing: border-box;
    padding: 48px 0 24px;
    background: #f8fafc; /* keep original footer color */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 16px 24px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.footer-link {
    display: block;
    color: #0a3cff; /* more visible blue on light footer background */
    text-decoration: none;
    padding: 8px 0;
    font-size: 1rem;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Footer copyright */
.footer-copyright {
    font-size: 0.97rem;
    color: #9ca3af;
    margin-top: 14px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Responsive footer breakpoints */
@media (max-width: 1200px) {
    .footer-links-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 900px) {
    /* switch to a stacked layout on narrow screens */
    .footer-links-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .footer-link {
        width: 100%;
        text-align: center;
        padding: 8px 0;
        box-sizing: border-box;
        margin: 0;
        border-radius: 6px;
        background: transparent;
    }
}

@media (max-width: 480px) {
    .footer-content { padding: 0 12px; }
    .footer-link { font-size: 0.95rem; padding: 6px 0; }
}

/* Mobile: fix link wrapping/inline issue */
@media (max-width: 600px) {
    .section a,
    .footer-link {
        display: inline !important;       /* force inline */
        width: auto !important;
        max-width: 100% !important;       /* prevent overflow */
        padding: 0 !important;.section-description a
        margin: 0 2px !important;
        vertical-align: baseline;
        white-space: normal !important;   /* allow wrapping */
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    /* Reset pseudo underline */
    .section a::after,
    .footer-link::after {
        display: none !important;   /* test: disable underline effect */
    }

    p, .section, .footer, .section-description {
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }
}
/* Force compressed links ONLY inside .section-description */
.section-description a {
    display: inline !important;        /* override inline-block */
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 2px !important;
    vertical-align: baseline !important;
    white-space: normal !important;    /* allow wrapping */
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.4 !important;
    text-decoration: underline !important;
}

/* Remove animated underline effect only for section-description links */
.section-description a::after {
    display: none !important;
}
