/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* 背景と文字色を新しいデザインに合わせて変更 */
  background-color: #eaeaea;
  color: #111111;
  font-family: "Inter", sans-serif;
  /* 【最終修正】サイト幅制限によるはみ出しを隠すため、bodyではなくhtmlにoverflow-xを設定 */
}

/* 【最終修正】サイト全体の幅制限を持つコンテナによる、横スクロールバーの発生を防ぎます */
html {
  overflow-x: hidden;
  background-color: #eaeaea;
  scroll-behavior: smooth; /* ← この1行を追加してください */
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

#root,
#__next {
  isolation: isolate;
}

/* --- ページ全体のレイヤー構造 DEFINITION --- */

/* --- Loader (Logo Wipe) --- */
.loader--logo-wipe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #eaeaea;
  z-index: 9999;

  /* 最初から表示しておく */
  display: flex;
  opacity: 1;

  align-items: center;
  justify-content: center;
}

.loader__logo {
  /* 画像のサイズをここで指定 */
  width: 200px;
  height: auto; /* 縦横比を維持 */

  /* アニメーションの初期状態 */
  transform: scale(0);
}

/* スマホ表示ではロゴを少し小さくする */
@media (max-width: 767px) {
  .loader__logo {
    width: 150px;
  }
}

/* Layer 2: メインコンテンツ (スクロールする部分) */
.site-main {
  position: relative;
  /* 背景色を新しいデザインに合わせて変更 */
  background-color: #eaeaea;
  isolation: isolate;
}

/* Layer 3: ヘッダー (最前面) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease-in-out,
    backdrop-filter 0.3s ease-in-out, border-bottom 0.3s ease-in-out;
}
.site-logo {
  z-index: 101; /* ロゴが他の要素の前に来るように念のため指定 */
}

/* 既存の .site-logo a スタイルを上書き、または修正 */
.site-logo a {
  font-size: 0; /* テキストベースのスタイルが影響しないように */
  display: block;
  color: #111; /* 既存のスタイルを維持 */
  text-decoration: none;
  font-weight: 700;
}

.site-logo__image {
  /* 画像のサイズをここで制御します */
  height: 40px; /* 例：高さを40pxに指定 */
  width: auto; /* 縦横比を維持 */
}

/* スマホ表示ではロゴを少し小さくする（任意） */
@media (max-width: 767px) {
  .site-logo__image {
    height: 32px;
  }
}

/* --- ヘッダーのスクロール効果 --- */
.site-header.is-scrolled {
  /* スクロール時の背景色とボーダーを新しいデザインに合わせて変更 */
  background-color: rgba(234, 234, 234, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #cccccc;
}
.site-logo a {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  /* ロゴの色を新しいデザインに合わせて変更 */
  color: #111111;
  z-index: 101;
}

/* --- ハンバーガーメニュー --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}
.menu-toggle .hamburger,
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  content: "";
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  /* ハンバーガーメニューの色を新しいデザインに合わせて変更 */
  background-color: #111111;
  transition: all 0.3s ease;
}
.menu-toggle .hamburger::before {
  top: -8px;
}
.menu-toggle .hamburger::after {
  bottom: -8px;
}
.is-menu-open .menu-toggle .hamburger {
  background-color: transparent;
}
.is-menu-open .menu-toggle .hamburger::before {
  transform: translateY(8px) rotate(45deg);
}
.is-menu-open .menu-toggle .hamburger::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- ナビゲーションメニュー --- */
.main-navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.main-navigation a {
  text-decoration: none;
  /* ナビゲーションの文字色を新しいデザインに合わせて変更 */
  color: #333333;
  transition: color 0.3s ease;
}
.main-navigation a:hover {
  color: #000000;
}

