/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

:root {
  /* Contact イラストの微調整用（デスクトップでは少し右に寄せる） */
  --contact-nudge: 8px;
}

body {
  font-family: 'Outfit', sans-serif;
  margin: 0;
  color: #222;
  background: #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 .3s ease;
}

a:hover {
  text-decoration: none;
}

/* ===== Header (centered nav, IG right) ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.05);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: .75rem 1rem;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  cursor: pointer;
  justify-self: start;
  margin-bottom: 0;
  padding-left: 0;
}

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

.main-nav {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  margin: 0;
}

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

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

.header-right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.header-right a svg {
  fill:#333;
  opacity:.75;
  transition: opacity .3s ease, transform .3s ease;
}

.header-right a:hover svg {
  opacity:1;
  transform: scale(1.1);
}

/* ===== Hero ===== */
.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;
}

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

.section h3 {
  text-align: center;
}

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

/* ===== Now / On-going Projects ===== */

.section-now {
  padding-top: 3em;
  padding-bottom: 3em;
}

/* 見出しサイズは他セクションと合わせる */
.section-now h3,
.section-now .section-title {
  text-align: center;
  margin-bottom: 0.5em;
  font-size: 1.8rem;
}

.now-lead {
  text-align: center;
  font-size: 0.95rem;
  max-width: 640px;
  margin: 0 auto 1.8rem;
}

/* 横スクロール本体 */
.now-scroller {
  position: relative;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-inline: -2em;   /* 画面端まで広げたい場合 */
  padding-inline: 2em;
  scroll-behavior: smooth;

  /* スクロールバー非表示 */
  scrollbar-width: none;    /* Firefox */
  -ms-overflow-style: none; /* IE/Edge old */
}

.now-scroller::-webkit-scrollbar {
  display: none;            /* Chrome / Safari */
}

.now-track {
  display: flex;
  gap: 1.5rem;
  transform: translateX(0);
  transition: transform 220ms ease-out;
}

/* マウスオーバーしたとき、全体がほんの少し左にスッと動く */
.now-scroller:hover .now-track {
  transform: translateX(-12px);
}

/* 各カード */
.now-card {
  flex: 0 0 320px;          /* カード幅 */
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  transition:
    transform 200ms ease-out,
    box-shadow 200ms ease-out;
}

.now-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin-bottom: 1rem;
}

.now-card h4 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: #222;
}

.now-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  color: #999;
}

/* Now セクションのリンク色を灰色に、ホバーで緑に */
.section-now a {
  color: #999;                 /* 通常状態は灰色（ポートフォリオと揃える） */
  text-decoration: none;
  transition: color .3s ease;
}

.section-now a:hover {
  color: #4e9a84;              /* ホバー時は緑 */
  text-decoration: none;
}

/* ホバーしたカードだけ、少しだけ大きく＆持ち上がる */
.now-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}

/* タイトル内の薄いタグ用 */
.tag-muted {
  font-size: 0.9rem;
  font-weight: normal;
  color: #777;
}

/* ← scroll → ヒント */
.now-hint {
  font-size: 0.75rem;
  text-align: right;
  margin-top: 0.25rem;
  opacity: 0.0;
  transition: opacity 160ms ease-out;
}

.now-scroller:hover + .now-hint {
  opacity: 0.8;
}

/* モバイルで Now セクションを少し詰める */
@media (max-width: 600px) {
  .section-now {
    padding-inline: 1.25rem;
  }
  .now-card {
    flex: 0 0 260px;
  }
}

/* About：Instagramリンクは下線なし＋ホバー緑 */

.section.about a {
  color:#444;
  text-decoration:none;
  transition: color .3s ease;
}

.section.about a:hover {
  color:#4e9a84;
  text-decoration:none;
}

/* ===== 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,.08);
  display:flex;
  flex-direction:column;
  transition: transform .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:.4em;
  color:#222;
}

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

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

/* ===== Fade-in ===== */
.fade-in {
  opacity:0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .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: rgba(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,.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: rgba(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,.3);
  transition: color .3s ease, background-color .3s ease;
}

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

/* ===== KABK modal close button (unify with Works modal) ===== */
.kabk-close {
  background: none !important;
  box-shadow: none !important;
  color: #fff;
  font-size: 32px;
  font-weight: 600;
  border: none;
  width: auto;
  height: auto;
  padding: 0;
  line-height: 1;
  top: 20px;
  right: 25px;
}

.kabk-close:hover {
  background: none !important;
  color: #ccc;
}


/* ===== KABK modal slider ===== */

.kabk-modal .kabk-modal-inner {
  position: relative;
  margin: 4vh auto;
  max-width: 900px;
  background: #111;
  border-radius: 12px;
  padding: 1.5rem 3.5rem 2rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  color: #eee;
}

.kabk-slide-frame {
  text-align: center;
}

#kabk-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto 1rem;
}

.kabk-caption {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0.25rem 0 0.5rem;
  color: #ccc;
}

.kabk-counter {
  font-size: 0.8rem;
  color: #888;
}

.kabk-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255,255,255,0.08);
  color: #f5f5f5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.kabk-prev { left: 1.2rem; }
.kabk-next { right: 1.2rem; }

.kabk-nav:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-50%) scale(1.05);
}

/* KABK 内の × ボタンだけ、背景を少し濃く */
.kabk-modal .kabk-close {
  right: 1.2rem;
  top: 1rem;
  background: rgba(255,255,255,0.08);
}

.kabk-modal .kabk-close:hover {
  background: rgba(255,255,255,0.2);
}

/* モバイル調整 */
@media (max-width: 640px) {
  .kabk-modal .kabk-modal-inner {
    margin: 6vh auto;
    max-width: 95vw;
    padding: 1rem 1.5rem 1.5rem;
  }
  .kabk-prev { left: 0.4rem; }
  .kabk-next { right: 0.4rem; }
}


/* ===== 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: visual centering tweak */
.section.contact .contact-illustration {
  display: block;
  margin: 0 auto 2em;
  width: clamp(90px, 12vw, 150px);
  height: auto;
  transform: translateX(var(--contact-nudge));
}

/* Contact内のリンク（メール等）は従来の下線あり */
.section.contact a {
  color: #88bca7;
  text-decoration: underline;
  font-weight: 500;
}

.section.contact a:hover {
  color: #4e9a84;
  text-decoration: underline;
}

/* ===== 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;
  }

  .section.contact .contact-illustration {
    width: clamp(120px, 35vw, 220px);
  }

  /* スマホではイラストの寄せをリセット */
  :root {
    --contact-nudge: 0px;
  }
}
