/* styles/portfolio.css - Portfolio Page Stylesheet */

@import url('common.css');

/* --- Hero Landing Section --- */
.hero-landing {
    position: relative;
    width: 100%;
    min-width: 320px;
    min-height: calc(100vh - 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 4rem 1.5rem;
    overflow: hidden;
}

/* 3D Animated Isometric TKL Keyboard Hero Backdrop */
.hero-keyboard-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(100vw, 1400px);
    height: min(96vh, 860px);
    z-index: 1;
    pointer-events: none;
    user-select: none;
    opacity: 1.0;
    filter: saturate(1.08);
    transition: opacity 0.4s ease;
}

#keyboard-canvas {
    width: 100% !important;
    height: 100% !important;
    outline: none !important;
    border: none !important;
    background: transparent !important;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent !important;
}

/* Centered Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 880px;
    margin: 0 auto;
    pointer-events: auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(16, 24, 28, 0.92);
    border: 1.5px solid rgba(var(--colour-glow), 0.85);
    border-radius: 999px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.8), 0 0 20px rgba(var(--colour), 0.35);
    text-shadow: 0 0 10px rgba(var(--colour-glow), 0.65);
}

.hero-title {
    font-family: var(--ff-heading);
    font-size: clamp(3.4rem, 7.5vw, 6rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    color: #ffffff;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.95), 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 0, 0, 0.75);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.22rem);
    font-weight: 400;
    color: #ffffff;
    max-width: 620px;
    margin: 0 auto 2.4rem auto;
    line-height: 1.65;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.95), 0 1px 6px rgba(0, 0, 0, 0.95);
}

/* Category Quick Jump Pills */
.hero-nav-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
    margin-bottom: 2.5rem;
}

.hero-pill {
    padding: 0.65rem 1.35rem;
    font-family: var(--ff-heading);
    font-size: 1.08rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgb(var(--bright));
    background: rgba(var(--dark), 0.85);
    border: 1px solid rgba(var(--bright), 0.25);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hero-pill:hover {
    color: #ffffff;
    background: rgba(var(--colour), 0.3);
    border-color: rgb(var(--colour-glow));
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--colour), 0.35);
}

.hero-pill[href="#architecture"]:hover {
    background: rgba(0, 180, 167, 0.25);
    border-color: rgb(0, 210, 195);
    box-shadow: 0 6px 24px rgba(0, 180, 167, 0.35);
}

.hero-pill[href="#engineering"]:hover {
    background: rgba(248, 66, 108, 0.25);
    border-color: rgb(255, 90, 130);
    box-shadow: 0 6px 24px rgba(248, 66, 108, 0.35);
}

.hero-pill[href="#computational"]:hover {
    background: rgba(254, 213, 0, 0.25);
    border-color: rgb(255, 235, 90);
    box-shadow: 0 6px 24px rgba(254, 213, 0, 0.35);
}

.hero-pill[href="#miscellaneous"]:hover {
    background: rgba(25, 158, 237, 0.25);
    border-color: rgb(64, 176, 255);
    box-shadow: 0 6px 24px rgba(25, 158, 237, 0.35);
}

.hero-scroll-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.45rem;
    font-family: var(--ff-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(18, 24, 28, 0.92);
    border: 1.5px solid rgba(var(--colour), 0.75);
    border-radius: 999px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.8), 0 0 18px rgba(var(--colour), 0.3);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    animation: bounce 2.2s infinite ease-in-out;
}

.hero-scroll-indicator:hover {
    color: #ffffff;
    background: rgba(var(--colour), 0.3);
    border-color: rgb(var(--colour-glow));
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.85), 0 0 26px rgba(var(--colour-glow), 0.55);
    transform: translateY(-2px) scale(1.03);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- Portfolio Sections & Highlight Theme Scoping --- */
.portfolio-main {
    position: relative;
    width: 100%;
    min-width: 320px;
    z-index: 1;
    padding-bottom: 6rem;
}

.portfolio-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2rem 2rem 2rem;
}

/* Section-Specific Theme Scopes */
#architecture,
.portfolio-section.theme-teal {
    --colour: 0, 180, 167;
    --colour-glow: 0, 210, 195;
}

