@charset "UTF-8";

/* ==========================================================================
   1. 基本設定
   ========================================================================== */
html { font-size: 100%; }
body { color: #24292e; line-height: 1.6; }
a    { text-decoration: none; color: inherit; }
img  { max-width: 100%; height: auto; display: block; box-sizing: border-box; }
li   { list-style: none; }

.wrapper { 
    max-width: 960px; 
    margin: 0 auto 80px; 
    padding: 0 20px; 
    box-sizing: border-box; 
}
.sec-title { 
    font-size: 1.5rem; 
    text-align: center; 
    margin-bottom: 40px; 
}

/* ==========================================================================
   2. ヘッダー
   ========================================================================== */
#header { 
    max-width: 960px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 100px; 
    padding: 0 20px; 
    box-sizing: border-box; 
}
.site-title { width: 150px; }
#header ul { display: flex; }
#header li { font-size: 0.9rem; margin-left: 30px; }

/* ==========================================================================
   3. Mainvisual & キャッチコピー
   ========================================================================== */
#mainvisual { margin-bottom: 80px; }
.img-wrap { overflow: hidden; position: relative; }

/* カバーアニメーション */
.cover1, .cover2, .cover3 { 
    animation: cover 2s cubic-bezier(0.4, 0, 0.2, 1) forwards; 
    background: #fff; 
    height: calc(100% / 3); 
    left: 0; 
    pointer-events: none; 
    position: absolute; 
    right: 0; 
    z-index: 10; 
}
.cover1 { top: 0; }
.cover2 { animation-delay: 0.2s; top: calc(100% / 3); }
.cover3 { animation-delay: 0.4s; top: calc(100% / 3 * 2); }
@keyframes cover { 100% { transform: translateX(100%); } }

/* キャッチコピー（カーソル削除・以前の設定に戻す） */
.catch-copy {
    position: absolute;
    top: 30%; 
    left: 10%;
    z-index: 2;
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Georgia', serif;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #fff;
    animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 10.5em } /* 文字数に合わせて調整 */
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #fff }
}

/* ==========================================================================
   4. About & Skills
   ========================================================================== */
.about-content { display: flex; gap: 40px; align-items: flex-start; }
.about-image   { flex: 0 0 300px; }
.about-image img { border-radius: 8px; }

#skills { padding: 80px 0; text-align: center; }
.skill-list { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 40px; }
.skill-item {
   position: relative;
    width: calc(33.33% - 20px);
    max-width: 150px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    padding: 10px;
    border-radius: 8px;
}
.skill-item img { width: 80px; margin: 0 auto 10px; }

/* ホバー時の動き */
.skill-item:hover {
    transform: translateY(-15px) scale(1.05); /* 浮き上がりつつ少し大きく */
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    background: #fff;
}

.info-box {
   opacity: 0;
    visibility: hidden;
    position: absolute;
    top: -45px; /* 位置を少し上に調整 */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 4px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.skill-item:hover .info-box {
    opacity: 1;
    visibility: visible;
}

.progress-bar-bg {
    width: 100%;
    background: #eee;
    height: 8px;
    border-radius: 4px;
    margin-top: 10px;
}
.progress-bar-fill {
    height: 100%;
    background: #24292e;
    border-radius: 4px;
    /* 読み込み時の伸びるアニメーション */
    animation: progress-fill 1.5s ease-out forwards;
    transition: background 0.3s ease, transform 0.3s ease;
}

.skill-item:hover .progress-bar-fill {
    background: #4a90e2; /* ホバー時に青系へ変化 */
    transform: scaleX(1.02);
    transform-origin: left;
}

/* 各スキルごとのバーの長さ */
.skill-html .progress-bar-fill { width: 90%; }
.skill-css .progress-bar-fill { width: 80%; }
.skill-laravel .progress-bar-fill { width: 40%; }
.skill-python .progress-bar-fill { width: 50%; }
.skill-swift .progress-bar-fill { width: 50%; }
.skill-js .progress-bar-fill { width: 75%; }

/* 読み込み時のアニメーションキーフレーム */
@keyframes progress-fill {
    from { width: 0; }
}

/* ==========================================================================
   5. Works (画像縦横比固定)
   ========================================================================== */
.works-list { display: flex; gap: 20px; flex-wrap: wrap; }
.works-item { width: calc(33.33% - 14px); }
.works-item img { 
    width: 100%; 
    aspect-ratio: 16 / 9; 
    object-fit: cover; 
    border-radius: 4px; 
}

/* ==========================================================================
   6. Contact (送信ボタン中央寄せ)
   ========================================================================== */
#contact { padding: 0 20px; box-sizing: border-box; }
#contact dl { display: flex; flex-wrap: wrap; margin-bottom: 20px; }
#contact dt { width: 15%; }
#contact dd { width: 85%; margin-bottom: 10px; }
#contact dd input, #contact dd textarea { width: 100%; padding: 10px; border: 1px solid #ccc; box-sizing: border-box; }

.button { 
    text-align: center; 
    width: 100%; 
    margin-top: 20px; 
    display: flex;
    justify-content: center; 
}
.button input { 
    width: 200px; 
    background: #24292e; 
    color: #fff; 
    padding: 15px; 
    border: none; 
    cursor: pointer; 
    margin: 0;
}

/* ==========================================================================
   7. レスポンシブ (スマホ設定)
   ========================================================================== */
@media screen and (max-width: 767px) {
    html, body { overflow-x: hidden; width: 100%; }
  
    #header { height: auto; flex-direction: column; padding: 20px; }
    
    .about-content { flex-direction: column; align-items: center; }
    .about-image   { flex: 0 0 auto; width: 100%; max-width: 200px; margin-bottom: 20px; }
  
    .skill-item { width: calc(50% - 15px) !important; }
    .works-item { width: 100% !important; }
  
    .catch-copy { font-size: 1.5rem; top: 20%; left: 5%; }
  
    #contact dt, #contact dd { width: 100% !important; }
    .button input { width: 100%; max-width: 300px; }
}

#footer { background: #24292e; color: #fff; text-align: center; padding: 20px; font-size: 0.8rem; }