:root {
    --bg-color: #ffffff;
    --text-color: #0a0a0a;
    --text-light: #666666;
    --text-lighter: #999999;
    --border-color: #e0e0e0;
    --nav-height: 80px;
    
    --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-base);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s var(--ease);
}

a:hover {
    opacity: 0.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: all 0.3s var(--ease);
}

.main-nav.scrolled {
    border-bottom-color: var(--border-color);
}

.nav-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 60px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 50px;
}

.nav-link {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-color);
}

.back-link {
    font-size: 14px;
    color: var(--text-light);
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--nav-height) 60px 120px;
}

/* Hero */
.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 0;
}

.hero-title {
    margin-bottom: 30px;
}

.name-en {
    display: block;
    font-size: clamp(56px, 10vw, 120px);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 20px;
}

.name-ja {
    display: block;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--text-light);
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.hero-affiliation {
    font-size: 14px;
    color: var(--text-lighter);
    font-weight: 300;
}

/* About */
.section-about {
    max-width: 900px;
    margin: 0 auto 180px;
    padding: 60px 0;
}

.about-content {
    padding: 0;
}

.about-main {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 60px;
    color: var(--text-color);
}

.skills-section {
    margin: 60px 0;
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.skills-section h3 {
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    display: inline-block;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: default;
}

/* Featured Section */
.section-featured {
    margin-bottom: 180px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 80px;
}

.featured-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease);
}

.featured-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.featured-link {
    display: block;
}

.featured-image {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 25px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.featured-link:hover .featured-image img {
    transform: scale(1.03);
}

.featured-info {
    padding: 0;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.featured-type {
    font-weight: 400;
}

.featured-year {
    font-weight: 400;
}

.featured-title {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 15px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.featured-description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-light);
}

/* Projects */
.section-projects {
    margin-bottom: 180px;
}

.projects-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 15px;
}

.projects-intro {
    font-size: 14px;
    color: var(--text-light);
}

.project-filter {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 80px;
}

.filter-btn {
    padding: 0;
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    letter-spacing: 0.02em;
    font-family: var(--font-base);
}

.filter-btn:hover {
    color: var(--text-color);
}

.filter-btn.active {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 60px 40px;
}

.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-link {
    display: block;
}

.project-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 20px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.project-link:hover .project-image img {
    transform: scale(1.03);
}

.project-info {
    padding: 0;
}

.project-title {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 10px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

.project-type {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.separator {
    opacity: 0.5;
}

/* Contact */
.section-contact {
    max-width: 900px;
    margin: 0 auto 120px;
    padding: 80px 0;
    text-align: center;
}

.section-contact .section-title {
    margin-bottom: 60px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.contact-link {
    font-size: 16px;
    color: var(--text-color);
    font-weight: 400;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 50px 60px;
    text-align: center;
    color: var(--text-lighter);
    font-size: 12px;
    font-weight: 300;
}

/* Project Detail */
.project-detail-container {
    max-width: 1200px;
    padding-top: calc(var(--nav-height) + 80px);
}

.project-detail {
    margin-bottom: 120px;
}

.detail-header {
    margin-bottom: 80px;
}

.detail-title {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
    line-height: 1.2;
}

.detail-meta-wrapper {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-label {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-value {
    font-size: 15px;
    color: var(--text-color);
    font-weight: 400;
}

.detail-image-container {
    margin-bottom: 80px;
}

.detail-main-image {
    width: 100%;
    height: auto;
}

.detail-content {
    max-width: 800px;
    margin: 0 auto 80px;
    line-height: 2;
}

.detail-content p {
    margin-bottom: 30px;
    font-size: 16px;
    color: var(--text-color);
}

.detail-navigation {
    text-align: center;
    margin-top: 100px;
}

.btn-back {
    display: inline-block;
    padding: 15px 40px;
    background: var(--text-color);
    color: var(--bg-color);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: all 0.2s var(--ease);
}

.btn-back:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1200px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 70px;
    }
    
    .nav-inner,
    .container,
    .site-footer {
        padding-left: 30px;
        padding-right: 30px;
    }
    
    .nav-links {
        gap: 30px;
    }
    
    .hero {
        min-height: 70vh;
        padding: 80px 0;
    }
    
    .section-about,
    .section-featured,
    .section-projects,
    .section-contact {
        margin-bottom: 120px;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .project-filter {
        gap: 20px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .skills-section {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .nav-inner,
    .container,
    .site-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 13px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .section-about,
    .section-featured,
    .section-projects {
        margin-bottom: 100px;
    }
    
    .featured-grid,
    .project-grid {
        gap: 40px;
    }
}

/* Gallery Grid System */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    transition: opacity 0.2s;
}

.gallery-item img:hover {
    opacity: 0.9;
}

/* キャプション（説明文）用 */
.gallery-caption {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 薄いグレーのノイズ画像（データURI） */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.4; /* 薄く乗せる */
    pointer-events: none;
    z-index: -1; /* コンテンツの後ろに配置 */
}

/* 2. テキスト選択色をカスタマイズ（これだけで洗練されて見えます） */
::selection {
    background: #0a0a0a;
    color: #ffffff;
}

/* 3. プロジェクトカードのホバー演出強化 */
.project-card, .featured-card {
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.6s var(--ease);
}

/* 浮き上がり + 影をつけて「物」としての質感を出す */
.project-card:hover, .featured-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* 画像自体の拡大部分は少し控えめに */
.featured-link:hover .featured-image img,
.project-link:hover .project-image img {
    transform: scale(1.02); /* 1.03から少し控えめに */
}

/* 4. ボタンのクリック感 */
.filter-btn {
    position: relative;
    padding-bottom: 2px;
}

/* アクティブなボタンに下線アニメーション */
.filter-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--text-color);
    transition: width 0.3s var(--ease);
}

.filter-btn:hover::after,
.filter-btn.active::after {
    width: 100%;
}

/* 既存のボーダー指定を打ち消し */
.filter-btn, .filter-btn.active {
    border-bottom: 1px solid transparent; 
}

/* 5. フッターのタイピングカーソル用 */
.cursor-blink {
    display: inline-block;
    width: 8px;
    height: 12px;
    background-color: var(--text-color);
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

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