/* ==========================================================================
   home.css — Home Page Styles
   Mobile-first, organized by component. Inline styles belong in CSS, not HTML.
   ========================================================================== */

/* Design tokens (motion easing, shimmer, theme colors) live in theme_bridge.css */

/* ── 1. Page Wrapper ───────────────────────────────────────────────────── */

.home-page-wrapper {
    padding: 40px 16px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── 3. Hero ───────────────────────────────────────────────────────────── */

.hero-lead {
    max-width: 800px;
    font-size: 1.15rem;
    line-height: 1.7;
    text-align: justify;
}

.hero-action-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: var(--surface-overlay);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 0.85rem 2rem;
    min-width: 160px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease,
        transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-action-box i {
    font-size: 0.95em;
}

/* Ghost (secondary) — About Me */
.hero-action-box:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

/* Primary (filled accent) — Resume */
.hero-action-box.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.hero-action-box.primary:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--accent-glow);
}

/* ── 4. Section Headers ────────────────────────────────────────────────── */

.section-header-line {
    border-bottom: none;
    padding-bottom: 0.75rem;
}

/* Section titles (My Circle, Gallery, Projects, …) use the logo font */
.section-header-line h2 {
    font-family: "OdorMeanChey", var(--bs-font-sans-serif), system-ui, sans-serif;
    font-weight: 400 !important;
    font-size: 1.8rem;
}

/* ── 5. My Circle ──────────────────────────────────────────────────────── */

.circles-wrapper-outer {
    max-width: 100%;
    position: relative;
}

.circles-scroll-container {
    overflow-x: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 10px 0;
}

.circles-scroll-container::-webkit-scrollbar {
    display: none;
}

.circle-item {
    flex: 0 0 auto;
    width: 163px;
    scroll-snap-align: start;
    position: relative;
}

.circle-avatar-wrapper {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: var(--surface-raised);
    transition: transform 0.3s var(--ag-bounce);
}

.circle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.circle-name {
    font-size: 0.95rem;
    color: var(--text-muted) !important;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.circle-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 64px;
    border-radius: 8px;
    background: transparent !important;
    border: 1px solid var(--border-strong);
    box-shadow: none;
    color: var(--text-primary);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.circle-nav-btn .fas {
    font-size: 0.85rem;
    transition: filter 0.2s ease;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

.circle-nav-btn.prev { left: 12px; }
.circle-nav-btn.next { right: 12px; }

.circles-wrapper-outer:hover .circle-nav-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: hover) {
    .circle-nav-btn:hover {
        background: var(--accent-glow) !important;
        border-color: var(--accent-primary);
        color: var(--accent-primary);
        transform: translateY(-50%) scale(1.08);
        box-shadow: 0 0 16px var(--accent-glow);
    }

    .circle-nav-btn:hover .fas {
        filter: drop-shadow(0 0 6px var(--accent-primary));
    }
}

/* ── 6. Gallery Panel ──────────────────────────────────────────────────── */

#home .container {
    width: 100%;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 0 !important;
}

#home .row {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

#homeHeroCarousel {
    width: 100%;
    margin: 0;
}

#home .carousel-inner {
    width: 100%;
    height: 100%;
    margin: 0;
}

.gallery-home-row {
    display: flex !important;
    align-items: stretch !important;
    width: 100%;
    background: var(--surface-raised);
    border-radius: 12px;
}

.gallery-home-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

#galleryCarouselInner {
    min-height: 580px;
    transition: height 0.4s var(--ag-smooth);
}

#home-active-post-panel {
    padding: 0 !important;
    margin: 0 !important;
    border-left: 1px solid var(--border, rgba(128, 128, 128, 0.2));
}

#home-active-post-panel .card {
    border: none !important;
    border-radius: 0 !important;
    flex: 1 !important;
    min-height: 0 !important;
}

.gallery-home-row .carousel,
.gallery-home-row .carousel-inner,
.gallery-home-row .carousel-item {
    height: 100% !important;
}

/* Carousel slide layers */
.gallery-bg-layer {
    background-color: #1a1a1a;
}

.gallery-blur-img {
    object-fit: cover;
    filter: blur(30px) brightness(0.5);
    transform: scale(1.15);
}

.gallery-fg-layer {
    z-index: 1;
}

.gallery-fg-img {
    object-fit: contain;
    pointer-events: none;
}

/* Fade-in gallery images once loaded (JS adds .loaded on img onload) */
.ag-img-reveal {
    opacity: 0;
    transition: opacity 0.4s var(--ag-smooth);
}

