:root {
  --text-color: #4a4641;
  --main-color: #d7d0c8;
  --sub-color: #7b8d91;
  --gray-bg: #f5f4f0;
  --text-bright: #ffffff;

  --font-main: "Shippori Mincho", serif;
  --font-sub: "Noto Serif JP", serif;
  --font-en: "Montserrat", sans-serif;
}

body {
  color: var(--text-color);
  background-color: var(--gray-bg);
  font-family: var(--font-main);
  line-height: 1.8;
}

.wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 40px;
  padding: 0;
}

.section {
  padding: 100px 40px;
}

.flex {
  display: flex;
}

.bg-light-gray {
  background-color: var(--gray-bg);
}

.end {
  justify-content: flex-end;
}

.section h2,
.section .section-title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 0;
  margin-bottom: 60px;

  .main-title {
    font-family: var(--font-main);
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
  }

  /* 文字右側の線 */
  &::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--sub-color);
    opacity: 0.3;
  }
}

/* ボタン共通 */
.works-more-btn,
.about-link {
  display: inline-block;
  width: 200px;
  padding: 16px 0;
  border: 1px solid var(--sub-color);
  color: var(--sub-color);
  text-align: center;
  text-decoration: none;
  font-family: var(--font-en);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  transition: 0.3s;
}

.works-more-btn:hover,
.about-link:hover {
  background: var(--sub-color);
  color: #fff;
}

/* ファーストビュー */
#fv {
  background-image: url(../img/snap_umi.jpg); /* 修正：パスを適正化 */
  background-size: cover;
  background-position: center;
  height: 100vh;
  position: relative;
  padding: 0;

  /* ヘッダー */
  header {
    padding: 40px 60px;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    z-index: 10;

    ul {
      list-style: none;
      gap: 40px;

      a {
        color: var(--text-bright);
        text-decoration: none;
        font-family: var(--font-main);
        font-size: 0.95rem;
        transition: 0.3s;

        &:hover {
          opacity: 0.6;
        }
      }
    }
  }

  /* ファーストビューキャッチ　 */
  .fv-catch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-bright);

    h1 {
      font-family: var(--font-en);
      font-weight: 300;
      letter-spacing: 0.2em;
      font-size: 3.5rem;
    }

    p {
      font-family: var(--font-en);
      font-weight: 300;
      letter-spacing: 0.4em;
      font-size: 0.8rem;
      margin-top: 15px;
    }
  }
}

/* ワークスのセクション */
.works-list {
  list-style: none;
  display: flex;
  justify-content: space-between; /* 両端揃え */
  gap: 40px;

  li {
    /* 修正：3カラムを100%均等にする計算式 */
    width: calc((100% - 80px) / 3);

    /* 制作物を包む正方形 */
    .works-box {
      background-color: #eceee9;
      aspect-ratio: 1 / 1;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 25px;
      padding: 30px;

      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
      }

      .portfolio-mockup {
        position: relative;
        width: 100%;
      }

      .mockup-fv,
      .mockup-works,
      .mockup-sp {
        display: block;
        width: 100%;
        height: auto;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
      }

      .mockup-fv {
        margin-bottom: 10px;
      }

      .mockup-works {
        width: 95%;
        margin: 0 auto;
      }

      .mockup-sp {
        position: absolute;
        right: -8%;
        bottom: 6%;
        width: 24%;
        border-radius: 10px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
      }
    }

    &:first-child {
      .works-box {
        align-items: center;
      }

      .portfolio-mockup {
        width: 90%;
        margin: 0 auto;
      }
    }

    .works-info {
      text-align: center;

      .client-name {
        font-size: 0.75rem;
        color: var(--sub-color);
        letter-spacing: 0.15em;
        text-transform: uppercase;
        margin-bottom: 8px;
        display: block;
      }

      .works-title {
        font-size: 0.9rem;
        line-height: 1.6;
        min-height: calc(1.6em * 2);
      }
    }
  }
}

