/* ============================================================
   KAORU FURUBAYASHI — Self-Introduction
   Reference: nagi-yoshida.com layout
   Font: P22 Cezanne (hero name) + Jost (UI) + Cormorant (display)
   ============================================================ */

:root {
  --bg:        #0a0a0a;
  --bg2:       #111111;
  --border:    rgba(255,255,255,0.12);
  --white:     #ffffff;
  --muted:     rgba(255,255,255,0.50);
  --accent:    rgba(255,255,255,0.06);
  --topbar-h:  36px;
  --nav-h:     60px;
  --offset:    calc(var(--topbar-h) + var(--nav-h));
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* Offset anchor targets so fixed header doesn't overlap */
section[id] {
  scroll-margin-top: var(--offset);
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Jost', 'Noto Serif JP', sans-serif;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.8;
  overflow-x: hidden;
}

/* ── SCROLLBAR ─────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }

/* ── TOP BAR ────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.topbar-title {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── NAV — left:links / right:SNS (nagi-yoshida.com style) ── */
.nav {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 5vw, 4rem);
  z-index: 999;
}

.nav-left {}

.nav-links {
  list-style: none;
  display: flex;
  gap: clamp(1.4rem, 3vw, 3rem);
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.25s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }

/* NAV — right: SNS text links */
.nav-sns {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.nav-sns-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  transition: color 0.25s;
}

.nav-sns-link:hover { color: var(--white); }

.nav-sns-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── HERO ───────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* No padding-top: we want photo to go full height behind fixed nav */
}

/* ── HERO SLIDESHOW BACKGROUND ── */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Each slide stacked absolutely */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: heroFade 42s ease-in-out infinite; /* 7s × 6枚 = 42s */
  background: #000; /* contain時の余白を黒で埋める */
}

.hero-slide-placeholder {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
}

/* 写真がある場合の img スタイル */
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* 全体を収める（切り取りなし） */
  object-position: center center;
  display: block;
}

/* Stagger each slide by 7s (42s total cycle = 7s × 6 slides) */
.hero-slide--1 { animation-delay:  0s; }
.hero-slide--2 { animation-delay:  7s; }
.hero-slide--3 { animation-delay: 14s; }
.hero-slide--4 { animation-delay: 21s; }
.hero-slide--5 { animation-delay: 28s; }
.hero-slide--6 { animation-delay: 35s; }

/*
  Each slide (35s cycle):
  - 0s      : 非表示
  - 〜1.5s  : フェードイン   (1.5/35 ≈ 4.3%)
  - 〜5.5s  : 表示キープ     (5.5/35 ≈ 15.7%)
  - 〜7s    : フェードアウト (7/35   = 20%)
  - 残り28s : 非表示
*/
@keyframes heroFade {
  0%     { opacity: 0; }
  3.6%   { opacity: 1; }   /* fade in  完了 (1.5s / 42s) */
  13.1%  { opacity: 1; }   /* hold     終了 (5.5s / 42s) */
  16.7%  { opacity: 0; }   /* fade out 完了 (7s   / 42s) */
  100%   { opacity: 0; }
}

/* Dark gradient overlay — ensures text legibility over any photo */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.45) 0%,
      rgba(0,0,0,0.30) 50%,
      rgba(0,0,0,0.55) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-top: var(--offset); /* push text below fixed nav */
}

.hero-sub {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.5em;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  margin-bottom: 1.6rem;
  font-weight: 300;
}

/* Sign / handwritten font for name */
.hero-name {
  font-family: "p22-cezanne-pro", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2.8rem, 6.5vw, 6.5rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--white);
  text-shadow:
    0 2px 28px rgba(0,0,0,0.65),
    0 1px 6px rgba(0,0,0,0.5);
}

.hero-line {
  width: 36px;
  height: 1px;
  background: rgba(255,255,255,0.45);
  margin: 2rem auto;
}

.hero-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.65);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  animation: fadeUpDown 2.2s ease-in-out infinite;
}

@keyframes fadeUpDown {
  0%,100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 1;   transform: translateX(-50%) translateY(-5px); }
}

/* ── SECTIONS ───────────────────────────── */
.section {
  padding: clamp(5rem, 10vh, 8rem) clamp(1.5rem, 7vw, 8rem);
}

.section-dark { background: var(--bg2); }

.section-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.38em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 3rem;
  font-weight: 300;
}

.section-desc {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-top: -1.8rem;
  margin-bottom: 3.5rem;
}

/* ── ABOUT GRID ─────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(2.5rem, 6vw, 7rem);
  align-items: start;
  max-width: 1100px;
}

.about-photo-wrap {
  position: sticky;
  top: calc(var(--offset) + 2rem);
}

.about-photo-placeholder {
  width: 100%;
  /* aspect-ratio は画像の縦横比に自動追従 */
  background: var(--accent);
  border: 1px solid var(--border);
  overflow: hidden;
}

