/* ==========================================================================
   Mio Arakawa - Sample Site (Kazuma Web Works 制作サンプル)
   1ページ完結の作家サイト。
   - 左：名前・自己紹介・お問い合わせ
   - 右：作品が上から下へゆっくり流れ、ホバーで停止、クリックで拡大
   - 背景：青系グラデーション + canvas の雨エフェクト
   色とタイポグラフィは :root のカスタムプロパティで管理しています。
   ========================================================================== */

:root {
  /* 夜と雨のブルー */
  --c-bg-deep: #04080f;
  --c-bg-mid: #071223;
  --c-bg-far: #0a1a2e;

  --c-ink: #e9eff8;
  --c-ink-soft: rgba(233, 239, 248, 0.62);
  --c-ink-faint: rgba(233, 239, 248, 0.5);
  --c-line: rgba(233, 239, 248, 0.14);
  --c-line-soft: rgba(233, 239, 248, 0.08);

  --c-accent: #e2b184;        /* 雨の中の窓明かり */
  --c-focus: #8fc2f2;

  --font-en: "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium",
    "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
  --font-body: var(--font-en), var(--font-ja);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   リセット・ベース
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  background-color: var(--c-bg-deep);
  background-image:
    radial-gradient(120% 80% at 10% 4%, rgba(28, 66, 108, 0.55), transparent 58%),
    radial-gradient(95% 75% at 92% 96%, rgba(12, 44, 80, 0.5), transparent 62%),
    linear-gradient(158deg, var(--c-bg-deep) 0%, var(--c-bg-mid) 44%, var(--c-bg-far) 100%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 画面周辺をわずかに落として奥行きを出す */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  box-shadow: inset 0 0 20vmax rgba(2, 5, 11, 0.6);
}

/* 拡大表示中は背面をスクロールさせません */
body.is-locked {
  overflow: hidden;
}

body.is-locked .stage {
  z-index: 50;
}

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

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
p,
figure,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--c-ink);
  color: var(--c-bg-deep);
  font-size: 0.8rem;
  text-decoration: none;
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

.sample-badge {
  position: fixed;
  top: clamp(0.8rem, 2vw, 1.4rem);
  right: clamp(0.8rem, 2vw, 1.6rem);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(226, 177, 132, 0.42);
  border-radius: 999px;
  background: rgba(4, 9, 18, 0.84);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--c-ink);
  line-height: 1;
  pointer-events: none;
}

.sample-badge__en {
  color: var(--c-accent);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sample-badge__ja {
  padding-left: 0.7em;
  border-left: 1px solid var(--c-line);
  font-family: var(--font-ja);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   背景写真（室内から見た雨の夜景）
   写真の中の「窓の範囲」に合わせて雨を降らせるため、
   object-fit: cover の位置計算を js/main.js 側でも同じ条件で行っています。
   （object-position を変える場合は main.js の計算も合わせてください）
   ========================================================================== */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 2s ease, transform 2.4s var(--ease);
}

.has-scene .scene__photo {
  opacity: 1;
  transform: none;
}

/* 文字を読みやすくするための覆い。左（文章側）を濃く、右（作品側）は薄く。 */
.scene__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(4, 9, 18, 0.72) 0%,
      rgba(4, 9, 18, 0.6) 34%,
      rgba(4, 9, 18, 0.42) 52%,
      rgba(4, 9, 18, 0.36) 100%
    ),
    linear-gradient(
      180deg,
      rgba(4, 9, 18, 0.42) 0%,
      rgba(4, 9, 18, 0.06) 34%,
      rgba(4, 9, 18, 0.1) 66%,
      rgba(4, 9, 18, 0.5) 100%
    ),
    rgba(9, 24, 44, 0.22);
}

/* ==========================================================================
   背景演出（雨・ポインタの光）
   ========================================================================== */
.rain {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s ease 0.3s;
}

.is-ready .rain {
  opacity: 1;
}

/* .scene の中（写真と覆いのあいだ）に置いています。
   覆いの下になるので、文章が乗る左側では光がほとんど目立ちません。 */