.works-more {
  margin-top: 80px;
  text-align: center;
}

/* アバウトのセクション */
.about-flex {
  display: flex;
  align-items: center;
  gap: 80px;
  margin-bottom: 60px;
}

.about-visual {
  flex: 0 0 320px;
  position: relative;
  height: 400px;

  /* 背面の座布団写真 */
  .about-visual-bg {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    z-index: 1;

    img {
      width: 100%;
      aspect-ratio: 3 / 4;
      object-fit: cover;
      opacity: 0.2;
      display: block;
    }
  }

  /* 前面モノクロ写真 */
  .about-visual-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px;
    z-index: 2;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.05);

    img {
      width: 100%;
      aspect-ratio: 3 / 4;
      object-fit: cover;
      filter: grayscale(100%);
      display: block;
    }

    /* タイポグラフィ */
    .visual-caption {
      position: absolute;
      top: -10px;
      left: -35px;
      writing-mode: vertical-rl; /* 縦書き */
      opacity: 0.2;
      font-family: var(--font-en);
      font-size: 0.95rem;
      font-weight: 600;
      letter-spacing: 0.35em;
      color: var(--text-color);
      mix-blend-mode: multiply;
      white-space: nowrap;
      text-transform: uppercase;
    }
  }
}

.about-profile {
  flex: 1;

  .about-text {
    font-size: 0.95rem;
    line-height: 2.2;
    margin-bottom: 30px;
    text-align: justify;
    text-justify: inter-character;
  }

  .about-history {
    text-align: left;
    list-style: none;
    border-left: 1px solid var(--sub-color);
    padding-left: 30px;

    li {
      margin-bottom: 30px;

      .history-label {
        display: block;
        font-size: 0.75rem;
        font-weight: bold;
        letter-spacing: 0.2em;
        opacity: 0.5;
        margin-bottom: 8px;
      }

      .history-desc {
        font-size: 0.9rem;
      }
    }
  }
}

.about-more {
  text-align: center;
  width: 100%;
  margin-top: 60px;

  .about-link {
    display: inline-block;
  }
}

/* コンタクトのセクション */
#contact {
  text-align: center;

  p {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 40px;
  }

  /* メールボタン */
  .contact-btn.email {
    display: inline-block;
    width: 200px;
    padding: 20px 0;
    margin: 0 auto 40px;
    background-color: var(--text-color);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-en);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    transition: opacity 0.3s ease;

    &:hover {
      opacity: 0.7;
    }

    /* ↓ キーボード操作時のフォーカス表示（新規追加） */
    &:focus-visible {
      outline: 2px solid var(--sub-color);
      outline-offset: 4px;
    }
  }

  /* SNSリスト */
  .sns-list {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 30px;

    li a {
      color: var(--sub-color);
      text-decoration: none;
      font-family: var(--font-en);
      font-size: 0.85rem;
      letter-spacing: 0.1em;
      border-bottom: 1px solid transparent;
      transition: border-color 0.3s ease;

      &:hover {
        border-bottom: 1px solid var(--sub-color);
      }

      /* ↓ キーボード操作時のフォーカス表示（新規追加） */
      &:focus-visible {
        outline: 2px solid var(--sub-color);
        outline-offset: 4px;
        border-radius: 2px;
      }
    }
  }
}

/* フッター */
footer {
  width: 100%;
  background-color: var(--main-color);
  padding: 24px 0;
  text-align: center;

  .wrapper {
    padding: 0;
    margin: 0 auto;
    display: block;
  }

  small {
    line-height: 1;
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.7;
    display: inline-block;
  }
}

/* 詳細ページ専用ヘッダー */
.works-header {
  background-color: var(--gray-bg);
  padding: 10px 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 50px;
  }

  .header-logo {
    a {
      font-size: 1.2rem;
      font-weight: bold;
      text-decoration: none;
      color: var(--text-color);
      line-height: 1;
    }
  }

  .nav-list {
    list-style: none;
    gap: 30px;
    line-height: 1;
  }
}

