
/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #090909;
  color: #ffffff;
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}

/* =========================
   HEADER
========================= */

.header {
  width: 100%;
  padding: 30px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.logo {
  color: #ffffff;
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 2px;
}

.nav {
  display: flex;
  gap: 35px;
}

.nav a {
  color: #aaaaaa;
  font-size: 12px;
  text-decoration: none;
  letter-spacing: 2px;
  transition: color 0.3s;
}

.nav a:hover {
  color: #ffffff;
}

/* =========================
   HERO
========================= */

.hero {
  min-height: 100vh;
  padding: 180px 8% 80px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-sub {
  color: #888888;
  font-size: 12px;
  letter-spacing: 4px;
  margin-bottom: 30px;
}

.hero h1 {
  font-size: clamp(80px, 15vw, 220px);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: -10px;
}

.hero h1 span {
  color: transparent;
  -webkit-text-stroke: 1px #ffffff;
}

.hero-description {
  color: #999999;
  font-size: 14px;
  line-height: 1.8;
  margin-top: 45px;
}

.scroll-text {
  position: absolute;
  bottom: 35px;
  right: 8%;
  color: #777777;
  font-size: 11px;
  letter-spacing: 3px;
}

/* =========================
   SECTION COMMON
========================= */

.about,
.works,
.contact {
  padding: 150px 8%;
}

.section-label {
  color: #888888;
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 35px;
}

.about h2,
.works h2 {
  font-size: clamp(45px, 8vw, 100px);
  margin-bottom: 40px;
  letter-spacing: -3px;
}

.about > p:last-child {
  color: #aaaaaa;
  font-size: 18px;
  line-height: 2;
}

/* =========================
   WORKS
========================= */

.work-item {
  padding: 50px 0;
  border-top: 1px solid #333333;
  transition: padding-left 0.4s;
}

.work-item:hover {
  padding-left: 25px;
}

.work-item p {
  color: #888888;
  font-size: 11px;
  letter-spacing: 3px;
  margin-bottom: 15px;
}

.work-item h3 {
  font-size: clamp(35px, 7vw, 85px);
  font-weight: 700;
}

/* =========================
   CONTACT
========================= */

.contact h2 {
  font-size: clamp(80px, 15vw, 190px);
  line-height: 0.9;
  letter-spacing: -8px;
  margin-bottom: 40px;
}

.contact > p:last-child {
  color: #999999;
  font-size: 14px;
}

/* =========================
   FOOTER
========================= */

.footer {
  padding: 30px 8%;
  border-top: 1px solid #333333;
}

.footer p {
  color: #777777;
  font-size: 10px;
  letter-spacing: 2px;
}

/* =========================
   LOADER
========================= */

.loader {
  display: none;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

  .header {
    padding: 25px 5%;
  }

  .nav {
    gap: 12px;
  }

  .nav a {
    font-size: 9px;
    letter-spacing: 1px;
  }

  .hero {
    padding-left: 5%;
  }

  .hero h1 {
    letter-spacing: -5px;
  }

  .about,
  .works,
  .contact {
    padding: 100px 5%;
  }

  .contact h2 {
    letter-spacing: -4px;
  }

}


/* =========================
   ANIMATION
========================= */

.hero-sub,
.hero h1,
.hero-description,
.scroll-text {
  opacity: 0;
  transform: translateY(40px);
}

.about,
.works,
.contact {
  opacity: 0;
  transform: translateY(60px);
}

.work-item {
  overflow: hidden;
}


/* =========================
   CUSTOM CURSOR
========================= */

.custom-cursor {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.3s, height 0.3s;
}

.custom-cursor.active {
  width: 70px;
  height: 70px;
}

/* マウス操作できる端末だけ表示 */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button {
    cursor: none;
  }
}

/* =========================
   BIG SCROLL TEXT
========================= */

.scroll-title {
  font-size: clamp(70px, 15vw, 200px);
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: -8px;
  color: transparent;
  -webkit-text-stroke: 1px #ffffff;
  padding: 70px 0;
}

/* =========================
   WORK HOVER
========================= */

.work-item {
  position: relative;
  transition: background 0.4s;
}

.work-item:hover {
  background: #151515;
}

.work-item h3 {
  transition: color 0.4s;
}

.work-item:hover h3 {
  color: #888888;
}


/* =========================
   WORKS GALLERY
========================= */

.works h2 {
  margin-bottom: 80px;
}

.work-item:hover .work-image img {
  transform: scale(1.08);
  filter: brightness(1);
}

.work-info p {
  font-size: 11px;
  color: #888888;
  letter-spacing: 3px;
  margin-bottom: 15px;
}

.work-info h3 {
  font-size: clamp(30px, 6vw, 75px);
  letter-spacing: -2px;
  transition: transform 0.5s;
}

.work-item:hover .work-info h3 {
  transform: translateX(20px);
}


/* =========================
   SCATTERED WORKS GALLERY
========================= */

.work-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  padding: 30px 0 100px;
}

.work-item {
  display: block;
  color: #ffffff;
  text-decoration: none;
  border: none;
  padding: 0;
  overflow: visible;
}

/* 画像共通 */

.work-image {
  width: 100%;
  overflow: hidden;
  background: #1a1a1a;
}

.work-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
  transition: transform 0.8s ease,
              filter 0.8s ease;
}