.pointer-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 46vmax;
  height: 46vmax;
  margin: -23vmax 0 0 -23vmax;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle,
    rgba(94, 156, 226, 0.18),
    rgba(94, 156, 226, 0.06) 42%,
    transparent 68%
  );
  transition: opacity 1.2s ease;
  will-change: transform;
}

.pointer-glow.is-active {
  opacity: 1;
}

/* ==========================================================================
   レイアウト
   ========================================================================== */
.stage {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
  height: 100vh;
  height: 100dvh;
}

/* ==========================================================================
   左：プロフィール
   ========================================================================== */
.profile {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(1.6rem, 3vh, 3rem) clamp(1.6rem, 4vw, 4.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 239, 248, 0.18) transparent;
}

/* 文章の背後だけを落とす覆い。右へ向かって完全に消えるので境目が出ません。 */
.profile::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: -16%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(4, 9, 18, 0.9) 0%,
    rgba(4, 9, 18, 0.88) 46%,
    rgba(4, 9, 18, 0.78) 68%,
    rgba(4, 9, 18, 0.42) 86%,
    rgba(4, 9, 18, 0) 100%
  );
}

.profile::-webkit-scrollbar {
  width: 6px;
}

.profile::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(233, 239, 248, 0.16);
}

.profile__inner {
  position: relative; /* 覆い（.profile::before）より前に出す */
  width: 100%;
  max-width: 34rem;
  /* 上下中央に置きつつ、内容が画面より高いときは上から読めるようにします */
  margin: auto;
  /* 名前の文字サイズをこの幅基準で決めます */
  container-type: inline-size;
}

/* 共通のフェードアップ演出 */
.profile__eyebrow,
.name__ja,
.style-line,
.bio,
.contact,
.disclaimer {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}

.is-ready .profile__eyebrow { opacity: 1; transform: none; transition-delay: 0.1s; }
.is-ready .name__ja        { opacity: 1; transform: none; transition-delay: 0.72s; }
.is-ready .style-line      { opacity: 1; transform: none; transition-delay: 0.84s; }
.is-ready .bio             { opacity: 1; transform: none; transition-delay: 0.96s; }
.is-ready .contact         { opacity: 1; transform: none; transition-delay: 1.08s; }
.is-ready .disclaimer      { opacity: 1; transform: none; transition-delay: 1.24s; }

.profile__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin-bottom: clamp(1rem, 2.2vh, 1.7rem);
  color: var(--c-ink-faint);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.profile__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 10px rgba(226, 177, 132, 0.9);
}

/* 名前と本人写真の並び
   1列目は名前の実寸（auto）、2列目は余ったぶん全部を写真に割り当てるので、
   フォントが変わって名前の幅が増減しても写真がはみ出しません。 */
.headline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(0.8rem, 2.2cqw, 1.5rem);
}

.headline__text {
  min-width: 0;
}

/* 高さは名前ブロックに合わせ、幅は縦横比から決めます。
   こうすると画面幅が変わっても写真の形が変わらず、人物が切れません。 */
.portrait {
  position: relative;
  align-self: stretch;
  justify-self: end;
  aspect-ratio: 5 / 4;
  width: auto;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--c-line);
  background: rgba(9, 21, 38, 0.6);
  box-shadow: 0 26px 48px -30px rgba(0, 0, 0, 0.95);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 1.2s var(--ease), transform 1.3s var(--ease);
}

.is-ready .portrait {
  opacity: 1;
  transform: none;
  transition-delay: 0.78s;
}

/* 画像は絶対配置にして、写真の実寸が行の高さに影響しないようにします */
.portrait__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 32%;
  /* 少しだけモノクロに寄せて、青い画面になじませています */
  filter: grayscale(0.82) contrast(1.06) brightness(0.94);
  transition: filter 1.4s var(--ease), transform 1.6s var(--ease);
}

.portrait:hover .portrait__img {
  filter: grayscale(0.42) contrast(1.03) brightness(1);
  transform: scale(1.035);
}

