/* ========================================
   General Styles
======================================== */
html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans JP', sans-serif;
  scroll-behavior: smooth;
}

/* ========================================
   Background & Content Containers
======================================== */
#background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: #fcfdff;
}

main#page-wrapper {
  position: relative;
  z-index: 1;
  /* 背景を透過させることで background-container が見えるようにする */
  isolation: isolate;
}

/* ========================================
   Parallax Background Styles
======================================== */
#parallax-bg {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.parallax-shape {
  position: absolute;
  border-radius: 15%;
  transition: transform 0.1s linear;
}

/* ========================================
   Hero Section
======================================== */
#hero {
  position: relative;
  height: 720px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#logo {
  position: absolute;
  top: 1rem;
  left: 1rem;
  margin: 0;
  font-size: 2.4rem;
  z-index: 2;
}

/* --- Navigation --- */
#nav {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

#hamburger {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 101;
  user-select: none;
}

#close-btn {
  display: none;
}

#nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#nav-menu li a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 1rem;
}

/* --- Hero Content --- */
.hero-flex-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
  justify-items: center;
  box-sizing: border-box;
}

#hero-content {
  grid-area: 1 / 1 / 2 / 2;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#animation-wrapper {
  grid-area: 1 / 1 / 2 / 2;
  z-index: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

#catch {
	padding-top: 100px;
  font-size: 3rem;
  font-weight: bolder;
  letter-spacing: 0.2em;
  line-height: 2em;
}

#sub-catch {
  max-width: 50%; /* 表示幅を調整 */
  margin: 3rem auto 0 auto;
  padding: 0 2rem;
  font-size: 2rem; /* フォントサイズを調整 */
  font-weight: 600; /* 少し太字に */
  color: #265568;
  letter-spacing: 0.1em;
  line-height: 1.7;
  text-align: center; /* 中央揃えに */
  z-index: 2;
  position: relative;
}

#catch-txt {
  max-width: 45%;
  margin: 1.5rem auto 0 auto;
  padding: 0 2rem;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  line-height: 1.8;
  text-align: justify;
  z-index: 2;
  position: relative;
}

/* --- Puzzle Animation (Hero Background) --- */
#puzzle-container {
  position: absolute;
  top: 10%;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.piece {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  opacity: 0;
  transition: transform 2s ease, opacity 2s ease, background-color 3s ease;
}

/* ========================================
   Main Contents
======================================== */
h2 {
  font-size: 2.4rem;
}

#features h2,
#main-section h2,
#about h2,
#contact h2 {
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

#features h2::after,
#main-section h2::after,
#about h2::after,
#contact h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background-color: #abccdd;
}

#logo img{
	width: 200px;
}

/* ========== Features Section ========== */
#features {
  padding: 4rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

#features h2 {
  text-align: center;
  margin-bottom: 20px;
}

.features-subtitle {
  text-align: center;
  margin-bottom: 60px;
  color: #555;
}

.feature-image-viewer {
  display: none;
}

.feature-text-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
}

.feature-item {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 30px;
  padding-top: 50px;
  box-sizing: border-box;
  text-align: center;
  background-color: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.feature-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-item::before {
  content: '';
  display: block;
  width: 240px;
  height: 240px;
  margin: 0 auto 25px auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.feature-item[data-feature="1"]::before { background-image: url('image/feature01.jpg'); }
.feature-item[data-feature="2"]::before { background-image: url('image/feature02.jpg'); }
.feature-item[data-feature="3"]::before { background-image: url('image/feature03.jpg'); }

.feature-number {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  padding: 10px 15px 15px 15px;
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  color: #fff;
  background-color: #3682a0;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
}

.feature-title {
  display: inline-block;
  position: relative;
  margin-bottom: 15px;
  padding-bottom: 5px;
  font-size: 1.1rem;
  color: #3682a0;
}

.feature-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #3682a0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-item.is-visible .feature-title::after {
  transform: scaleX(1);
}

.feature-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #333;
  text-align: justify;
}

