/* Prevent horizontal overflow on all pages */
html, body {
    overflow-x: hidden;
    width: 100%;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure project page grid doesn't cause overflow */
.project-screen-layout {
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================
   VARIABLES & BASE STYLES
   ============================================ */
:root {
    --page-background: #edf2f4;
    --page-card: #E8162A;
    --small-card: #8d99ae;
    --ink: #edf2f4;
    --muted: #edf2f4;
    --line: #edf2f4;
    --nav-background: #E8162A;
}

[data-theme="dark"] {
    --page-background: #0f0f0f;
    --page-card: #990012;
    --small-card: #b0b0b0;
    --ink: #0f0f0f;
    --muted: #0f0f0f;
    --line: #2a2a2a;
    --nav-background: #990012;
}

html {
    scroll-behavior: smooth;
    min-height: 100vh;
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.12), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(22, 22, 22, 0.06), transparent 22%),
        var(--page-background);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    transition: opacity 0.2s ease;
}

a:hover { opacity: 0.88; }
a:visited { color: inherit; }

/* ============================================
   12-COLUMN GRID
   ============================================ */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

.col-span-12 { grid-column: 1 / -1; }
.col-span-10 { grid-column: 2 / 12; }
.col-offset-1 { grid-column-start: 2; }

@media (max-width: 900px) {
    .grid-12 .col-span-10 {
        padding: 0;
        width: 100%;
    }

    /* Ensure site-shell on project page doesn't add extra padding */
    .site-shell.project-screen-layout {
        padding: 80px 16px 0 16px;
    }
}


.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* ============================================
   TOP NAVIGATION
   ============================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--nav-background);
    --top-nav-height: 64px;
}

.top-nav-inner {
    max-width: none;
    margin: 0;
    padding: 14px 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
}

.brand a {
    text-decoration: none;
    color: inherit;
}

.brand-full { display: inline; }
.brand-short { display: none; }

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-tabs a {
    text-decoration: none;
    color: var(--ink);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    background: transparent;
    box-shadow: none;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-tabs a:hover {
    transform: translateY(-1px);
    opacity: 0.92;
    background: var(--ink);
    color: var(--nav-background);
    border-color: var(--ink);
}

.nav-tabs a.active {
    background: var(--ink);
    color: var(--nav-background);
    border-color: var(--ink);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    color: var(--ink);
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 1;
}

.nav-toggle i { font-size: 1.7rem; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 10px;
    color: var(--ink);
    cursor: pointer;
    font-size: 1rem;
    flex: 0 0 auto;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    background: var(--ink);
    color: var(--nav-background);
    border-color: var(--ink);
}

.nav-toggle:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
}

/* ============================================
   COMPACT NAV MODE (JS-driven, desktop)
   ============================================ */
.top-nav.compact-mode .brand {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(1rem, 3.5vw, 2rem);
    letter-spacing: 0.06em;
    line-height: 1;
}

.top-nav.compact-mode .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-nav.compact-mode .nav-toggle i {
    font-size: 1.2rem;
    line-height: 1;
}

.top-nav.compact-mode .brand-full { display: none; }
.top-nav.compact-mode .brand-short { display: inline; }

.top-nav.compact-mode .nav-tabs {
    position: fixed;
    top: var(--top-nav-height);
    left: 0;
    height: calc(100vh - var(--top-nav-height));
    width: fit-content;
    min-width: 0;
    max-width: min(82vw, 320px);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 16px 18px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--nav-background);
    border-right: 1px solid var(--line);
    box-shadow: none;
    transform: translateX(-100%);
    pointer-events: none;
    transition: transform 0.28s ease;
    border-radius: 0;
}

.top-nav.compact-mode.menu-open .nav-tabs {
    transform: translateX(0);
    pointer-events: auto;
}

.top-nav.compact-mode .nav-tabs a {
    width: fit-content;
    text-align: left;
    padding: 10px 16px;
    border: 0;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    box-shadow: none;
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
}

.top-nav.compact-mode .nav-tabs a:hover {
    transform: none;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 999px;
}

