@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300&display=swap');

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

/* Ensure consistent paragraph rendering */
p {
    margin: 0;
    padding: 0;
}

/* Prevent double-tap zoom on mobile */
html, body {
    touch-action: pan-x pan-y;
}

@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }
}

button,
a,
.nav-arrow,
.resume-item,
.back-link,
.preview-wrapper,
.phone-mockup,
.preview-content,
.mobile-nav {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #111111;
    line-height: 1.6;
    font-size: 14px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Initial state - hide elements */
.profile,
.resume-item,
.section-header,
.phone-mockup,
.laptop-mockup,
.device-container,
.standalone-preview,
.preview-caption,
.mobile-header,
.carousel-item,
.mobile-nav,
.resume-item-mobile {
    opacity: 0;
}

/* Animations */
.profile {
    animation: fadeInUp 0.48s ease-out forwards;
}

.resume-item {
    animation: fadeInUp 0.48s ease-out forwards;
}

.section-header {
    animation: fadeInUp 0.48s ease-out forwards;
}

.phone-mockup,
.laptop-mockup,
.device-container,
.standalone-preview {
    animation: fadeIn 0.48s ease-out forwards;
}

.preview-caption {
    animation: fadeInUp 0.48s ease-out forwards;
}

.mobile-header {
    animation: fadeInUp 0.48s ease-out forwards;
}

.carousel-item {
    animation: fadeInUp 0.48s ease-out forwards;
    animation-delay: 0.24s;
}

.mobile-nav {
    animation: fadeInUp 0.48s ease-out forwards;
    animation-delay: 0.32s;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #ffffff;
    align-items: flex-start;
    padding-top: 120px;
}

.resume {
    flex: 1;
    padding: 60px;
    padding-right: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: flex-end;
}

.resume-view {
    width: 400px;
    max-width: 400px;
}

.project-detail {
    width: 400px;
    max-width: 400px;
}

.profile {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    margin-bottom: 20px;
}

.profile.resume-item {
    margin-left: 0;
    margin-right: 0;
    padding: 10px 15px;
}

.profile-photo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
}

.profile-info {
    padding-left: 0px;
}

.profile h1 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 5px;
    color: #111111;
    white-space: nowrap;
}

.profile .title {
    color: #999999;
    font-size: 14px;
    white-space: nowrap;
}

.experience, .projects, .education {
    margin-bottom: 20px;
}

.section-header {
    display: grid;
    grid-template-columns: 120px 1fr;
    margin-bottom: 8px;
}

.section-header .date {
    padding-left: 15px;
}


.resume-item {
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 15px;
    width: fit-content;
    position: relative;
}

/* Create a hover indicator */
.resume-view {
    position: relative;
}

