body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    color: #333;
    overflow-x: hidden;
    /* 横スクロール防止 */
}

header {
    display: flex;
    flex-direction: column;
    /* 縦並びにする */
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    flex-wrap: nowrap;
    /* ← 折り返さない */
}

header div {
    font-size: 1.2rem;
    /* ロゴ文字サイズを少し小さく */
    white-space: nowrap;
    /* 改行させない */
    padding-left: 8px;
}

header nav {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    /* ロゴとの間隔 */
    justify-content: flex-end;
    /* ナビ内のリンクを右揃え */
    width: 100%;
    /* 右寄せを有効にするため全幅 */
}

header nav a {
    text-decoration: none;
    color: #333;
    font-size: 1rem;
}

.blink {
    display: inline-block;
    animation: blink 4s infinite;
    transform-origin: center;
}

@keyframes blink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
        /* 開いた状態 */
    }

    92%,
    96% {
        transform: scaleY(0.1);
        /* 閉じた状態（まばたき） */
    }
}

.hero-text {
    height: 70vh;
    background: url('../images/main.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    /* セクション内で上下中央 */
    justify-content: flex-start;
    /* 左寄せ */
    padding-left: 5%;
    /* 左の余白 */
    position: relative;
    white-space: nowrap;
    /* 自動改行させない */
}

.hero-text-box {
    display: flex;
    flex-direction: column;
    /* 縦2列 */
    justify-content: center;
    /* ボックス内で上下中央 */
    text-align: left;
    /* 左揃え */
    width: 350px;
    /* 左側の範囲を決める */
}

.hero-title {
    font-size: 5vw;
    /* 画面幅の5%で自動調整 */
    margin: 0;
    line-height: 1.2;
    color: white;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
}

.jump-text span {
    display: inline-block;
    animation: jump 0.6s ease-in-out forwards;
}

.sub-text {
    font-size: 5vw;
    display: block;
    /* 2行目に固定 */
}


@keyframes jump {
    0% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(0);
    }
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: #333;
    text-decoration: none;
    padding: 8px 12px;
    transition: color 0.3s ease, transform 0.2s ease;
}

nav a:hover {
    color: #43C060;
    transform: translateY(-3px);
    /* ほんの少し上に移動 */
}


/* ハンバーガーボタン */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}


h1,
h2 {
    text-align: center;
    margin-top: 36px;
}

/*      works      */

.works {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.work-item {
    background: #e0e0e0;
    padding: 10px;
    border-radius: 8px;
}

.work-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    /* ホバーアニメーション */
}

.work-item img:hover {
    transform: scale(1.05);
    /* 5%拡大 */
    filter: brightness(80%);
    /* 少し暗くなる */
}


/*  about   */

.about-content {
    display: flex;
    gap: 20px;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: nowrap;
    /* 折り返さない */
}

.about-content img {
    flex: 0 0 40%;
    /* 40%固定 */
    max-width: 30%;
    /* 画像を小さめに */
    height: auto;
    border-radius: 16px;
}

.about-content p {
    flex: 1;
    /* 残りスペースを占有 */
    min-width: 0;
    /* 長いテキストでもはみ出さない */
}

/*     Skill   */

.skills {
    text-align: center;
    margin-top: 60px;
    padding: 20px;
}

.icons {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.icon {
    background: #f0f0f0;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.skills-description {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    font-size: 1rem;
    line-height: 1.8;
}

.skills .icons div {
    background: #ddd;
    padding: 10px 20px;
    border-radius: 8px;
}

/*  contact   */

.contact {
    text-align: center;
    margin-top: 60px;
}

footer {
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
    margin-top: 40px;
}

#toTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;

    width: 60px;
    height: 60px;
    /* 完全な正円 */
    border-radius: 50%;
    background-color: #43C060;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

    display: flex;
    flex-direction: column;
    /* 縦2列 */
    align-items: center;
    /* 横中央 */
    justify-content: center;
    /* 縦中央 */
    gap: 0;
    /* 文字間の隙間は個別で調整 */
    padding: 0;
}

.k-rotated {
    transform: rotate(90deg);
    font-size: 22px;
    line-height: 1;
    /* 高さを詰める */
    margin: 0;
}

.top-text {
    font-size: 12px;
    line-height: 1;
    /* 高さを詰める */
    margin: 0;
}

section[id] {
    scroll-margin-top: 100px;
}

/* レスポンシブ対応：画面が狭いときは1列に */
@media (max-width: 600px) {
    header {
        padding: 25px 0 15px 0;
    }

    header div {
        font-size: 16px;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        /* ヘッダー内で絶対位置 */
        top: 40px;
        /* 上からの距離 */
        transform: translateY(-50%);
        /* 中央揃え */
        right: 20px;
        /* 右からの距離 */
        font-size: 1.8rem;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1002;
        /* ナビより前面 */
    }

    /* ナビを右から隠しておく */
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 150px;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.8);
        border-left: 1px solid #ddd;
        padding-top: 80px;
        /* ヘッダー分のスペース */
        padding-left: 20px;
        gap: 20px;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* ← 上から順に並べる */
        align-items: flex-start;
        /* ← 左寄せに */
        transform: translateX(100%);
        /* 初期状態 → 完全に右に隠れる */
        transition: transform 0.3s ease-in-out;
        z-index: 1001;
    }

    header nav a {
        display: block;
        color: #333;
        text-decoration: none;
        font-size: 1rem;
        line-height: 1.8;
    }

    .nav.active {
        transform: translateX(0);
        /* アクティブで表示 */
    }

    .hero-content h1 {
        font-size: 1.8rem;
        /* 幅に収めるため文字サイズを小さく */
    }

    .hero-text {
        justify-content: flex-start;
        /* 横方向を左寄せ */
        padding-left: 20px;
        /* 左余白 */
    }

    .hero-text h1 {
        font-size: 2rem;
        /* フォントサイズ調整 */
        transform: none;
        /* 左寄せでtranslate不要 */
    }

    .works {
        grid-template-columns: 1fr;
    }

    .about {
        flex-direction: column;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about img,
    .about p {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 433px) {
    .hero-text {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero-content h1 {
        font-size: 2rem;
        /* 狭い画面用 */
    }
}