/* ワークスページ専用スタイル */
#works-page {
  padding: 100px 40px;

  .works-block {
    width: 100%;
  }

  .works-banner-block {
    margin-bottom: 100px;
  }

  .works-web-block {
    margin-bottom: 100px;
  }

  .web-grid {
    width: 100%;
  }

  .web-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 40px;
  }

  .web-img-v3 {
    position: relative;
    width: calc((100% - 40px) / 2);
    background-color: #fff;
    border-radius: 10px;
    overflow: visible;
    line-height: 0;
    border: 1px solid rgba(123, 141, 145, 0.15);
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.05),
      0 1px 4px rgba(0, 0, 0, 0.1);
    padding: 8px;
    box-sizing: border-box;
  }

  .web-fv,
  .web-works,
  .web-sp {
    display: block;
    height: auto;
  }

  .web-fv {
    width: 100%;
    margin-bottom: 10px;
  }

  .web-works {
    width: 94%;
    margin: 0 auto;
  }

  .web-sp {
    position: absolute;
    right: -4%;
    bottom: 6%;
    width: 23%;
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  }

  .web-item {
    .banner-text-v3 {
      width: calc((100% - 40px) / 2);
      padding: 20px 32px 0 28px;
      text-align: center;
      box-sizing: border-box;

      .works-title {
        display: block;
        font-weight: bold;
        margin-bottom: 25px;
        color: var(--sub-color);
        font-size: 1.1rem;
      }

      .works-desc-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin: 0 auto;

        .works-desc {
          text-align: left;
          font-size: 0.85rem;
          line-height: 2;
          margin-bottom: 14px;
          color: #444;

          &:last-child {
            margin-bottom: 0;
          }

          & + .works-desc {
            margin-top: 18px;
          }
        }
      }
    }
  }

  .works-photo-block {
    width: 100%;
  }

  .sub-title {
    font-family: var(--font-en);
    font-size: 1.3rem;
    color: var(--sub-color);
    letter-spacing: 0.14em;
    margin: 60px 0 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  /* バナーの配置 */
  .banner-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 60px 40px;

    .banner-item {
      width: calc((100% - 40px) / 2);

      .banner-img-v3 {
        width: 100%;
        background-color: #fff;
        border-radius: 10px;
        overflow: hidden;
        line-height: 0;
        border: 1px solid rgba(123, 141, 145, 0.15);
        box-shadow:
          0 10px 30px rgba(0, 0, 0, 0.05),
          0 1px 4px rgba(0, 0, 0, 0.1);
        padding: 8px;
        box-sizing: border-box;

        img {
          width: 100%;
          height: auto;
          display: block;
        }

        &.ab-hover {
          position: relative;
          cursor: pointer;

          .img-b {
            position: absolute;
            top: 0;
            left: 0;
            opacity: 0;
            transition: 0.5s;
          }

          &:hover .img-b {
            opacity: 1;
          }
        }
      }

      /* テキストエリアの設定 */
      .banner-text-v3 {
        padding: 20px 0;
        text-align: center;

        .works-title {
          display: block;
          font-weight: bold;
          margin-bottom: 25px;
          color: var(--sub-color);
          font-size: 1.1rem;
        }

        .works-desc-container {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          width: 68%;
          margin: 0 auto;

          .works-desc {
            text-align: left;
            font-size: 0.85rem;
            line-height: 1.9;
            margin-bottom: 14px;
            color: #444;

            &:last-child {
              margin-bottom: 0;
            }
          }
        }
      }
    }
  }

  /* 写真ギャラリー全体レイアウト */
  .photo-gallery {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
  }

  .photo-item {
    break-inside: avoid;
    margin-bottom: 20px;

    img {
      width: 100%;
      height: auto;
      display: block;
      border-radius: 8px;
      transition: 0.3s;
      border: 1px solid rgba(0, 0, 0, 0.05);
    }

    &:hover img {
      transform: translateY(-5px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }
  }
}