.ag-img-reveal.loaded {
    opacity: 1;
}

/* ── 7. Gallery Carousel Controls ─────────────────────────────────────── */

#homeHeroCarousel .carousel-control-prev,
#homeHeroCarousel .carousel-control-next {
    width: 36px !important;
    top: 50%;
    transform: translateY(-50%);
    height: 64px;
    bottom: auto;
    border-radius: 8px;
    background: transparent !important;
    border: 1px solid var(--border-strong);
    box-shadow: none;
    color: var(--text-primary);
    transition: all 0.25s ease;
    z-index: 4 !important;
    opacity: 1 !important;
}

#homeHeroCarousel .carousel-control-prev { left: 10px; }
#homeHeroCarousel .carousel-control-next { right: 10px; }

#homeHeroCarousel:hover .carousel-control-prev,
#homeHeroCarousel:hover .carousel-control-next {
    opacity: 0.6 !important;
}

#homeHeroCarousel .carousel-control-prev-icon,
#homeHeroCarousel .carousel-control-next-icon {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)) brightness(1.2);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 20px !important;
    height: 20px !important;
    background-size: 100% 100% !important;
}

@media (hover: hover) {
    #homeHeroCarousel .carousel-control-prev:hover,
    #homeHeroCarousel .carousel-control-next:hover {
        background: var(--accent-glow) !important;
        border-color: var(--accent-primary);
        box-shadow: 0 0 16px var(--accent-glow);
        transform: translateY(-50%) scale(1.08);
    }

    #homeHeroCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
    #homeHeroCarousel .carousel-control-next:hover .carousel-control-next-icon {
        filter: drop-shadow(0 0 6px var(--accent-primary)) brightness(1.3);
    }
}

/* ── 8. Active Post Panel ─────────────────────────────────────────────── */

/* .ig-modal-comments is kept for social.js container scoping */
.ig-modal-comments {
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    height: 100%;
    min-height: 0;
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    flex-shrink: 0;
    text-align: center;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.panel-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-secondary);
    overflow-x: auto;
    scrollbar-width: none;
}

.panel-meta::-webkit-scrollbar { display: none; }

.panel-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
}

.panel-link i {
    font-size: 11px;
}

.panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
}

.panel-up-next-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}

/* ── 9. Up Next List ──────────────────────────────────────────────────── */

.up-next-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.up-next-list::-webkit-scrollbar { display: none; }

.up-next-item-card {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-left-color 0.2s ease;
    border-left: 3px solid transparent;
    background: transparent;
    align-items: center;
    flex-shrink: 0;
}

.up-next-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-primary);
}

.up-next-thumb {
    position: relative;
    flex: 0 0 110px;
    width: 110px;
    height: 110px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.up-next-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.up-next-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.up-next-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

/* ── 10. Project Cards ─────────────────────────────────────────────────── */

.project-card {
    flex: 0 0 calc((100% - 0.75rem) / 2);
    width: calc((100% - 0.75rem) / 2);
    max-width: 200px;
}

.project-card,
.project-card * {
    transition: none !important;
    transform: none !important;
}

.project-card:hover {
    opacity: 1 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.project-card:hover .ratio {
    border-color: var(--accent-primary) !important;
    filter: brightness(1.1);
    background: var(--surface-overlay) !important;
}

.project-card:active,
.project-card:focus {
    box-shadow: none !important;
    outline: none !important;
}

.project-card .ratio {
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

/* ── 11. Blog Carousel (horizontal card + dot pagination) ──────────────── */

.home-blog-carousel {
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 16px 0;
    overflow: hidden;
}

.home-blog-track {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-blog-track::-webkit-scrollbar {
    display: none;
}

.home-blog-card {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none !important;
    color: inherit;
    padding: 0 16px;
    box-sizing: border-box;
    scroll-snap-align: start;
}

.home-blog-thumb {
    position: relative;
    flex: 0 0 130px;
    width: 130px;
    height: 130px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-inset);
}

.home-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-blog-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-inset);
}

.home-blog-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-blog-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-blog-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary, #b6b6b6);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted, #9ca3af);
    margin-top: 2px;
}

.home-blog-meta-sep {
    opacity: 0.7;
}

.home-blog-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.home-blog-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--text-muted, #9ca3af);
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.2s ease, width 0.2s ease, background 0.2s ease;
}

.home-blog-dot:hover {
    opacity: 0.7;
}

