* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a0e0e;
    color: #c4a3a3;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== HERO LANDING SECTION ===== */
.hero-section {
    min-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #8b1a1a 0%, #5c1010 50%, #ff0000 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    overflow: visible;
    -webkit-animation: gradientShift 8s ease infinite;
}

/* Fade gradient at bottom of hero section */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(26, 14, 14, 0.3) 30%,
        rgba(26, 14, 14, 0.7) 60%,
        #1a0e0e 100%);
    z-index: 5;
    pointer-events: none;
}

/* Animated background with moving shapes */
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1%, transparent 1%);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
    z-index: 0;
}

/* Pulsing colored gradients */
.hero-section > .hero-pulse {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(214, 52, 71, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 26, 26, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(92, 16, 16, 0.3) 0%, transparent 50%);
    animation: pulse 6s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HERO SOCIAL LINKS ===== */
.hero-social-links {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    gap: 20px;
    z-index: 10;
}

.hero-social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hero-social-icon:hover {
    color: #ffffff;
    background-color: rgba(214, 52, 71, 0.8);
    transform: translateY(-3px);
}

.hero-social-icon svg {
    width: 22px;
    height: 22px;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.hero-image-container {
    margin-bottom: 40px;
}

.hero-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.05);
}

.hero-name {
    font-size: 4.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #f0f0f0;
    margin-bottom: 30px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* ===== SCROLLING SKILLS BAR ===== */
.skills-scroll-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    margin: 0 auto 40px;
    padding: 20px 0;
    -webkit-mask-image: linear-gradient(to right, 
        transparent 0%, 
        black 10%, 
        black 90%, 
        transparent 100%);
    mask-image: linear-gradient(to right, 
        transparent 0%, 
        black 10%, 
        black 90%, 
        transparent 100%);
}

.skills-scroll {
    display: flex;
    gap: 30px;
    white-space: nowrap;
    /* faster scroll with smoother loop */
    --scroll-duration: 65s;
    animation: scroll var(--scroll-duration) linear infinite;
    will-change: transform;
}

.skill-item {
    font-size: 1rem;
    font-weight: 500;
    color: #ff6b7a;
    background-color: rgba(214, 52, 71, 0.15);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(214, 52, 71, 0.3);
    flex-shrink: 0;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-1 * var(--scroll-width, 50%)));
    }
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    animation: bounce 2s ease-in-out infinite;
    cursor: pointer;
    margin-top: 40px;
}

.scroll-indicator span {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.scroll-indicator svg {
    opacity: 0.8;
}

.main-container {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 50%;
    max-width: 600px;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 96px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.sidebar-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #f5d5d5;
    margin-bottom: 12px;
    line-height: 1.1;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: #f5d5d5;
    margin-bottom: 16px;
}

.sidebar-header .tagline {
    font-size: 1rem;
    color: #9d6b6b;
    max-width: 320px;
    line-height: 1.6;
}

/* ===== NAVIGATION ===== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 80px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: #9d6b6b;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 0;
    transition: all 0.2s ease;
    position: relative;
}

.nav-indicator {
    width: 32px;
    height: 1px;
    background-color: #6b3535;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #f5d5d5;
}

.nav-link:hover .nav-indicator {
    width: 64px;
    background-color: #d63447;
}

.nav-link.active {
    color: #f5d5d5;
}

.nav-link.active .nav-indicator {
    width: 64px;
    background-color: #d63447;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
    display: flex;
    gap: 20px;
    margin-top: auto;
}

.social-links a {
    color: #9d6b6b;
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
    color: #d63447;
    transform: translateY(-2px);
}

.social-links svg {
    width: 24px;
    height: 24px;
}

/* ===== CONTENT AREA ===== */
.content {
    width: 50%;
    padding: 96px 48px 96px 24px;
}

.content-section {
    margin-bottom: 120px;
    scroll-margin-top: 96px;
}

.section-title {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: rgba(26, 14, 14, 0.85);
    backdrop-filter: blur(10px);
    padding: 24px 0;
    margin-bottom: 24px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f5d5d5;
}

.section-content {
    color: #c4a3a3;
}

.section-content p {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.75;
}

/* ===== EXPERIENCE SECTION ===== */
.experience-item {
    margin-bottom: 48px;
    padding: 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.experience-item:hover {
    background-color: rgba(214, 52, 71, 0.08);
    box-shadow: 0 0 0 1px rgba(214, 52, 71, 0.2);
}

.experience-header {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
}

.experience-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9d6b6b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 2px;
}

.experience-details h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #f5d5d5;
    margin-bottom: 12px;
}

.experience-details p {
    font-size: 0.875rem;
    color: #c4a3a3;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ===== TAGS ===== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: #ff6b7a;
    background-color: rgba(214, 52, 71, 0.15);
    padding: 4px 12px;
    border-radius: 9999px;
}

/* ===== PROJECTS SECTION ===== */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-card {
    border-radius: 8px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.project-card:hover {
    background-color: rgba(214, 52, 71, 0.08);
    box-shadow: 0 0 0 1px rgba(214, 52, 71, 0.2);
}

.project-content-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 16px;
}

.project-thumbnail {
    width: 200px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(214, 52, 71, 0.2);
    background: #2b1515;
}

.project-thumbnail img,
.project-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.project-card:hover .project-thumbnail img,
.project-card:hover .project-thumbnail video {
    transform: scale(1.05);
}

