html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  margin: 0;
  color: #222;
  background-color: #fff;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Quicksand', sans-serif;
  letter-spacing: 0.03em;
  margin-bottom: 0.5em;
}

h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

a {
  color: #444;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* 全リンクのホバー時の下線を消す */
a:hover {
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1rem;
  padding-left: 1rem; /* 左余白 */
  cursor: pointer; /* クリック可能っぽく */
}

.logo-image {
  width: 40px;
  height: auto;
}

.main-nav {
  text-align: center;
  margin: 0 auto 1.5rem;
}

.main-nav a {
  margin: 0 1rem;
  color: #333;
  font-weight: 500;
  font-family: 'Quicksand', sans-serif;
}

.main-nav a:hover {
  color: #4e9a84;
}

.hero {
  position: relative;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  height: 400px;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 600px;
  height: auto;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

.hero-image.active {
  opacity: 1;
  pointer-events: auto;
}

.section {
  padding: 4em 2em;
  max-width: 800px;
  margin: auto;
}

.section h3 {
  text-align: center;
}

.section.about p,
.section.contact p {
  text-align: center;
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5em;
  margin-top: 2em;
}

.portfolio-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-5px);
}

.portfolio-card img {
  width: 100%;
  height: auto;
  display: block;
}

.card-text {
  padding: 1em;
}

.card-text h4 {
  font-weight: 600;
  margin-bottom: 0.4em;
  color: #222;
}

.card-text p {
  font-size: 0.9em;
  color: #999;
  margin-top: 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2em;
  background-color: #fafafa;
  font-size: 0.9em;
  color: #666;
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

.modal-caption {
  margin: auto;
  width: 90%;
  max-width: 700px;
  text-align: center;
  color: #ddd;
  padding: 10px 0;
  font-size: 1.1rem;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 35px;
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  transition: color 0.3s ease, background-color 0.3s ease;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.6);
  color: #ccc;
}

/* View More Link */
.view-more-link {
  text-align: center;
  margin-top: 1.5em;
}

.view-more-link a {
  color: #4e9a84;
  font-weight: 600;
  text-decoration: none;
  font-family: 'Quicksand', sans-serif;
}

.view-more-link a:hover {
  color: #36755a;
  text-decoration: none;
}

/* Contact Section */
.section.contact {
  padding: 6em 2em;
  text-align: center;
}

.contact-illustration {
  max-width: 20%;
  height: auto;
  margin-bottom: 2em;
}

.section.contact a {
  color: #88bca7;
  text-decoration: underline;
  font-weight: 500;
}

.section.contact a:hover {
  color: #4e9a84;
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav a {
    margin: 0 10px;
    display: inline-block;
    margin-top: 0.5em;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2em 1em;
  }

  .contact-illustration {
    max-width: 60%;
  }
}

/* .section::before は一旦コメントアウトまたは削除 */
/*
.section::before {
  content: "";
  display: block;
  height: 80px; 
  margin-top: -80px;
  visibility: hidden;
}
*/

/* 固定ヘッダーの高さに合わせてジャンプ補正 */
:target::before {
  content: "";
  display: block;
  height: 70px; /* ここはヘッダーの実際の高さに合わせて調整 */
  margin-top: -70px;
  visibility: hidden;
}

@media (max-width: 768px) {
  :target::before {
    height: 60px; /* スマホのヘッダー高さが違えばここで調整 */
    margin-top: -60px;
  }
}

/* 固定ヘッダーの高さが70pxの場合 */
h3:target::before {
  content: "";
  display: block;
  height: 70px; /* ヘッダーの高さ */
  margin-top: -70px; /* ヘッダー分を引いて隠れないように */
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 768px) {
  h3:target::before {
    height: 60px;
    margin-top: -60px;
  }
}

.anchor-offset {
  height: 110px;
  margin-top: -110px;
  content: "";
  display: block;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 768px) {
  .anchor-offset {
    height: 110px;
    margin-top: -110px;
  }
}