/* 名前（ローマ字）
   コンテナ幅（cqw）基準で決めるため、フォントが変わっても列からはみ出しません。
   1行目の指定は、コンテナクエリ未対応環境向けのフォールバックです。 */
.name {
  font-family: var(--font-en);
  font-size: clamp(2.9rem, 6.4vw, 5.7rem);
  font-size: clamp(2.9rem, 17cqw, 6rem);
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.name__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}

/* 2行目（姓）は少し下げた色で置きます */
.name__line + .name__line {
  margin-left: 0.06em;
  color: var(--c-ink-soft);
}

.name__ch {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.15s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms + var(--l, 0) * 170ms + 180ms);
}

.is-ready .name__ch {
  transform: none;
}

.name__line + .name__line .name__ch { --l: 1; }
.name__ch:nth-child(1) { --i: 0; }
.name__ch:nth-child(2) { --i: 1; }
.name__ch:nth-child(3) { --i: 2; }
.name__ch:nth-child(4) { --i: 3; }
.name__ch:nth-child(5) { --i: 4; }
.name__ch:nth-child(6) { --i: 5; }
.name__ch:nth-child(7) { --i: 6; }

.name__ja {
  margin-top: clamp(0.8rem, 1.8vh, 1.2rem);
  font-family: var(--font-ja);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  color: var(--c-ink-faint);
}

/* 作風 */
.style-line {
  position: relative;
  margin-top: clamp(1.3rem, 2.6vh, 2rem);
  padding-top: clamp(1.3rem, 2.6vh, 2rem);
  border-top: 1px solid var(--c-line);
}

.style-line__ja {
  display: block;
  font-family: var(--font-ja);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--c-ink);
}

.style-line__en {
  display: block;
  margin-top: 0.3em;
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--c-accent);
}

/* 自己紹介 */
.bio {
  margin-top: clamp(1.3rem, 2.6vh, 2rem);
  display: grid;
  gap: clamp(1rem, 2.2vh, 1.5rem);
}

.bio__block p {
  font-size: 0.81rem;
  line-height: 2.05;
  letter-spacing: 0.05em;
  color: var(--c-ink-soft);
}

.bio__block p + p {
  margin-top: 0.9em;
}

.bio__block[lang="ja"] p {
  font-family: var(--font-ja);
}

.bio__block--en {
  padding-left: 1.1rem;
  border-left: 1px solid var(--c-line-soft);
}

.bio__block--en p {
  font-size: 0.75rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: var(--c-ink-faint);
}

/* お問い合わせ
   見出し（Inquiries）〜連絡先メモまでをひとつのカードとして扱い、
   ホバー時に一体で濃くなるようにします（上下のセクションには影響しません）。
   背景は疑似要素で少しはみ出させているだけなので、文字の位置は動きません。 */
.contact {
  position: relative;
  margin-top: clamp(1.4rem, 2.8vh, 2.1rem);
  padding-top: clamp(1.3rem, 2.6vh, 1.9rem);
  border-top: 1px solid var(--c-line);
}

.contact::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  right: -0.9rem;
  bottom: -0.7rem;
  left: -0.9rem;
  /* z-index: -1 だと文章側の覆い（不透明度0.9）の裏に回って見えなくなるため 0 にし、
     文字のほうを 1 に上げて前に出しています */
  z-index: 0;
  border-radius: 14px;
  background: rgba(4, 9, 18, 0);
  transition: background 0.55s var(--ease);
  pointer-events: none;
}

.contact > * {
  position: relative;
  z-index: 1;
}

.contact:hover::before,
.contact:focus-within::before {
  background: rgba(4, 9, 18, 0.5);
}

.contact__heading {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-ink-faint);
}

.contact__heading span {
  font-family: var(--font-ja);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: none;
}

/* 見出しと「メールで承ります」を同じ行に並べます（縦の高さを増やさないため） */
.contact__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1.1em;
}

/* 窓口がメール1つであることを、項目より先に伝えます */
.contact__head .contact__method {
  position: relative;
  padding-left: 1.2em;
  font-family: var(--font-ja);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--c-accent);
}

.contact__head .contact__method::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 0.75em;
  height: 1px;
  background: var(--c-line);
}