#engineering,
.portfolio-section.theme-red {
    --colour: 248, 66, 108;
    --colour-glow: 255, 90, 130;
}

#computational,
.portfolio-section.theme-yellow {
    --colour: 254, 213, 0;
    --colour-glow: 255, 235, 90;
}

#miscellaneous,
.portfolio-section.theme-blue {
    --colour: 25, 158, 237;
    --colour-glow: 64, 176, 255;
}

.sub-hero {
    position: relative;
    padding: 2.5rem 2.5rem;
    background: linear-gradient(135deg, rgba(35, 35, 35, 0.75) 0%, rgba(25, 25, 25, 0.9) 100%);
    border: 1px solid rgba(var(--bright), 0.12);
    border-left: 4px solid rgb(var(--colour));
    border-radius: 12px;
    backdrop-filter: blur(12px);
    margin-bottom: 2.5rem;
}

.sub-hero-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sub-hero-number {
    font-family: var(--ff-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: rgb(var(--colour));
    letter-spacing: 0.1em;
}

.sub-hero-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(var(--bright), 0.6);
}

.sub-hero-title {
    font-family: var(--ff-heading);
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.sub-hero-desc {
    font-size: 1rem;
    color: rgba(var(--bright), 0.78);
    max-width: 820px;
    line-height: 1.6;
}

/* --- Gallery Subsections (for categorized disciplines like Computation) --- */
.gallery-subsection {
    margin-bottom: 4rem;
}

.gallery-subsection:last-child {
    margin-bottom: 1rem;
}

.subsection-header {
    margin-bottom: 1.75rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(var(--bright), 0.1);
}

.subsection-tag {
    font-family: var(--ff-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(var(--colour-glow));
    margin-bottom: 0.35rem;
}

.subsection-title {
    font-family: var(--ff-heading);
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 0.4rem;
}

.subsection-desc {
    font-size: 0.95rem;
    color: rgba(var(--bright), 0.76);
    max-width: 800px;
    line-height: 1.55;
}

/* --- Gallery Grid & Cards --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 2rem;
}

.gallery-card {
    background: rgba(33, 33, 33, 0.75);
    border: 1px solid rgba(var(--bright), 0.1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.gallery-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--colour-glow), 0.6);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--colour), 0.2);
}

.card-media-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #141414;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%) contrast(1.05) brightness(0.92);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, filter;
}

.gallery-card:hover .card-image {
    transform: scale(1.06);
    filter: grayscale(0%) contrast(1.0) brightness(1.0);
}

.card-overlay-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(var(--dark), 0.8);
    border: 1px solid rgba(var(--bright), 0.2);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(var(--bright));
    backdrop-filter: blur(6px);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.card-title {
    font-family: var(--ff-heading);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.card-tagline {
    font-size: 0.88rem;
    color: rgba(var(--bright), 0.72);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.card-tag {
    background: rgba(var(--bright), 0.06);
    border: 1px solid rgba(var(--bright), 0.12);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    color: rgba(var(--bright), 0.85);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(var(--bright), 0.08);
    font-size: 0.82rem;
    color: rgb(var(--colour-glow));
    font-weight: 500;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: transform 0.2s ease;
}

.gallery-card:hover .card-cta {
    transform: translateX(4px);
}

/* --- Miscellaneous 3-Column Triptych Grid --- */
.misc-triptych-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.misc-column-card {
    background: rgba(30, 34, 38, 0.78);
    border: 1px solid rgba(var(--bright), 0.12);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.misc-column-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--colour-glow), 0.65);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(var(--colour), 0.25);
}

.misc-cover-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #12161a;
}

.misc-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.misc-column-card:hover .misc-cover-image {
    transform: scale(1.06);
}

