@charset "UTF-8";

* {
    box-sizing: border-box;
}

html,body {
    margin: 0;
}

/* ベース（背景画像） */
body {
    background-image: url('./img/prof.webp');
    background-repeat: no-repeat;
    min-height: 100svh;

    background-size: cover; /* 画像を画面サイズに合わせて拡大縮小する */
    background-position: center top; /* 画像の位置を中央上にする */
    background-attachment: fixed; /* 背景画像を固定 */
}

.header {
    position: fixed; /* ヘッダーを固定位置に設定 */
    top: 0; /* ヘッダーの上端を画面の上端に設定 */
    left: 0; /* ヘッダーの左端を画面の左端に設定 */
    z-index: 100; /* ヘッダーの重なり順序を100に設定 */
    width: 100%; /* ヘッダーの幅を100%に設定 */
}

.ribbon {
    position: relative; /* リボンを相対位置に設定 */
    z-index: 2; /* リボンの重なり順序を2に設定 */
    
    display: block; /* リボンをブロック要素として表示 */
    width: 100%;
    height: auto;
}

.nav {
    position: absolute; /* ナビゲーションを絶対位置に設定 */
    top: clamp(38px, 4.2vw, 60px);
    right: max(5%, calc((100% - 1100px) / 2)); /* ナビゲーションの右端を画面幅に応じて調整 */
    z-index: 3; /* ナビゲーションの重なり順序を3に設定 */ 

    pointer-events: auto; /* ナビゲーションのクリックイベントを有効化 */    
}
.nav-list {
    display: flex;
    align-items: center;
    
    gap: clamp(18px, 2.5vw, 35px);
    font-size: clamp(16px, 1.5vw, 20px);

    margin: 0; /* 上部の余白を0に設定 */
    padding: 0;
    list-style: none;

    font-family: "Alata", sans-serif;
    line-height: 1.2; /* ナビゲーションの行間を1.2に設定 */
}

.nav-list li {
    margin: 0;
    padding: 0;
}

.nav-list a,
.nav-list p {
    display: block;
    margin: 0;
    padding: 0;

    font: inherit; /* 親要素のフォントスタイルを継承 */
    line-height: inherit; /* 親要素の行間を継承 */  
}

.nav-work {
    color: #a0a5a5;

    text-decoration-line: line-through;
    text-decoration-color: #a0a5a5;
    text-decoration-thickness: 2px;
}

.nav-link {
    color: #636f6f;
    text-decoration: none;

    transition:
        color 0.3s,
        opacity 0.3s;
}

.nav-link:visited {
    color: #636f6f;
}

.nav-link:hover {
    color: #087f83;
    opacity: 0.7;
}

.nav-link-current,
.nav-link-current:visited {
    color: #087f83;
}

.nav-link-current:hover {
    color: #636f6f;
    opacity: 0.7;
}

/*mainをリボンの下へスクロールさせる:*/ 

.main {
    padding-top: clamp(180px, 16vw, 260px); /* ヘッダーの高さ分の余白を上部に追加 */
}

/* Design works */
.main-title {
    margin-top: 100px; /* 上部の余白を100pxに設定 */
    display: flex; /* フレックスボックスを使用して要素を配置 */
    align-items: center; /* 垂直方向の中央揃え */
    gap: 20px; /* アイコンとテキストの間に20pxの隙間を設定 */
    text-shadow: 8px 8px 2px rgba(32, 31, 31, 0.1); /* テキストに影を追加 */
    font-family:'Alata', sans-serif; /* フォントを'Alata'に設定 */
    font-size: clamp(40px, 4.5vw, 60px); /* フォントサイズを40pxに設定 */
    font-weight: 400; /* フォントの太さを400に設定 */
    color: #636F6F; /* フォントカラーを#636F6Fに設定 */
    margin-bottom: 30px; /* 下部の余白を20pxに設定 */
}


.main-title::before { 
    content:""; /* アイコンの内容を指定(文字の前のライン) */
    width: clamp(70px, 10vw, 145px); /* アイコンの幅を70pxに設定 */
    border-top: 3px solid #636F6F; /* アイコンの上線の色を#636F6Fに設定 */
    box-shadow: 8px 8px 2px rgba(32, 31, 31, 0.1); /* アイコンに影を追加 */
}

/* 3つの作品カテゴリー */
.works-img {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 20px;

    width: min(1120px, calc(100% - 20px));
    margin: 70px auto 0;
}

/* 画像と文字をまとめた1項目 */
.work-item {
    min-width: 0;
}

.work-link {
    display: grid;
    grid-template-rows: 230px auto;
    justify-items: center;

    width: 100%;
    min-width: 0;

    color: inherit;
    text-decoration: none;
}

/* 画像を置く共通領域 */
.work-img {
    display: block;
    align-self: center;

    max-width: 100%;
    max-height: 210px;

    object-fit: contain;
}

/* Web Designの画像 */
.work-item:nth-child(1) .work-img {
    width: 150px;
}

/* SNS Designの画像 */
.work-item:nth-child(2) .work-img {
    width: 70px;
}

