/*
 * TOP / MUSIC 共通スタイル。
 * 2026-09-16：TOPページのみビジュアルリニューアル（方向性A案「水鏡 / 桜 — 金地アーチ額装」を反映）。
 * MUSICページ・個別LPは既存の機能実装優先スタイルのまま据え置き。
 * TOP固有のスタイルは body.page-top を起点にスコープし、MUSICに波及しないようにしている
 * （.profile* / .music-link / .frame* / .plate* / .intro-* / .lens / .rip はTOPにしか存在しないため
 * スコープなしでも安全）。
 */

:root {
  --color-bg: #fff;
  --color-text: #1a1a1a;
  --color-muted: #767676;
  --color-border: #e2e2e2;
  --max-width: 960px;

  /* TOPページ redesign（2026-09-14）のカラートークン。
     ラファエル前派（パーチメント×深い緑）→ ヴィクトリア朝の金の彫刻装飾 →
     ブロンズエイジ・コミック（ドクター・ストレンジ）の密度、という検討順を経て確定。 */
  --top-ink: #0a0a0a;
  --top-teal-deep: #0B3B34;
  --top-teal: #00A496;
  --top-gold: #D4AF37;
  --top-gold-pale: #E9D8A6;
  --top-bordeaux: #7A2E3B;
  --top-ochre: #8a6420;
  --top-paper: #B8A87C;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.7;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ヘッダー */
.site-header {
  display: block;
  padding: 24px 16px;
  text-align: center;
}

.site-header__name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: inherit;
  text-decoration: none;
}