/* 共通ボタン設定 */
.back-nav {
  margin-top: 80px;
  margin-bottom: 60px;
  text-align: center;
  width: 100%;
}

/* About詳細専用スタイル */
#about-detail {
  padding-top: 60px;
  padding-bottom: 0;

  /* 縦書きコピー */
  .vertical-copy-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 80px;
    width: 100%;
  }

  .vertical-copy {
    writing-mode: vertical-rl; /* 縦書き設定 */
    font-family: var(--font-main);
    font-size: 2.2rem;
    font-weight: bold;
    letter-spacing: 0.4em;
    line-height: 1.5;
    color: var(--sub-color);
    text-align: left;
    height: 380px;
    margin: 0 auto;

    /* 1文字ずつフェードイン演出 */
    .char {
      display: inline-block;
      opacity: 0;
      transform: translateY(-6px);
      will-change: opacity, transform;
    }

    &.is-visible .char {
      animation: fadeInChar 0.7s ease-out forwards;
    }
  }
}

/* キーフレーム定義（ネストの外に置く） */
@keyframes fadeInChar {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* アクセシビリティ：動きを減らす設定の人向け */
@media (prefers-reduced-motion: reduce) {
  #about-detail .vertical-copy .char {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* 写真・導入文レイアウト */
.about-modern-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 80px;
  margin-bottom: 100px;
}

/* 写真の横幅を固定、テキストのスペース確保 */
.profile-photo-container {
  flex: 1;
  img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
    display: block;
  }
}

.about-main-text {
  flex: 1;
  text-align: left;

  .intro-block {
    line-height: 2.2;
    p {
      margin-bottom: 25px;
      &:last-child {
        margin-bottom: 0;
      }
    }
  }
}

/* 下の文章セクション */
.story-block {
  max-width: 800px;
  margin: 0 auto;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 80px;

  .story-title {
    font-size: 1.4rem;
    margin-bottom: 40px;
    color: var(--text-color);
    text-align: center;
  }

  .highlight-text {
    margin: 56px auto;
    color: var(--sub-color);
    font-size: 1.15rem;
    line-height: 2;
    text-align: center;
    letter-spacing: 0.08em;
    background: none;
    padding: 0;
    display: block;
    max-width: 780px;
  }

  p {
    margin-bottom: 30px;
    line-height: 2.2;
    text-align: justify;
  }
}

/* 強みセクション */
.value-block {
  margin-top: 100px;

  .value-grid {
    display: flex;
    gap: 30px;
    margin-top: 40px;
  }

  .value-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.5);
    padding: 48px 40px;
    border-radius: 4px;
    .item-title {
      color: var(--sub-color);
      font-weight: bold;
      margin-bottom: 22px;
      font-size: 1.1rem;
      line-height: 1.7;
      text-align: center;
    }

    .item-text {
      font-size: 0.95rem;
      line-height: 2.1;
      text-align: justify;
    }
  }
}

/* スキル・使用ツールセクション */
.skill-block {
  margin-top: 100px;
  padding-bottom: 60px;

  .skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    margin-top: 40px;
    justify-content: center;
  }

  .skill-category {
    flex: 1;
    min-width: 300px;
    max-width: 400px;

    .category-title {
      font-size: 0.9rem;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 0.2em;
      color: var(--sub-color);
      margin-bottom: 25px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.08);
      padding-bottom: 10px;
      text-align: center;
    }

    .skill-items {
      list-style: none;
      text-align: center;
      padding: 0;

      li {
        font-size: 0.9rem;
        margin-bottom: 12px;
        color: var(--text-color);
        opacity: 0.85;
        line-height: 1.6;
      }
    }
  }
}

/* 共通見出しスタイル */
.sub-title {
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.2em;
  color: var(--text-color);
  margin-bottom: 50px;
}