/* 相談内容の列挙。区切り記号で1行に並べ、
   「押せる3つのボタン」に見えないようにしています。 */
.contact__list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 0.85rem;
  font-family: var(--font-ja);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--c-ink);
}

.contact__list li + li::before {
  content: "／";
  margin: 0 0.5em;
  color: var(--c-line);
}

.contact__list-en {
  margin-top: 0.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--c-ink-faint);
}

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 0.95rem;
  font-size: 0.97rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--c-ink);
}

.contact__mail--sample {
  cursor: default;
}

/* 封筒アイコン。ここが唯一の窓口であることを一目で示します */
.contact__mail-icon {
  display: inline-flex;
  flex: none;
  color: var(--c-accent);
}

.contact__mail-icon svg {
  width: 1.05em;
  height: 1.05em;
}

.contact__mail-text {
  position: relative;
  padding-bottom: 0.22em;
}

.contact__mail-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--c-accent);
  transform: scaleX(0.28);
  transform-origin: left;
  transition: transform 0.7s var(--ease);
}

.contact__mail:hover .contact__mail-text::after,
.contact__mail:focus-visible .contact__mail-text::after {
  transform: scaleX(1);
}

.contact__mail--sample .contact__mail-text::after {
  transform: scaleX(1);
}

.contact__mail-mark {
  padding: 0.35em 0.55em;
  border: 1px solid rgba(226, 177, 132, 0.35);
  border-radius: 999px;
  color: var(--c-accent);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.contact__note {
  margin-top: 0.6rem;
  font-family: var(--font-ja);
  font-size: 0.71rem;
  letter-spacing: 0.08em;
  color: var(--c-ink-faint);
}

.disclaimer {
  margin-top: clamp(1.4rem, 2.8vh, 2rem);
  padding: 0.9rem 1rem;
  border: 1px solid rgba(226, 177, 132, 0.24);
  border-left: 3px solid rgba(226, 177, 132, 0.72);
  background: rgba(9, 21, 38, 0.56);
  font-family: var(--font-ja);
  font-size: 0.68rem;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: rgba(233, 239, 248, 0.72);
}

.disclaimer strong {
  display: block;
  margin-bottom: 0.2em;
  color: var(--c-accent);
  font-size: 1.04em;
  font-weight: 600;
}

/* ==========================================================================
   右：作品の流れ
   ========================================================================== */
.gallery {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.gallery__hint {
  position: absolute;
  right: clamp(1rem, 2vw, 2rem);
  bottom: clamp(1rem, 2.4vh, 1.8rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15em;
  text-align: right;
  pointer-events: none;
  /* 背景写真の明るい部分に重なっても読めるように */
  text-shadow: 0 1px 10px rgba(4, 9, 18, 0.95);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease) 1.6s, transform 1s var(--ease) 1.6s;
}

.gallery__hint-desktop,
.gallery__hint-mobile {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15em;
}

.gallery__hint-desktop {
  display: flex;
}

.gallery__hint-mobile {
  display: none;
}

.is-ready .gallery__hint {
  opacity: 1;
  transform: none;
}

.gallery.is-viewing .gallery__hint,
.gallery.is-paused .gallery__hint {
  opacity: 0;
  transform: translateY(6px);
  transition-delay: 0s;
}

.gallery__hint-ja {
  font-family: var(--font-ja);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--c-ink-faint);
}

.gallery__hint-en {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(233, 239, 248, 0.42);
}

.flow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(600px, 58vh, 90%);
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 10%,
    #000 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 10%,
    #000 90%,
    transparent 100%
  );
}

/* 作品カード（JSで translate3d を毎フレーム更新） */
.art {
  position: absolute;
  top: 0;
  left: var(--x, 0%);
  width: var(--w, 70%);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.is-ready .art {
  opacity: 1;
}

.art__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ar, 3 / 4);
  overflow: hidden;
  background: linear-gradient(152deg, #16304f 0%, #0a1729 58%, #060f1d 100%);
  border: 1px solid rgba(233, 239, 248, 0.1);
  box-shadow:
    0 2px 0 rgba(233, 239, 248, 0.05) inset,
    0 34px 60px -34px rgba(0, 0, 0, 0.95),
    0 8px 24px -16px rgba(0, 0, 0, 0.8);
  transition: transform 0.9s var(--ease), box-shadow 0.9s var(--ease),
    border-color 0.9s var(--ease);
}