.home-blog-dot.active {
    opacity: 1;
    width: 22px;
    border-radius: 5px;
    background: var(--text-primary);
}

/* ── 12. Achievements ──────────────────────────────────────────────────── */

.achievements-filters {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.achievements-flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    padding: 10px 0;
}

.achievement-item {
    flex: 0 0 calc(33.333% - 16px);
    min-width: 0;
    margin-bottom: 10px;
}

.achievement-card {
    background: var(--surface-raised);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-default);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.achievement-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 12px 28px var(--shadow-color);
    transform: translateY(-6px);
}

.achievement-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid var(--border-default);
}

.achievement-img-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.achievement-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    color: var(--text-muted);
    background: var(--surface-inset);
}

.achievement-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.achievement-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.achievement-category {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 1px;
    transition: color 0.18s ease;
}

/* Accent the category on hover / tap of the card. */
.achievement-card:hover .achievement-category,
.achievement-card:focus .achievement-category,
.achievement-card:active .achievement-category {
    color: var(--accent-primary);
}

.achievement-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.achievement-date {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-date i {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ── 13. Achievement Modal ─────────────────────────────────────────────── */

.achievement-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.achievement-modal.active {
    display: flex;
    opacity: 1;
}

.achievement-modal .modal-content {
    background: transparent;
    border: none;
    max-width: 1000px;
    width: 100%;
    margin: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s var(--ag-bounce);
}

.achievement-modal.active .modal-content {
    transform: scale(1);
}

.achievement-modal .modal-close {
    position: absolute;
    top: -18px;
    right: -18px;
    background: #1e293b;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 10002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.achievement-modal .modal-close:hover {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.08);
}

.achievement-modal .modal-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.achievement-modal .modal-body {
    padding: 24px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
}

.achievement-modal .modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
    text-align: center;
}

.achievement-modal .modal-category {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.achievement-modal .modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.achievement-modal .modal-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Visit Certificate button — white text, accent-primary on hover/tap. */
.achievement-modal #modal-url {
    color: var(--text-primary);
    transition: color 0.15s ease;
}

.achievement-modal #modal-url:hover,
.achievement-modal #modal-url:focus,
.achievement-modal #modal-url:active {
    color: var(--accent-primary);
}

/* ── 14. Responsive — Mobile (≤ 470px) ─────────────────────────────────── */

@media (max-width: 470px) {
    .achievement-item {
        flex: 0 0 100%;
    }

    .home-blog-card {
        gap: 12px;
    }

    .home-blog-thumb {
        flex: 0 0 92px;
        width: 92px;
        height: 92px;
        border-radius: 10px;
    }

    .home-blog-title {
        font-size: 1.05rem;
    }

    .home-blog-excerpt {
        font-size: 0.85rem;
    }

    /* Gallery panel stats: shrink so all four (views/likes/comments/shares)
       fit on a single row instead of scrolling */
    .panel-meta {
        gap: 8px;
        font-size: 10.5px;
        overflow-x: visible;
        justify-content: space-between;
    }

    .panel-meta-item {
        gap: 3px;
    }

    .panel-meta-label {
        margin-left: 1px;
    }

    .hero-action-box {
        flex: 1;
        min-width: 0;
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
        text-align: center;
    }

    /* Gallery: stack the carousel above the active-post panel */
    .gallery-home-row {
        flex-direction: column !important;
    }

    .gallery-home-row > [class*="col-"] {
        width: 100% !important;
        flex: none !important;
    }

    .gallery-home-row .carousel,
    .gallery-home-row .carousel-inner,
    .gallery-home-row .carousel-item {
        height: auto !important;
        min-height: 420px;
    }

    #galleryCarouselInner {
        min-height: 420px !important;
    }

    #home-active-post-panel {
        border-left: none !important;
        border-top: 1px solid rgba(128, 128, 128, 0.2) !important;
    }

    #home-active-post-panel .card {
        height: auto !important;
        min-height: auto !important;
    }

    /* Up Next: compact horizontal cards */
    .up-next-list {
        flex-direction: column !important;
        gap: 10px !important;
        overflow-x: unset !important;
        flex: unset !important;
    }

    .up-next-item-card {
        flex-direction: row !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 6px 8px !important;
        border-radius: 8px !important;
        border-left: none !important;
        background: rgba(255, 255, 255, 0.03) !important;
        overflow: visible !important;
        min-height: 0 !important;
    }

    .up-next-item-card .up-next-thumb {
        flex: 0 0 72px !important;
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 6px !important;
        align-self: center !important;
    }

    .up-next-item-card .up-next-meta {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0 !important;
        justify-content: center !important;
    }
}