/* プロフィール（TOPのみ） */
.profile {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto 48px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.profile__photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile__body {
  flex: 1;
  min-width: 200px;
}

.profile__name {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.profile__bio {
  margin: 0 0 12px;
  color: var(--color-text);
}

.profile__links {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile__links a {
  color: var(--color-text);
}

.page-title {
  font-size: 1.4rem;
  margin: 8px 0 24px;
}

/* 作品グリッド：2列固定（D-22） */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.work-grid__empty {
  grid-column: 1 / -1;
  color: var(--color-muted);
  text-align: center;
  padding: 32px 0;
}

.work-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.work-card--disabled {
  cursor: default;
  opacity: 0.6;
}

.work-card__cover {
  display: block;
  aspect-ratio: 1 / 1;
  background: #f2f2f2;
  overflow: hidden;
}

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

.work-card__meta {
  display: block;
  padding: 8px 10px;
}

.work-card__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.work-card__year {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.work-card__label {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 1px 6px;
}

.music-link {
  text-align: center;
  margin-top: 40px;
}

.music-link a {
  color: inherit;
}

.site-footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* =====================================================================
   TOPページ 2026-09-16 redesign（方向性A案：ミレイ額装 × 桜 × 水鏡）
   body.page-top を起点に、MUSICと共有しているクラス（site-header / work-grid /
   work-card* / site-footer / main）だけを上書きする。それ以外（.frame* / .plate* /
   .profile* / .music-link / .section-label / .divider / .rip）はTOP専用クラス。

   設計方針（2026-09-16 決定）：
   - 金は「額装」だけが持つ。ページ外周のポスター枠・金ベタのCTA・メタリックなロゴは廃止。
     額装を原画（ミレイ《箱舟に帰る鳩》1851）の比率に順守させると、金は上の細い帯＋
     左右上部のスパンドレル＋細い側桟だけになり、順守＝減量が同時に成立する。
   - アーチ内は深緑（原画順守）。2026-09-15までの深紅から変更。
   - 桜は画面下から立ち上げる。上から垂らす構図＋花筏は「和」の定型になるため不採用。
   - 逆流する滝は廃止（静止した水面と矛盾）。閃光のみ継続。
   ===================================================================== */

body.page-top {
  /* このリニューアルで使う色。既存の :root トークンはMUSIC側と共有のため触らない */
  --top-water: #061311;      /* 水／ページ地 */
  --top-arch: #0a1f1a;       /* アーチ内（深緑） */
  --top-gold: #d9bd77;       /* 金（線） */
  --top-gold-lite: #e8d49b;  /* 金（明） */
  --top-gold-dim: #a88a3f;   /* 金（沈めた線・年号） */
  --top-gold-dark: #5f4713;  /* 金（暗い輪郭線） */
  --top-body: #dce7df;
  --top-sub: #a8bdb1;

  background: var(--top-water);
  color: var(--top-body);
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  -webkit-font-smoothing: antialiased;
}

.intro-locked { overflow: hidden; }

/* ページ外周の枠は持たない（額装と二重に枠が出て競合するため） */
.frame {
  max-width: 560px;
  margin: 0 auto;
  border: 0;
  background: var(--top-water);
}

.frame__inner {
  border: 0;
  margin: 0;
}

.page-top .site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0;
  background: none;
  border-bottom: 1px solid rgba(217, 189, 119, .28);
}

.page-top .site-header__name {
  font-family: "Shippori Mincho", serif;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .3em;
  padding-left: .3em; /* letter-spacingの余白を右側だけに残さないための微調整 */
  color: var(--top-gold);
  text-decoration: none;
}

.page-top main {
  max-width: none;
  margin: 0;
  padding: 0 0 8px;
}

/* ---------------------------------------------------------------
   ヒーロー：金地アーチ額装 ＋ 水鏡 ＋ 手前から立ち上がる桜
   --------------------------------------------------------------- */

.plate {
  position: relative;
  overflow: hidden;
  padding: 18px 0 26px;
  background: linear-gradient(180deg, #10302a 0%, #0a201c 56%, var(--top-water) 100%);
  --boltx: 50%;
}

.plate__stage {
  position: relative;
  z-index: 1;
  width: min(85%, 380px);
  margin: 0 auto;
}

/* 額装本体。アーチはSVG側で evenodd の「穴」になっており、肖像を透かす */
.plate__art {
  position: relative;
  aspect-ratio: 330 / 380;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .65);
}

.plate__ground {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, #123b30 0%, var(--top-arch) 58%, #06140f 100%);
  transition: filter 55ms linear;
}

.plate.is-lit .plate__ground {
  filter: brightness(2.1) saturate(.45);
}

.plate__photo {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 0;
  width: auto;
  height: 87%;
  object-fit: cover;
  object-position: center 6%;
  display: block;
  z-index: 2; /* 桜（.plate__branch, z-index:1）より手前 */
}

.plate__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 4; /* 桜(1)・肖像(2)より確実に手前。額装は常に最前面 */
}

/* 閃光。額の金が不透明なので、光はアーチの開口部からのみ見える */
.plate__bolt,
.plate__bolt--front {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  mix-blend-mode: screen;
}

.plate__bolt {
  background:
    radial-gradient(130% 95% at var(--boltx) -18%,
      #f8fdff 0%, #bfe6f5 26%, #6fb4cf 48%, rgba(60, 130, 165, 0) 82%);
}

.plate__bolt--front {
  background: linear-gradient(to bottom,
    rgba(224, 246, 255, .9) 0%, rgba(150, 205, 228, .45) 40%, rgba(70, 140, 170, 0) 82%);
}

.plate__bolt.is-striking { animation: bolt 1100ms linear 1; }
.plate__bolt--front.is-striking { animation: boltFront 1100ms linear 1; }

@keyframes bolt {
  0% { opacity: 0 }   1% { opacity: 0 }
  2% { opacity: .96 } 5% { opacity: .82 }
  6% { opacity: .04 } 10% { opacity: .04 }
  11% { opacity: .74 } 15% { opacity: .52 }
  16% { opacity: .07 } 22% { opacity: .05 }
  24% { opacity: .46 } 31% { opacity: .20 }
  46% { opacity: .05 } 100% { opacity: 0 }
}

@keyframes boltFront {
  0% { opacity: 0 }   1% { opacity: 0 }
  2% { opacity: .34 } 5% { opacity: .28 }
  6% { opacity: .02 } 10% { opacity: .02 }
  11% { opacity: .26 } 15% { opacity: .18 }
  16% { opacity: .02 } 24% { opacity: .16 }
  31% { opacity: .07 } 46% { opacity: .02 } 100% { opacity: 0 }
}

/* 水面線。ステージ幅ではなく画面幅いっぱいに引く */
.plate__waterline {
  position: relative;
  height: 2px;
  margin: 0 -50%;
  width: 200%;
  background: linear-gradient(90deg,
    rgba(217, 189, 119, 0) 0%, rgba(246, 234, 208, .7) 50%, rgba(217, 189, 119, 0) 100%);
}

/* 水鏡：額装の下端側が水面に映る。肖像は映さない（水中の像は濁る想定） */
.plate__mirror {
  position: relative;
  aspect-ratio: 330 / 118;
  overflow: hidden;
  opacity: .5;
  filter: blur(1.7px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .3) 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .3) 68%, transparent 100%);
}

/* 額の下端だけを切り出すと、その範囲には金がほとんど無く反射に見えない。
   額全体を上下反転＋縦31%に圧縮して映し、金の帯とスパンドレルが水面に出るようにする。
   translateY(31%) は scaleY 後に自分の高さぶん戻すための補正（％は要素自身の高さ基準）。 */
.plate__mirror svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 330 / 380;
  transform: translateY(31%) scaleY(-0.31);
  transform-origin: top center;
  display: block;
}