.art:hover .art__frame,
.art:focus-visible .art__frame {
  transform: translateY(-6px) scale(1.014);
  border-color: rgba(233, 239, 248, 0.24);
  box-shadow:
    0 2px 0 rgba(233, 239, 248, 0.08) inset,
    0 46px 78px -34px rgba(0, 0, 0, 0.95),
    0 0 42px -12px rgba(143, 194, 242, 0.28);
}

/* 濡れたガラスのような斜めの反射 */
.art__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0) 34%,
    rgba(255, 255, 255, 0) 66%,
    rgba(143, 194, 242, 0.09) 100%
  );
  opacity: 0.75;
  transition: opacity 0.9s var(--ease);
}

.art:hover .art__frame::after {
  opacity: 0.35;
}

.art__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.2s ease, transform 1.6s var(--ease);
}

.art__frame.has-image .art__img {
  opacity: 1;
  transform: none;
}

.art:hover .art__frame.has-image .art__img {
  transform: scale(1.03);
}

/* 画像未設置時のプレースホルダー */
.art__placeholder,
.viewer__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  transition: opacity 0.8s ease;
}

.art__frame.has-image .art__placeholder,
.viewer__frame.has-image .viewer__placeholder {
  opacity: 0;
}

.art__placeholder::before,
.art__placeholder::after,
.viewer__placeholder::before,
.viewer__placeholder::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(233, 239, 248, 0.22);
}

.art__placeholder::before,
.viewer__placeholder::before {
  top: 14px;
  left: 14px;
  border-width: 1px 0 0 1px;
}

.art__placeholder::after,
.viewer__placeholder::after {
  right: 14px;
  bottom: 14px;
  border-width: 0 1px 1px 0;
}

.art__ph-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(233, 239, 248, 0.26);
  transform: rotate(45deg);
}

.art__ph-mark::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(226, 177, 132, 0.7);
}

.art__ph-file {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(233, 239, 248, 0.4);
}

/* キャプション（ホバー・フォーカスで表示） */
.art__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 0.85rem;
  padding: 3rem 1.1rem 1.05rem;
  background: linear-gradient(
    to top,
    rgba(4, 9, 18, 0.9) 0%,
    rgba(4, 9, 18, 0.5) 48%,
    transparent 100%
  );
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.art:hover .art__caption,
.art:focus-visible .art__caption {
  opacity: 1;
  transform: none;
}

.art__no,
.viewer__no {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  padding-top: 0.35em;
}

.art__text,
.viewer__text {
  display: block;
  min-width: 0;
}

.art__title {
  display: block;
  font-family: var(--font-ja);
  font-size: 0.86rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--c-ink);
}

.art__title-en {
  display: block;
  margin-top: 0.15em;
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--c-ink-soft);
}

.art__meta {
  display: block;
  margin-top: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--c-ink-faint);
}

/* ==========================================================================
   拡大表示
   ========================================================================== */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.viewer[hidden] {
  display: none;
}

.viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 18, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(0.9);
  backdrop-filter: blur(16px) saturate(0.9);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.viewer.is-open .viewer__backdrop {
  opacity: 1;
}

.viewer__figure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 2.2vh, 1.6rem);
  width: 100%;
  height: 100%;
  margin: 0;
  padding: clamp(1.2rem, 3vw, 2.8rem);
}

/* 幅・高さは JS が実寸で指定します（クリック位置からの拡大を等倍にするため） */
.viewer__frame {
  position: relative;
  display: block;
  overflow: hidden;
  transform-origin: 0 0;
  background: linear-gradient(152deg, #16304f 0%, #0a1729 58%, #060f1d 100%);
  border: 1px solid rgba(233, 239, 248, 0.14);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.95);
}