/* ── 15. Responsive — Tablet (471px – 1023px) ─────────────────────────── */

@media (min-width: 471px) and (max-width: 1023px) {
    #home-active-post-panel .card {
        max-height: 450px;
        height: auto !important;
        min-height: auto !important;
    }

    .gallery-mobile-slider {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 0 !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .gallery-mobile-slider::-webkit-scrollbar {
        display: none;
    }

    .gallery-mobile-slider .carousel-item {
        display: block !important;
        flex: 0 0 100% !important;
        scroll-snap-align: start !important;
        position: relative !important;
        margin-right: 0 !important;
    }

    #homeHeroCarousel .carousel-control-prev,
    #homeHeroCarousel .carousel-control-next,
    #homeHeroCarousel .carousel-indicators {
        display: none !important;
    }

    .achievement-item {
        flex: 0 0 calc(50% - 12px);
    }

    .hero-action-box {
        flex: 1;
        min-width: 120px;
        padding: 0.8rem 1rem;
        text-align: center;
    }

    .project-card {
        flex: 0 0 calc((100% - 2rem) / 3);
        width: calc((100% - 2rem) / 3);
    }

    /* Gallery: stack the carousel above the active-post panel */
    .gallery-home-row {
        flex-direction: column !important;
    }

    .gallery-home-row > [class*="col-"] {
        width: 100% !important;
        flex: none !important;
    }

    .gallery-home-row .carousel,
    .gallery-home-row .carousel-inner,
    .gallery-home-row .carousel-item {
        height: auto !important;
        min-height: 420px;
    }

    #galleryCarouselInner {
        min-height: 420px !important;
    }

    #home-active-post-panel {
        border-left: none !important;
        border-top: 1px solid rgba(128, 128, 128, 0.2) !important;
    }

    /* Up Next: compact horizontal cards */
    .up-next-list {
        flex-direction: column !important;
        gap: 10px !important;
        overflow-x: unset !important;
        flex: unset !important;
    }

    .up-next-item-card {
        flex-direction: row !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 6px 8px !important;
        border-radius: 8px !important;
        border-left: none !important;
        background: rgba(255, 255, 255, 0.03) !important;
        overflow: visible !important;
        min-height: 0 !important;
    }

    .up-next-item-card .up-next-thumb {
        flex: 0 0 72px !important;
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 6px !important;
        align-self: center !important;
    }

    .up-next-item-card .up-next-meta {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0 !important;
        justify-content: center !important;
    }
}

/* ── 16. Responsive — Desktop (≥ 1024px) ──────────────────────────────── */

@media (min-width: 1024px) {
    /* The global .container adds padding-right: 10rem, which pushes the home
       column left of centre. Cancel it here so .home-page-wrapper (margin auto)
       centres in the visible area between the sidebar and the right edge. */
    .container:has(#home) {
        padding-right: 0 !important;
    }

    .hero-intro {
        max-width: 60rem;
        margin-left: 100px;
    }

    .circles-scroll-container {
        overflow-x: hidden;
        padding: 5px 0;
        width: 100%;
    }

    .circle-item {
        flex: 0 0 calc((100% - 4 * 1.5rem) / 5);
        width: calc((100% - 4 * 1.5rem) / 5);
    }

    .circle-avatar-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .circle-nav-btn {
        display: flex;
    }

    .circle-nav-btn.prev { left: 20px; }
    .circle-nav-btn.next { right: 20px; }

    .project-intro,
    .gallery-intro,
    .blog-intro,
    .achievements-intro,
    .mycircle-intro {
        max-width: 1440px;
        margin: 0 auto;
        left: 4rem;
    }

    .section-header-line {
        max-width: 100%;
        border-bottom: none !important;
    }

    #home-active-post-panel .card {
        position: absolute !important;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto !important;
        border-radius: 0 !important;
    }

    #home,
    #home .container,
    #home .container.mt-5 {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    #main-wrapper {
        padding-bottom: 0 !important;
    }

    .blog-card-vertical {
        flex: 0 0 calc((100% - 2rem) / 3);
        width: calc((100% - 2rem) / 3);
        max-width: none;
    }

    .project-card {
        flex: 0 0 calc((100% - 2.25rem) / 4);
        width: calc((100% - 2.25rem) / 4);
    }
}
