/* ========================================
   Yumeno Mei Portfolio Site - Refined Version
   ======================================== */

:root {
    --color-bg: #FAFAF8;
    --color-main: #8B7E74;
    --color-text: #3E3E3E;
    --color-heading: #2A2A2A;
    --color-white: #FFFFFF;
    --color-overlay: rgba(139, 126, 116, 0.75);
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;
    --font-family: 'Noto Serif JP', serif;
    --transition: 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height-large: 100px;
    --header-height-small: 70px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Loading Screen
   ======================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

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

.loading-text {
    font-size: 1.5rem;
    color: var(--color-heading);
    margin-bottom: 2rem;
    letter-spacing: 0.3em;
}

.dots {
    animation: blink 1.5s infinite;
}

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

.loading-face {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    opacity: 0.6;
    animation: rotate 2s linear infinite;
    border-radius: 50%;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   Header
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-main);
    z-index: 1000;
    transition: all var(--transition);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height-large);
    transition: height var(--transition);
}

.header.scrolled {
    background-color: rgba(139, 126, 116, 0.9);
    backdrop-filter: blur(10px);
}

.header.scrolled .header-inner {
    height: var(--header-height-small);
}

.logo-image {
    height: 60px;
    transition: height var(--transition);
}

.header.scrolled .logo-image {
    height: 40px;
}

.nav-list {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--color-white);
    padding: 0.5rem 0;
    position: relative;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header.scrolled .nav-link {
    font-size: 0.85rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-white);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--color-white);
    transition: all 0.3s ease;
}

/* ========================================
   Main Content
   ======================================== */
.main {
    margin-top: var(--header-height-large);
}

.section {
    padding: var(--spacing-xxl) 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-heading);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    letter-spacing: 0.2em;
}

/* ========================================
   TOP Section
   ======================================== */
.section-top {
    min-height: calc(100vh - var(--header-height-large));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    position: relative;
}

.top-layout {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.top-overlay-box {
    background-color: var(--color-overlay);
    padding: var(--spacing-xl);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
}

.top-logo {
    max-width: 400px;
    width: 100%;
}

.top-buttons {
    display: flex;
    gap: var(--spacing-md);
}

.top-btn {
    padding: 0.8rem 2rem;
    background-color: var(--color-white);
    color: var(--color-main);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
}

.top-btn:hover {
    background-color: var(--color-main);
    color: var(--color-white);
    transform: translateY(-2px);
}

.top-photo-wrapper {
    position: relative;
}

.top-photo {
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--color-text);
    font-size: 0.875rem;
    letter-spacing: 0.2em;
    animation: bounce 2s infinite;
}

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

.scroll-arrow {
    width: 1px;
    height: 30px;
    background-color: var(--color-text);
    margin: 0.5rem auto 0;
}

/* ========================================
   NEWS Section
   ======================================== */
.section-news {
    background-color: var(--color-white);
}

.news-content {
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid #E3E0DF;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-item:hover {
    background-color: #FAFAF8;
    transform: translateX(5px);
}

.news-date {
    flex-shrink: 0;
    color: var(--color-main);
    font-weight: 600;
}

.news-title {
    flex-grow: 1;
}

/* Decorative Boxes */
.deco-box {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: rgba(139, 126, 116, 0.1);
    z-index: -1;
    opacity: 0;
    transition: all 1s ease;
}

.deco-box.visible {
    opacity: 1;
}

.deco-left {
    left: -100px;
    top: 50%;
    transform: translateY(-50%) translateX(-50px);
}

.deco-left.visible {
    transform: translateY(-50%) translateX(0);
}

.deco-right {
    right: -100px;
    top: 50%;
    transform: translateY(-50%) translateX(50px);
}

.deco-right.visible {
    transform: translateY(-50%) translateX(0);
}

/* ========================================
   PROFILE Section
   ======================================== */
.profile-content {
    max-width: 800px;
    margin: 0 auto;
}

.profile-text {
    font-size: 1.125rem;
    line-height: 2;
    margin-bottom: var(--spacing-lg);
}

.history-details {
    border: 1px solid #E3E0DF;
    border-radius: 8px;
    overflow: hidden;
    margin-top: var(--spacing-lg);
}

.history-summary {
    padding: var(--spacing-md);
    background-color: #E3E0DF;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    transition: background-color 0.3s ease;
}

.history-summary:hover {
    background-color: #D0CCC8;
}

.history-content {
    padding: var(--spacing-md);
}