.plate__ripples,
.plate__fallen {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 118px;
  display: block;
  pointer-events: none;
}

.plate__ripples { z-index: 2; }
.plate__fallen { z-index: 3; }

/* 桜（油彩PNG）。.plate__art の中、.plate__ground と .plate__photo の間に配置し、
   肖像の背後に見えるようにしている（2026-09-20 SVGイラストから油彩画像に置き換え） */
.plate__branch {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 100%, rgba(0, 0, 0, .35) 100%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 100%, rgba(0, 0, 0, .35) 100%, transparent 100%);
}

.plate__branch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: bottom center;
}

.plate__branch--l {
  left: -30%;
  bottom: -22%;
  width: 81%;
  height: 130%;
}

.plate__branch--l img {
  object-position: 3% bottom;
  transform: scaleX(1) rotate(9deg) scale(1.07);
}

.plate__branch--r {
  right: -26%;
  bottom: -25%;
  width: 73%;
  height: 130%;
}

.plate__branch--r img {
  object-position: 0% bottom;
  transform: scaleX(1) rotate(-13deg) scale(1.18);
}

/* ---------------------------------------------------------------
   プロフィール以下
   --------------------------------------------------------------- */

.profile {
  display: block;
  max-width: none;
  margin: 0;
  padding: 28px 22px 32px;
  text-align: center;
}

.profile__name {
  font-family: "Cormorant Garamond", "Shippori Mincho", serif;
  font-weight: 500;
  font-size: clamp(1.5rem, 6vw, 2rem);
  letter-spacing: .12em;
  color: var(--top-gold);
  margin: 0;
  line-height: 1.3;
}

.profile__bio {
  font-size: .78rem;
  line-height: 2;
  letter-spacing: .04em;
  color: var(--top-sub);
  margin: .9em 0 0;
}

.profile__links {
  display: flex;
  gap: 12px;
  justify-content: center;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.profile__links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 44px; /* タップ領域44px（スマホ優先方針） */
  font-family: "Cormorant Garamond", serif;
  font-size: .72rem;
  letter-spacing: .22em;
  padding-left: .22em;
  text-transform: uppercase;
  color: var(--top-gold-lite);
  text-decoration: none;
  border: 1px solid rgba(217, 189, 119, .55);
}

.profile__links a:focus-visible {
  outline: 2px solid var(--top-gold-lite);
  outline-offset: 2px;
}

.section-label {
  margin: 0 0 12px;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: .82rem;
  letter-spacing: .44em;
  padding-left: .44em;
  color: var(--top-gold);
}

.divider {
  display: block;
  width: min(100% - 40px, 350px);
  height: 14px;
  margin: 0 auto;
}

.page-top .work-grid {
  padding: 20px 20px 0;
  gap: 18px;
}

.page-top .work-card {
  position: relative;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.page-top .work-card__cover {
  position: relative;
  border: 1px solid rgba(217, 189, 119, .45);
  background: #0a251f;
}

/* 水面に置かれた見え方に寄せる下端の照り返し */
.page-top .work-card__cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(to top, rgba(6, 19, 17, .55), transparent);
  pointer-events: none;
}

