/* ==========================================================================
   Jun Takahashi Portfolio — メインスタイル
   参考サイト（固定サイドバー / セリフ体 / ブルーアクセント）に準拠
   ========================================================================== */

:root {
  --color-bg: #ececea;
  --color-bg-alt: #e4e3df;
  --color-blue: #3d4de0;
  --color-blue-soft: #eef0fd;
  --color-ink: #46484c;
  --color-text: #333438;
  --color-muted: #6f7075;
  --color-border: #d6d5d0;
  --color-dark: #3c4149;
  --color-white: #ffffff;

  --font-serif: 'Playfair Display', serif;
  --font-jp: 'Zen Kaku Gothic New', sans-serif;

  --sidebar-width: 260px;
  --mobile-header-height: 68px;
  --radius: 18px;
  --transition: 0.25s ease;
}

/* ---------- リセット ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-jp);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-dark);
  color: var(--color-white);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* ---------- サイドバー ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  z-index: 900;
}

.sidebar__inner {
  height: 100%;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar__nav ul {
  display: flex;
  flex-direction: column;
  gap: 1.9rem;
}

.sidebar__nav a {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-ink);
  transition: color var(--transition);
}

.sidebar__nav a:hover {
  color: var(--color-blue);
}

.sidebar__social {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--color-ink);
}

.sidebar__social-icon {
  display: flex;
  transition: color var(--transition);
}

.sidebar__social-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar__social-icon:hover {
  color: var(--color-blue);
}

.sidebar__social-divider {
  width: 1px;
  height: 16px;
  background: var(--color-border);
}

/* ---------- モバイルヘッダー ---------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--mobile-header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 950;
}

.mobile-header__logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-ink);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}

.nav-toggle__bar {
  width: 100%;
  height: 2px;
  background: var(--color-ink);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 共通レイアウト ---------- */
.main {
  margin-left: var(--sidebar-width);
}

.section {
  padding: 7rem 4rem;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section__inner {
  max-width: 980px;
}

.section__lead {
  color: var(--color-muted);
  max-width: 620px;
  margin: -1.5rem 0 2.5rem;
}

.section__lead--nowrap {
  max-width: none;
  white-space: nowrap;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.section-head h2 {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-shrink: 0;
}

.section-head__en {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--color-ink);
}

.section-head__jp {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-blue);
  white-space: nowrap;
}

.section-head__line {
  flex: 1;
  height: 1px;
  background: var(--color-blue);
  opacity: 0.5;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: transform var(--transition), background var(--transition), color var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn--ghost {
  color: var(--color-white);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn--solid {
  background: var(--color-blue);
  color: var(--color-white);
  border-color: var(--color-blue);
}

.btn--solid:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 4rem;
  background:
    linear-gradient(135deg, rgba(61, 77, 224, 0.16), rgba(15, 17, 22, 0.4)),
    linear-gradient(160deg, #23262d 0%, #15171c 65%, #0f1013 100%);
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
  overflow: hidden;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0.2;
  filter: grayscale(15%) contrast(1.05);
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, black 38%);
  mask-image: linear-gradient(100deg, transparent 0%, black 38%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 70%;
  max-width: 1400px;
}

.hero__title {
  font-family: var(--font-serif);
  line-height: 1.05;
  margin-bottom: 2.75rem;
}

.hero__title-line {
  display: block;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  font-weight: 600;
  white-space: nowrap;
}

.hero__title-line--sub {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  color: var(--color-white);
}

.hero__white {
  color: var(--color-white);
}

.hero__accent {
  color: var(--color-blue);
}

/* ---------- Intro（キャッチコピー） ---------- */
.intro {
  padding: 6rem 4rem;
  background: var(--color-bg);
}

.intro__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3rem;
}

.intro__catch {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-blue);
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1.35;
}

.intro__catch > span {
  display: block;
}

.intro__amp {
  font-style: italic;
  font-weight: 400;
  color: var(--color-ink);
  margin: 0 0.15em;
}

.intro__divider {
  width: 1px;
  height: 100%;
  min-height: 8rem;
  background: var(--color-blue);
  opacity: 0.5;
  justify-self: center;
}