.history-year {
    margin-bottom: var(--spacing-lg);
}

.year {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--color-main);
    display: inline-block;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-list li {
    display: flex;
    gap: var(--spacing-md);
}

.month {
    flex-shrink: 0;
    width: 2rem;
    font-weight: 600;
    color: var(--color-main);
}

/* ========================================
   VOICE Section
   ======================================== */

/* ========================================
   VOICE Timestamps (タイムスタンプ用デザイン)
   ======================================== */
.timestamp-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 2rem auto 0;
}

.timestamp-btn {
    padding: 1rem;
    background-color: var(--color-white);
    border: 1px solid #E3E0DF;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.timestamp-btn:hover {
    background-color: #FAFAF8;
    border-color: var(--color-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.time-num {
    color: var(--color-main);
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 45px;
}

.time-label {
    color: var(--color-heading);
    font-weight: 500;
    font-size: 0.95rem;
}

/* スマホ表示時の微調整 */
@media screen and (max-width: 658px) {
    .timestamp-list {
        grid-template-columns: 1fr; /* スマホでは縦1列に並べる */
        gap: 10px;
        margin-top: 1.5rem;
    }
    .timestamp-btn {
        padding: 0.8rem;
    }
}

.voice-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.coming-soon {
    padding: var(--spacing-xl);
    background-color: #E3E0DF;
    border-radius: 8px;
}

.coming-soon-text {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-heading);
    letter-spacing: 0.15em;
    margin-bottom: var(--spacing-sm);
}

.coming-soon-date {
    font-size: 1rem;
    color: var(--color-text);
}

/* ========================================
   PHOTO Section
   ======================================== */
.section-photo {
    background-color: var(--color-white);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    max-width: 1000px;
    margin: 0 auto;
}

.photo-card {
    background-color: #E3E0DF;
    border-radius: 8px;
    overflow: hidden;
    padding: var(--spacing-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.photo-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.photo-card img {
    width: 100%;
    border-radius: 4px;
}

/* ========================================
   LINKS Section
   ======================================== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    max-width: 900px;
    margin: 0 auto;
}

.link-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid #E3E0DF;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--color-main);
}

.link-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-main);
}

.link-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-heading);
}

.link-handle {
    font-size: 0.875rem;
    color: var(--color-text);
}

/* ========================================
   CONTACT Section
   ======================================== */
.section-contact {
    background-color: var(--color-white);
}

.contact-intro {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: var(--color-heading);
    color: var(--color-bg);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--color-main);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    position: relative;
    background-color: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-date {
    color: var(--color-main);
    margin-bottom: 1rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
}

/* ========================================
   Animations
   ======================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition), transform var(--transition);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-main);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6d6157;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .top-layout {
        grid-template-columns: 1fr;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        position: fixed;
        top: var(--header-height-large);
        left: 0;
        right: 0;
        background-color: rgba(139, 126, 116, 0.98);
        padding: var(--spacing-md);
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .nav.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-list {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .back-to-top {
        left: auto;
        right: 2rem;
        bottom: 2rem;
    }
}

/* =========================================
   iPhone (横幅 658px以下) 向けの特別設定
   ========================================= */
@media screen and (max-width: 658px) {

    /* --- 1. 基本設定 --- */
    body {
        font-size: 14px;
    }
    img {
        max-width: 100%;
        height: auto;
    }

    /* --- 2. TOPページ レイアウト --- */
    .top-layout {
        display: flex !important;           
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    .section-top {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* OverlayBox（文字とロゴの箱） */
    .top-overlay-box {
        order: 1 !important;
        
        /* ★修正：幅を100%に戻しました */
        width: 100% !important;
        margin: 0 !important;
        
        /* デザイン調整 */
        border-radius: 0 !important;
        background: rgba(139, 126, 116, 0.85) !important; 
        padding: 0 1rem 3rem 1rem !important; 
    }

    /* Topロゴの位置調整（維持） */
    .top-logo {
        width: 50% !important;
        max-width: 200px !important;
        
        /* 上に余白、下に少し余白 */
        margin-top: 5rem !important;
        margin-bottom: 1rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        
        display: block !important;
    }

    .top-buttons {
        margin-top: 0 !important;
    }

    .top-photo-wrapper {
        order: 2 !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .top-photo {
        border-radius: 0 !important;
        box-shadow: none !important;
        display: block !important;
        width: 100% !important;
    }

    /* --- 3. ヘッダー設定（修正：高さ固定） --- */
    
    .header {
        background-color: #8B7E74 !important; 
        backdrop-filter: none !important;
    }

    /* ヘッダーロゴのアニメーション設定（維持） */
    .logo-image {
        display: block !important;       
        height: 25px !important;         
        
        /* 初期状態：透明にして隠す */
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px);    
        transition: all 0.5s ease !important;
    }

    /* スクロールした時だけ表示（維持） */
    .header.scrolled .logo-image {
        opacity: 1 !important;           
        visibility: visible !important;  
        transform: translateY(0);        
    }

    /* ★修正：ヘッダーの高さを最初から「40px」に固定 */
    .header-inner {
        height: 40px !important;
        padding: 0 15px !important;
    }
    
    /* ★修正：スクロールしても高さは「40px」のまま（変化させない） */
    .header.scrolled .header-inner {
        height: 40px !important;
    }

    /* メインコンテンツの位置調整 */
    .main {
        margin-top: 40px !important; /* ヘッダーの高さに合わせる */
    }

    /* --- 4. メニューバー --- */
    .menu-toggle {
        display: flex !important;
        transform: scale(0.9);
        margin-left: auto;
    }

    .nav {
        position: fixed;
        top: 40px !important; /* ヘッダーの高さ(40px)に合わせる */
        right: 0;
        width: 70%;
        height: calc(100vh - 40px);
        background-color: rgba(139, 126, 116, 0.98);
        padding: 2rem;
        transform: translateX(100%);
        opacity: 0;
        transition: all 0.4s ease;
        display: block !important;
    }
    
    .nav.active {
        transform: translateX(0);
        opacity: 1;
    }

    .nav-list {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
    }
    
    .nav-link {
        font-size: 1.1rem !important;
    }
}

/* PC・iPad版：VOICE欄のYouTubeプレイヤーのサイズをMOVIE欄と揃える */
@media screen and (min-width: 659px) {
    .section-voice .youtube-wrapper {
        max-width: 600px;
        margin: 0 auto 2rem; /* 中央揃えにして、下のボタンとの間隔をあける */
    }
}

/* =========================================
   YouTubeの設定（スマホ対応）
   ========================================= */
.youtube-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9の比率を維持 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* 少し影をつける */
}

.youtube-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* =========================================
   アニメーション定義（キーフレーム）
   ========================================= */

/* 下からふわっと（Box用） */
@keyframes fadeInUpBox {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* その場でふわっと（ロゴ・ボタン用） */
@keyframes fadeInSimple {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* =========================================
   アニメーション定義（共通）
   ========================================= */
/* 下からふわっと（Box用） */
@keyframes fadeInUpBox {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* その場でふわっと（ロゴ・ボタン用） */
@keyframes fadeInSimple {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* =========================================
   PC・iPad (横幅 659px以上) アニメーション設定
   ========================================= */
@media screen and (min-width: 659px) {

    /* --- サイズ・位置調整 --- */
    .section-movie .container {
        max-width: 600px !important;
        margin: 0 auto;
    }

    .top-logo {
        max-width: 260px; /* ロゴサイズ縮小 (確認済み) */
        width: 100%;
        margin-top: 50px; 
        opacity: 0; /* 最初は隠す */
    }
    
    .logo-image {
        height: 40px; /* ヘッダーロゴ縮小 (確認済み) */
    }

    .top-overlay-box {
        opacity: 0; /* 最初は隠す */
    }
    
    .top-buttons .top-btn {
        opacity: 0; /* 最初は隠す */
    }

    /* --- アニメーション実行（スイッチが入ったら開始） --- */
    
    /* 1. Box: 1.2秒かけて出現 */
    .start-animations .top-overlay-box {
        animation: fadeInUpBox 1.2s ease forwards;
    }

    /* 2. Logo: 1.2秒待機 → 0.7秒かけて出現 */
    .start-animations .top-logo {
        animation: fadeInSimple 0.7s ease 1.2s forwards;
    }

    /* 3. Voiceボタン: 1.9秒待機 → 0.7秒かけて出現 */
    .start-animations .top-buttons .top-btn:nth-of-type(1) {
        animation: fadeInSimple 0.7s ease 1.9s forwards;
    }

    /* 4. Contactボタン: 2.6秒待機 → 0.7秒かけて出現 */
    .start-animations .top-buttons .top-btn:nth-of-type(2) {
        animation: fadeInSimple 0.7s ease 2.6s forwards;
    }
}

/* =========================================
   iPhone (横幅 658px以下) 設定（レイアウト＆アニメーション）
   ========================================= */
@media screen and (max-width: 658px) {

    /* --- 1. 基本設定 --- */
    body {
        font-size: 14px;
        overflow-x: hidden; /* 横スクロール防止 */
    }
    img {
        max-width: 100%;
        height: auto;
    }

    /* --- 2. TOPページ レイアウト --- */
    .top-layout {
        display: flex !important;           
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    .section-top {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* OverlayBox（文字とロゴの箱） */
    .top-overlay-box {
        order: 1 !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        background: rgba(139, 126, 116, 0.85) !important; 
        padding: 0 1rem 3rem 1rem !important; 
        
        opacity: 1 !important; 
        animation: none !important;
    }

    /* Topロゴの位置調整 */
    .top-logo {
        width: 50% !important;
        max-width: 200px !important;
        margin-top: 5rem !important;
        margin-bottom: 1rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
        opacity: 0; 
    }

    .top-buttons {
        margin-top: 0 !important;
    }
    
    .top-buttons .top-btn {
        opacity: 0;
    }

    .top-photo-wrapper {
        order: 2 !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .top-photo {
        border-radius: 0 !important;
        box-shadow: none !important;
        display: block !important;
        width: 100% !important;
    }

    /* --- 3. ヘッダー設定 --- */
    .header {
        background-color: #8B7E74 !important; 
        backdrop-filter: none !important;
    }

    .logo-image {
        display: block !important;       
        height: 25px !important;         
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px);    
        transition: all 0.5s ease !important;
    }

    .header.scrolled .logo-image {
        opacity: 1 !important;           
        visibility: visible !important;  
        transform: translateY(0);        
    }

    .header-inner {
        height: 40px !important;
        padding: 0 15px !important;
    }
    .header.scrolled .header-inner {
        height: 40px !important;
    }

    .main {
        margin-top: 40px !important;
    }

    /* --- 4. メニューバー（右寄せ・完全修正版） --- */
    .menu-toggle {
        display: flex !important;
        transform: scale(0.9);
        margin-left: auto; /* ボタンを右端に */
        z-index: 1001;
    }

    .nav {
        position: fixed;
        top: 40px !important;
        
        /* ★重要：iPad設定(left:0)を解除し、右に配置 */
        left: auto !important; 
        right: 0 !important;   
        
        width: 60% !important; /* 幅を少し狭めてスタイリッシュに */
        height: calc(100vh - 40px);
        background-color: rgba(139, 126, 116, 0.98);
        padding: 2rem 1rem 2rem 2rem;
        
        /* 初期状態：画面の右外へ隠す */
        transform: translateX(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important; /* 閉じてる時は消す */
        
        transition: all 0.4s ease;
        display: block !important;
    }
    
    .nav.active {
        /* 開いた時 */
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .nav-list {
        display: flex !important;
        flex-direction: column !important;
        
        /* ★重要：文字を右寄せにする */
        align-items: flex-end !important; 
        text-align: right !important;
        
        gap: 1.5rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .nav-list li {
        width: 100%;
        display: flex;
        justify-content: flex-end; /* 右寄せ */
    }
    
    .nav-link {
        font-size: 1.1rem !important;
        display: inline-block;
    }
    
    /* 下線アニメーション調整 */
    .nav-link::after {
        left: auto !important;
        right: 0 !important;
    }

    /* --- 5. アニメーション実行 --- */
    .start-animations .top-logo {
        animation: fadeInSimple 1.2s ease forwards !important;
    }
    .start-animations .top-buttons .top-btn:nth-of-type(1) {
        animation: fadeInSimple 0.7s ease 1.2s forwards !important;
    }
    .start-animations .top-buttons .top-btn:nth-of-type(2) {
        animation: fadeInSimple 0.7s ease 1.9s forwards !important;
    }
}

/* =========================================
   スマホ版：プロフィール文字サイズの調整
   ========================================= */
@media screen and (max-width: 658px) {
    /* プロフィール本文をNEWS見出しと同じサイズに縮小 */
    .profile-text {
        font-size: 1rem !important; 
        line-height: 1.8 !important;
        /* ↓ ここに追加（略歴部分を両端揃えにする） ↓ */
    }
    /* 「夢望めい -Yumeno Mei」の強調部分もスマホに合わせて縮小 */
    .profile-text p[style] {
        font-size: 1.15rem !important;
        margin-bottom: 0.5rem !important;
        /* ↓ ここに追加（名前部分は左揃えのままにする） ↓ */
    }
}