.hover-indicator {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.timeline {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: baseline;
}

.date {
    font-size: 14px;
    color: #999999;
    white-space: nowrap;
}

.section-header .date {
    color: #111111;
}


.timeline-content {
    padding-left: 0px;
}

.detail-header .timeline-content {
    padding-top: 0;
    padding-bottom: 0;
}

.timeline h3 {
    font-size: 14px;
    font-weight: 400;
    color: #111111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-content p {
    font-size: 14px;
    color: #111111;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-content .degree {
    color: #999999;
}

.edu-content {
    flex: 1;
}

.preview-area {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background-color: #ffffff;
    padding-left: 40px;
    padding-top: 60px;
    overflow: visible;
}

.preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phone-mockup {
    position: relative;
    width: 320px;
    height: 662px; /* Maintains device frame aspect ratio (492:1017) */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.laptop-mockup {
    position: relative;
    width: 440px;
    height: 280px;
}

.device-container {
    position: relative;
    width: 320px;
    height: 662px; /* Matches phone-mockup height */
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-container .preview-content {
    width: 880px;
    height: 560px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.standalone-preview {
    position: relative;
    width: 320px;
    height: 662px; /* Matches phone device frame aspect ratio */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    pointer-events: none;
    background-color: #ffffff;
}

.standalone-preview img {
    width: 800px;
    height: auto;
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Adobe and Kleiner specific sizing */
.standalone-preview img[alt="Adobe Preview"],
.standalone-preview img[alt="Kleiner Preview"] {
    width: 400px;
}

.phone-device,
.laptop-device {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    pointer-events: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.phone-screen {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background-color: #ffffff;
    border-radius: 30px;
    overflow: hidden;
    z-index: 1;
}

.laptop-screen {
    position: absolute;
    top: 28px;
    left: 68px;
    right: 68px;
    bottom: 88px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
}

.preview-content {
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
}


.preview-content img {
    height: 100% !important;
    margin-top: 0;
}

/* Hide broken image states */
.preview-content img:not([src]),
.preview-content img[src=""],
.preview-content img.loading {
    opacity: 0;
}

/* Hide alt text and broken image icon */
.preview-content img::before,
.preview-content img::after {
    display: none;
}

/* Prevent showing alt text */
.preview-content img {
    color: transparent;
    font-size: 0;
}

/* Ensure white background while loading */
.phone-screen,
.laptop-screen {
    background-color: #ffffff;
}

/* Increase phone screen size on mobile to fill gaps */
@media (max-width: 768px) {
    .carousel-item .phone-screen {
        top: 6px;
        left: 6px;
        right: 6px;
        bottom: 6px;
    }
}

.onboarding-preview {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 20px;
}

.onboarding-preview.active {
    display: flex;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 30px;
    color: #111111;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.circle-loader {
    width: 80px;
    height: 80px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    margin-bottom: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-content h2 {
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 400;
    color: #111111;
}

.options {
    width: 100%;
    margin-bottom: 30px;
}

.option {
    background-color: #f5f5f5;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
}

.hint {
    color: #999999;
    font-size: 14px;
    margin-bottom: 20px;
}

.stop-btn {
    background-color: #FF3B30;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.tab-bar {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 20px;
}

.detail-header {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: baseline;
    padding: 10px 0;
    margin: 0;
    width: 100%;
}

.detail-body {
    margin-top: 0;
}

.detail-content {
    font-size: 14px;
    line-height: 1.8;
    color: #111111;
    /* Reset any inherited margins/padding */
    margin: 0;
    padding: 0;
    /* Ensure consistent rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Fixed height to keep navigation arrows in consistent position */
    height: 500px;
    overflow-y: auto;
}

.detail-content p {
    margin: 0 0 16px 0;
}

.detail-content p:first-child {
    margin-top: 0 !important;
}

.detail-content p:last-child {
    margin-bottom: 0;
}

.detail-content ul,
.detail-content ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
    list-style-position: outside;
}

.detail-content ul {
    list-style-type: disc;
}

.detail-content ol {
    list-style-type: decimal;
}

.detail-content ul:last-child,
.detail-content ol:last-child {
    margin-bottom: 0;
}

.detail-content li {
    margin-bottom: 4px;
}

.detail-content strong {
    font-weight: 600;
}

.detail-content em {
    font-style: italic;
}

.detail-content a {
    color: #007aff;
    text-decoration: none;
}

.detail-content a:hover {
    text-decoration: underline;
}

.project-detail h2 {
    font-size: 14px;
    font-weight: 400;
    color: #111111;
    margin: 0;
    line-height: 1.2;
}

.back-link {
    color: #999999;
    text-decoration: none;
    cursor: pointer;
    display: block;
    font-size: 14px;
}

.back-link:hover {
    opacity: 0.7;
}

/* Style back link in profile header */
.profile .title .back-link {
    color: #999999;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.profile .title .back-link:hover {
    opacity: 0.7;
}

/* Detail view navigation */
.detail-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 20px;
}

.detail-nav-btn {
    background: none;
    border: none;
    color: #999999;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.detail-nav-btn:hover:not(:disabled) {
    color: #666666;
}

.detail-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.preview-caption {
    text-align: center;
    color: #999999;
    font-size: 14px;
    margin-top: 20px;
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Remove pointer cursor from header in detail view */
body:has(.project-detail) .profile.resume-item {
    cursor: default;
}

/* Reduce margin-top for standalone previews on desktop */
#desktop-preview:has(.standalone-preview) ~ #preview-caption {
    margin-top: -80px;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 50;
}

.mobile-profile-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: opacity 0.1s ease-in-out;
}

.mobile-header-text {
    text-align: left;
}

.mobile-header h1 {
    font-size: 14px;
    font-weight: 400;
    color: #111111;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header p {
    font-size: 14px;
    color: #999999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.mobile-center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    overflow: visible;
    position: relative;
}

/* Hide carousel on desktop, show on mobile */
.carousel-container {
    display: none;
}

.mobile-content-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    flex-direction: column;
}

.mobile-resume-view {
    display: block;
    padding: 0 30px;
    max-width: 400px;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars but keep functionality */
.mobile-resume-view::-webkit-scrollbar {
    display: none;
}

.mobile-resume-view {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Show mobile resume view in carousel on mobile */
@media (max-width: 768px) {
    .carousel-item .mobile-resume-view {
        display: block;
    }
}

.mobile-resume-view .experience,
.mobile-resume-view .projects,
.mobile-resume-view .education {
    margin-bottom: 20px;
}

.mobile-resume-view .section-header {
    display: grid;
    grid-template-columns: 110px 1fr;
    margin-bottom: 5px;
}

.mobile-resume-view .section-header .date {
    padding-left: 0;
    color: #111111;
}

.resume-item-mobile {
    margin-bottom: 12px;
    cursor: pointer;
    border-radius: 6px;
    padding: 5px;
    margin: 3px -5px 12px -5px;
    -webkit-tap-highlight-color: transparent;
}

.resume-item-mobile:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.mobile-resume-view .timeline {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: baseline;
}

.mobile-resume-view .date {
    font-size: 14px;
    color: #999999;
    white-space: nowrap;
}

.mobile-resume-view .timeline-content {
    padding-left: 0px;
}

.mobile-resume-view .timeline h3 {
    font-size: 14px;
    font-weight: 400;
    color: #111111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-resume-view .timeline-content p {
    font-size: 14px;
    color: #111111;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-resume-view .timeline-content .degree {
    color: #999999;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0;
    flex-shrink: 0;
    /* Floating pill style */
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: max-content;
    background: rgba(255, 255, 255, 0.98);
    padding: 4px 4px;
    border-radius: 40px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-arrow {
    background: none;
    border: none;
    font-size: 20px;
    color: #111111;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:first-child {
    margin-right: 4px;
}

.nav-arrow:active, .nav-home:active {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.nav-home {
    background: none;
    border: none;
    color: #111111;
    cursor: pointer;
    height: 36px;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: width 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    width: 36px;
    opacity: 1;
    transform: scale(1);
    margin: 0 4px;
}

.nav-home.hidden {
    width: 0;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    padding: 0;
    margin: 0;
}

.home-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 0;
        align-items: center;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        background-color: #ffffff;
        position: relative;
    }
    
    .resume {
        display: none;
    }
    
    .preview-area {
        order: 1;
        padding: 0;
        justify-content: flex-start;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        display: flex;
        align-items: stretch;
        overflow: hidden; /* Changed from auto to hidden */
        padding-top: 0;
    }
    
    .preview-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden; /* Changed from auto to hidden */
    }
    
    /* Disable scrolling on home/resume wrapper */
    .carousel-item[data-index="0"] {
        overflow: hidden !important;
    }
    
    .carousel-item[data-index="0"] .preview-wrapper {
        overflow: hidden !important;
        height: auto;
        padding-top: 0;
    }
    
    .phone-mockup {
        width: 220px;
        height: 455px; /* Maintains aspect ratio (220 * 2.07) */
        margin: 0 auto;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .laptop-mockup {
        width: 340px;
        height: 220px;
        margin: 0 auto;
    }
    
    .laptop-mockup .laptop-screen {
        top: 20px;
        left: 46px;
        right: 46px;
        bottom: 62px;
    }
    
    .device-container {
        width: 220px;
        height: 455px; /* Matches mobile phone-mockup height */
        margin: 0 auto;
    }
    
    .device-container .preview-content {
        width: 440px;
        height: 280px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .standalone-preview {
        width: 220px;
        height: 455px; /* Matches mobile phone device frame aspect ratio */
        margin: 0 auto;
    }
    
    .standalone-preview img {
        width: 480px;
    }
    
    /* Scale up Descript preview on mobile by 20% */
    .carousel-item .standalone-preview img[alt="Descript Preview"] {
        width: 576px; /* 480px * 1.2 */
    }
    
    /* Scale up Adobe preview on mobile by 30% */
    .carousel-item .standalone-preview img[alt="Adobe Preview"] {
        width: 312px; /* 240px * 1.3 */
    }
    
    /* Scale up Kleiner preview on mobile by 30% (same as Adobe) */
    .carousel-item .standalone-preview img[alt="Kleiner Preview"] {
        width: 312px; /* 240px * 1.3 */
    }
    
    /* Scale Yale preview to 60% size on mobile (40% smaller) */
    .carousel-item .standalone-preview img[alt="Yale Preview"] {
        width: 288px; /* 480px * 0.6 */
    }
    
    .mobile-nav {
        display: flex;
        margin-bottom: 0; /* Remove bottom margin since it's now fixed */
    }
    
    .mobile-header {
        display: flex;
    }
    
    /* Show carousel on mobile, hide desktop preview */
    .carousel-container {
        display: flex;
        transition: transform 0.3s ease-out;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .carousel-item {
        width: 100vw;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin: 0;
        box-sizing: border-box;
        overflow-y: auto; /* Allow scrolling for carousel items with detail content */
        overflow-x: hidden;
        height: 100vh;
        height: 100dvh;
        isolation: isolate;
        padding-top: 90px; /* Account for fixed header + additional spacing */
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .carousel-item::-webkit-scrollbar {
        display: none;
    }
    
    /* Special styling for home/resume carousel item */
    .carousel-item[data-index="0"] {
        justify-content: center;
        overflow: hidden !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: unset !important;
        padding-top: 0 !important; /* Remove padding for centered home view */
        padding-bottom: 0 !important;
    }
    
    .carousel-item[data-index="0"] .mobile-content-area {
        margin-top: auto;
        margin-bottom: auto;
        width: 100%;
        height: auto;
    }
    
    .carousel-item[data-index="0"] .mobile-resume-view {
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* Prevent any detail content on home carousel */
    .carousel-item[data-index="0"] .mobile-detail-content {
        display: none !important;
    }
    
    #desktop-preview {
        display: none !important;
    }
    
    .mobile-center-content > #preview-caption {
        display: none;
    }
    
    /* Hide "About Me" caption on mobile */
    .carousel-item .preview-caption {
        display: none;
    }
    
    .resume-view {
        max-width: 100%;
    }
    
    /* Hide all resume items on mobile except active one */
    .resume-item {
        display: none;
    }
    
    .resume-item.active {
        display: block;
        background-color: rgba(0, 0, 0, 0.03);
    }
    
    /* Always show section headers */
    .section-header {
        display: grid !important;
    }
}

/* Extra small screens - reduce font sizes */
@media (max-width: 380px) {
    body {
        font-size: 13px;
    }
    
    .mobile-header h1 {
        font-size: 13px;
    }
    
    .mobile-header p {
        font-size: 13px;
    }
    
    .mobile-resume-view .timeline h3 {
        font-size: 13px;
    }
    
    .mobile-resume-view .timeline-content p,
    .mobile-resume-view .date,
    .mobile-resume-view .section-header .date {
        font-size: 13px;
    }
    
    .preview-caption {
        font-size: 13px;
    }
}

/* Mobile detail content */
@media (max-width: 768px) {
    .mobile-detail-content {
        display: block;
        padding: 20px 30px;
        padding-bottom: 96px; /* Extra padding for floating nav + 16px */
        position: relative;
        margin-top: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Override fixed height on mobile */
    .mobile-detail-content .detail-content {
        height: auto;
        overflow-y: visible;
    }
    
    /* Fade out effect at the bottom */
    .mobile-detail-content::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
        pointer-events: none;
    }
}

/* Very small screens - further reduce sizes */
@media (max-width: 320px) {
    body {
        font-size: 12px;
    }
    
    .mobile-header h1 {
        font-size: 12px;
    }
    
    .mobile-header p {
        font-size: 12px;
    }
    
    .mobile-resume-view .timeline h3 {
        font-size: 12px;
    }
    
    .mobile-resume-view .timeline-content p,
    .mobile-resume-view .date,
    .mobile-resume-view .section-header .date {
        font-size: 12px;
    }
    
    .preview-caption {
        font-size: 12px;
    }
    
    /* Reduce grid column for dates on very small screens */
    .mobile-resume-view .timeline,
    .mobile-resume-view .section-header {
        grid-template-columns: 100px 1fr;
    }
}