@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; /* 背景画像を固定 */
}

/* ===== Design category ===== */

.category-nav {
  display: flex;
  justify-content: space-between;
  max-width: 1300px;
  margin: 0 auto;
  gap: clamp(20px, 8vw, 120px);
  padding: 0 clamp(20px, 5vw, 60px);
}

/* 共通 */
.nav-item {
  width: clamp(150px, 17vw, 220px);
  aspect-ratio: 220 / 300;
  height: auto;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
  transition: background-image 0.4s ease;
}

/* ---- default（薄） ---- */
.nav-item.web  {
    background-image: url("./img/web-off.webp"); 
}
.nav-item.sns  {
    background-image: url("./img/sns-off.webp");
}
.nav-item.book {
    background-image: url("./img/book-off.webp");
}

/* ---- hover（濃） ---- */
.nav-item.web:hover  {
    background-image: url("./img/web-on.webp");
}
.nav-item.sns:hover  {
    background-image: url("./img/sns-on.webp");
}
.nav-item.book:hover {
    background-image: url("./img/book-on.webp");
}

/* ---- current（常に濃・hover無効） ---- */
.nav-item.current {
  pointer-events: none;
}

.nav-item.web.current {
  background-image: url("./img/web-on.webp");
}

/* ========================================
   Web Design 作品一覧
======================================== */

.web-design {
    position: relative;
    width: 100%;
    padding: 45px 0 100px;
    isolation: isolate;
    color: #626d6d;
}

/* メインコンテンツ背面の白い長方形 */
.web-design::before {
    content: "";
    position: absolute;
    z-index: -1;

    top: 0;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);

    width: min(1280px, calc(100% - 80px));

    /* 白い透かし */
    background-color: rgba(255, 255, 255, 0.40);

}

/* Ocean HouseとBlue Starを横並びにする */
.web-projects {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(35px, 7vw, 100px);
    
    width: min(1160px, calc(100% - 80px));
    margin: 0 auto;
}

/* 各作品の列 */
.web-project {
    min-width: 0;
}

/*各作品のタイトル*/
.project-name {
    width: fit-content;
    margin: 0 auto 75px; /* 上下の余白を設定 */
    padding: 0 8px 7px;

    color: #008783;
    font-family:'Alata', sans-serif; /* フォントを'Alata'に設定 */
    text-shadow: 8px 8px 2px rgba(32, 31, 31, 0.1); /* テキストに影を追加 */
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-align: center;

    border-bottom: 3px dotted #008783;
    filter:8px 8px 2px rgba(32, 31, 31, 0.1); /* 文字の下に影を追加 */
    
}

.project-description {
    max-width: 480px;
    min-height: 120px;
    margin: -45px auto 35px;
    padding: 0 20px;

    color: #626d6d;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 2;
    letter-spacing: 0.05em;
    text-align: justify;
}

/* コンセプトボード／Webサイトのまとまり */
.project-section {
    margin-bottom: 60px;
}

/* ========================================
   見出し
======================================== */

.project-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 15px; /* 見出しの下に20pxの余白を設定 */
    font-size: clamp(25px, 2.5vw, 34px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    font-family:'Alata', sans-serif; /* フォントを'Alata'に設定 */
    font-size: 25px; /* フォントサイズを25pxに設定 */
    color: #626d6d;
    text-shadow: 8px 8px 2px rgba(32, 31, 31, 0.1); /* テキストに影を追加 */
}

/* 見出し左側の横線 */
.project-heading::before {
    content: "";
    flex: 0 0 64px;
    height: 3px;
    background-color: #626d6d;
    box-shadow: 8px 8px 2px rgba(32, 31, 31, 0.1); /* テキストに影を追加 */
}

/* ========================================
   サムネイル
======================================== */

.project-image-button {
    position: relative;
    display: block;
    width: min(100%, 330px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: 4px 5px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* ボタンのキーボード選択表示 */
.project-image-button:focus-visible {
    outline: 3px solid #68c9c3;
    outline-offset: 5px;
}

/* 共通画像設定 */
.project-image {
    display: block;
    width: 100%;
    height: auto;
    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

/* コンセプトボードの比率 */
.concept-image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Webサイト画像の比率 */
.website-image {
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: top center;
}

/* ========================================
   ホバー時のClick表示
======================================== */

.image-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-family:'Alata', sans-serif; /* フォントを'Alata'に設定 */
    font-size: 25px;
    font-weight: 500;
    letter-spacing: 0.12em;
    background-color: rgba(55, 65, 65, 0.45);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

/* ホバー時に少し拡大＋暗くする */
.project-image-button:hover .project-image,
.project-image-button:focus-visible .project-image {
    transform: scale(1.04);
    filter: brightness(0.65);
}

.project-image-button:hover .image-overlay,
.project-image-button:focus-visible .image-overlay {
    opacity: 1;
}

/* ========================================
   拡大表示用モーダル
======================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(15px, 3vw, 40px);
}

/* JavaScriptでis-openを追加すると表示 */
.modal.is-open {
    display: flex;
}

/* 背景の黒い部分 */
.modal-background {
    position: absolute;
    inset: 0;
    background-color: rgba(20, 30, 30, 0.8);
    backdrop-filter: blur(4px);
}

/* 拡大画像を囲む部分 */
.modal-content {
    position: relative;
    z-index: 1;
    width: min(1000px, 90vw);
    height: min(850px, 88dvh);
    padding: 55px 20px 20px;
    border-radius: 4px;
    
    background-color: rgba(220, 244, 241, 0.476);
    
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: 8px;
    right: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    color: #008783;
    font-size: 38px;
    line-height: 1;
    background: transparent;
    cursor: pointer;
    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.modal-close:hover {
    color: #318f8b;
    transform: rotate(90deg);
}

.modal-close:focus-visible {
    outline: 3px solid #68c9c3;
    outline-offset: 2px;
}

/* 縦長画像をスクロールさせる領域 */
.modal-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* 拡大画像 */
#modal-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* モーダル表示中、bodyに追加するクラス */
body.modal-open {
    overflow: hidden;
}

/* ========================================
   画面上には表示しない見出し
======================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* 準備中の画像ボタン */
.project-image-button:disabled {
    cursor: default;
}

.project-image-button:disabled .project-image {
    transform: none;
    filter: none;
}

.project-image-button:disabled .image-overlay {
    display: none;
}

/* ========================================
   共通部分（フッター・スクロール追従TOPボタン）
======================================== */

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

/*レスポンシブルデザイン*/

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

    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;
    }


    .web-projects {
        grid-template-columns: 1fr;
        row-gap: 80px;
    }

    .modal {
        padding: 15px;
    }

    .modal-content {
        width: 92vw;
        height: 78dvh;
        max-height: 700px;

        padding: 48px 12px 15px;
    }

    .modal-scroll {
        width: 100%;
        height: 100%;
        overflow-y: auto;
    }

    #modal-image {
        width: 100%;
        height: auto;
    }

    .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;
    }
}