.viewer__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.viewer__frame.has-image .viewer__img {
  opacity: 1;
}

.viewer__caption {
  display: flex;
  gap: 0.9rem;
  max-width: min(100%, 42rem);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease) 0.18s, transform 0.7s var(--ease) 0.18s;
}

.viewer.is-open .viewer__caption {
  opacity: 1;
  transform: none;
}

.viewer__title {
  display: block;
  font-family: var(--font-ja);
  font-size: 1.02rem;
  letter-spacing: 0.1em;
}

.viewer__title-en {
  display: block;
  margin-top: 0.2em;
  font-size: 0.76rem;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--c-ink-soft);
}

.viewer__meta {
  display: block;
  margin-top: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--c-ink-faint);
}

.viewer__close {
  position: absolute;
  top: clamp(0.9rem, 2vh, 1.6rem);
  right: clamp(0.9rem, 2vw, 1.6rem);
  z-index: 2;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: rgba(8, 18, 32, 0.55);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s var(--ease) 0.15s, transform 0.5s var(--ease) 0.15s,
    background-color 0.4s ease, border-color 0.4s ease;
}

.viewer.is-open .viewer__close {
  opacity: 1;
  transform: none;
}

.viewer__close:hover {
  background: rgba(20, 40, 66, 0.8);
  border-color: rgba(233, 239, 248, 0.32);
}

.viewer__close span,
.viewer__close span::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 1px;
  background: var(--c-ink);
  content: "";
}

.viewer__close span {
  margin: -0.5px 0 0 -7.5px;
  transform: rotate(45deg);
}

.viewer__close span::before {
  top: 0;
  left: 0;
  margin: 0;
  transform: rotate(90deg);
}

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .stage {
    grid-template-columns: 1fr;
    height: auto;
  }

  .profile {
    overflow: visible;
    padding: clamp(3.2rem, 12vw, 5rem) 1.5rem clamp(1.6rem, 6vw, 2.4rem);
  }

  /* 縦並びになるので、覆いも下方向へ抜きます */
  .profile::before {
    right: 0;
    bottom: -14%;
    background: linear-gradient(
      180deg,
      rgba(4, 9, 18, 0.9) 0%,
      rgba(4, 9, 18, 0.88) 62%,
      rgba(4, 9, 18, 0.66) 84%,
      rgba(4, 9, 18, 0) 100%
    );
  }

  .profile__inner {
    max-width: 32rem;
  }

  /* 横に並べる余地が無いので、写真は名前の下に置きます */
  .headline {
    grid-template-columns: 1fr;
    gap: clamp(1rem, 4vw, 1.6rem);
  }

  /* 縦積みでは幅いっぱい。高さは縦横比から決めます */
  .portrait {
    align-self: auto;
    justify-self: stretch;
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .gallery {
    height: 78vh;
    height: 78dvh;
    margin-bottom: 3rem;
  }

  .flow {
    z-index: 1;
    width: min(420px, 84%);
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* モバイルでは親要素の mask を外し、カードのタップ判定を保ったまま端だけをぼかします */
  .gallery::before,
  .gallery::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    z-index: 10;
    height: 10%;
    pointer-events: none;
  }

  .gallery::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(4, 9, 18, 0.9), transparent);
  }

  .gallery::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(4, 9, 18, 0.9), transparent);
  }

  /* 縦方向の指の動きを引き取るのは作品の枠だけにします。
     列の余白や作品どうしの隙間に触れたときは、
     ブラウザ本来の縦スクロール（ページ送り）がそのまま働きます。
     pinch-zoom は拡大表示の妨げにならないよう残しています。 */
  .art {
    touch-action: pan-x pinch-zoom;
  }

  /* 横幅が足りず折り返すと行頭に区切り記号が来てしまうため、
     スマホでは縦並び（頭にダッシュ）に切り替えます。 */
  .contact__list {
    display: grid;
    justify-content: start;
    gap: 0.12rem;
  }

  .contact__list li {
    position: relative;
    padding-left: 1.2em;
  }

  .contact__list li::before,
  .contact__list li + li::before {
    content: "—";
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    color: var(--c-line);
  }

  .gallery__hint-desktop {
    display: none;
  }

  .gallery__hint-mobile {
    display: flex;
  }

  .viewer {
    position: fixed;
  }

  .gallery__hint {
    right: 1rem;
  }
}

