/* Instagram-inspired Portfolio Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Instagram-style Profile Section */
.profile-section {
    max-width: 935px;
    margin: 0 auto 60px;
    padding: 40px 20px;
    border-bottom: 1px solid #262626;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    gap: 60px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4);
    padding: 3px;
    position: relative;
    flex-shrink: 0;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: #000000;
    border-radius: 50%;
}

.profile-avatar-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    z-index: 1;
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-size: 1.75rem;
    font-weight: 300;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #8e8e8e;
}

.profile-bio {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 25px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-number {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 0.875rem;
    color: #8e8e8e;
}

.profile-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #8e8e8e;
}

/* Main content */
.main {
    padding: 40px 0;
}

.section {
    margin-bottom: 120px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: 60px;
    text-align: center;
    letter-spacing: -0.02em;
    opacity: 0.9;
}

/* Instagram-style Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 935px;
    margin: 0 auto;
    padding: 0 20px;
}

.post-item {
    position: relative;
    aspect-ratio: 1;
    background: #121212;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-item:hover {
    transform: scale(1.01);
}

.post-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    z-index: 5;
}

.post-item:hover .post-item-overlay {
    opacity: 1;
}

.post-item-content {
    text-align: center;
    color: #ffffff;
    z-index: 2;
    position: relative;
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.post-project-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.post-project-type {
    font-size: 0.875rem;
    color: #b3b3b3;
    margin-bottom: 16px;
}

.post-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 12px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.post-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.post-link svg {
    width: 20px;
    height: 20px;
}

/* Instagram-style Post Image */
.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #121212, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #262626;
    font-weight: 700;
}

/* Stories-style navigation */
.stories-container {
    max-width: 935px;
    margin: 0 auto 40px;
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stories-wrapper {
    display: flex;
    gap: 24px;
    min-width: max-content;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4);
    padding: 2px;
    margin-bottom: 8px;
}

.story-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

.story-label {
    font-size: 0.75rem;
    color: #8e8e8e;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Instagram-style section headers */
.section-header {
    max-width: 935px;
    margin: 0 auto 20px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.view-options {
    display: flex;
    gap: 16px;
}

.view-option {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #8e8e8e;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.view-option:hover,
.view-option.active {
    color: #ffffff;
}

.view-option svg {
    width: 100%;
    height: 100%;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Responsive design - Instagram-style mobile layout */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        margin-bottom: 20px;
    }

    .profile-avatar {
        width: 77px;
        height: 77px;
        margin: 0 auto;
    }

    .profile-avatar-inner {
        font-size: 1.5rem;
    }

    .profile-username {
        font-size: 1.25rem;
        justify-content: center;
    }

    .profile-stats {
        justify-content: center;
        gap: 30px;
        margin-bottom: 20px;
    }

    .profile-stat {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-name {
        font-size: 0.875rem;
        margin-bottom: 10px;
    }

    .profile-description {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* ストーリーズをモバイル用に調整 */
    .stories-container {
        padding: 16px 0;
        margin-bottom: 20px;
    }

    .stories-wrapper {
        gap: 16px;
    }

    .story-avatar {
        width: 56px;
        height: 56px;
    }

    .story-label {
        font-size: 0.6875rem;
        max-width: 56px;
    }

    /* 投稿グリッドをInstagram風に */
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        padding: 0;
    }

    .section-header {
        padding: 0 16px;
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 0.875rem;
    }

    .view-options {
        gap: 12px;
    }

    .view-option {
        width: 20px;
        height: 20px;
        padding: 2px;
    }

    /* ポストリンクボタンをモバイルで見やすく */
    .post-link {
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.25);
    }

    .post-link svg {
        width: 18px;
        height: 18px;
    }

    .post-project-name {
        font-size: 1rem;
    }

    .post-project-type {
        font-size: 0.8125rem;
    }
}

    .view-option {
        width: 20px;
        height: 20px;
        padding: 2px;
    }
}

@media (max-width: 480px) {
    .profile-section {
        padding: 30px 16px;
    }

    .profile-avatar {
        width: 77px;
        height: 77px;
    }

    .profile-avatar-inner {
        font-size: 1.5rem;
    }

    .profile-username {
        font-size: 1.125rem;
    }

    .profile-stats {
        gap: 25px;
    }

    .posts-grid {
        gap: 2px;
    }

    .story-avatar {
        width: 48px;
        height: 48px;
    }

    .story-label {
        font-size: 0.625rem;
        max-width: 48px;
    }

    .container {
        padding: 0;
    }

    .main {
        padding: 0;
    }
}

/* Animation on scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth transitions for all interactive elements */
a, button, .post-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
a:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}