.top-nav.compact-mode .nav-tabs a.active {
    display: inline-flex;
    width: fit-content;
    align-self: flex-start;
    padding: 10px 16px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: var(--nav-background);
}

.top-nav.compact-mode ~ .site-shell {
    padding: 132px 0 0;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.site-shell {
    position: relative;
    z-index: 1;
    padding: 80px 0 0;
    width: 100%;
    margin: 0;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.gallery-page-card,
.portfolio-card,
.section-card {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.portfolio-card,
.section-card {
    border: 1px solid var(--line);
    background: var(--page-card);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(22, 22, 22, 0.08);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.gallery-page-card,
.contact-layout,
.project-page-card {
    flex: 1 0 auto;
}

.section-card { padding: 34px; }

.portfolio-card {
    padding: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 60px;
    align-items: start;
    overflow: hidden;
}

.portfolio-card .portfolio-visual {
    background: var(--small-card);
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    display: flex;
    align-self: center;
    justify-self: center;
}

.portfolio-card .portfolio-visual img {
	padding: 10px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image { border-radius: 2rem; }

.portfolio-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (min-width: 901px) {
    .portfolio-copy {
        padding-top: 42px;
    }
}

.portfolio-copy .eyebrow {
    margin-bottom: 10px;
    line-height: 1;
}

.portfolio-title {
    margin: 0;
    line-height: 1.02;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.eyebrow,
.mini-label {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.eyebrow {margin-bottom: 25px;}

.portfolio-title,
.section-title,
.hero-title {
    letter-spacing: -0.06em;
    line-height: 1.1;
}

.portfolio-title {
    font-size: clamp(2rem, 4vw, 3rem);
    width: 100%;
}

.section-title,
.hero-title { font-size: clamp(2rem, 4vw, 3rem); }

.section-subtitle {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    letter-spacing: -0.04em;
}

.intro {
    line-height: 1.6;
    color: var(--muted);
    font-size: 1.15rem;
}

p {
    line-height: 1.7;
    color: var(--muted);
    font-size: 1.08rem;
}

.portfolio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.portfolio-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid var(--ink);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    background: var(--ink);
    color: var(--nav-background);
    box-shadow: none;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.portfolio-actions a:hover {
    transform: translateY(-1px);
    opacity: 0.92;
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}

/* ============================================
   PILL BUTTONS (shared style)
   ============================================ */
.contact-pill,
.instagram-pill,
.custom-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--small-card);
    box-shadow: 0 12px 28px rgba(22, 22, 22, 0.12);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
    flex: 0 0 auto;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.custom-pill:hover,
.instagram-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(22, 22, 22, 0.28);
    background: rgba(255, 255, 255, 0.86);
}

.custom-pill img {
    width: 21px;
    height: 18px;
}

.custom-pill i,
.instagram-pill i {
    font-size: 1rem;
    line-height: 1;
}

/* ============================================
   RESUME PAGE - PROJECT GRID
   ============================================ */
.project-section { margin-top: 10px; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 20px;
    align-items: stretch;
}

.project-category {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--small-card);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-self: start;
}

.project-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-card-link:hover {
    border-color: rgba(22, 22, 22, 0.28);
    box-shadow: 0 16px 32px rgba(22, 22, 22, 0.12);
}

.project-link {
    display: block;
    margin: 6px 0 8px;
    font-size: 1.08rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

.project-card-link:hover .project-link { text-decoration: underline; }

.project-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9; 
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.project-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

/* ============================================
   PROJECT DETAIL PAGE
   ============================================ */
.project-page-card {
    width: 100%;
    align-self: center;
}

.project-screen-layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    min-height: calc(100vh - var(--top-nav-height, 64px));
}

.project-screen-gallery {
    position: sticky;
    top: var(--top-nav-height, 64px);
    width: 100%;
    z-index: 8;
    align-self: start;
}

.project-page-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.project-page-meta div {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--small-card);
    padding: 14px 16px;
    display: grid;
    gap: 4px;
}

.project-page-meta strong {
    font-size: 1rem;
    font-weight: 700;
}

.project-gallery {
    position: relative;
    top: calc((100vh - var(--top-nav-height, 64px)) / 2 - 40px);
    transform: translateY(-50%);
}

.project-gallery-main { position: relative; }

.project-main-slider { margin-top: 12px; }

.project-main-slider .splide__track {
    border-radius: 18px;
    overflow: hidden;
}

.project-main-slider .splide__slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image,
.gallery-video {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

.project-thumbnail-slider { margin-top: 12px; }

.project-thumbnail-slider .splide__track { padding: 2px 0; }

.project-thumbnail-slider .splide__arrow {
    width: 104px !important;
    height: 58px !important;
    border-radius: 12px !important;
    background: var(--small-card) !important;
    opacity: 0.85 !important;
}

.project-thumbnail-slider .splide__arrow svg {
    width: 18px !important;
    height: 18px !important;
    fill: var(--page-background) !important;
}

.project-thumbnail-slider .splide__slide {
    border-radius: 12px;
    overflow: hidden;
    opacity: 0.55;
    border: 1px solid transparent;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.project-thumbnail-slider .splide__slide.is-active {
    opacity: 1;
    border-color: var(--ink);
}

.project-thumb-media {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.05);
}

/* ============================================
   GALLERY INDEX - SPLIDE CAROUSEL
   ============================================ */
.gallery-row {
    margin-bottom: 56px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 32px;
}

.gallery-row-header { margin-bottom: 20px; }

.gallery-row-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.gallery-row-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--ink);
    transition: width 0.3s ease;
}

.gallery-row-title:hover::after { width: 100%; }

.gallery-row .splide__slide {
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-row .splide__slide:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.gallery-row .splide__slide img,
.gallery-row .splide__slide video,
.gallery-row .carousel-media {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.05);
}

/* Splide Arrows */
.splide__arrow {
    width: 150px !important;
    height: 100px !important;
    background: var(--small-card) !important;
    opacity: 0.85 !important;
    border-radius: 18px !important;
    color: var(--page-background) !important;
}

.splide__arrow svg {
    width: 30px !important;
    height: 30px !important;
    fill: currentColor !important;
}

.splide__arrow:hover {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.08) !important;
}

/* Progress Bar */
.splide-progress {
    background: var(--line);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.splide-progress-bar {
    background: var(--ink);
    height: 100%;
    width: 0;
    transition: width 400ms ease;
    border-radius: 3px;
}

/* ============================================
   GALLERY DETAIL PAGE
   ============================================ */
.gallery-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.gallery-stack-item {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

.gallery-stack-media {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-stack-nav { margin-top: 24px; }

.back-to-gallery,
.back-to-gallery:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    background: var(--ink);
    color: var(--page-card);
    border: 1px solid var(--page-card);
    box-shadow: none;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-to-gallery:hover,
.back-to-gallery:focus {
    transform: translateY(-1px);
    opacity: 0.92;
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}

/* ============================================
   INFO BOXES (Resume page)
   ============================================ */
.info-box {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.info-box h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.info-box ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}

/* ============================================
   FOOTER
   ============================================ */
.page-end-credit-row {
    padding: 40px 0 24px;
    margin-top: auto;
}

.page-end-credit-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.site-credit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--small-card);
    box-shadow: 0 12px 28px rgba(22, 22, 22, 0.12);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
}

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-layout { display: block; }

.contact-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.contact-field { display: grid; gap: 6px; }

.contact-field label {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.contact-field input,
.contact-field textarea {
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--small-card);
    padding: 14px 16px;
    color: var(--ink);
    caret-color: var(--ink);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
    color: rgba(255, 234, 174, 0.7);
    opacity: 1;
}

.contact-field input:focus,
.contact-field textarea:focus {
    border-color: rgba(22, 22, 22, 0.35);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
    background: var(--page-card);
}

.contact-field textarea {
    min-height: 180px;
    resize: vertical;
}

.contact-submit {
    justify-self: start;
    border: 1px solid var(--page-background);
    background: var(--page-card);
    color: var(--page-background);
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.contact-submit:hover {
    background: var(--ink);
    color: var(--page-card);
    border-color: var(--ink);
}


/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .top-nav { overflow: visible; }

    .top-nav-inner {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 0;
        position: relative;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(0rem, 3.5vw, 5rem);
        letter-spacing: 0.06em;
        line-height: 1;
    }

    .brand-full { display: none; }
    .brand-short { display: inline; }

    .nav-toggle {
        display: inline-flex;
        z-index: 1100;
    }

    .nav-tabs {
        position: fixed;
        top: var(--top-nav-height);
        left: 0;
        height: calc(100vh - var(--top-nav-height));
        width: min(82vw, 320px);
        z-index: 5;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 14px 18px;
        box-sizing: border-box;
        overflow-y: auto;
        background: var(--nav-background);
        border-right: 1px solid var(--line);
        transform: translateX(-100%);
        pointer-events: none;
        transition: transform 0.28s ease;
        border-radius: 0;
    }

    .top-nav.menu-open .nav-tabs {
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-tabs a {
        width: 100%;
        text-align: left;
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 0.95rem;
        background: rgba(255, 255, 255, 0.9);
    }

    .site-shell { padding: 0px 0 0; }

    .page-end-credit-wrap { gap: 10px; }

    .site-credit {
        white-space: normal;
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        padding: 9px 14px;
    }

    .contact-pill,
    .instagram-pill,
    .custom-pill {
        padding: 9px 14px;
        font-size: 0.88rem;
    }

    .portfolio-card {
        padding: 30px 24px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .portfolio-title { font-size: 1.5rem; }

    .portfolio-copy .intro {
        font-size: 1rem;
        max-width: 100%;
    }

    .portfolio-visual {
        min-height: 320px;
        max-height: 400px;
    }

    .portfolio-actions a {
        padding: 10px 16px;
        font-size: 0.88rem;
    }

        /* Remove the grid wrapper on mobile for this page */
    .project-screen-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        padding: 0;
    }

    /* Project info card - full width and centered */
    .project-page-card {
        width: 100%;
        order: 1;
        margin-bottom: 24px;
    }

    /* Gallery section - full width, below the info */
    .project-screen-gallery {
        position: static !important;
        width: 100% !important;
        order: 2;
        margin-top: 0;
        transform: none !important;
    }

    /* Gallery container */
    .project-gallery {
        position: static !important;
        top: auto !important;
        transform: none !important;
    }

    /* Meta info - stack vertically */
    .project-page-meta {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Ensure proper spacing */
    .project-page-meta div {
        width: 100%;
        box-sizing: border-box;
    }

    /* Gallery images max height */
    .project-main-slider .splide__slide img,
    .project-main-slider .splide__slide video {
        max-height: 300px;
        width: auto;
        margin: 0 auto;
    }

    /* Thumbnail slider adjustments */
    .project-thumbnail-slider .splide__arrow {
        width: 40px !important;
        height: 40px !important;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .project-thumbnail { height: 200px; }

    .gallery-row {
        margin-bottom: 36px;
        padding-bottom: 24px;
    }

    .gallery-row-header { margin-bottom: 14px; }

    .gallery-row .splide__slide img,
    .gallery-row .splide__slide video,
    .gallery-row .carousel-media { height: 180px; }

    .splide-progress { margin-top: 14px; }

    .gallery-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .splide__arrow {
        width: 44px !important;
        height: 44px !important;
        border-radius: 14px !important;
    }

    .splide__arrow svg {
        width: 20px !important;
        height: 20px !important;
    }

    .splide__arrow--prev { left: 0 !important; }
    .splide__arrow--next { right: 0 !important; }
}

@media (max-width: 600px) {
    .gallery-row {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .gallery-row .splide__slide img,
    .gallery-row .splide__slide video,
    .gallery-row .carousel-media { height: 160px; }

    .gallery-stack { grid-template-columns: 1fr; }

    .gallery-row-title { font-size: 1.15rem; }
}