.project-info {
    flex: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 8px;
}

.project-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f5d5d5;
    margin: 0;
    transition: color 0.2s ease;
}

.project-card:hover .project-title {
    color: #ff6b7a;
}

/* Different color gradients for project titles */
.project-card:nth-child(1):hover .project-title {
    color: #ff6b7a;
}

.project-card:nth-child(2):hover .project-title {
    color: #ff8590;
}

.project-card:nth-child(3):hover .project-title {
    color: #ff9ea7;
}

.project-card:nth-child(4):hover .project-title {
    color: #ffb8be;
}

.project-card:nth-child(5):hover .project-title {
    color: #d63447;
}

.project-card:nth-child(6):hover .project-title {
    color: #ff525f;
}

.expand-icon {
    font-size: 1.5rem;
    color: #9d6b6b;
    transition: transform 0.3s ease, color 0.2s ease;
    font-weight: bold;
    line-height: 1;
}

.project-header.active .expand-icon {
    transform: rotate(45deg);
    color: #d63447;
}

.project-description {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.project-description.active {
    max-height: 300px;
}

.project-description p {
    font-size: 0.875rem;
    color: #c4a3a3;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .hero-social-links {
        top: 20px;
        left: 20px;
        gap: 15px;
    }
    
    .hero-social-icon {
        width: 36px;
        height: 36px;
    }
    
    .hero-social-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .hero-name {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-image {
        width: 200px;
        height: 200px;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
        position: relative;
        height: auto;
        padding: 48px 24px;
    }
    
    .sidebar-nav {
        display: none;
    }
    
    .content {
        width: 100%;
        padding: 24px;
    }
    
    .section-title {
        position: relative;
        top: auto;
        background-color: transparent;
        backdrop-filter: none;
    }
    
    .experience-header {
        grid-template-columns: 1fr;
    }
    
    .experience-date {
        margin-bottom: 8px;
    }
    
    .project-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .project-thumbnail {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 640px) {
    .hero-name {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-image {
        width: 180px;
        height: 180px;
    }
    
    .sidebar {
        padding: 32px 16px;
    }
    
    .sidebar-header h1 {
        font-size: 2rem;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .content {
        padding: 16px;
    }
    
    .content-section {
        margin-bottom: 80px;
    }
}

/* ===== ENTRY AND MEDIA ADDITIONS ===== */
.project-description.active {
    max-height: 780px;
}

.project-description p + p {
    margin-top: 8px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 4px;
}

.project-links a {
    color: #f5d5d5;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(214, 52, 71, 0.45);
    background-color: rgba(214, 52, 71, 0.12);
    border-radius: 9999px;
    padding: 5px 12px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-links a:hover {
    color: #ffffff;
    background-color: rgba(214, 52, 71, 0.35);
    transform: translateY(-1px);
}

.project-thumbnail img[src$='.svg'] {
    object-fit: cover;
    background: #2b1515;
}

@media (max-width: 1024px) {
    .project-description.active {
        max-height: 980px;
    }
}

/* ===== REVISION: WIDER CONTENT, EXPANDED CARDS, AND MEDIA GALLERIES ===== */
.main-container {
    width: min(100%, 1500px);
    max-width: none;
    overflow: visible;
}

.sidebar {
    width: 32%;
    max-width: 480px;
    min-width: 320px;
    padding: 96px 40px;
    z-index: 1;
}

.content {
    width: 68%;
    padding: 96px 56px 96px 18px;
    overflow: visible;
}

.projects-grid,
.content-section {
    overflow: visible;
}

.project-card {
    position: relative;
    overflow: visible;
    border-radius: 14px;
    transition: transform 0.32s ease, width 0.32s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.project-content-wrapper {
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    gap: 22px;
    padding: 20px;
    align-items: start;
    border-radius: 14px;
    transition: grid-template-columns 0.3s ease, padding 0.3s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.project-thumbnail {
    width: 100%;
    height: clamp(175px, 18vw, 245px);
    border-radius: 10px;
    border: 1px solid rgba(214, 52, 71, 0.28);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.project-card.expanded {
    transform: translateX(var(--expanded-shift, 0));
    width: var(--expanded-width, 100%);
    z-index: 30;
}

.project-card.expanded .project-content-wrapper {
    grid-template-columns: minmax(360px, 40%) minmax(0, 1fr);
    gap: 30px;
    padding: 26px;
    background: linear-gradient(135deg, rgba(67, 28, 28, 0.97), rgba(39, 18, 18, 0.98));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(214, 52, 71, 0.32);
}

.project-card.expanded .project-thumbnail {
    height: clamp(280px, 32vw, 430px);
}

.project-title {
    font-size: 1.05rem;
    line-height: 1.35;
}

.project-card.expanded .project-title {
    font-size: 1.35rem;
}

.project-description.active,
.project-card.expanded .project-description.active {
    max-height: 2600px;
}

.project-description p {
    font-size: 0.94rem;
    line-height: 1.72;
    margin-bottom: 14px;
}

.project-card.expanded .project-description p {
    font-size: 1rem;
    line-height: 1.78;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 14px;
}

.project-card.expanded .media-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.gallery-item {
    position: relative;
    display: block;
    min-height: 140px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(214, 52, 71, 0.3);
    background: #2b1515;
    text-decoration: none;
    color: #f5d5d5;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.28s ease, filter 0.28s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.04);
    filter: brightness(1.08);
}

.gallery-item span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 10px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
    color: #fff4f4;
}

.project-links {
    margin-top: 16px;
}

@media (max-width: 1180px) {
    .sidebar {
        min-width: 280px;
        padding: 72px 28px;
    }

    .content {
        padding-right: 28px;
    }

    .project-content-wrapper,
    .project-card.expanded .project-content-wrapper {
        grid-template-columns: 1fr;
    }

    .project-thumbnail,
    .project-card.expanded .project-thumbnail {
        height: clamp(240px, 42vw, 380px);
    }

    .project-card.expanded .media-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .main-container {
        width: 100%;
    }

    .sidebar {
        min-width: 0;
    }

    .content {
        padding: 24px;
    }

    .project-card.expanded {
        transform: none;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .project-content-wrapper,
    .project-card.expanded .project-content-wrapper {
        padding: 14px;
    }

    .project-thumbnail,
    .project-card.expanded .project-thumbnail {
        height: 220px;
    }

    .media-gallery,
    .project-card.expanded .media-gallery {
        grid-template-columns: 1fr;
    }
}

/* ===== INTERACTION REVISION: CARD-WIDE OPEN, REAL MEDIA, RIGHT-SIDE IMAGE VIEWER ===== */
.project-card {
    cursor: pointer;
}

.project-card.expanded {
    cursor: default;
}

.project-card:focus-visible {
    outline: 2px solid #ff6b7a;
    outline-offset: 4px;
}

.project-card.expanded .project-content-wrapper {
    grid-template-columns: minmax(340px, 34%) minmax(0, 1fr);
}

.gallery-item {
    font: inherit;
    padding: 0;
    cursor: pointer;
}

button.gallery-item {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(214, 52, 71, 0.3);
    text-align: left;
}

.gallery-item.media-link {
    cursor: pointer;
}

.gallery-item video {
    pointer-events: none;
}

.image-trigger::after {
    content: 'click to enlarge';
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff4f4;
    background: rgba(26, 14, 14, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-trigger:hover::after,
.image-trigger:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.image-viewer {
    --viewer-gap: 18px;
    position: fixed;
    left: var(--viewer-left, 34vw);
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 120;
    display: none;
    align-items: stretch;
    justify-content: center;
    padding: var(--viewer-gap);
    pointer-events: none;
}

.image-viewer.active {
    display: flex;
    pointer-events: auto;
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 14, 14, 0.88);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(214, 52, 71, 0.32);
}

.image-viewer-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.image-viewer-panel img {
    max-width: 100%;
    max-height: calc(100vh - 92px);
    width: auto;
    height: auto;
    justify-self: center;
    align-self: center;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid rgba(214, 52, 71, 0.35);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
    background: #2b1515;
}

.image-viewer-panel figcaption {
    justify-self: center;
    color: #f5d5d5;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    max-width: 760px;
}

.image-viewer-close {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(26, 14, 14, 0.82);
    color: #fff4f4;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.image-viewer-close:hover {
    background: rgba(214, 52, 71, 0.7);
}

@media (max-width: 1180px) {
    .project-card.expanded .project-content-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .image-viewer {
        left: 0;
        padding: 12px;
    }

    .image-viewer-backdrop {
        border-left: 0;
    }
}

/* ===== V4 ENTRY RESTYLE: media-left expanded cards, no off-page media links ===== */
.section-title {
    z-index: 90;
    box-shadow: 0 8px 24px rgba(26, 14, 14, 0.42);
}

.sidebar {
    z-index: 100;
}

.content {
    position: relative;
    z-index: 1;
}

.project-card,
.project-card.expanded {
    width: 100%;
    transform: none;
    z-index: 2;
    cursor: pointer;
}

.project-card.expanded {
    z-index: 4;
}

.project-content-wrapper,
.project-card.expanded .project-content-wrapper {
    display: grid;
    grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.project-card.expanded .project-content-wrapper {
    grid-template-columns: minmax(390px, 46%) minmax(0, 1fr);
    gap: 30px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(67, 28, 28, 0.97), rgba(39, 18, 18, 0.98));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(214, 52, 71, 0.32);
}

.project-media-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.project-thumbnail {
    width: 100%;
    height: clamp(175px, 18vw, 245px);
    aspect-ratio: 16 / 9;
}

.project-card.expanded .project-thumbnail {
    display: none;
}

.project-card.expanded .project-info {
    min-width: 0;
}

.project-header {
    cursor: inherit;
}

.project-description,
.project-description.active {
    overflow: hidden;
}

.project-description.active,
.project-card.expanded .project-description.active {
    max-height: 2200px;
}

.project-card.expanded .project-title {
    font-size: clamp(1.28rem, 1.6vw, 1.55rem);
    line-height: 1.28;
}

.project-card.expanded .project-description p {
    font-size: 1rem;
    line-height: 1.78;
}

.media-gallery,
.project-card.expanded .media-gallery {
    display: none;
}

.project-card.expanded .media-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 0;
}

.gallery-item,
.project-card.expanded .gallery-item {
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(214, 52, 71, 0.34);
    background: #2b1515;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.gallery-item img,
.gallery-item video,
.project-thumbnail img,
.project-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-video {
    cursor: inherit;
}

.media-video video {
    pointer-events: none;
}

button.gallery-item.image-trigger {
    cursor: zoom-in;
}

button.gallery-item.image-trigger img {
    object-fit: cover;
}

.gallery-item span {
    pointer-events: none;
}

.image-trigger::after {
    content: 'expand';
}

.project-links {
    display: none !important;
}

.tags {
    margin-top: 20px;
}

.project-card.expanded .tags {
    margin-top: 22px;
}

.image-viewer {
    left: var(--viewer-left, 34vw);
    z-index: 130;
}

.image-viewer-panel img {
    object-fit: contain;
    max-height: calc(100vh - 96px);
}

@media (max-width: 1180px) {
    .project-content-wrapper,
    .project-card.expanded .project-content-wrapper {
        grid-template-columns: 1fr;
    }

    .project-card.expanded .project-thumbnail {
        display: none;
    }

    .project-card.expanded .media-gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        z-index: 20;
    }

    .section-title {
        z-index: 80;
    }

    .image-viewer {
        left: 0;
    }
}

/* ===== FINAL BALANCE PATCH: slimmer media column, roomier text, no contact-sheet feel ===== */
.project-card {
    margin-bottom: 16px;
}

.project-content-wrapper,
.project-card.expanded .project-content-wrapper {
    grid-template-columns: minmax(210px, 30%) minmax(0, 1fr);
    gap: 20px;
}

.project-card.expanded .project-content-wrapper {
    grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
    gap: 24px;
    padding: 22px;
}

.project-card.expanded .project-info {
    padding-right: 4px;
}

.project-card.expanded .project-title {
    font-size: clamp(1.18rem, 1.35vw, 1.42rem);
}

.project-card.expanded .project-description p {
    font-size: 0.98rem;
    line-height: 1.72;
    margin-bottom: 12px;
}

.project-card.expanded .tags {
    margin-top: 16px;
}

.project-card.expanded .media-gallery {
    gap: 12px;
}

.gallery-item,
.project-card.expanded .gallery-item {
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 260px;
}

.project-card.expanded .gallery-item video,
.project-card.expanded .gallery-item img {
    object-fit: cover;
}

/* The image viewer still shows the original aspect ratio, so portrait figures expand as portrait. */
.image-viewer-panel img {
    object-fit: contain;
}

@media (min-width: 1280px) {
    .content {
        padding-right: 48px;
    }
}

@media (max-width: 1180px) {
    .project-content-wrapper,
    .project-card.expanded .project-content-wrapper {
        grid-template-columns: 1fr;
    }

    .gallery-item,
    .project-card.expanded .gallery-item {
        max-height: none;
    }
}

/* ===== PATCH: shorter collapsed cards + reliable enlarged image viewer ===== */
.project-card:not(.expanded) {
    margin-bottom: 10px;
}

.project-card:not(.expanded) .project-content-wrapper {
    grid-template-columns: minmax(150px, 24%) minmax(0, 1fr);
    gap: 14px;
    padding: 12px 14px;
    align-items: center;
}

.project-card:not(.expanded) .project-thumbnail {
    height: clamp(105px, 10vw, 145px);
    border-radius: 8px;
}

.project-card:not(.expanded) .project-title {
    font-size: 0.98rem;
    line-height: 1.25;
}

.project-card:not(.expanded) .project-header {
    margin-bottom: 4px;
}

.project-card:not(.expanded) .tags {
    margin-top: 8px;
    gap: 6px;
}

.project-card:not(.expanded) .tag {
    font-size: 0.68rem;
    padding: 3px 9px;
}

.image-viewer.active {
    display: flex !important;
    pointer-events: auto;
}

.image-viewer-panel {
    place-items: center;
}

.image-viewer-panel img {
    max-width: min(100%, 1120px);
    max-height: calc(100vh - 78px);
    width: auto;
    height: auto;
}

.project-card.expanded .image-trigger {
    cursor: zoom-in;
}

.project-card.expanded .image-trigger img {
    pointer-events: none;
}

@media (max-width: 1180px) {
    .project-card:not(.expanded) .project-content-wrapper {
        grid-template-columns: minmax(140px, 28%) minmax(0, 1fr);
    }

    .project-card:not(.expanded) .project-thumbnail {
        height: clamp(96px, 16vw, 135px);
    }
}

@media (max-width: 720px) {
    .project-card:not(.expanded) .project-content-wrapper {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .project-card:not(.expanded) .project-thumbnail {
        height: 130px;
    }
}

/* ===== PATCH: slightly tighter spacing between major sections ===== */
.content-section {
    margin-bottom: 72px;
}

.section-title {
    margin-bottom: 16px;
    padding-top: 18px;
    padding-bottom: 18px;
}

@media (max-width: 768px) {
    .content-section {
        margin-bottom: 52px;
    }

    .section-title {
        margin-bottom: 12px;
        padding-top: 14px;
        padding-bottom: 14px;
    }
}

/* ===== QoL polish: scanability, filters, accessibility ===== */
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    transform: translateY(-140%);
    z-index: 1000;
    background: #fff4f4;
    color: #2b1515;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.skip-link:focus {
    transform: translateY(0);
}

.hero-intro {
    max-width: 760px;
    margin: -10px auto 26px;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(1rem, 1.5vw, 1.22rem);
    line-height: 1.65;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.28);
}

.hero-actions,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 30px;
}

.hero-action,
.contact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.hero-action.primary,
.contact-action:first-child {
    background: rgba(214, 52, 71, 0.84);
    border-color: rgba(255, 255, 255, 0.38);
}

.hero-action:hover,
.contact-action:hover,
.hero-action:focus-visible,
.contact-action:focus-visible {
    transform: translateY(-2px);
    background: rgba(214, 52, 71, 0.94);
    outline: none;
}

.sidebar-contact-card {
    margin: 26px 0 22px;
    padding: 14px;
    border: 1px solid rgba(214, 52, 71, 0.24);
    border-radius: 14px;
    background: rgba(214, 52, 71, 0.08);
}

.sidebar-contact-card p {
    margin: 0 0 8px;
    color: #c4a3a3;
    font-size: 0.82rem;
    line-height: 1.45;
}

.sidebar-contact-card a {
    color: #ff8b96;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
}

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

.overview-item,
.contact-details,
.case-study-block {
    border: 1px solid rgba(214, 52, 71, 0.22);
    border-radius: 14px;
    background: rgba(214, 52, 71, 0.065);
}

.overview-item {
    padding: 16px;
}

.overview-item h3,
.contact-copy h3,
.case-study-block h4 {
    margin: 0 0 8px;
    color: #fff0f0;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.overview-item p {
    margin: 0;
    font-size: 0.88rem;
    color: #c4a3a3;
    line-height: 1.55;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 18px;
}

.filter-btn {
    appearance: none;
    border: 1px solid rgba(214, 52, 71, 0.28);
    background: rgba(214, 52, 71, 0.06);
    color: #d8b4b4;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.filter-btn:hover,
.filter-btn:focus-visible,
.filter-btn.active {
    color: #fff6f6;
    background: rgba(214, 52, 71, 0.42);
    border-color: rgba(255, 107, 122, 0.74);
    outline: none;
}

.filter-btn:hover {
    transform: translateY(-1px);
}

.project-card.is-filter-hidden {
    display: none !important;
}

.project-title-group {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.entry-type {
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 107, 122, 0.16);
    color: #ff9aa4;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-summary {
    color: #dec2c2;
    font-size: 0.83rem;
    line-height: 1.45;
    margin: 0 0 8px;
}

.project-card:not(.expanded) .project-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 8px;
}

.meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(214, 52, 71, 0.2);
    background: rgba(0, 0, 0, 0.12);
}

.meta-item dt {
    margin: 0;
    color: #ff8b96;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.meta-item dd {
    margin: 0;
    color: #d8b4b4;
    font-size: 0.72rem;
    font-weight: 650;
}

.project-card:not(.expanded) .project-meta {
    display: none;
}

.interaction-hint {
    margin: 2px 0 0;
    color: #a87979;
    font-size: 0.72rem;
    font-weight: 700;
}

.project-card:not(.expanded) .interaction-hint {
    display: none;
}

.case-study-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 2px 0 18px;
}

.case-study-block {
    padding: 13px;
}

.case-study-block h4 {
    font-size: 0.74rem;
    color: #ff9aa4;
}

.case-study-block p,
.project-card.expanded .case-study-block p {
    margin: 0;
    color: #d1b4b4;
    font-size: 0.83rem;
    line-height: 1.55;
}

.description-label {
    display: inline-block;
    margin-right: 8px;
    color: #ff8b96;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-card:not(.expanded) .case-study-highlights {
    display: none;
}

.project-card:not(.expanded) .project-content-wrapper {
    padding-top: 10px;
    padding-bottom: 10px;
}

.project-card:not(.expanded) .tags {
    max-height: 28px;
    overflow: hidden;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: 20px;
    align-items: stretch;
}

.contact-copy,
.contact-details {
    padding: 20px;
}

.contact-copy h3 {
    font-size: 1rem;
}

.contact-copy p {
    color: #c4a3a3;
    line-height: 1.65;
    margin: 0 0 16px;
}

.contact-actions {
    justify-content: flex-start;
    margin: 6px 0 14px;
}

.contact-action {
    color: #ffffff;
    border-color: rgba(214, 52, 71, 0.38);
    background: rgba(214, 52, 71, 0.18);
}

.contact-note {
    font-size: 0.78rem;
    color: #a87979 !important;
}

.contact-detail {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(214, 52, 71, 0.18);
}

.contact-detail:last-child {
    border-bottom: 0;
}

.contact-detail strong {
    color: #ff8b96;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-detail span {
    color: #d8b4b4;
    font-size: 0.92rem;
}

@media (max-width: 1180px) {
    .case-study-highlights,
    .overview-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        margin-top: 0;
    }
}

@media (max-width: 720px) {
    .hero-actions,
    .contact-actions {
        flex-direction: column;
        align-items: stretch;
        width: min(100%, 320px);
    }

    .hero-intro {
        padding: 0 18px;
    }

    .project-summary {
        font-size: 0.8rem;
    }

    .filter-bar {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .skills-scroll {
        animation: none !important;
        transform: none !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    video[autoplay] {
        animation: none !important;
    }
}


/* Resume/professional content polish */
.project-card.expanded .project-description p {
    max-width: 74ch;
}
.project-card.expanded .project-summary {
    max-width: 76ch;
}

/* Final cleanup: no duplicate sidebar identity header; scroll-only contact/resume actions; wide image viewer. */
.sidebar-header {
    display: none !important;
}

.sidebar-content {
    padding-top: 10px;
}

.clean-contact .contact-actions {
    display: none !important;
}

.contact-detail a {
    color: #fff4f4;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 154, 164, 0.55);
}

.contact-detail a:hover,
.contact-detail a:focus-visible {
    color: #ff9aa4;
    border-bottom-color: #ff9aa4;
}

.image-viewer {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 220 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(16px, 4vw, 48px) !important;
}

.image-viewer.active {
    display: flex !important;
    pointer-events: auto !important;
}

.image-viewer-backdrop {
    inset: 0 !important;
    background: rgba(18, 8, 10, 0.92) !important;
    border-left: 0 !important;
    backdrop-filter: blur(12px) !important;
}

.image-viewer-panel {
    width: min(96vw, 1440px) !important;
    height: min(92vh, 980px) !important;
    max-width: 1440px !important;
    max-height: 92vh !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 12px !important;
}

.image-viewer-panel img {
    max-width: 100% !important;
    max-height: calc(92vh - 74px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 16px !important;
}

.image-viewer-panel figcaption {
    max-width: min(92vw, 980px) !important;
}

.image-viewer-close {
    top: 12px !important;
    right: 12px !important;
}

body.viewer-open {
    overflow: hidden;
}

/* ===== FINAL INTERACTION PATCH: media clicks open a wide viewer, not the card toggle ===== */
.project-card.expanded .project-thumbnail,
.project-card.expanded .gallery-item,
.project-card.expanded .media-video,
.project-card.expanded .image-trigger {
    cursor: zoom-in;
}

.project-card.expanded .project-thumbnail video,
.project-card.expanded .project-thumbnail img,
.project-card.expanded .gallery-item video,
.project-card.expanded .gallery-item img {
    pointer-events: none;
}

.image-viewer-panel video {
    max-width: 100% !important;
    max-height: calc(92vh - 74px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 16px !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42) !important;
}

.image-viewer-panel img[hidden],
.image-viewer-panel video[hidden] {
    display: none !important;
}

.image-viewer-panel img:not([hidden]),
.image-viewer-panel video:not([hidden]) {
    display: block !important;
}

.project-card .media-gallery [role="button"]:focus-visible,
.project-card.expanded .project-thumbnail:focus-visible,
.gallery-item.image-trigger:focus-visible {
    outline: 2px solid rgba(255, 154, 164, 0.95);
    outline-offset: 3px;
}

/* Navigation state cleanup: top quick links are plain jump links, not active section indicators. */
.hero-actions .hero-action.primary,
.hero-actions .hero-action.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: none;
}

.hero-actions .hero-action:hover,
.hero-actions .hero-action:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.58);
}

/* Media explanation blurbs for diagrams, flow charts, and plots. */
.media-blurb {
    display: block;
    margin-top: 6px;
    font-size: 0.74rem;
    line-height: 1.35;
    color: rgba(64, 47, 52, 0.78);
    text-align: left;
}

.project-card:not(.expanded) .media-blurb {
    display: none;
}

.project-card.expanded .gallery-item {
    align-content: start;
}

.project-card.expanded .gallery-item span {
    margin-bottom: 0;
}

.image-viewer-panel figcaption {
    white-space: normal;
    line-height: 1.45;
}

/* ===== Recruiter polish: target roles, outcomes, and evidence links ===== */
.hero-role-target {
    max-width: 760px;
    margin: -16px auto 30px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    line-height: 1.55;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.28);
}

.project-outcome {
    margin: 8px 0 8px;
    padding: 9px 12px;
    border-left: 3px solid rgba(255, 107, 122, 0.72);
    border-radius: 0 10px 10px 0;
    background: rgba(214, 52, 71, 0.10);
    color: #f3cfd2;
    font-size: 0.9rem;
    line-height: 1.45;
    font-weight: 500;
}

.project-card:not(.expanded) .project-outcome {
    margin: 6px 0 6px;
    padding: 7px 10px;
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.entry-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(214, 52, 71, 0.34);
    background: rgba(214, 52, 71, 0.08);
    color: #ffd7dc;
    font-size: 0.78rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.entry-link:hover,
.entry-link:focus-visible {
    background: rgba(214, 52, 71, 0.18);
    border-color: rgba(255, 107, 122, 0.7);
    transform: translateY(-1px);
    outline: none;
}

.entry-link[data-link-type="pdf"]::before {
    content: "PDF";
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    color: #1a0e0e;
    background: #ffb8be;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
}

.entry-link.direct-link::before {
    content: "#";
    color: #ffb8be;
    font-weight: 700;
}

.project-card:not(.expanded) .entry-links {
    margin-top: 8px;
}

.project-card:not(.expanded) .entry-link:not(.direct-link) {
    display: none;
}

.project-card.expanded .entry-links {
    margin: 14px 0 16px;
}

.project-card.expanded .project-outcome {
    font-size: 0.98rem;
    margin-top: 12px;
    margin-bottom: 12px;
}

@media (max-width: 760px) {
    .hero-role-target {
        max-width: 90vw;
        margin-top: -12px;
        font-size: 0.95rem;
    }

    .entry-links {
        gap: 7px;
    }

    .entry-link {
        font-size: 0.74rem;
        padding: 6px 9px;
    }
}


/* Embedded resume preview in the bottom contact section. */
.resume-preview-card {
    grid-column: 1 / -1;
    padding: 20px;
    border: 1px solid rgba(214, 52, 71, 0.24);
    border-radius: 16px;
    background: rgba(35, 14, 14, 0.54);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.20);
}

.resume-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.resume-preview-header h3 {
    margin: 0;
    color: #fff4f4;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.resume-preview-header a {
    color: #fff4f4;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 154, 164, 0.55);
    font-size: 0.9rem;
}

.resume-preview-header a:hover,
.resume-preview-header a:focus-visible {
    color: #ff9aa4;
    border-bottom-color: #ff9aa4;
}

.resume-preview-frame {
    width: 100%;
    height: min(84vh, 940px);
    min-height: 620px;
    border: 1px solid rgba(255, 154, 164, 0.18);
    border-radius: 12px;
    background: #211010;
}

@media (max-width: 720px) {
    .resume-preview-card {
        padding: 14px;
    }

    .resume-preview-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .resume-preview-frame {
        height: 72vh;
        min-height: 480px;
    }
}

/* Resume is its own left-nav chapter. */
.resume-section .resume-preview-card {
    grid-column: auto;
}

.resume-section .resume-preview-frame {
    height: min(86vh, 980px);
}

/* ===== MOBILE / TABLET RESPONSIVE STABILITY PATCH =====
   Keeps the portfolio fully usable on narrow screens and prevents
   horizontal overflow from late desktop layout overrides.

   Important: do NOT set overflow-x: hidden on the root html element on
   desktop. Doing so creates a scrolling/overflow ancestor that prevents
   the desktop .sidebar { position: sticky; } behavior from working in
   Chromium-based browsers. The body-level overflow rule below preserves
   the horizontal overflow fix while keeping the original sticky sidebar
   behavior after the hero/landing section. */
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html {
    width: 100%;
    max-width: none;
    overflow-x: visible;
}

img,
video,
iframe,
svg {
    max-width: 100%;
}

.main-container,
.sidebar,
.content,
.content-section,
.section-content,
.projects-grid,
.project-card,
.project-content-wrapper,
.project-media-column,
.project-info,
.project-title-group,
.project-description,
.media-gallery,
.gallery-item,
.contact-grid,
.contact-copy,
.contact-details,
.resume-preview-card {
    min-width: 0;
    max-width: 100%;
}

.project-summary,
.project-description,
.project-description p,
.project-title,
.meta-item,
.meta-item dd,
.entry-link,
.tag,
.contact-detail span,
.contact-detail a,
.resume-preview-header,
.hero-role-target,
.hero-subtitle {
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 1024px) {
    html,
    body {
        overflow-x: hidden !important;
    }

    .hero-section {
        min-height: 100svh;
        overflow: hidden;
        padding: 80px 18px 44px;
    }

    .hero-section::before {
        width: 160%;
        height: 160%;
        left: -30%;
        top: -30%;
    }

    .hero-content {
        width: 100%;
        max-width: 720px;
        padding: 0 4px;
    }

    .hero-name {
        font-size: clamp(2.25rem, 11vw, 3.25rem) !important;
        line-height: 1.08;
        letter-spacing: 0.03em;
    }

    .hero-subtitle,
    .hero-role-target {
        max-width: 92vw;
        margin-left: auto;
        margin-right: auto;
    }

    .skills-scroll-container {
        width: 100%;
        max-width: 100%;
    }

    .main-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }

    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        position: relative !important;
        top: auto !important;
        padding: 28px clamp(16px, 5vw, 34px) 8px !important;
    }

    .sidebar-content {
        height: auto !important;
        padding-top: 0 !important;
    }

    .sidebar-nav {
        display: none !important;
    }

    .social-links {
        justify-content: center;
        margin: 0 auto 12px;
    }

    .content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px clamp(14px, 4.5vw, 32px) 56px !important;
        overflow-x: hidden !important;
    }

    .section-title {
        position: relative !important;
        top: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        z-index: 1 !important;
    }

    .overview-grid,
    .case-study-highlights,
    .contact-grid {
        grid-template-columns: 1fr !important;
    }

    .filter-bar {
        max-width: 100%;
        overflow: visible;
    }

    .project-card,
    .project-card.expanded {
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        overflow: hidden !important;
    }

    .project-content-wrapper,
    .project-card:not(.expanded) .project-content-wrapper,
    .project-card.expanded .project-content-wrapper {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 16px !important;
        padding: clamp(13px, 4vw, 20px) !important;
    }

    .project-card.expanded .project-content-wrapper {
        background: linear-gradient(135deg, rgba(67, 28, 28, 0.97), rgba(39, 18, 18, 0.98));
    }

    .project-media-column,
    .project-info {
        width: 100% !important;
        max-width: 100% !important;
    }

    .project-card.expanded .project-info {
        order: 1;
    }

    .project-card.expanded .project-media-column {
        order: 2;
    }

    .project-thumbnail,
    .project-card:not(.expanded) .project-thumbnail,
    .project-card.expanded .project-thumbnail {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 16 / 9;
    }

    .project-card.expanded .project-thumbnail {
        display: none !important;
    }

    .media-gallery,
    .project-card.expanded .media-gallery {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    .gallery-item,
    .project-card.expanded .gallery-item {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 16 / 9;
    }

    .project-description,
    .project-description.active,
    .project-card.expanded .project-description,
    .project-card.expanded .project-description.active {
        max-height: none !important;
        overflow: visible !important;
    }

    .project-card.expanded .project-description p,
    .project-card.expanded .project-summary {
        max-width: 100% !important;
    }

    .project-meta,
    .entry-links,
    .tags {
        max-width: 100%;
    }

    .image-viewer {
        padding: 12px !important;
    }

    .image-viewer-panel {
        width: 100% !important;
        height: calc(100svh - 24px) !important;
        max-height: calc(100svh - 24px) !important;
    }

    .image-viewer-panel img,
    .image-viewer-panel video {
        max-width: 100% !important;
        max-height: calc(100svh - 96px) !important;
    }
}