/* --- スマホ表示 (768px未満) --- */
@media (max-width: 767px) {
  .menu-toggle {
    display: block;
  }
  .main-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* SPメニューの背景色を新しいデザインに合わせて変更 */
    background-color: rgba(234, 234, 234, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  .is-menu-open .main-navigation {
    opacity: 1;
    visibility: visible;
  }
  .main-navigation ul {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
  }
  .main-navigation a {
    font-size: 1.5rem;
    font-weight: bold;
  }
  body.is-menu-open {
    overflow: hidden;
  }
}

/* --- PC表示 (768px以上) --- */
@media (min-width: 768px) {
  .main-navigation ul {
    display: flex;
    gap: 2rem;
  }
  .main-navigation a {
    position: relative;
    padding: 0.5rem 0;
  }
  .main-navigation a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    /* ホバー時の下線の色を新しいデザインに合わせて変更 */
    background-color: #111111;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  }
  .main-navigation a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* --- mv --- */

.mv {
  position: relative;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.mv__canvas {
  position: fixed; /* スクロールしても追従するように変更 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* コンテンツの背後に配置 */
}
.mv__content {
  position: relative;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Element: mv__title */
/* ※このスタイルは現在Canvas描画のため直接は使用されていません */
.mv__title {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 8rem; /* 128px */
  line-height: 1;
  color: #ffffff;
  letter-spacing: 0.05em;
}

/* Element: mv__subtitle */
/* ※このスタイルは現在Canvas描画のため直接は使用されていません */
.mv__subtitle {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 4rem; /* 64px */
  line-height: 1;
  margin-top: 1.25rem; /* 20px */
  color: #ffffff;
  letter-spacing: 0.1em;
}

/* --- Scroll Animation --- */
.js-fade-up {
  opacity: 0; /* 初期状態は透明 */
  transform: translateY(30px); /* 初期状態は30px下に */
  transition: opacity 4s ease-out, transform 1.2s ease-out;
}

.js-fade-up.is-visible {
  opacity: 1; /* 画面に入ったら透明度を1に */
  transform: translateY(0); /* 画面に入ったら元の位置に */
}

/* ===== Work Section ===== */
.work {
  padding: 100px 5%;
}

.work__inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* [修正] 「少し大きめ・太め」のデザインを適用 */
.work__title {
  font-family: "DM Mono", monospace;
  font-size: 1.25rem; /* 少し大きく */
  font-weight: 500; /* 少し太く */
  color: #666;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 4rem;
  text-transform: uppercase;
}

/* ↓ Grid と Item のスタイルは変更ありません ↓ */
.work__grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .work__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.work__item {
  display: block;
  text-decoration: none;
  color: #111111;
  border: 1px solid #cccccc;
  transition: box-shadow 0.3s ease;
}

.work__item:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.work__item-image-wrapper {
  overflow: hidden;
}

.work__item-image {
  width: 100%;
  display: block;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work__item:hover .work__item-image {
  transform: scale(1.05);
}

.work__item-info {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "DM Mono", monospace;
  font-size: 0.875rem;
}

/* ↓ Modal のスタイルは変更ありません ↓ */
.parallax-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.parallax-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.parallax-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(17, 17, 17, 0.7);
}

.parallax-modal__content-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 5%;
}

.parallax-modal__content {
  width: 100%;
  max-width: 550px;
  background: #eaeaea;
  padding: 2rem 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.parallax-modal.is-open .parallax-modal__content {
  opacity: 1;
  transform: translateY(0);
}

.parallax-modal__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.parallax-modal__tech {
  font-family: "DM Mono", monospace;
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.parallax-modal__description {
  line-height: 1.7;
  margin-bottom: 2rem;
}

.parallax-modal__link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid #111;
  color: #111;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s, color 0.3s;
}

.parallax-modal__link:hover {
  background-color: #111;
  color: #eaeaea;
}

.parallax-modal__close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-family: "DM Mono", monospace;
  cursor: pointer;
  padding: 0.5rem;
  color: #888;
  font-size: 0.875rem;
}

/* --- Skill Section --- */
.skill {
  padding: 100px 5%;
}

.skill__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.skill__title {
  font-family: "DM Mono", monospace;
  font-size: 1.25rem;
  font-weight: 500;
  color: #666;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 4rem;
  text-transform: uppercase;
}

.skill__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .skill__container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.skill-category__title {
  font-family: "DM Mono", monospace;
  font-size: 1rem;
  color: #888;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ddd;
}

.skill-category__list {
  list-style: none;
  padding-left: 0;
}

.skill-category__item {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.5rem 0;
  color: #333;
  transition: transform 0.3s ease, color 0.3s ease;
}

.skill-category__item:hover {
  transform: translateX(10px);
  color: #000;
}

/* --- About Section --- */
.about {
  padding: 100px 5%;
}

.about__inner {
  max-width: 1000px;
  margin: 0 auto;
}

.about__title {
  font-family: "DM Mono", monospace;
  font-size: 1.25rem;
  font-weight: 500;
  color: #666;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 4rem;
  text-transform: uppercase;
}

.about__container {
  display: grid;
  grid-template-columns: 1fr; /* スマホでは1カラム */
  gap: 2rem;
  align-items: center;
}

/* --- PC表示 (768px以上) --- */
@media (min-width: 768px) {
  .about__container {
    grid-template-columns: 1fr 1fr; /* PCでは2カラムに */
    gap: 4rem;
  }
}

.about__heading {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.about__description {
  line-height: 1.8;
  color: #444;
}

.about__image-wrapper {
  /* PC表示で画像を右側に持ってくるため、順序を変更 */
  order: -1;
}
@media (min-width: 768px) {
  .about__image-wrapper {
    order: 1;
  }
}

.about__image {
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  padding: 1rem;
}

/* --- Contact Section --- */
.contact {
  padding: 100px 5%;
  background-color: #f4f4f4; /* 背景色を少し変える */
}

.contact__inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.contact__title {
  font-family: "DM Mono", monospace;
  font-size: 1.25rem;
  font-weight: 500;
  color: #666;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.contact__description {
  margin-bottom: 3rem;
  line-height: 1.8;
  color: #555;
}

.br-sp {
  display: none;
}
@media (max-width: 767px) {
  .br-sp {
    display: block;
  }
}

/* --- MW WP Form Styling --- */
.mw_wp_form table {
  width: 100%;
  text-align: left;
}

.mw_wp_form th,
.mw_wp_form td {
  border: none;
  padding: 0;
}

.mw_wp_form th {
  font-family: "DM Mono", monospace;
  font-weight: 400;
  padding-bottom: 0.5rem;
  display: block;
}

.mw_wp_form td {
  padding-bottom: 1.5rem;
  display: block;
}

.mw_wp_form input[type="text"],
.mw_wp_form input[type="email"],
.mw_wp_form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  background-color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.mw_wp_form input[type="text"]:focus,
.mw_wp_form input[type="email"]:focus,
.mw_wp_form textarea:focus {
  outline: none;
  border-color: #333;
}

.mw_wp_form textarea {
  min-height: 150px;
  resize: vertical;
}

.mw_wp_form .button-area {
  text-align: center;
  margin-top: 1rem;
}

.mw_wp_form input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 3rem;
  border: 1px solid #111;
  background-color: #111;
  color: #eaeaea;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.mw_wp_form input[type="submit"]:hover {
  background-color: transparent;
  color: #111;
}

/* --- MW WP Form 完了メッセージ --- */
.contact__complete-message {
  text-align: left;
  line-height: 1.8;
  color: #333;
  background-color: #f4f4f4;
  border: 1px solid #ddd;
  padding: 2rem;
}

/* --- Page Top Button --- */
.page-top-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  cursor: pointer;
  z-index: 1000;

  /* ボタンのスタイル */
  width: 48px;
  height: 48px;
  border: 1px solid #888;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  background-color: transparent; /* 背景は透明 */
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, opacity 0.4s,
    visibility 0.4s, transform 0.4s;

  /* 初期状態は非表示 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.page-top-button svg {
  width: 20px;
  height: 20px;
}

.page-top-button:hover {
  background-color: #111;
  color: #eaeaea;
  border-color: #111;
}

.page-top-button.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