.misc-cover-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.misc-item-count-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    font-family: var(--ff-heading), monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(14, 20, 24, 0.9);
    border: 1px solid rgba(var(--colour-glow), 0.6);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.misc-panel-body {
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.misc-panel-header {
    margin-bottom: 0.75rem;
}

.misc-panel-tag {
    font-family: var(--ff-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgb(var(--colour-glow));
    display: block;
    margin-bottom: 0.35rem;
}

.misc-panel-title {
    font-family: var(--ff-heading);
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #ffffff;
}

.misc-panel-desc {
    font-size: 0.95rem;
    color: rgba(var(--bright), 0.8);
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.misc-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--bright), 0.1);
    font-family: var(--ff-heading);
    font-size: 0.92rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.misc-footer-label {
    color: rgba(var(--bright), 0.55);
    font-weight: 500;
}

.misc-panel-cta {
    color: rgb(var(--colour-glow));
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: transform 0.25s ease;
}

.misc-column-card:hover .misc-panel-cta {
    transform: translateX(4px);
    color: #ffffff;
}

/* --- Carousel Collection Cards in Computational Galleries --- */
.gallery-card.carousel-collection-card {
    border-color: rgba(var(--colour-glow), 0.35);
    background: linear-gradient(135deg, rgba(38, 42, 38, 0.85) 0%, rgba(20, 26, 24, 0.95) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.gallery-card.carousel-collection-card:hover {
    border-color: rgba(var(--colour-glow), 0.85);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(var(--colour), 0.35);
    transform: translateY(-6px);
}

.carousel-card-tag {
    display: inline-block;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(var(--colour-glow));
    margin-top: 0.15rem;
    margin-bottom: 0.65rem;
}

.gallery-card.carousel-collection-card .card-tagline {
    margin-bottom: 1.5rem;
    color: rgba(var(--bright), 0.75);
}

/* --- Project Detail Lightbox Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 12, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.modal-container {
    background: linear-gradient(160deg, rgba(38, 38, 38, 0.95) 0%, rgba(24, 24, 24, 0.98) 100%);
    border: 1px solid rgba(var(--colour), 0.45);
    border-radius: 16px;
    max-width: 860px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--colour), 0.8) transparent;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(var(--colour), 0.15);
    transform: scale(0.94) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-button,
.modal-container::-webkit-scrollbar-button:single-button,
.modal-container::-webkit-scrollbar-button:vertical:decrement,
.modal-container::-webkit-scrollbar-button:vertical:increment,
.modal-container::-webkit-scrollbar-button:start:decrement,
.modal-container::-webkit-scrollbar-button:end:increment {
    display: block !important;
    width: 0px !important;
    height: 0px !important;
    background: transparent !important;
    border: none !important;
}

.modal-container::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 22px;
    margin-bottom: 22px;
    border-radius: 999px;
}

.modal-container::-webkit-scrollbar-track-piece {
    background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--colour), 0.85) 0%, rgba(var(--colour-glow), 0.85) 100%);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    min-height: 48px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgb(var(--colour-glow)) 0%, rgb(var(--colour)) 100%);
    box-shadow: 0 0 10px rgba(var(--colour-glow), 0.6);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(var(--dark), 0.7);
    border: 1px solid rgba(var(--bright), 0.25);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    color: rgb(var(--bright));
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgb(var(--colour));
    border-color: rgb(var(--colour-glow));
    color: #ffffff;
    transform: rotate(90deg);
}

.modal-hero-image-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    max-height: 48vh;
    min-height: 280px;
    background: radial-gradient(circle at center, #1a2027 0%, #0a0d11 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.modal-container.has-carousel .modal-hero-image-wrapper,
.modal-container.has-subgallery .modal-hero-image-wrapper {
    cursor: grab;
}

.modal-container.has-carousel .modal-hero-image-wrapper:active,
.modal-container.has-carousel .modal-hero-image-wrapper.is-dragging,
.modal-container.has-subgallery .modal-hero-image-wrapper:active,
.modal-container.has-subgallery .modal-hero-image-wrapper.is-dragging {
    cursor: grabbing;
}

.modal-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.22s ease, transform 0.12s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Modal Carousel Controls */
.modal-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 18, 22, 0.88);
    border: 1.5px solid rgba(var(--colour-glow), 0.5);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    transition: all 0.25s ease;
}

.modal-container.has-carousel .modal-carousel-btn {
    display: flex;
}

.modal-carousel-btn.prev {
    left: 1.15rem;
}

.modal-carousel-btn.next {
    right: 1.15rem;
}

.modal-carousel-btn:hover {
    background: rgb(var(--colour));
    border-color: rgb(var(--colour-glow));
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(var(--colour), 0.65);
}

.modal-carousel-indicator {
    position: absolute;
    bottom: 1.15rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: none;
    align-items: center;
    gap: 0.85rem;
    background: rgba(14, 18, 22, 0.92);
    border: 1px solid rgba(var(--bright), 0.2);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.modal-container.has-carousel .modal-carousel-indicator {
    display: flex;
}

#modal-carousel-counter {
    font-family: var(--ff-heading), monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgb(var(--colour-glow));
    letter-spacing: 0.08em;
}

.modal-carousel-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(var(--bright), 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.modal-carousel-dot.active {
    background: rgb(var(--colour-glow));
    width: 20px;
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(var(--colour), 0.8);
}

/* --- Modal Sub-Gallery (Photo Browser for MODEL & SOLAR) --- */
.modal-subgallery-controls {
    position: absolute;
    top: 1.15rem;
    left: 1.15rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: rgba(14, 18, 22, 0.92);
    border: 1px solid rgba(var(--colour-glow), 0.45);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.modal-container.has-subgallery .modal-subgallery-controls {
    display: flex;
}

.modal-subgallery-btn {
    background: rgba(var(--bright), 0.12);
    border: 1px solid rgba(var(--bright), 0.25);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.modal-subgallery-btn:hover {
    background: rgb(var(--colour));
    border-color: rgb(var(--colour-glow));
    transform: scale(1.1);
}

.modal-subgallery-counter {
    font-family: var(--ff-heading), monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(var(--bright));
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.35rem;
}

.modal-subgallery-counter .subgallery-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--colour-glow));
    flex-shrink: 0;
}

.modal-subgallery-strip-wrapper {
    display: none;
    background: #111418;
    border-bottom: 1px solid rgba(var(--bright), 0.1);
    padding: 0.75rem 1.25rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--colour), 0.6) transparent;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.modal-subgallery-strip-wrapper::-webkit-scrollbar {
    height: 6px;
}

