@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Yusei+Magic&display=swap');

:root {
    --primary: #ff4757;
    --bg-dark: #1e272e;
    --bg-card: #2f3542;
    --text-main: #f1f2f6;
    --sticky-yellow: #fff200;
    --sticky-pink: #ff9ff3;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.site-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.site-header h1 a {
    color: var(--primary);
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}

.site-header h1 a:hover {
    color: #ff6b81;
}

/* Grid Layout (Top Page) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: start;
    gap: 3rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-item {
    background: #fff;
    padding: 15px 15px 110px 15px; /* ポラロイド風の余白 (下部を80pxから110pxに拡大) */
    border-radius: 2px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

/* トップページのセロテープ */
.grid-item::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    width: 100px;
    height: 35px;
    background: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.8) 30%, rgba(255,255,255,0.2));
    box-shadow: 0 2px 5px rgba(0,0,0,0.1), inset 0 0 10px rgba(255,255,255,0.5);
    border-radius: 2px;
    transform: translateX(-50%) rotate(-2deg);
    z-index: 5;
    border-left: 2px dashed rgba(0,0,0,0.1);
    border-right: 2px dashed rgba(0,0,0,0.1);
}

.grid-item:hover {
    transform: translateY(-10px) scale(1.02) rotate(1deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.image-wrapper {
    width: 100%;
    position: relative; /* バツ印を重ねるため */
    overflow: hidden; /* 画像の拡大がフチを越えないようにする */
}

/* 非表示（白黒＆バツ印）の演出 */
.hidden-target .image-wrapper img {
    filter: grayscale(100%) contrast(1.2);
    opacity: 0.8;
}

.cross-mark {
    position: absolute;
    /* はみ出させるためにマイナス値と100%超えを設定 */
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M 5 5 C 30 35 70 75 95 95 M 3 7 C 30 37 70 77 93 97 M 95 5 C 70 35 30 75 5 95 M 97 7 C 72 37 32 77 7 97" stroke="%23d63031" stroke-width="4" fill="none" stroke-linecap="round" opacity="0.85"/></svg>');
    background-size: 100% 100%;
    mix-blend-mode: multiply;
    z-index: 20;
}

.image-wrapper img {
    width: 100%;
    height: auto; /* 正方形制限を解除、自然なアスペクト比 */
    display: block;
    transition: transform 0.5s ease;
}

.grid-item:hover .image-wrapper img {
    transform: scale(1.05); /* 拡大率を少し下げる */
}

.info {
    padding: 1rem;
    text-align: center;
    background: transparent; /* 黒いグラデーションを削除 */
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.name-container {
    position: relative;
    display: inline-block;
    padding-top: 40px; /* ターゲット文字と画像の距離を離すため余白を増加 */
}

.target-text {
    font-family: 'Yusei Magic', sans-serif;
    color: #d63031;
    font-size: 1.4rem;
    position: absolute;
    top: 5px;
    left: -40px;
    transform: rotate(-5deg);
    white-space: nowrap;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}

.info h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333; /* 文字を黒に */
    text-shadow: none; /* ドロップシャドウを削除 */
    font-weight: bold;
}

/* Detail Page */
.detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-section {
    display: flex;
    gap: 2rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 3rem;
    align-items: center;
}

.profile-image img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.profile-details h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-top: 0;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.profile-text {
    font-size: 1.1rem;
    color: #ced6e0;
}

/* Timeline / Sticky Notes */
.timeline-section {
    display: flex;
    flex-direction: column;
    padding: 3rem 0 6rem 0; /* 下部の余白を多めに取って見切れ防止 */
}

.timeline-item {
    width: 55%; /* 重なりすぎないように幅を調整 */
    max-width: 550px;
    display: flex;
    position: relative;
    z-index: 1;
    transition: z-index 0.3s ease;
}

/* 2枚目以降を上に引き上げて斜めに配置する */
.timeline-item + .timeline-item {
    margin-top: -6rem; 
}

.timeline-item:hover {
    z-index: 10; /* ホバー時は一番手前に */
}

/* 左右交互に配置 */
.timeline-item:nth-child(odd) {
    align-self: flex-start;
    padding-left: 1rem;
}
.timeline-item:nth-child(odd) .timeline-note {
    transform: rotate(-2deg);
}

.timeline-item:nth-child(even) {
    align-self: flex-end;
    padding-right: 1rem;
}
.timeline-item:nth-child(even) .timeline-note {
    transform: rotate(2deg);
}

.single-note {
    /* 本物の紙のような質感のグラデーション */
    background: linear-gradient(135deg, #fff7c0 0%, #ffeaa7 50%, #ffd97d 100%);
    background-image: 
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSJub25lIi8+CjxjaXJjbGUgY3g9IjEiIGN5PSIxIiByPSIxIiBmaWxsPSJyZ2JhKDAsMCwwLDAuMDIpIi8+Cjwvc3ZnPg=='), 
        linear-gradient(135deg, #fff7c0 0%, #ffeaa7 50%, #ffd97d 100%);
    color: #2d3436;
    padding: 2.5rem 2rem 2rem; /* 上部テープ用に余白を増やす */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 5px 10px 20px rgba(0,0,0,0.3);
    position: relative;
    border-radius: 2px 2px 20px 2px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.ad-note {
    /* 広告用は水色のグラデーション */
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
    background-image: 
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSJub25lIi8+CjxjaXJjbGUgY3g9IjEiIGN5PSIxIiByPSIxIiBmaWxsPSJyZ2JhKDAsMCwwLDAuMDIpIi8+Cjwvc3ZnPg=='), 
        linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
}

.single-note:hover {
    transform: scale(1.05) rotate(0deg) !important;
    box-shadow: 8px 8px 25px rgba(0,0,0,0.5);
    z-index: 10;
}

.note-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}

.note-video-container {
    text-align: center;
    margin-top: 1.5rem;
}

/* 動画に枠線をつけるとコントロールが隠れる問題を防ぐため、親要素(ポラロイド風)で装飾する */
.note-video {
    display: inline-block;
    background: #fff;
    padding: 8px 8px 24px 8px; /* ポラロイド写真風のフチ */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: rotate(1deg);
    border-radius: 2px;
}

.timeline-item:nth-child(even) .note-video {
    transform: rotate(-1.5deg);
}

.note-video video {
    display: block;
    width: 100%;
    max-width: 380px;
    background: #000;
    border-radius: 2px;
}

/* Pins and Tapes */
.pin {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 15px;
    height: 15px;
    background: #ff4757;
    border-radius: 50%;
    box-shadow: -2px 5px 5px rgba(0,0,0,0.3), inset -2px -2px 5px rgba(0,0,0,0.3);
    transform: translateX(-50%);
}

.tape {
    position: absolute;
    top: -20px;
    left: 50%;
    width: 160px; /* テープを大きく */
    height: 45px; /* テープを大きく */
    /* セロテープらしい半透明とテカリ感 */
    background: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.7) 30%, rgba(255,255,255,0.2));
    box-shadow: 0 2px 5px rgba(0,0,0,0.1), inset 0 0 10px rgba(255,255,255,0.5);
    border-radius: 2px;
    transform: translateX(-50%) rotate(-3deg);
    z-index: 5;
    /* 端をギザギザに見せるための簡易スタイル */
    border-left: 2px dashed rgba(0,0,0,0.1);
    border-right: 2px dashed rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .profile-section {
        flex-direction: column;
        text-align: center;
    }
    .timeline-item {
        width: 95%;
        margin-top: 2rem !important; /* スマホでは重なりをなくす */
        align-self: center !important;
        padding: 0;
    }
    .timeline-item + .timeline-item {
        margin-top: 2rem !important;
    }
    .timeline-item:nth-child(odd) .timeline-note,
    .timeline-item:nth-child(even) .timeline-note {
        transform: rotate(0deg);
    }
}