.page-top .work-card__meta {
  position: static;
  padding: 8px 2px 0;
  background: none;
}

.page-top .work-card__title {
  display: block;
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--top-body);
}

.page-top .work-card__year {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: .82rem;
  letter-spacing: .12em;
  color: var(--top-gold-dim);
}

.page-top .work-card__label {
  color: var(--top-gold-dim);
  border-color: rgba(217, 189, 119, .45);
}

.page-top .work-grid__empty {
  color: var(--top-sub);
}

.rip {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: radial-gradient(circle, rgba(217, 189, 119, .5), rgba(217, 189, 119, 0) 70%);
  animation: rip .65s ease-out forwards;
  pointer-events: none;
}

@keyframes rip {
  to { transform: scale(1.9); opacity: 0; }
}

/* CTA：金ベタ塗りではなく、額と同じ二重罫のモールディングで組む */
.music-link {
  position: relative;
  padding: 0 20px;
  margin: 40px 0 0;
}

.music-link::before,
.music-link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(217, 189, 119, .15);
  border-radius: 50%;
  pointer-events: none;
}

.music-link::before { width: min(420px, 96%); height: 100px; }
.music-link::after  { width: min(330px, 80%); height: 76px; }

.music-link a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 286px;
  min-height: 60px;
  margin: 0 auto;
  font-family: "Cormorant Garamond", serif;
  font-size: .92rem;
  letter-spacing: .34em;
  padding-left: .34em;
  text-decoration: none;
  color: var(--top-gold-lite);
  background: rgba(217, 189, 119, .06);
  border: 1px solid var(--top-gold);
  box-shadow:
    inset 0 0 0 4px var(--top-water),
    inset 0 0 0 5px rgba(95, 71, 19, .9);
}

.music-link a:focus-visible {
  outline: 2px solid var(--top-gold-lite);
  outline-offset: 3px;
}

.page-top .site-footer {
  padding: 26px 16px 34px;
  margin-top: 28px;
  border-top: 1px solid rgba(217, 189, 119, .2);
  font-size: .62rem;
  letter-spacing: .2em;
  color: #7d8a80;
}

/* ---------- 初回訪問時のみの水滴ワイプ演出 ---------- */
.intro-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.intro-refract {
  backdrop-filter: url(#fx-refract);
}

.intro-film {
  backdrop-filter: blur(7px) saturate(1.15) brightness(.94);
  background: rgba(128, 176, 196, .26);
}

.intro-refract, .intro-film, .intro-canvas {
  -webkit-mask-image: url(#fx-wipe);
  mask-image: url(#fx-wipe);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  transition: opacity .9s ease;
}

.intro-lenses {
  position: fixed;
  inset: 0;
  z-index: 61;
  pointer-events: none;
}

.lens {
  position: absolute;
  border-radius: 52% 48% 47% 53% / 46% 44% 56% 54%;
  backdrop-filter: url(#fx-lens) brightness(1.05) saturate(1.1);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, .85),
    inset 1px -3px 6px rgba(255, 255, 255, .55),
    inset -2px 2px 5px rgba(18, 52, 68, .5),
    0 2px 4px rgba(8, 30, 42, .38);
  transition: opacity .9s ease;
}

.lens::after {
  content: "";
  position: absolute;
  left: 22%; top: 18%;
  width: 26%; height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  filter: blur(.4px);
}

.intro-catch {
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  z-index: 62;
}

.intro-catch.is-wiping {
  cursor: grabbing;
}

.intro-hint {
  position: fixed;
  left: 50%; bottom: 12%;
  transform: translateX(-50%);
  z-index: 63;
  opacity: 0;
  transition: opacity .8s ease;
  font-family: "Shippori Mincho", serif;
  font-size: .78rem;
  letter-spacing: .16em;
  color: #eaf6fa;
  text-shadow: 0 1px 6px rgba(0, 20, 30, .65);
  pointer-events: none;
  white-space: nowrap;
}

.intro-hint.is-shown {
  opacity: .92;
}

.intro-done .intro-layer, .intro-done .intro-hint, .intro-done .lens {
  opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .plate__bolt, .plate__bolt--front { display: none; }
}