.about-photo-placeholder span {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
}

.about-photo-placeholder img {
  width: 100%;
  height: auto;      /* 画像本来の縦横比を保って表示 */
  display: block;
}

.about-block { margin-bottom: 2.8rem; }

.about-block-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.38em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.about-text {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.78);
  line-height: 2.1;
  font-weight: 300;
}

/* Timeline */
.timeline { list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.tl-year {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 300;
}

.tl-desc {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.82);
  font-weight: 300;
}

/* Tag list */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.38rem 0.9rem;
  text-transform: uppercase;
  font-weight: 300;
  transition: color 0.25s, border-color 0.25s;
}

.tag-list li:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}

/* ── SNS inside ABOUT — inline text links (nagi-yoshida.com style) ── */
.about-sns-block {
  margin-top: 0.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}

.about-sns {
  list-style: none;
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
}

.about-sns-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  transition: color 0.25s;
}

.about-sns-link:hover { color: var(--white); }

.about-sns-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── GALLERY ────────────────────────────── */
.gallery-viewer { max-width: 1100px; }

.gallery-main {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  margin-bottom: 1rem;
}

.gallery-main img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.35s ease;
}

.gallery-main img.fading { opacity: 0; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  color: var(--white);
  width: 44px; height: 44px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
  z-index: 10;
}

.gallery-arrow:hover { background: rgba(255,255,255,0.12); }
.gallery-arrow.left  { left: 1rem; }
.gallery-arrow.right { right: 1rem; }

.gallery-thumbs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.gallery-thumbs::-webkit-scrollbar { height: 3px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.gallery-thumb {
  flex: 0 0 auto;
  width: 90px; height: 60px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  opacity: 0.4;
  transition: opacity 0.25s, border-color 0.25s;
}

.gallery-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.gallery-thumb.active {
  opacity: 1;
  border-color: rgba(255,255,255,0.55);
}

.gallery-thumb:hover { opacity: 0.75; }

.gallery-hint {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1.5rem;
  letter-spacing: 0.05em;
  font-weight: 300;
}

.gallery-hint code {
  font-family: monospace;
  font-size: 0.85em;
  background: var(--accent);
  padding: 0.1em 0.4em;
  color: rgba(255,255,255,0.55);
}

/* ── CONTACT SNS — same inline style as About sns ── */
.contact-note {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.04em;
}

.contact-sns-list {
  list-style: none;
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}

.contact-sns-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.contact-sns-link:hover {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.35);
}

.contact-sns-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

/* ── FOOTER — nagi-yoshida.com style: TOP left, copyright center ── */
.footer {
  height: 52px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 clamp(1.2rem, 5vw, 4rem);
}

.footer-top-link {
  position: absolute;
  right: clamp(1.2rem, 5vw, 4rem);
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s;
}

.footer-top-link:hover { color: var(--white); }

.footer-copy {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-photo-wrap {
    position: static;
    max-width: 220px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  html { font-size: 13px; } /* ベースサイズを下げて全体を小さく */

  /* Nav */
  .nav { padding: 0 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.65rem; letter-spacing: 0.15em; }

  /* SNS: アイコンのみ表示 */
  .nav-sns-link span { display: none; }
  .nav-sns-link svg { width: 17px; height: 17px; }
  .nav-sns { gap: 0.85rem; }

  /* 本文・タイムライン・タグを一回り小さく */
  .about-text  { font-size: 0.72rem; line-height: 1.85; }
  .tl-desc     { font-size: 0.72rem; }
  .tl-year     { font-size: 0.62rem; }
  .tag-list li { font-size: 0.62rem; padding: 0.3rem 0.75rem; }
  .about-block-title { font-size: 0.62rem; }
  .section-desc { font-size: clamp(1.2rem, 4vw, 1.6rem); }

  /* ギャラリー */
  .gallery-thumb { width: 70px; height: 48px; }

  /* 縦長・横長問わず最大高さを統一し、縦横比は維持 */
  .gallery-main {
    height: 60vw;      /* 画面幅の60%を最大高さとして固定 */
    min-height: 200px;
    max-height: 70vh;
  }
  .gallery-main img {
    width: 100%;
    height: 100%;
    max-height: none;  /* PCのmax-heightをリセット */
    object-fit: contain;
  }

  /* iframeはPC想定幅(860px)・高さ固定でレンダリングし、JSでscale縮小 */
}

@media (max-width: 480px) {
  html { font-size: 12.5px; }

  .hero-name { font-size: clamp(2.4rem, 12vw, 4rem); }

  .topbar-title { font-size: 0.6rem; letter-spacing: 0.1em; }

  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.6rem; letter-spacing: 0.08em; }

  .section { padding: 4rem 1rem; }

  .gallery-arrow { width: 36px; height: 36px; }

}

/* ── FADE-IN ON SCROLL ──────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}