@media (min-width: 769px) {
  #feature-wrapper {
    position: relative;
    height: 450vh;
  }

  #feature-box {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
  }

  #features {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem;
  }

  #features-header {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  #features-header h2 {
    margin-bottom: 20px;
  }

  .features-container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 60px;
    overflow: hidden;
  }

  .feature-image-viewer {
    display: flex;
    flex: 3;
    position: relative;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .feature-image {
    position: absolute;
    width: 100%;
    max-width: 650px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
  }

  .feature-image.active {
    opacity: 1;
  }

  .feature-image img {
    width: 100%;
    height: auto;
  }

  .feature-text-container {
    flex: 3;
    height: 100%;
    position: relative;
  }

  .feature-item::before {
    display: none;
  }

  .feature-item {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    max-width: none;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.4s ease-in-out;
  }

  .feature-item.is-visible {
    opacity: 1;
    transform: translateY(-50%);
  }

  .feature-number {
    position: static;
    display: inline-block;
    padding: 10px 15px 18px 15px;
    margin-bottom: 1.5rem;
    transform: none;
  }

  .feature-title {
    width: 100%;
    font-size: 2rem;
  }

  .feature-desc {
    font-size: 1rem;
    line-height: 1.8;
  }

  .feature-number,
  .feature-title,
  .feature-desc {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .feature-item.is-visible .feature-number {
    opacity: 1;
    transform: translateY(0);
  }

  .feature-item.is-visible .feature-title {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
  }

  .feature-item.is-visible .feature-desc {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
  }

  .feature-scroll-triggers {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    z-index: -1;
  }

  .trigger {
    height: 120vh;
  }
}

/* ========== Service (Works) Section ========== */
#main-section {
  padding: 4rem 2rem;
  max-width: 960px;
  margin: 0 auto;
  line-height: 1.6;
}

#main-section h2 {
  text-align: center;
}

.card-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.card {
  position: relative;
  width: 70%;
  padding: 10px 20px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.card.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.card:nth-child(1)::before,
.card:nth-child(4)::before {
  animation: float1 6s ease-in-out infinite alternate;
}

.card:nth-child(2)::before,
.card:nth-child(5)::before {
  animation: float2 8s ease-in-out infinite alternate -2s;
}

.card:nth-child(3)::before,
.card:nth-child(6)::before {
  animation: float3 7s ease-in-out infinite alternate -4s;
}

.card:nth-child(odd)::before {
  left: calc(100% + 50px);
  right: -100vw;
  background-position: left center;
}

.card:nth-child(even)::before {
  right: calc(100% + 50px);
  left: -100vw;
  background-position: right center;
}

.card:nth-child(1)::before { background-image: url('image/service01.png'); }
.card:nth-child(2)::before { background-image: url('image/service02.png'); }
.card:nth-child(3)::before { background-image: url('image/service03.png'); }
.card:nth-child(4)::before { background-image: url('image/service04.png'); }
.card:nth-child(5)::before { background-image: url('image/service05.png'); }
.card:nth-child(6)::before { background-image: url('image/service06.png'); }

.card:nth-child(odd) {
  margin-right: auto;
  margin-left: 0;
}

.card:nth-child(even) {
  margin-left: auto;
  margin-right: 0;
}

.title {
  padding: 0 0 10px 0;
  font-size: 1.4em;
  font-weight: bold;
  color: #3682a0;
  text-align: left;
  opacity: 0;
  transition: opacity 0.5s ease-out 0.2s, transform 0.5s ease-out 0.2s;
}

.card:nth-child(odd) .title {
  transform: translateX(-40px);
}

.card:nth-child(even) .title {
  transform: translateX(40px);
}

.card.is-shown .title {
  opacity: 1;
  transform: translateX(0);
}

.card-catch {
  margin: 10px 0;
  color: #3682a0;
  text-align: left;
}

.desc {
  padding: 10px 0 20px;
  font-size: 0.95em;
  color: #555;
  line-height: 1.5;
  text-align: justify;
}

.simple-badge {
  display: inline-block;
  margin: 5px 0;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #444;
  background: #f0f0f0;
  border-radius: 12px;
}

.tools-used {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
  margin: 5px 0 30px 0;
  font-size: 0.8rem;
  color: #333;
}

.tool {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #333;
  background: #dbe1f0;
  border-radius: 14px;
}

/* ========== About Section ========== */
#about-box {
  padding: 4rem 0;
}

#about h2,
#about .features-subtitle {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
  text-align: center;
}

.about-container {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem;
  box-sizing: border-box;
}

.about-text {
  flex-basis: 65%;
  min-width: 0;
  line-height: 2;
  text-align: justify;
}

.about-text p {
  padding-bottom: 2rem;
}

.about-image {
  position: absolute;
  top: 50%;
  left: calc(50% - 50vw);
  right: calc(65% + 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

/* ========== Contact Section ========== */
#contact {
  padding: 4rem 2rem;
  max-width: 960px;
  margin: 100px auto;
}

#contact h2 {
  text-align: center;
  margin-bottom: 20px;
}