.intro__heading {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.intro__lead {
  color: var(--color-muted);
  max-width: 480px;
}

/* ---------- About ---------- */
.about__row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
  margin-bottom: 4rem;
}

.about__photo {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  background: var(--color-dark);
  overflow: hidden;
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(20%) contrast(1.02);
}

.about__name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-ink);
}

.about__name-en {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-blue);
  margin-bottom: 1.5rem;
}

.about__bio {
  color: var(--color-text);
  margin-bottom: 1.75rem;
}

.about__hobby {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.about__hobby-label {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-blue);
  margin-right: 0.75rem;
}

.history {
  margin-bottom: 3.5rem;
}

.history__label,
.vision__label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-ink);
  margin-bottom: 1.5rem;
}

.history__label-jp,
.vision__label-jp {
  font-family: var(--font-jp);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-blue);
  margin-left: 0.75rem;
}

.history__list {
  border-top: 1px solid var(--color-border);
}

.history__list li {
  display: flex;
  gap: 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.history__date {
  flex-shrink: 0;
  width: 160px;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-blue);
  font-size: 0.9rem;
}

.history__text {
  color: var(--color-text);
}

.vision {
  border-left: 2px solid var(--color-blue);
  padding-left: 2rem;
}

.vision__text {
  color: var(--color-text);
  max-width: 700px;
}

/* ---------- Works ---------- */
.works__category-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 1.75rem;
}

.works__category-title::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-blue);
  flex-shrink: 0;
}

.works__category-title:not(:first-of-type) {
  margin-top: 4rem;
}

.works__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
}

/* 「もっと見る」対応グリッド：初期状態はPC/タブレットで2枚、モバイルで1枚のみ表示 */
#ai-works .work-card {
  display: none;
}

#ai-works .work-card:nth-child(-n + 2) {
  display: block;
}

@media (max-width: 767px) {
  #ai-works .work-card:nth-child(-n + 2) {
    display: none;
  }

  #ai-works .work-card:nth-child(1) {
    display: block;
  }
}

/* is-visibleは常に最後に評価させ、幅を問わず展開状態を優先する */
#ai-works .work-card.is-visible {
  display: block;
}

.works__more-btn {
  display: block;
  margin: 2.5rem auto 0;
  padding: 0.8rem 2.4rem;
  border: 1px solid var(--color-blue);
  border-radius: 999px;
  background: transparent;
  color: var(--color-blue);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.works__more-btn:hover {
  background: var(--color-blue);
  color: var(--color-white);
}

/* クリックできるのはビジュアル部分だけ */
.work-card__visual-link {
  display: block;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

/* ここで“カード部分”だけホバーさせる */
.work-card__visual {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-dark), #23262d);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.work-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ロゴ画像用：切れないようにロゴの背景色に合わせて全体を表示 */
.work-card__visual--logo {
  background: #f7fbfb;
}

.work-card__visual--logo img {
  object-fit: contain;
}

/* ホバー時の見え方を強める */
.work-card__visual-link:hover .work-card__visual {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
}

/* もし .work-card にもホバーがついていたら消す or 弱める */
.work-card:hover {
  transform: none;
  box-shadow: none;
}

.work-card__visual-icon {
  font-size: 2.5rem;
}

.work-card__visual-stat {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-blue-soft);
  font-size: 1rem;
}

.work-card__visual--soon {
  background: transparent;
  border: 1px dashed var(--color-border);
}

.work-card__visual--soon .work-card__visual-icon {
  color: var(--color-muted);
}

.work-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 0.6rem;
}

.work-card__meta {
  color: var(--color-text);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.work-card__role {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.work-card__result {
  font-size: 0.88rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.work-card__tools {
  font-size: 0.82rem;
  color: var(--color-blue);
}

.work-card__note {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 0.75rem;
}

/* サムネエリア（.work-card__thumb）だけをクリック対象にする */
.work-card__thumb {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.work-card__thumb:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
}

@media (hover: none) {
  .work-card__thumb:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ---------- チャットボットプレビューモーダル ---------- */
.bot-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.bot-modal.is-open {
  display: flex;
}

.bot-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 21, 26, 0.6);
}

.bot-modal__content {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius);
  width: min(720px, 100%);
  max-height: 85vh;
  padding: 1.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.bot-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-ink);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
}

