/* =====================================================
   aihararisa.com — メインスタイルシート

   構成:
   1. Google Fonts Import
   2. CSS Variables (デザイントークン)
   3. Reset & Base
   4. Layout Utilities
   5. Navigation
   6. Hero Section
   7. Section共通
   8. Latest Writing (note)
   9. Instagram
   10. Company
   11. Footer
   12. Profile Page
   13. Fade-in Animation
   14. Responsive
   ===================================================== */

/* ----- 1. Google Fonts ----- */
/* [CONFIGURABLE] フォントを変更する場合はこのimportを編集してください */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');


/* ----- 2. CSS Variables ----- */
:root {
  /* Colors */
  --bg:           #FAFAF8;   /* ページ背景（温かみのある白） */
  --surface:      #F2EDE6;   /* カード・区切り背景 */
  --border:       #E3DDD5;   /* ボーダー線 */
  --text:         #1A1816;   /* メインテキスト */
  --text-sub:     #1A1816;   /* サブテキスト（メインと統一） */
  --text-muted:   #AEA89E;   /* 薄いテキスト・装飾 */

  /* Typography */
  --font-en:        'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-ja:        -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', '游ゴシック UI', 'Helvetica Neue', Arial, sans-serif;
  --font-ja-serif:  'Hiragino Mincho Pro', 'Yu Mincho', '游明朝', 'HGS明朝E', Georgia, serif;

  /* Spacing Scale */
  --sp-1:  8px;
  --sp-2:  16px;
  --sp-3:  24px;
  --sp-4:  32px;
  --sp-5:  40px;
  --sp-6:  48px;
  --sp-8:  64px;
  --sp-10: 80px;
  --sp-12: 96px;
  --sp-16: 128px;

  /* Layout */
  --max-w:      1060px;
  --max-w-text: 660px;
  --section-v:  var(--sp-12);

  /* Animation */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur:  0.35s;
}


/* ----- 3. Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-ja);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.025em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}


/* ----- 4. Layout Utilities ----- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.container--narrow {
  max-width: var(--max-w-text);
}

/* PC のみ改行（モバイルでは非表示） */
.br-pc {
  display: block;
}


/* ----- 5. Navigation ----- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-nav__logo {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--dur) var(--ease);
}

.site-nav__logo:hover {
  opacity: 0.6;
}

.site-nav__logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 200px;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  list-style: none;
}

.site-nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* タッチターゲット確保 */
  font-family: var(--font-en);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-sub);
  transition: color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.site-nav__links a:hover,
.site-nav__links a[aria-current="page"] {
  color: var(--text);
}


/* ----- 6. Hero Section ----- */
.hero {
  padding: var(--sp-16) 0;
  text-align: center;
}

.hero__photo {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 24px rgba(26, 24, 22, 0.06);
  /* 円形エッジのアンチエイリアス改善 */
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  image-rendering: -webkit-optimize-contrast;
}

.hero__name-ja {
  font-family: var(--font-ja-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1.2;
  margin-bottom: var(--sp-1);
}

.hero__name-en {
  font-family: var(--font-en);
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.hero__title {
  font-size: 0.82rem;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-5);
}

.hero__bio {
  max-width: 420px;
  margin: 0 auto var(--sp-8);
  font-size: 0.9rem;
  line-height: 2.2;
  color: var(--text-sub);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
}

/* ボタン共通 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* iOS/Android タッチターゲット推奨サイズ */
  padding: 11px 40px;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* スマホタップ時のハイライト除去 */
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

/* SNSアイコンリンク */
.hero__sns {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.hero__sns__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--text);
  opacity: 0.5;
  transition: opacity var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.hero__sns__icon:hover {
  opacity: 1;
}

.hero__sns__icon svg {
  display: block;
  flex-shrink: 0;
}


/* ----- 7. Section 共通 ----- */
.section {
  padding: var(--section-v) 0;
  border-top: 1px solid var(--border);
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
}

.section__title {
  font-family: var(--font-en);
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}

.section__more:hover {
  color: var(--text);
}


/* ----- 8. Latest Writing (note RSS) ----- */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.writing-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: opacity var(--dur) var(--ease);
}

.writing-card:hover {
  opacity: 0.7;
}

.writing-card__thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

.writing-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.writing-card:hover .writing-card__thumb img {
  transform: scale(1.03);
}

.writing-card__thumb--empty {
  width: 100%;
  height: 100%;
  background: var(--surface);
}

.writing-card__date {
  font-family: var(--font-en);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: block;
}

.writing-card__title {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text);
}

/* サムネイルなしカード（note RSS に画像がない場合） */
.writing-card--text-only {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-4);
}

.writing-card--text-only .writing-card__title {
  font-size: 0.92rem;
  line-height: 1.8;
}

/* writing-grid が text-only カードのみの場合はボーダーを調整 */
.writing-grid:has(.writing-card--text-only) {
  gap: 0;
}

/* ローディング・エラー・フォールバック */
.writing-loading,
.writing-fallback {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-8) 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.writing-fallback a {
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.writing-fallback a:hover {
  color: var(--text);
  border-color: var(--text);
}

.section__footer {
  text-align: right;
  margin-top: var(--sp-1);
}


/* ----- 9. Instagram ----- */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-bottom: var(--sp-5);
}

.instagram-item {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
  position: relative;
  display: block;
}

.instagram-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.instagram-item:hover img {
  transform: scale(1.04);
}