@media (max-width: 640px) {
    .hero-social-links {
        top: 18px !important;
        left: 50% !important;
        transform: translateX(-50%);
        gap: 12px !important;
    }

    .hero-image {
        width: clamp(142px, 42vw, 180px) !important;
        height: clamp(142px, 42vw, 180px) !important;
    }

    .hero-image-container {
        margin-bottom: 28px;
    }

    .hero-actions,
    .contact-actions {
        width: 100% !important;
        max-width: 360px;
    }

    .hero-action,
    .contact-action {
        width: 100%;
    }

    .content {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .content-section {
        margin-bottom: 50px !important;
    }

    .project-card:not(.expanded) .project-summary,
    .project-card:not(.expanded) .project-outcome {
        -webkit-line-clamp: unset !important;
        display: block !important;
        overflow: visible !important;
    }

    .project-header {
        gap: 12px;
    }

    .expand-icon {
        flex: 0 0 auto;
    }

    .overview-item,
    .contact-copy,
    .contact-details,
    .resume-preview-card {
        padding: 14px !important;
    }

    .contact-detail span,
    .contact-detail a {
        font-size: 0.86rem;
    }

    .resume-preview-header {
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: start !important;
        gap: 8px !important;
    }

    .resume-preview-frame {
        display: none !important;
    }

    .resume-preview-card::after {
        content: "Open the PDF for the best mobile resume view.";
        display: block;
        margin-top: 10px;
        color: #c4a3a3;
        font-size: 0.86rem;
        line-height: 1.45;
    }
}

/* ===== MOBILE POLISH: metadata labels + resume prompt =====
   Prevent short labels like "Tools" from breaking across lines while
   still letting long metadata values wrap within the card width. */
.project-meta,
.meta-item,
.meta-item dt,
.meta-item dd {
    overflow-wrap: normal;
    word-break: normal;
}

.meta-item {
    min-width: 0;
    max-width: 100%;
}

.meta-item dt {
    flex: 0 0 auto;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

.meta-item dd {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .project-meta {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        width: 100%;
    }

    .meta-item {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        column-gap: 7px;
        row-gap: 2px;
        width: 100%;
        max-width: 100%;
        border-radius: 14px;
    }

    .meta-item dt {
        white-space: nowrap;
    }

    .resume-preview-card::after {
        content: "Open PDF" !important;
    }
}

/* ===== DESKTOP SIDEBAR FOLLOW RESTORE =====
   Keep the mobile layout fixes, but make desktop sidebar behavior explicit
   instead of relying on position: sticky. The aside remains in the flex layout
   as a placeholder; only the inner sidebar panel becomes fixed after the hero
   scrolls away. */
@media (min-width: 1025px) {
    .main-container {
        display: flex !important;
        align-items: stretch !important;
        overflow: visible !important;
    }

    .sidebar {
        position: relative !important;
        top: auto !important;
        align-self: stretch !important;
        height: auto !important;
        min-height: 100vh !important;
        padding: 0 !important;
        overflow: visible !important;
        flex: 0 0 32% !important;
        width: 32% !important;
        max-width: 480px !important;
        min-width: 320px !important;
        z-index: 100 !important;
    }

    .sidebar-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 100vh !important;
        padding: 96px 40px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        overflow: visible !important;
        z-index: 100 !important;
    }

    .sidebar-content.sidebar-follow-fixed {
        position: fixed !important;
        top: 0 !important;
        left: var(--sidebar-follow-left, 0px) !important;
        width: var(--sidebar-follow-width, 320px) !important;
    }

    .sidebar-content.sidebar-follow-bottom {
        position: absolute !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
    }
}

/* ===== PATCH: mobile collapsed cards + precise section jumps =====
   The responsive overflow patch previously made descriptions visible in all
   mobile cards. Keep descriptions expanded only after the card has the
   .expanded state, and make hash/nav jumps place the section banner at the
   top of the viewport. */
.content-section {
    scroll-margin-top: 0 !important;
}

@media (max-width: 1024px) {
    .project-card:not(.expanded) .project-description,
    .project-card:not(.expanded) .project-description.active {
        max-height: 0 !important;
        overflow: hidden !important;
        margin-top: 0 !important;
    }

    .project-card:not(.expanded) .project-description p {
        opacity: 0 !important;
        transform: translateY(-4px) !important;
    }

    .project-card.expanded .project-description.active {
        max-height: none !important;
        overflow: visible !important;
    }

    .project-card.expanded .project-description.active p {
        opacity: 1 !important;
        transform: none !important;
    }
}