.bot-modal__close:hover {
  background: var(--color-blue-soft);
}

.bot-modal__body {
  margin-top: 2rem;
  flex: 1;
  display: flex;
}

#bot-frame {
  width: 100%;
  height: 65vh;
  border: none;
  border-radius: 12px;
}

@media (max-width: 767px) {
  .bot-modal__content {
    padding: 1rem;
  }

  #bot-frame {
    height: 60vh;
  }
}

/* ---------- Service（Skillパネル）---------- */
.skill-panel {
  background: var(--color-blue);
  border-radius: 28px;
  padding: 3.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.skill-panel__col {
  color: var(--color-white);
}

.skill-panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.skill-panel__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.skill-panel__price {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--color-blue-soft);
  margin-bottom: 1.25rem;
}

.skill-panel__desc {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 1.5rem;
}

.skill-panel__note {
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.skill-panel__note strong {
  color: var(--color-white);
  font-weight: 600;
}

.skill-panel__tags {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.service__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}

.service__meta-label {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-blue);
  margin-bottom: 0.5rem;
}

.service__meta-value {
  color: var(--color-text);
  font-size: 0.92rem;
}

/* ---------- Contact / フッター ---------- */
.contact-footer {
  margin-left: var(--sidebar-width);
  background: var(--color-dark);
  color: var(--color-white);
  padding: 6rem 4rem 3rem;
}

.contact-footer__inner {
  max-width: 720px;
}

.contact-footer__eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-blue-soft);
  margin-bottom: 0.5rem;
}

.contact-footer__eyebrow-jp {
  font-family: var(--font-jp);
  font-style: normal;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 0.75rem;
}

.contact-footer__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(3rem, 8vw, 5rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
}

.contact-footer__lead {
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin-bottom: 2rem;
}

.contact-footer__email {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--color-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
  transition: color var(--transition), border-color var(--transition);
}

.contact-footer__email:hover {
  color: var(--color-blue-soft);
  border-color: var(--color-blue-soft);
}

.contact-footer__x a:hover {
  color: var(--color-blue-soft);
}

.contact-footer__x {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.contact-footer__response {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 3rem;
}

.contact-footer__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1.75rem;
}

.contact-footer__copyright {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 960px) {
  .sidebar {
    top: var(--mobile-header-height);
    transform: translateX(-100%);
    transition: transform var(--transition);
    width: min(320px, 82vw);
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.12);
  }

  .mobile-header {
    display: flex;
  }

  .main,
  .contact-footer {
    margin-left: 0;
    margin-top: var(--mobile-header-height);
  }

  .section {
    padding: 4.5rem 1.75rem;
  }

  .section__lead--nowrap {
    white-space: normal;
  }

  .hero {
    padding: 5rem 1.75rem;
    min-height: calc(100vh - var(--mobile-header-height));
  }

  .hero__inner {
    width: 100%;
    max-width: none;
  }

  .hero__title-line {
    white-space: normal;
  }

  .hero__photo {
    width: 100%;
  }

  .hero__photo img {
    opacity: 0.2;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 55%);
    mask-image: linear-gradient(180deg, transparent 0%, black 55%);
  }

  .intro {
    padding: 4.5rem 1.75rem;
  }

  .intro__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .intro__divider {
    width: 100%;
    height: 1px;
    min-height: 0;
  }

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

  .about__photo {
    max-width: 220px;
  }

  .skill-panel {
    padding: 2.25rem;
  }

  .contact-footer {
    padding: 4.5rem 1.75rem 2.5rem;
  }
}

@media (max-width: 560px) {
  .history__list li {
    flex-direction: column;
    gap: 0.3rem;
  }

  .history__date {
    width: auto;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .section-head__line {
    width: 100%;
    flex-basis: 100%;
  }
}
