/* 
 * 松樹ウェブサイト - スタイルシート
 * 完全版（モバイルメニュー、全機能含む）
 */

/* フォント設定 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;300;400;500;700&display=swap');

/* CSS変数定義 */
:root {
    --base-color: #ffffff;
    --main-color: #1a1a1a;
    --accent-color: #666666;
    --light-gray: #f8f8f8;
    --medium-gray: #e0e0e0;
    --dark-gray: #333333;
    --gradient-primary: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    --gradient-secondary: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    --gradient-dark: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 15px 40px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.15);
    --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--main-color);
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 50%, #e8e8e8 100%);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* タイポグラフィ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    letter-spacing: 0.08em;
    line-height: 1.4;
}

/* ローディング画面 */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-content {
    text-align: center;
}

.loader-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
    animation: loaderRotate 4s ease-in-out infinite;
}

@keyframes loaderRotate {
    0%, 100% { transform: rotateX(20deg) rotateY(0deg); }
    50% { transform: rotateX(20deg) rotateY(180deg); }
}

.loader-circle-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    animation: loaderPulse 2s ease-in-out infinite;
}

.loader-circle-inner {
    position: absolute;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: loaderSpin 3s linear infinite reverse;
}

.loader-zen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    background: linear-gradient(180deg, var(--main-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

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

.loader-text {
    font-size: 0.875rem;
    letter-spacing: 0.3em;
    color: var(--accent-color);
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

/* ヘッダー - 追従型 */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

header.scrolled {
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ロゴ */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--main-color);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.logo .zen-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* メインナビゲーション */
nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--main-color);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    position: relative;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border-radius: 25px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.05), -5px -5px 10px rgba(255, 255, 255, 0.8);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 15px rgba(0, 0, 0, 0.08), -8px -8px 15px rgba(255, 255, 255, 0.9);
}

.nav-link.active {
    background: var(--gradient-dark);
    color: white;
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.3), inset -5px -5px 10px rgba(255, 255, 255, 0.1);
}



/* セクション共通 */
section {
    padding: 120px 0;
    position: relative;
}

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

/* セクションタイトル */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title .title-en {
    font-size: 3rem;
    font-weight: 100;
    display: block;
    background: linear-gradient(180deg, var(--main-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.section-title .title-jp {
    font-size: 1rem;
    color: var(--accent-color);
    letter-spacing: 0.3em;
    opacity: 0.7;
}

/* HOMEセクション */
#home {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center top, rgba(255,255,255,0.8) 0%, transparent 60%),
                linear-gradient(180deg, var(--base-color) 0%, var(--light-gray) 100%);
}

/* 3D背景レイヤー */
.hero-3d-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-layer {
    position: absolute;
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
    opacity: 0.3;
}

.layer-1 {
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.8) 0%, transparent 60%);
    animation: layerFloat1 15s ease-in-out infinite;
}

.layer-2 {
    background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 50%);
    animation: layerFloat2 20s ease-in-out infinite;
}

.layer-3 {
    background: radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.4) 0%, transparent 40%);
    animation: layerFloat3 25s ease-in-out infinite;
}

@keyframes layerFloat1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -20px); }
    66% { transform: translate(-20px, 30px); }
}

@keyframes layerFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-40px, 20px); }
}

@keyframes layerFloat3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, 20px); }
    75% { transform: translate(-30px, -10px); }
}

/* 浮遊要素 */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 10%;
    animation: float3D 8s ease-in-out infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 15%;
    animation: float3D 12s ease-in-out infinite reverse;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    animation: float3D 10s ease-in-out infinite;
}

@keyframes float3D {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-20px, -40px); }
    75% { transform: translate(-30px, 20px); }
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    filter: grayscale(100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(255, 255, 255, 0.5) 100%);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-inner {
    padding: 4rem;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 100;
    letter-spacing: 0.3em;
    margin-bottom: 2rem;
    background: linear-gradient(180deg, var(--main-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 3D禅アイコン */
.zen-icon-3d {
    position: relative;
    display: inline-block;
    margin: 2rem 0;
    animation: zenRotate 10s linear infinite;
}

@keyframes zenRotate {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.zen-main {
    font-size: 4rem;
    display: block;
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--main-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.zen-shadow {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 4rem;
    opacity: 0.3;
    filter: blur(3px);
}

.hero-subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.3em;
    color: var(--accent-color);
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.5s;
}

/* スクロールインジケーター */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    cursor: pointer;
}

.scroll-text {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 10px;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

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

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--accent-color) 0%, transparent 100%);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: var(--main-color);
    animation: scrollDown 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes scrollDown {
    0% { transform: translateY(-20px); opacity: 0; }
    40% { opacity: 1; }
    100% { transform: translateY(80px); opacity: 0; }
}

/* ABOUTセクション */
#about {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-image-wrapper {
    perspective: 1000px;
}

.about-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 20px 20px 40px rgba(0,0,0,0.1), -20px -20px 40px rgba(255,255,255,0.9);
    transition: transform 0.6s ease;
}

.about-image:hover {
    transform: rotateY(5deg);
}

.about-image img,
.placeholder-image {
    width: 100%;
    height: auto;
    display: block;
}

.placeholder-image {
    height: 500px;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zen-placeholder {
    font-size: 6rem;
    color: var(--accent-color);
    opacity: 0.3;
}

.image-frame {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    pointer-events: none;
}

.about-text {
    padding: 2rem;
}

.fade-text {
    margin-bottom: 1.5rem;
    line-height: 2;
    position: relative;
    padding-left: 2rem;
}

.fade-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 1rem;
    height: 1px;
    background: var(--accent-color);
}

