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

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #fff;
    color: #000;
    overflow-x: hidden;
    scroll-behavior: smooth;
    line-height: 1.4;
    font-weight: 300;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* ヒーローセクション */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    position: relative;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.logo {
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    font-weight: 400;
}

.menu {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    position: relative;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 1rem;
    min-width: 200px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

.menu-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.menu-dropdown a {
    display: block;
    color: #000;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.menu-dropdown a:last-child {
    border-bottom: none;
}

.menu-dropdown a:hover {
    padding-left: 0.5rem;
    border-color: #000;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 100;
    letter-spacing: -0.02em;
    line-height: 0.9;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.hero-subtitle {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid #000;
    padding-top: 2rem;
}

.hero-subtitle p {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-year {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 40px;
    background: #000;
    animation: scroll 2s infinite;
}

/* メインコンテナ制限 */
main, #main, .main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* セクション共通スタイル */
section {
    padding: 100px 2rem;
    margin: 0 auto;
    width: calc(100% - 4rem);
    max-width: min(1200px, calc(100vw - 4rem));
    box-sizing: content-box;
    overflow-x: hidden;
}

section:not(.hero) {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease;
}

section:not(.hero).visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    margin-bottom: 4rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #000;
}

/* Worksセクション */
#works {
    width: 100%;
    /* max-width: 100%; */ /* Removed to inherit parent's max-width */
    overflow: hidden;
    box-sizing: border-box;
}

.works-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.work-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem 0;
    border-bottom: 1px solid #e0e0e0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.work-item:first-child {
    padding-top: 0;
}

.work-item:last-child {
    border-bottom: none;
}

.work-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.work-item:nth-child(even) {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.work-item:nth-child(even) > * {
    direction: ltr;
}

.work-image {
    width: 100%;
    max-width: 100%;
    height: 400px;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #999;
    transition: all 0.5s ease;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.work-item:hover .work-image {
    background: #000;
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.work-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.5s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    border-radius: 12px;
    padding: 20px;
}

.work-item:hover .work-image img {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

.work-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.work-number {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: #999;
}

.work-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.work-info p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    font-weight: 300;
}

.work-tags {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tag {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #000;
}

.app-store-link {
    display: inline-block;
    line-height: 0;
    padding: 0;
    font-size: 0;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    align-self: flex-start;
}

.app-store-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.app-store-icon {
    width: 120px;
    height: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.app-store-link:hover .app-store-icon {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15)) brightness(1.05);
}

/* Aboutセクション */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: start;
}

.about-image {
    width: 100%;
    height: 500px;
    background: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #999;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.about-image:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.logo-image {
    width: 80%;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.about-image:hover .logo-image {
    transform: scale(1.02);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.about-text h3 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 200;
    line-height: 1.2;
}

.about-text p {
    color: #333;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* Skillsセクション */
.skills-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.skill-item {
    padding: 3rem 0;
    border-top: 1px solid #000;
    transition: all 0.3s ease;
}

.skill-item:hover {
    padding-left: 1rem;
}

.skill-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: -0.01em;
}

.skill-level {
    color: #999;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Contactセクション */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 200;
    line-height: 1.2;
}

.contact-info p {
    color: #333;
    line-height: 1.8;
    margin-bottom: 3rem;
    font-weight: 300;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-links a {
    color: #000;
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-links a::after {
    content: '→';
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.contact-links a:hover {
    padding-left: 1rem;
    border-color: #000;
}

.contact-links a:hover::after {
    transform: translateX(5px);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    font-size: 0.9rem;
}

.contact-label {
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

/* プライバシーポリシー */
.privacy-policy {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 2rem;
}

.policy-content h3 {
    margin: 25px 0 15px;
    color: #000;
    font-size: 1.5rem;
    font-weight: 300;
}

.policy-content p, .policy-content ul {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #333;
}

.policy-content ul {
    padding-left: 20px;
}

.policy-updated {
    margin-top: 40px;
    font-style: italic;
    color: #999;
    font-size: 0.9rem;
}

/* フッター */
.footer {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #999;
}

/* アニメーション */
@keyframes scroll {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    section {
        padding: 80px 1rem;
        max-width: 100vw;
        width: 100%;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .work-item,
    .work-item:nth-child(even) {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 2rem;
        width: 100%;
        max-width: 100%;
    }
    
    .works-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-links {
        margin-bottom: 3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .hero-header {
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        margin-bottom: 2rem;
    }
    
    .work-item {
        padding: 2rem 0;
    }
    
    .work-image {
        height: 250px;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
}

/* すべての要素に対する幅制限 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}