.work-item:hover .work-image img {
  transform: scale(1.1);
  filter: brightness(1);
}

/* 1枚目 */

.work-item:nth-child(1) {
  grid-column: 1 / 8;
  grid-row: 1;
  width: 100%;
  transform: rotate(-3deg);
  z-index: 2;
}

.work-item:nth-child(1) .work-image {
  height: 380px;
}

/* 2枚目 */

.work-item:nth-child(2) {
  grid-column: 8 / 13;
  grid-row: 1;
  width: 100%;
  margin-top: 150px;
  transform: rotate(4deg);
  z-index: 3;
}

.work-item:nth-child(2) .work-image {
  height: 280px;
}

/* 3枚目 */

.work-item:nth-child(3) {
  grid-column: 3 / 10;
  grid-row: 2;
  width: 100%;
  margin-top: 70px;
  transform: rotate(-2deg);
  z-index: 1;
}

.work-item:nth-child(3) .work-image {
  height: 400px;
}

/* タイトル */

.work-info {
  padding: 20px 0;
}

.work-info p {
  color: #888;
  font-size: 11px;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.work-info h3 {
  font-size: clamp(22px, 4vw, 45px);
  transition: transform 0.4s ease;
}

.work-item:hover .work-info h3 {
  transform: translateX(10px);
}

/* スマホ */

@media (max-width: 768px) {

  .work-list {
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding-bottom: 50px;
  }

  .work-item:nth-child(1),
  .work-item:nth-child(2),
  .work-item:nth-child(3) {
    width: 85%;
    margin: 0;
  }

  .work-item:nth-child(2) {
    align-self: flex-end;
  }

  .work-item:nth-child(3) {
    align-self: center;
  }

  .work-item:nth-child(1) .work-image,
  .work-item:nth-child(2) .work-image,
  .work-item:nth-child(3) .work-image {
    height: 250px;
  }

}

/* MOBILE */

@media (max-width: 768px) {

  .work-list {
    gap: 60px;
  }

  .work-image {
    height: 280px;
  }

}

/* =========================
   PARALLAX EFFECT
========================= */

.work-item {
  will-change: transform;
}

.work-item:nth-child(1) {
  --parallax-speed: -40px;
}

.work-item:nth-child(2) {
  --parallax-speed: 60px;
}

.work-item:nth-child(3) {
  --parallax-speed: -25px;
}


/* =========================
   3D HOVER EFFECT
========================= */

.work-item {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: filter 0.4s ease;
}

.work-image {
  transform-style: preserve-3d;
  transition: box-shadow 0.4s ease;
}

.work-item:hover .work-image {
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.work-info {
  transform: translateZ(20px);
}


/* =========================
   HERO BACKGROUND VISUAL
========================= */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-image: url("../images/hero-bg.png");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

/* 背景の暗さを調整 */

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

/* 背景にゆっくり動きをつける */

.hero {
  animation: heroBackground 18s ease-in-out infinite alternate;
}

@keyframes heroBackground {
  from {
    background-position: 50% 50%;
  }

  to {
    background-position: 60% 50%;
  }
}

/* スマホ */

@media (max-width: 768px) {
  .hero {
    background-position: 60% center;
  }

  .hero::before {
    background: rgba(0, 0, 0, 0.55);
  }
}



/* =========================
   FIXED HEADER
========================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 25px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;

  background: rgba(9, 9, 9, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);

  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* PCナビゲーション */

.nav {
  display: flex;
  align-items: center;
  gap: 35px;
}

.nav a {
  color: #aaaaaa;
  font-size: 12px;
  letter-spacing: 2px;
  text-decoration: none;
  transition: color 0.3s;
}

.nav a:hover {
  color: #ffffff;
}

/* ハンバーガーボタン */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: #ffffff;
  margin: 6px auto;
  transition: transform 0.3s, opacity 0.3s;
}

/* ボタンを押したときのアニメーション */

.menu-toggle.active span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* =========================
   MOBILE MENU
========================= */

@media (max-width: 768px) {

  .header {
    padding: 15px 5%;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;

    padding: 35px 20px;

    background: rgba(9, 9, 9, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-15px);
    transition: opacity 0.3s,
                transform 0.3s,
                visibility 0.3s;
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a {
    font-size: 13px;
    letter-spacing: 3px;
  }

}


/* =============================================
   MOBILE SIDE BOUNCE FIX　スマホ表示の時のブレ防止
=============================================== */

/* 横方向のはみ出しを防ぐ */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* 画像が画面からはみ出さないようにする */

img {
  max-width: 100%;
}

/* 横に移動する巨大文字を制限 */

.scroll-section {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* スマホ専用の調整 */

@media (max-width: 768px) {

  body {
    overflow-x: hidden;
  }

  main,
  .hero,
  .about,
  .works,
  .contact {
    max-width: 100%;
  }

  /* 写真の回転による横はみ出しを防ぐ */

  .work-item:nth-child(1),
  .work-item:nth-child(2),
  .work-item:nth-child(3) {
    transform: none !important;
  }

  /* 3D演出による揺れを防ぐ */

  .work-item {
    perspective: none;
    transform-style: flat;
  }

  .work-image {
    max-width: 100%;
  }

  /* 巨大文字のサイズ調整 */

  .scroll-title {
    letter-spacing: -4px;
  }

}