@media (max-width: 600px) {
  .sample-badge {
    top: 0.65rem;
    right: 0.65rem;
    gap: 0.5em;
    padding: 0.48rem 0.65rem;
  }

  .sample-badge__en {
    font-size: 0.58rem;
  }

  .sample-badge__ja {
    font-size: 0.62rem;
  }

  .bio__block--en {
    padding-left: 0.9rem;
  }
}

/* 横幅に余裕があるときは、写真の枠を列の余白側へ少し広げます
   （.portrait ではなく .headline に掛けることで、写真に使える幅そのものを増やします） */
@media (min-width: 1200px) {
  .headline {
    margin-right: 0;
  }
}

/* 画面が低いときは、余白と行間を詰めて1画面に収めます
   （名前は主役なので、余白より先に縮めないようにしています） */
@media (min-width: 901px) and (max-height: 1044px) {
  .name {
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    font-size: clamp(2.4rem, 16cqw, 5.4rem);
  }

  .profile__eyebrow {
    margin-bottom: 0.9rem;
  }

  .name__ja {
    margin-top: 0.7rem;
    font-size: 0.8rem;
  }

  .style-line {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
  }

  .bio {
    margin-top: 1.1rem;
    gap: 0.85rem;
  }

  .bio__block p {
    font-size: 0.78rem;
    line-height: 1.95;
  }

  .bio__block--en p {
    font-size: 0.72rem;
    line-height: 1.8;
  }

  .contact {
    margin-top: 1.2rem;
    padding-top: 1.1rem;
  }

  .contact__list {
    margin-top: 0.7rem;
    gap: 0.35rem 1.2rem;
  }

  .contact__mail {
    margin-top: 0.85rem;
    font-size: 0.88rem;
  }

  .disclaimer {
    margin-top: 1.1rem;
    padding: 0.8rem 0.9rem;
    font-size: 0.64rem;
  }
}

/* さらに低い画面（1366×768 など）向け */
@media (min-width: 901px) and (max-height: 830px) {
  .name {
    font-size: clamp(2.2rem, 4.7vw, 3.9rem);
    font-size: clamp(2.2rem, 12cqw, 4rem);
  }

  .profile {
    padding-block: 0.5rem;
  }

  .profile__eyebrow {
    margin-bottom: 0.5rem;
  }

  .style-line {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
  }

  .style-line__ja {
    font-size: 0.9rem;
  }

  .bio {
    margin-top: 0.7rem;
    gap: 0.5rem;
  }

  .bio__block p {
    font-size: 0.76rem;
    line-height: 1.85;
  }

  .bio__block--en p {
    font-size: 0.7rem;
    line-height: 1.75;
  }

  .contact {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
  }

  .contact__list {
    margin-top: 0.4rem;
  }

  .contact__mail {
    margin-top: 0.55rem;
  }

  .disclaimer {
    margin-top: 0.65rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.68rem;
    line-height: 1.75;
  }
}

/* ==========================================================================
   視差効果を減らす設定
   流れるアニメーションを止め、通常のスクロールで作品を見られるようにします。
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .profile__eyebrow,
  .name__ja,
  .style-line,
  .bio,
  .contact,
  .disclaimer,
  .portrait,
  .art,
  .gallery__hint {
    opacity: 1;
    transform: none;
  }

  .name__ch {
    transform: none;
  }

  .gallery {
    overflow-y: auto;
  }

  .flow {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    margin-inline: auto;
    padding: 3rem 0;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .art {
    position: relative;
    left: auto;
    margin-left: var(--x, 0%);
    transform: none !important;
  }

  /* 縦のパーセント指定は幅基準になるため、重なりは控えめにします */
  .art + .art {
    margin-top: -18%;
  }

  .art__caption {
    opacity: 1;
    transform: none;
  }

  .viewer {
    position: fixed;
  }
}