/* Book Designの画像 */
.work-item:nth-child(3) .work-img {
    width: 150px;
}

/* カテゴリー名 */
.work-text {
    width: max-content;
    margin:5px 0 0;
    padding: 0 0 10px;

    color: #636f6f;
    font-family: "Alata", sans-serif;
    font-size: 20px;
    font-weight: 400;
    text-decoration: none;
    line-height: 1;
    text-align: center;
    white-space: nowrap;

    border-bottom: 2px dashed #636f6f;
}

.work-link:hover .work-text {
    color: #087f83;
    transition: 0.3s ease; 
    opacity: 0.6;
    transform: translateY(-4px); /* 少し浮かせると上品 */
}

.work-text {
    transition:
        color 0.3s ease,
        opacity 0.3s ease,
        transform 0.3s ease;
}

.footer {
    text-align: center; /* フッターのテキストを中央揃えに設定 */
    font-family:'Zen Kaku Gothic', sans-serif; /* フォントを'Zen Kaku Gothic New'に設定 */
    font-size: 12px; /* フォントサイズを12pxに設定 */
    color: #636F6F; /* フォントカラーを#636F6Fに設定 */
    margin-top: 100px; /* 上部の余白を100pxに設定 */
    margin-bottom: 0; /* 下部の余白を0に設定 */
}

/* ----------------------------
   スクロール追従 TOPボタン
---------------------------- */
.scroll-top {
        position: fixed;
        right: 50px;

        /* Netlify表示やスマホ下部から離す */
        bottom: calc(75px + env(safe-area-inset-bottom));

        z-index: 999;

        /* タップできる範囲を確保 */
        display: grid;
        place-items: center;

        width: 44px;
        height: 44px;
    }

    .scroll-top img {
        display: block;
        width: 30px;
        height: auto;
    }

.scroll-top img {
    display: block;
    width: 50px;
    height: auto;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* ホバー時：ふわっと薄く */
.scroll-top:hover img {
  opacity: 0.6;
  transform: translateY(-4px); /* 少し浮かせると上品 */
}

html {
  scroll-behavior: smooth;
}

/* ========================================
   スマートフォン共通
   ヘッダー・ナビ・TOPアイコン
======================================== */

@media screen and (max-width: 768px) {

     body {
        position: relative;
        isolation: isolate;

        min-height: 100svh;

        /* 従来のbody背景を解除 */
        background-image: none;
    }

    /* 背景専用レイヤー */
    body::before {
        content: "";

        position: fixed;
        inset: 0;
        z-index: -1;

        background-image: url("./img/phone-prof.webp");
        background-repeat: no-repeat;
        background-position: center top;
        background-size: cover;

        pointer-events: none;
    }

    /* 固定ヘッダー */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;

        width: 100%;
        height: 170px;

        pointer-events: none;
    }

    /* リボン */
    .ribbon {
        position: relative;
        top: 0;
        left: 0;
        z-index: 2;

        display: block;
        width: 100%;
        height: auto;

        pointer-events: none;
    }

    /* ナビゲーション */
    .nav {
        position: absolute;
        top: 100px;
        right: auto;
        left: 50%;
        z-index: 3; /* ナビゲーションの重なり順序を3に設定 */

        width: 92%;
        transform: translateX(-50%);

        pointer-events: auto; /* ナビゲーションのクリックイベントを有効化 */
    }

    .nav-list {
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 8px;

        margin: 0;
        padding: 20px 10px;

        background-color: rgba(255, 255, 255, 0.55);

        font-size: 17px;
    }

    .nav-list li {
        flex-shrink: 0;
    }

    .nav-list p {
        margin: 0;
    }

    .nav-list p[aria-current="page"] {
        padding-bottom: 4px;
        border-bottom: 2px dashed #a0a5a5;
    }


    /* =========================
       WORK画像を縦並びにする
    ========================= */

    .works-img {
        display: grid;
        grid-template-columns: 1fr;

        width: calc(100% - 60px);
        max-width: 340px;
        margin: 50px auto 0;

        row-gap: 50px;
        column-gap: 0;
    }

    .work-item {
        width: 100%;
        min-width: 0;
    }

    .work-link {
        display: grid;
        grid-template-rows: auto auto;
        justify-items: center;

        width: 100%;
        row-gap: 15px;
    }

    .work-img {
        display: block;
        width: auto;
        max-width: 100%;
        max-height: 210px;
        height: auto;

        object-fit: contain;
    }


    /* TOPへ戻るアイコン */
    .scroll-top {
        position: fixed;
        right: 16px;

        /* Netlify表示やスマホ下部から離す */
        bottom: calc(75px + env(safe-area-inset-bottom));

        z-index: 999;

        /* タップできる範囲を確保 */
        display: grid;
        place-items: center;

        width: 44px;
        height: 44px;
    }

    .scroll-top img {
        display: block;
        width: 30px;
        height: auto;
    }
    .scroll-top:hover img {
        opacity: 0.6;
        transform: translateY(-4px);
    }
}