/* ================================================================
   MIYAZATO Portfolio — main.css
   Theme: Brutally minimal / industrial Japanese
   Font: Helvetica Neue (Latin) + Noto Sans JP (JP) + IBM Plex Mono
   Colors extracted from business card
   ================================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ── Design Tokens ── */
:root {
  --ink:        #1a1209;
  --ink-muted:  #5c5445;
  --ink-faint:  #a09585;
  --green:      #006837;   /* 北大グリーン */
  --green-pale: #e8f4ed;
  --white:      #ffffff;
  --off-white:  #faf9f7;
  --rule:       #d8d2c8;

  --font-body: 'Helvetica Neue', Helvetica, Arial, 'Noto Sans JP', sans-serif;
  --font-ja:   'Noto Sans JP', 'Helvetica Neue', sans-serif;
  --font-mono: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --nav-h: 56px;
  --max-w: 1500px;
  --px-margin: max(2.5rem, calc((100vw - 1500px) / 2));
}

/* ── Base ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* ── Typography helpers ── */
.section-num {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  color: var(--green);
  letter-spacing: -0.02em;
  font-weight: 900;
}

.tag-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  color: var(--ink-muted);
}
.tag.green {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 24px;
  border: 1px solid var(--ink);
  color: var(--ink);
  letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn.green { border-color: var(--green); color: var(--green); }
.btn.green:hover { background: var(--green); color: var(--white); }

/* ── NAV ── */
.site-nav {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 100;
  width: 100%; max-width: var(--max-w);
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  height: var(--nav-h);
}
.nav-logo {
  font-weight: 900; font-size: 1.15rem; letter-spacing: 0.05em;
  color: var(--ink);
}
.nav-logo span { color: var(--green); }

.nav-links {
  display: flex; gap: 2rem; list-style: none;
}
.nav-links a {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--ink-muted); text-transform: uppercase;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--green); }

/* ── SECTION WRAPPER ── */
section { border-bottom: 1px solid var(--rule); }

.section-header {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding: 3.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.section-header h2 {
  font-weight: 900; font-size: 1.7rem; letter-spacing: -0.01em;
}

/* ── HERO ── */
.hero {
  margin-top: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}

.hero__left {
  padding: 5rem 3rem 5rem 2.5rem;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--rule);
}

.hero__tag {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green);
  margin-bottom: 2rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.hero__tag::before {
  content: ''; display: block; width: 24px; height: 1px; background: var(--green);
}

.hero__name { font-weight: 900; line-height: 1.0; }
.hero__name .ja { font-size: 5rem; display: block; letter-spacing: -0.02em; white-space: nowrap; }
.hero__name .en {
  font-size: 1.2rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--ink-muted); display: block; margin-top: 1.5rem;
  font-family: var(--font-mono);
}

.hero__affil {
  margin-top: 2.5rem; padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem; color: var(--ink-muted); line-height: 2.0;
}
.hero__affil strong {
  color: var(--ink); font-weight: 700;
  display: block;
  white-space: nowrap;
}
.hero__affil .en-small {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-faint);
  display: block; margin-top: 0.5rem;
}

.hero__right {
  padding: 5rem 2.5rem 5rem 3rem;
  display: flex; flex-direction: column; justify-content: center;
}

.hero__bio {
  font-size: 1.15rem; line-height: 1.9; color: var(--ink);
  margin-bottom: 2.5rem;
}
.hero__bio p + p { margin-top: 0.9rem; }

/* ── PROJECTS ── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-card {
  padding: 2rem 2rem 2rem 2.5rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: background 0.18s;
}
.project-card:nth-child(2n) { border-right: none; }
.project-card:hover { background: var(--off-white); }

.project-card__num {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--ink-faint); letter-spacing: 0.1em; margin-bottom: 1rem;
}
.project-card__title {
  font-weight: 900; font-size: 1.2rem; margin-bottom: 0.75rem;
}
.project-card__desc {
  font-size: 0.95rem; color: var(--ink-muted); line-height: 1.7; margin-bottom: 1.25rem;
}
.project-card__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.project-card__tag {
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 3px 8px; background: #f0ede8; color: var(--ink-muted);
}

.project-card__arrow {
  position: absolute; top: 1.5rem; right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 700;
  color: var(--ink-faint); /* デフォルトで表示 */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.18s; display: inline-block;
}
.project-card:hover .project-card__arrow {
  color: var(--green); /* ホバーで色を変える */
  transform: translate(3px, -3px);
}

/* ── SKILLS ── */
.skill-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-bottom: 3rem;
}
.skill-group {
  padding: 2rem 2rem 2rem 2.5rem;
  border-right: 1px solid var(--rule);
}
.skill-group:last-child { border-right: none; }
.skill-group__title {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--green); margin-bottom: 1rem;
}
.skill-list { list-style: none; }
.skill-list li {
  font-size: 0.95rem; color: var(--ink-muted); padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 0.5rem;
}
.skill-list li::before { content: '—'; color: var(--rule); font-size: 0.75rem; }