.contact-message {
  margin-bottom: 40px;
  text-align: center;
  color: #555;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1em;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #75a5b8;
  box-shadow: 0 0 0 3px rgba(117, 165, 184, 0.2);
}

.form-submit {
  margin-top: 30px;
  text-align: center;
}

.form-submit button {
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  background-color: #e0c323;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.form-submit button:hover {
  background-color: #555;
}

/* ========================================
   Footer
======================================== */
footer {
  padding: 3rem 2rem;
  color: #f4f4f4;
  background-color: #75a5b8;
  text-align: center;
  /* 左上、右上の角を丸める */
  border-radius: 50px 50px 0 0;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto 2rem auto;
}

.footer-logo img{
/*font-size: 1.8rem;
  font-weight: bold;*/
  width: 200px;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
}

.footer-nav a {
  color: #f4f4f4;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.footer-nav a:hover {
  color: #abccdd;
}

.copyright {
  margin: 0;
  font-size: 0.8rem;
  color: #fff;
}

/* --- Floating Animation for Service Images --- */
@keyframes float1 {
  0% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0); }
}

@keyframes float2 {
  0% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}

@keyframes float3 {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* ========================================
   Utility: Ripple Effect
======================================== */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ========================================
   Responsive Styles (for Tablet & Mobile)
======================================== */
@media (max-width: 768px) {
  #hero {
    height: auto;
    padding: 6rem 0 3rem 0;
    justify-content: flex-start;
  }

  #puzzle-container {
	  top :0;
    opacity: 0.5;
  }

  .piece {
    width: 40px;
    height: 40px;
    border-radius: 6px;
  }

  #hamburger {
    display: block;
  }

  #close-btn {
    display: block;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    text-align: right;
    margin-bottom: 1rem;
  }

  #close-btn:hover {
    color: #000;
  }

  #nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    padding: 2rem;
    background: #fff;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
  }

  #nav-menu.active {
    transform: translateX(0);
  }

  #nav-menu li {
    margin-bottom: 1.5rem;
  }
  
  #logo img {
	  width: 120px;
  }

  .hero-flex-container {
    padding: 0 1.5rem;
  }

  #catch {
	  padding-top: 0;
    font-size: 2rem;
  }

  #sub-catch {
  max-width: 90%;
  margin-top: 2rem;
  font-size: 1.1rem;
}
  #catch-txt {
    max-width: 90%;
    margin-top: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
  }

  h2 {
    font-size: 1.6rem;
  }

  #features {
    padding: 3rem 1.5rem;
  }

  .feature-title {
    font-size: 1.4rem;
  }

  .card::before {
    display: none;
  }

  .card,
  .card:nth-child(odd),
  .card:nth-child(even) {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
  }

  .card .title,
  .card .card-catch {
    text-align: center;
  }

  .card .title {
    margin-top: 12px;
    font-size: 1.2rem;
  }

  .card:nth-child(even) .title {
    transform: translateX(0);
  }

  #about-box {
    padding: 3rem 1.5rem;
  }

  .about-container {
    position: static;
    flex-direction: column;
    gap: 30px;
    padding: 0;
  }

  .about-image {
    position: static;
    width: 100%;
    /* aspect-ratio: 1 / 1; の行を削除しました */
    transform: none;
  }

  .about-text {
    flex-basis: auto;
    max-width: 90%;
    padding: 0;
    text-align: justify;
  }

  #contact {
	  margin-top: 0px;
	  margin-bottom: 20px;
    padding: 3rem 1.5rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 2rem;
  }
  
  .footer-logo img {
	  width: 100px;
  }
}

/* --- Slideshow Styles for About Section --- */
.about-image .grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 15px;
  width: 100%;
}

.about-image .grid-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.about-image .grid-item img {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

@keyframes slide-in-from-top { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes slide-in-from-bottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slide-in-from-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes slide-in-from-right { from { transform: translateX(100%); } to { transform: translateX(0); } }

.about-image .slide-in-from-top { animation: slide-in-from-top 0.7s ease-out forwards; z-index: 2; }
.about-image .slide-in-from-bottom { animation: slide-in-from-bottom 0.7s ease-out forwards; z-index: 2; }
.about-image .slide-in-from-left { animation: slide-in-from-left 0.7s ease-out forwards; z-index: 2; }
.about-image .slide-in-from-right { animation: slide-in-from-right 0.7s ease-out forwards; z-index: 2; }