/* WORKSセクション */
#works {
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.work-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 10px 10px 20px rgba(0,0,0,0.08), -10px -10px 20px rgba(255,255,255,0.9);
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-item:hover {
    transform: translateY(-10px);
    box-shadow: 20px 20px 40px rgba(0,0,0,0.12), -20px -20px 40px rgba(255,255,255,0.95);
}

.work-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-item:hover img {
    transform: scale(1.1);
}

.work-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    color: white;
    padding: 3rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-item:hover .work-overlay {
    transform: translateY(0);
}

.work-title {
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 4rem;
}

.pagination a,
.pagination span {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--main-color);
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 5px 5px 10px rgba(0,0,0,0.08), -5px -5px 10px rgba(255,255,255,0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pagination a:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 15px rgba(0,0,0,0.1), -8px -8px 15px rgba(255,255,255,0.95);
}

.pagination .current {
    background: var(--gradient-dark);
    color: white;
    box-shadow: inset 5px 5px 10px rgba(0,0,0,0.3), inset -5px -5px 10px rgba(255,255,255,0.1);
}

/* CONTACTセクション */
#contact {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    position: relative;
    overflow: hidden;
}

.contact-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.contact-pattern {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(360deg); }
}

.contact-icon-3d {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 4rem;
    animation: iconFloat 4s ease-in-out infinite;
}

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

.icon-main {
    display: inline-block;
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--main-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-shadow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.2;
    filter: blur(3px);
    z-index: -1;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    padding: 3rem;
    border-radius: 25px;
    box-shadow: 20px 20px 40px rgba(0,0,0,0.08), -20px -20px 40px rgba(255,255,255,0.9);
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid var(--medium-gray);
    font-family: inherit;
    background: transparent;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 0;
    color: var(--accent-color);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group input:valid,
.form-group textarea:valid {
    outline: none;
}

.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:valid ~ label,
.form-group.focused label {
    top: -0.5rem;
    font-size: 0.8rem;
    color: var(--main-color);
}

.form-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-dark);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line {
    transform: scaleX(1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.g-recaptcha {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    transform: scale(0.9);
}

.form-submit {
    text-align: center;
}

.submit-button {
    position: relative;
    background: transparent;
    color: var(--main-color);
    border: none;
    padding: 1rem 3rem;
    font-size: 1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    border-radius: 30px;
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.submit-button:hover .button-bg {
    transform: scale(1);
}

.submit-button:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.form-note {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-style: italic;
    opacity: 0.8;
}

/* フッター */
footer {
    background: var(--gradient-dark);
    color: white;
    padding: 4rem 0 2rem;
    text-align: center;
    position: relative;
}

.footer-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.social-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
}

.social-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.social-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--main-color));
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: 1;
}

.social-link:hover .social-bg {
    transform: translate(-50%, -50%) scale(1.2);
}

.social-link:hover {
    transform: translateY(-5px);
}

.social-link img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.copyright {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
}

.modal-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    padding-bottom: 100px;
    box-sizing: border-box;
}

.modal-content img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    margin: 0 auto;
    display: block;
    transition: opacity 0.3s ease;
}

@media (min-aspect-ratio: 1/1) {
    .modal-content img {
        width: 100%;
    }
}

.modal-info {
    margin-top: 2rem;
    text-align: center;
}

.modal-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.modal-back-btn {
    background: #c9c9c9;
    color: #333333;
    border: none;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-back-btn:hover {
    background: #b5b5b5;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(255,255,255,0.2);
}

.modal.show {
    opacity: 1;
}

.modal.show .modal-content img {
    animation: modalImageFadeIn 0.5s ease forwards;
}

@media (min-width: 1200px) {
    .modal-content {
        padding: 3rem;
    }
    
    .modal-content img {
        max-width: calc(100vw - 6rem);
        max-height: calc(100vh - 250px);
    }
}

@media (orientation: landscape) and (max-height: 768px) {
    .modal-content {
        padding: 1rem;
    }
    
    .modal-content img {
        max-height: calc(100vh - 100px);
    }
    
    .modal-info {
        margin-top: 1rem;
    }
}

.modal::-webkit-scrollbar {
    width: 10px;
}

.modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes modalImageFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* フォントスムージング */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* スクロール時のアニメーション無効化 */
body.is-scrolling * {
    animation-play-state: paused !important;
    transition: none !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    /* ヘッダー */
    header {
        height: 60px;
    }
    
    header.scrolled {
        height: 60px;
    }
    
    .header-container {
        padding: 0 1rem;
    }
    
    /* ナビゲーション - モバイルでも表示 */
    nav ul {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
    
    /* ヒーロー */
    .hero-title {
        font-size: 2.5rem;
        letter-spacing: 0.1em;
    }
    
    .hero-inner {
        padding: 2rem;
    }
    
    .floating-circle {
        display: none;
    }
    
    /* アバウト */
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* 作品 */
    .works-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* フォーム */
    .contact-form {
        padding: 2rem;
    }
    
    /* タイトル */
    .section-title .title-en {
        font-size: 2.5rem;
    }
    
    /* モーダル - モバイル対応 */
    .modal-content {
        padding: 1rem;
        padding-bottom: 80px;
    }
    
    .modal-content img {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 150px);
    }
    
    .modal-info {
        margin-top: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-back-btn {
        padding: 0.6rem 2rem;
        font-size: 0.9rem;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 80px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title .title-en {
        font-size: 2rem;
    }
    
    .social-links {
        gap: 1.5rem;
    }
    
    /* ナビゲーション */
    nav ul {
        gap: 0.3rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .modal-content {
        padding: 0.5rem;
        padding-bottom: 60px;
    }
    
    .modal-content img {
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 120px);
        width: 100%;
    }
    
    .modal-back-btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.85rem;
    }
}