/* ── CONTACT ── */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr;
}
.contact__left {
  padding: 4rem 3rem 4rem 2.5rem;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; justify-content: center;
}
.contact__heading {
  font-weight: 900; font-size: 3rem; line-height: 1.0; margin-bottom: 1rem;
}
.contact__sub { font-size: 0.95rem; color: var(--ink-muted); }

.contact__right {
  padding: 4rem 2.5rem;
  display: flex; flex-direction: column; justify-content: center; gap: 0.75rem;
}
.contact-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; border: 1px solid var(--rule);
  transition: border-color 0.15s;
}
.contact-item:hover { border-color: var(--green); }
.contact-item__icon {
  width: 32px; height: 32px; border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0; color: var(--green);
}
.contact-item__label {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 2px;
}
.contact-item__value {
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink);
}

/* ── FOOTER ── */
.site-footer {
  padding: 1.5rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; font-family: var(--font-mono); color: var(--ink-faint);
  border-top: 1px solid var(--rule);
}

/* ── PROJECT DETAIL PAGE ── */
.project-detail {
  margin-top: var(--nav-h);
}

.project-detail__header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}

.project-detail__header-left {
  padding: 5rem 3rem 5rem 2.5rem;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* 子要素が横に広がらないように */
}

.project-detail__header-right {
  padding: 5rem 2.5rem 5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--off-white);
}

.project-detail__hero-image {
  position: relative;
  background-size: cover;
  background-position: center;
  border-left: 1px solid var(--rule);
  cursor: zoom-in; /* クリック可能であることを示す */
}

.project-detail__hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.05); /* 視認性のための極薄いフィルターのみ */
}

.project-detail__actions {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 10; /* ボタンを最前面に */
}

.btn.white-outline {
  background: rgba(255, 255, 255, 0.9);
  border-color: #fff;
  color: var(--ink);
  backdrop-filter: blur(4px);
}
.btn.white-outline:hover {
  background: #fff;
  color: var(--green);
}
/* ── TIMELINE ── */
  .back-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3.5rem;
    display: inline-block;
    padding: 6px 12px; /* 少し詰めました */
    border: 1px solid var(--rule);
    transition: all 0.15s;
  }

  .back-link:hover {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-pale);
  }

  .project-detail__meta {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 2rem; /* 余白追加 */
  }

  .project-detail__title {
    font-weight: 900;
    font-size: 3rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .project-detail__desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--ink-muted);
    margin-bottom: 3rem; /* 余白追加 */
    max-width: 550px;
  }
.project-detail__body-wrapper {
  padding: 5rem 2.5rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--rule);
}

.project-detail__body {
  max-width: 800px;
  width: 100%;
  font-size: 1.15rem;
  line-height: 2.0;
}

.project-detail__body h2 {
  font-weight: 900;
  font-size: 1.8rem;
  margin: 4rem 0 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.project-detail__body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.project-detail__body p + p {
  margin-top: 1.5rem;
}

.project-detail__body ul,
.project-detail__body ol {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}

.project-detail__body li {
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

.project-detail__body li::marker {
  color: var(--green);
  font-weight: 900;
}

.project-detail__body code {
  font-family: var(--font-mono);
  font-size: 0.95em;
  background: var(--off-white);
  padding: 3px 8px;
  border: 1px solid var(--rule);
}

.project-detail__body pre {
  background: var(--off-white);
  border: 1px solid var(--rule);
  padding: 2rem;
  overflow-x: auto;
  margin: 2.5rem 0;
}

.project-detail__footer {
  padding: 4rem 2.5rem;
  text-align: center;
  /*background: var(--off-white);*/
}

@media (max-width: 992px) {
  .project-detail__header {
    grid-template-columns: 1fr;
  }
  .project-detail__header-left {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 4rem 1.5rem;
  }
  .project-detail__header-right {
    padding: 3rem 1.5rem;
  }
  .project-detail__hero-image {
    min-height: 400px;
    border-left: none;
  }
  .project-detail__title {
    font-size: 2.2rem;
  }
}

/* ── HERO AWARDS ── */
.hero__awards { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 1.5rem; }
.awards-label {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--green); margin-bottom: 0.75rem;
}
.awards-list { list-style: none; }
.awards-list li {
  font-size: 0.95rem; color: var(--ink-muted);
  padding: 0.75rem 0 0.5rem; border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 1rem;
}
.award-year {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--green); flex-shrink: 0; font-weight: 700;
  min-width: 3.5rem;
  line-height: 1;
}
/* ── TIMELINE ── */
.timeline {
  padding: 0 2.5rem 3.5rem;
}
.timeline-subheading {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--green);
  margin: 2.5rem 0 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.timeline-subheading::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}