.instagram-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 24, 22, 0);
  transition: background var(--dur) var(--ease);
}

.instagram-item:hover .instagram-item__overlay {
  background: rgba(26, 24, 22, 0.12);
}

/* モックプレースホルダー */
.instagram-mock-bg {
  width: 100%;
  height: 100%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* フォールバック */
.instagram-fallback {
  text-align: center;
  padding: var(--sp-8) 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.instagram-fallback a {
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease);
}

.instagram-fallback a:hover {
  color: var(--text);
}


/* ----- 10. Company ----- */
.company-content {
  max-width: var(--max-w-text);
}

.company-content p {
  font-size: 0.9rem;
  line-height: 2.2;
  color: var(--text-sub);
  margin-bottom: var(--sp-6);
}


/* ----- 11. Footer ----- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-8) 0;
  margin-top: var(--sp-4);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer__copy {
  font-family: var(--font-en);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}


/* ----- 12. Profile Page ----- */
.page-header {
  padding: var(--sp-16) 0 var(--sp-8);
  border-bottom: 1px solid var(--border);
}

.page-header__name-ja {
  font-family: var(--font-ja-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.15;
  margin-bottom: var(--sp-1);
}

.page-header__name-en {
  font-family: var(--font-en);
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* プロフィール各セクション */
.profile-block {
  padding: var(--sp-10) 0;
  border-bottom: 1px solid var(--border);
}

.profile-block--intro {
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-10);
}

.profile-block__label {
  display: block;
  font-family: var(--font-en);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.profile-block__intro {
  font-family: var(--font-ja-serif);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  line-height: 2.3;
  color: var(--text);
}

.profile-block__intro + .profile-block__intro {
  margin-top: var(--sp-6);
}

.profile-block p {
  font-family: var(--font-ja-serif);
  font-size: 0.9rem;
  line-height: 2.15;
  color: var(--text-sub);
  margin-bottom: var(--sp-3);
}

/* Biography タイムライン */
.bio-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bio-timeline li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  column-gap: var(--sp-6);
}

.bio-timeline li + li {
  margin-top: var(--sp-6);
}

/* 年ラベル */
.bio-timeline__year {
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: right;
  padding-top: 0.35em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 本文エリア（縦線 + ドット付き） */
.bio-timeline__body {
  position: relative;
  padding-left: var(--sp-6);
  padding-bottom: var(--sp-2);
  font-family: var(--font-ja-serif);
  font-size: 0.9rem;
  line-height: 2.0;
  color: var(--text-sub);
  border-left: 1px solid var(--border);
}

/* ドット */
.bio-timeline__body::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--text-muted);
}

/* 末尾の締め文（縦線・ドットなし） */
.bio-timeline__closing-item .bio-timeline__body {
  border-left: none;
  padding-left: var(--sp-6);
}

.bio-timeline__closing-item .bio-timeline__body::before {
  display: none;
}

.bio-timeline__body--closing {
  color: var(--text);
  font-style: italic;
  margin-top: var(--sp-4);
}

.profile-block p:last-of-type {
  margin-bottom: 0;
}

/* 本文インラインリンク */
.text-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #C0B8AE;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur) var(--ease);
}
.text-link:hover {
  text-decoration-color: var(--text);
}

/* リスト（Current Work / Focus） */
.profile-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.profile-list li {
  font-family: var(--font-ja-serif);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-sub);
  padding-left: var(--sp-3);
  position: relative;
}

.profile-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* プロフィールページ リンク */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
}

.profile-link {
  font-family: var(--font-en);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.profile-link:hover {
  color: var(--text);
  border-color: var(--text);
}

.profile-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-bottom: none;
  padding: 0;
  color: var(--text);
  opacity: 0.5;
  transition: opacity var(--dur) var(--ease);
}

.profile-icon-link:hover {
  color: var(--text);
  border-color: transparent;
  opacity: 1;
}

.profile-icon-link svg {
  display: block;
  flex-shrink: 0;
}


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

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

/* ヒーローは即表示 */
.hero .fade-in {
  transition-delay: 0s;
}


/* ----- 14. Responsive ----- */
@media (max-width: 900px) {
  .writing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-v: var(--sp-10);
    --sp-16: 96px;
  }

  .container {
    padding: 0 var(--sp-3);
  }

  .hero {
    padding: var(--sp-12) 0;
  }

  .hero__bio {
    font-size: 0.85rem;
  }

  .writing-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  /* Instagram: モバイルでも3列維持（2列にするとスクロールが増えるため） */
  .instagram-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .br-pc {
    display: none;
  }

  .site-footer__inner {
    flex-direction: column;
    gap: var(--sp-2);
    text-align: center;
  }

  .section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }

  .page-header {
    padding-top: var(--sp-12);
  }

  .profile-block {
    padding: var(--sp-8) 0;
  }
}

@media (max-width: 480px) {
  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__sns {
    gap: var(--sp-2);
  }

  .hero__photo {
    width: 140px;
    height: 140px;
  }
}

/* 320px以下（iPhone SE 第1世代など） */
@media (max-width: 360px) {
  .container {
    padding: 0 var(--sp-2);
  }

  .hero__name-ja {
    letter-spacing: 0.1em; /* 超小画面では字間を詰める */
  }

  .site-nav__logo-img {
    height: 32px;
    max-width: 160px;
  }

  .profile-links {
    gap: var(--sp-3);
  }
}