.modal-subgallery-strip-wrapper::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.modal-subgallery-strip-wrapper::-webkit-scrollbar-track {
    background: transparent;
    margin-left: 14px;
    margin-right: 14px;
    border-radius: 6px;
}

.modal-subgallery-strip-wrapper::-webkit-scrollbar-track-piece {
    background: transparent;
}

.modal-subgallery-strip-wrapper::-webkit-scrollbar-thumb {
    background: rgba(var(--colour), 0.65);
    border-radius: 6px;
}

.modal-subgallery-strip-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--colour-glow));
}

.modal-subgallery-strip-wrapper.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.modal-container.has-subgallery .modal-subgallery-strip-wrapper {
    display: block;
}

.modal-subgallery-strip {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.modal-subgallery-thumb {
    width: 68px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.55;
    transition: all 0.25s ease;
    background-color: #1a1a1a;
    padding: 0;
}

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

.modal-subgallery-thumb:hover {
    opacity: 0.9;
    border-color: rgba(var(--colour-glow), 0.6);
    transform: translateY(-2px);
}

.modal-subgallery-thumb.active {
    opacity: 1;
    border-color: rgb(var(--colour-glow));
    box-shadow: 0 0 10px rgba(var(--colour), 0.6);
    transform: scale(1.05);
}

.modal-body {
    padding: 2.25rem 2.25rem 2.5rem 2.25rem;
}

.modal-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.modal-category-badge {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgb(var(--colour-glow));
    background: rgba(var(--colour), 0.15);
    border: 1px solid rgba(var(--colour), 0.3);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
}

.modal-date-text {
    font-size: 0.85rem;
    color: rgba(var(--bright), 0.6);
}

.modal-title {
    font-family: var(--ff-heading);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.modal-tagline {
    font-size: 1.05rem;
    color: rgba(var(--bright), 0.85);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.modal-divider {
    height: 1px;
    background: rgba(var(--bright), 0.1);
    margin: 1.5rem 0;
}

.modal-section-heading {
    font-family: var(--ff-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgb(var(--colour-glow));
    margin-bottom: 0.75rem;
}

.modal-description {
    font-size: 0.95rem;
    color: rgba(var(--bright), 0.88);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.modal-tag-chip {
    background: rgba(var(--bright), 0.08);
    border: 1px solid rgba(var(--bright), 0.15);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    color: rgba(var(--bright), 0.9);
}

.modal-highlights-list {
    list-style: none;
    margin-bottom: 2rem;
}

.modal-highlights-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    color: rgba(var(--bright), 0.85);
    line-height: 1.5;
}

.modal-highlights-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: rgb(var(--colour));
    font-size: 1rem;
}

.modal-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.9rem 1.75rem;
    font-family: var(--ff-heading);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    background: linear-gradient(135deg, rgb(var(--colour)) 0%, rgba(var(--colour), 0.82) 100%);
    border: 1px solid rgb(var(--colour-glow));
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(var(--colour), 0.35);
    transition: all 0.25s ease;
}

.modal-action-btn:hover {
    background: linear-gradient(135deg, rgb(var(--colour-glow)) 0%, rgb(var(--colour)) 100%);
    box-shadow: 0 8px 28px rgba(var(--colour), 0.5);
    transform: translateY(-2px);
}

/* Modal Theme Dynamic Colors */
.modal-overlay.modal-theme-red {
    --colour: 248, 66, 108;
    --colour-glow: 255, 90, 130;
}

.modal-overlay.modal-theme-yellow {
    --colour: 254, 213, 0;
    --colour-glow: 255, 235, 90;
}

.modal-overlay.modal-theme-yellow .modal-action-btn {
    color: #191919;
    font-weight: 700;
}

.modal-overlay.modal-theme-yellow .modal-action-btn:hover {
    color: #000000;
}

.modal-overlay.modal-theme-blue {
    --colour: 25, 158, 237;
    --colour-glow: 64, 176, 255;
}

.modal-overlay.modal-theme-teal {
    --colour: 0, 180, 167;
    --colour-glow: 0, 210, 195;
}

/* --- Responsive Adjustments for Mobile & Tablets --- */
@media (max-width: 768px) {
    .hero-landing {
        padding: 3rem 1.25rem;
        min-height: calc(100vh - 2.5rem);
    }

    .hero-keyboard-backdrop {
        width: 100vw;
        height: min(88vh, 650px);
        opacity: 1.0;
    }

    .hero-badge {
        padding: 0.35rem 1rem;
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(2.6rem, 11vw, 4.2rem);
        margin-bottom: 0.85rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.8rem;
        line-height: 1.55;
    }

    .hero-nav-pills {
        gap: 0.5rem;
        margin-bottom: 1.8rem;
    }

    .hero-pill {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    .portfolio-section {
        padding: 3.5rem 1.25rem 1rem 1.25rem;
    }

    .sub-hero {
        padding: 1.5rem 1.25rem;
        border-radius: 10px;
        margin-bottom: 1.75rem;
    }

    .sub-hero-title {
        font-size: 2.2rem;
    }

    .sub-hero-desc {
        font-size: 0.92rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .misc-triptych-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .misc-cover-wrapper {
        height: 220px;
    }

    .card-body {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.45rem;
    }

    .card-tagline {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .modal-container {
        max-width: 95vw;
        max-height: 90vh;
        border-radius: 12px;
    }

    .modal-hero-image-wrapper {
        height: 280px;
        max-height: 45vh;
        min-height: 200px;
    }

    .modal-body {
        padding: 1.35rem 1.25rem;
    }

    .modal-title {
        font-size: 1.85rem;
    }

    .modal-tagline {
        font-size: 0.95rem;
    }

    .modal-description {
        font-size: 0.9rem;
    }

    .modal-action-btn {
        font-size: 1rem;
        padding: 0.8rem 1.25rem;
    }
}

/* Portfolio Footer Contact Section (Exact match with portfolio-section width) */
.portfolio-main .global-contact-footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem 2rem;
    box-sizing: border-box;
}