.tl-item {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 0 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.tl-item::before {
  content: none;
}
.tl-year {
  font-family: var(--font-mono); font-size: 0.95rem;
  font-weight: 500; color: var(--green);
  padding-top: 0.1rem; text-align: right;
}
.tl-body { padding-left: 0; }
.tl-title {
  font-weight: 700; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.35rem;
}
.tl-desc { font-size: 0.95rem; color: var(--ink-muted); line-height: 1.7; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero,
  .contact-grid { grid-template-columns: 1fr; }

  .hero__left { border-right: none; border-bottom: 1px solid var(--rule); }
  .hero__name .ja { font-size: 3.5rem; }

  .project-grid,
  .skill-grid { grid-template-columns: 1fr; }

  .project-card { border-right: none; }
  .skill-group { border-right: none; border-bottom: 1px solid var(--rule); }

  .contact__left { border-right: none; border-bottom: 1px solid var(--rule); }
  .contact__heading { font-size: 2rem; }

  .timeline { padding: 0 1.25rem 2.5rem; }
  .tl-item { grid-template-columns: 48px 1fr; }
  .tl-item::before { left: 47px; }

  .site-nav { padding: 0 1.25rem; }
  .section-header { padding: 2.5rem 1.25rem 1.5rem; }
}

/* ── PARALLAX BANNER ── */
.parallax-banner {
  position: relative;
  height: 420px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.parallax-banner__img {
  position: absolute;
  inset: -30% 0;         /* 上下に余裕を持たせてスクロール量を吸収 */
  width: 100%;
  height: 160%;
  object-fit: cover;
  object-position: center;
  will-change: transform; /* JS で translateY を当てる */
  filter: grayscale(20%) brightness(0.88);
}
.parallax-banner__caption {
  position: absolute;
  bottom: 2rem; left: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.parallax-banner__caption strong {
  color: #fff; font-weight: 500;
}

/* ── PROJECT PHOTO GALLERY (STRIP) ── */
.photo-gallery-wrapper {
  position: relative;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--rule);
}

.gallery-scroll-btn {
  position: absolute;
  top: 0; bottom: 0;
  width: 50px;
  background: rgba(255, 255, 255, 0.3); /* 背景の白をさらに薄く（透明に） */
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--ink); /* 矢印の色は元の濃さに戻す */
  transition: all 0.2s;
  backdrop-filter: blur(2px);
}
.gallery-scroll-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--green);
}
.gallery-scroll-btn.prev {
  left: 0;
  border-right: 1px solid var(--rule);
}
.gallery-scroll-btn.next {
  right: 0;
  border-left: 1px solid var(--rule);
}

.photo-gallery--strip {
  display: flex !important; /* 強制的にフレックス適用 */
  overflow-x: auto;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--green) transparent;
  padding: 0;
  margin: 0;
  scroll-behavior: smooth; /* JavaScriptによるスクロールを滑らかに */
}

.photo-gallery--strip::-webkit-scrollbar {
  height: 6px;
}
.photo-gallery--strip::-webkit-scrollbar-thumb {
  background: var(--green);
}

.photo-gallery--strip .photo-gallery__item {
  flex: 0 0 auto;
  height: 350px; /* 縦幅を固定 */
  aspect-ratio: 16 / 10; /* 画像の縦横比を統一 */
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--off-white);
}

.photo-gallery--strip .photo-gallery__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* 枠いっぱいにトリミングして収める */
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: none; /* フィルターを完全に削除 */
}

.photo-gallery--strip .photo-gallery__item:hover img {
  transform: scale(1.05);
  filter: none; /* ホバー時もなし */
}

@media (max-width: 768px) {
  .gallery-scroll-btn {
    display: none; /* スマホではスワイプを使うためボタンを隠す */
  }
  .photo-gallery--strip .photo-gallery__item {
    height: auto;
    width: 85vw; /* 画面幅の85%を確保し、次の画像をチラ見えさせる */
    display: block;
  }
  .photo-gallery--strip .photo-gallery__item img {
    object-fit: cover;
  }
}

/* ライトボックスオーバーレイ */
.lb-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,8,5,0.92);
  align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lb-overlay.open { display: flex; }
.lb-overlay img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain;
  box-shadow: none;
}
.lb-close {
  position: absolute; top: 1.5rem; right: 2rem;
  font-family: var(--font-mono); font-size: 1rem;
  color: rgba(255,255,255,0.5); cursor: pointer;
  background: none; border: none;
  transition: color 0.15s;
}
.lb-close:hover { color: #fff; }
.lb-caption {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45); text-transform: uppercase;
  white-space: nowrap;
}
