/* ===== 狐の窓のページ: 月夜の山の、幻想的な神社 ===== */

.kitsune-page {
  --yozora: #0c1430;
  --yozora-2: #1b2550;
  --shu: #b53a2a;
  --shu-koi: #7b211d;
  --tomoshibi: #f0d49a;
  --onibi: #a8e0ff;
  --onibi-2: #d6f2ff;
  --shironeri: #f2ede3;
  --ai: #1a2135;

  min-height: 100vh;
  color: var(--shironeri);
  background: var(--yozora);
  line-height: 1.8;
}

/* 路地の背景を、星の散る藍の夜空に置き換える */
.kitsune-page::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(168, 224, 255, .08) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 25%, rgba(240, 212, 154, .08) 0 1px, transparent 2px),
    radial-gradient(circle at 65% 70%, rgba(168, 224, 255, .05) 0 1px, transparent 2px),
    linear-gradient(#0c1430, #121b3b 55%, #0a1127);
  background-position: 0 0;
  background-size: 97px 103px, 131px 137px, 173px 179px, auto;
  background-repeat: repeat, repeat, repeat, no-repeat;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .45);
}

.kitsune-page a:focus-visible { outline: 3px solid var(--onibi-2); outline-offset: 4px; }
.fox-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.fox-main { overflow: hidden; }

/* ----- 最初の画面 ----- */

.fox-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(214, 242, 255, .14);
  background: linear-gradient(#0a1129, #16204a 58%, #1b2550);
}

/* 空: 星・月・山の端の杉並木・地面 */
.fox-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(242, 237, 227, .7) 0 1px, transparent 1.6px),
    radial-gradient(circle at 37% 9%, rgba(214, 242, 255, .6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 63% 24%, rgba(242, 237, 227, .5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 86% 13%, rgba(214, 242, 255, .55) 0 1px, transparent 1.6px);
  background-size: 230px 170px, 310px 210px, 270px 190px, 350px 230px;
}

.fox-sky__moon {
  position: absolute;
  top: 42px;
  right: max(28px, calc(50% - 560px));
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fbf6e6, #e6dec4 70%, #d6ccae);
  box-shadow: 0 0 26px 8px rgba(240, 237, 220, .22), 0 0 90px 34px rgba(168, 224, 255, .09);
}

.fox-sky__moon::after { position: absolute; top: 22%; left: 20%; width: 22%; height: 15%; border-radius: 50%; content: ""; background: rgba(148, 144, 141, .22); box-shadow: 34px 20px 0 3px rgba(148, 144, 141, .14), 6px 44px 0 -2px rgba(148, 144, 141, .15); }

.fox-sky__ridge { position: absolute; right: 0; bottom: 0; left: 0; display: block; width: 100%; height: 64%; }

/* 鬼火（青白い火の玉）と蛍 */
.onibi { position: absolute; z-index: 1; width: 20px; height: 26px; border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 50% 60%, #f2fbff 0 12%, var(--onibi) 46%, rgba(168, 224, 255, .04) 74%); box-shadow: 0 0 18px 5px rgba(168, 224, 255, .45); animation: onibi-float 8s ease-in-out infinite alternate; }
.onibi::after { position: absolute; right: 3px; bottom: -9px; left: 3px; height: 16px; content: ""; background: var(--onibi); clip-path: polygon(50% 100%, 0 0, 100% 0); filter: blur(2px); opacity: .7; }
.onibi--1 { top: 64%; left: 6%; }
.onibi--2 { top: 30%; left: 44%; width: 14px; height: 18px; animation-delay: -3s; }
.onibi--3 { top: 52%; right: 4%; animation-delay: -5.5s; }

.hotaru { position: absolute; z-index: 1; width: 4px; height: 4px; border-radius: 50%; background: #f0e7a2; box-shadow: 0 0 8px 3px rgba(240, 231, 162, .55); animation: hotaru 5s ease-in-out infinite; }
.hotaru--1 { top: 24%; left: 9%; }
.hotaru--2 { top: 78%; left: 31%; animation-delay: -1.2s; }
.hotaru--3 { top: 16%; left: 56%; animation-delay: -2.7s; }
.hotaru--4 { top: 70%; right: 12%; animation-delay: -1.8s; }
.hotaru--5 { top: 38%; right: 3%; animation-delay: -.6s; }
.hotaru--6 { top: 88%; left: 8%; animation-delay: -3.6s; }

.fox-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(calc(100% - 32px), 1080px);
  margin-inline: auto;
  padding-top: 40px;
}

.fox-hero__copy { position: relative; z-index: 3; text-shadow: 0 2px 10px #070b1c; }
.fox-hero h1 { margin: 0; color: var(--shironeri); font-size: clamp(3rem, 9vw, 5.6rem); line-height: 1.1; letter-spacing: .1em; }

/* 一言は言葉の切れ目（<wbr>）でだけ折り返す */
.fox-lead { max-width: 22em; margin: 18px 0 0; font-size: clamp(1.05rem, 2.2vw, 1.25rem); font-weight: 700; word-break: keep-all; overflow-wrap: normal; }

.fox-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.fox-tags span { padding: 4px 12px; border: 1px solid rgba(242, 237, 227, .78); border-radius: 2px; color: var(--shironeri); background: rgba(12, 20, 48, .82); font-size: .875rem; font-weight: 700; text-shadow: none; }
.fox-tags span:first-child { border-color: var(--tomoshibi); color: #fff1c9; }
.fox-notice { max-width: 24em; margin: 24px 0 0; color: #fff2ca; font-weight: 700; }

/* 参道と鳥居の絵。下の端は最初の画面の下の端にそろう */
.shrine-stage { position: relative; min-width: 0; aspect-ratio: 760 / 640; }
.shrine-stage__art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }

/* 菱形の窓の下に落ちる、窓の灯りの照り返し */
.shrine-stage::after { position: absolute; z-index: 0; right: 22%; bottom: 0; left: 22%; height: 14%; border-radius: 50%; content: ""; background: radial-gradient(closest-side, rgba(240, 212, 154, .22), transparent); pointer-events: none; }

/* 狐の石像の画像は、月夜に合うよう少しだけ暗く沈める（形と色の数は変えない） */
.fox-statue { filter: brightness(.8) saturate(.9); }

.lantern-halo { animation: lantern-flicker 4.5s ease-in-out infinite alternate; }
.lantern-halo--late { animation-delay: -2.2s; }

/* 指でつくった菱形の窓。鳥居のくぐり口（柱の間・紙垂より下）に余白をもって収まる。中にだけ写真が見え、ふちは金にかすかに光る */
.fox-window { position: absolute; z-index: 1; top: 70.3%; left: 50%; width: 38%; aspect-ratio: 1; transform: translate(-50%, -50%); }

.fox-window::before { position: absolute; inset: 11%; border: 1px solid rgba(168, 224, 255, .38); content: ""; transform: rotate(45deg); }

.fox-window__pane {
  position: absolute;
  inset: 14.645%;
  overflow: hidden;
  border: 4px solid #e6c37f;
  background: #2a1d26;
  box-shadow: 0 0 0 1px rgba(255, 241, 201, .55), 0 0 24px 4px rgba(240, 212, 154, .42), 0 0 70px 10px rgba(181, 58, 42, .3);
  transform: rotate(45deg);
}

/* 写真は狐の目と鼻の間（左右 51.8%・上下 53.2% の所）を窓の真ん中に置き、そこを軸に戻して寄せる。
   窓の対角線に写真の幅の 440/1024 が入る大きさで、写真の指が窓を横切らない */
.fox-window__pane img {
  position: absolute;
  top: calc(50% - 141.5% * .532);
  left: calc(50% - 141.5% * .518);
  width: 141.5%;
  max-width: none;
  height: 141.5%;
  transform: rotate(-45deg) scale(2.33);
  transform-origin: 51.8% 53.2%;
}

/* 窓のふちのぼかし（夜の色）と、内側の朱のほのかな照り */
.fox-window__pane::after { position: absolute; z-index: 1; inset: 0; content: ""; background: radial-gradient(circle, transparent 52%, rgba(181, 58, 42, .2)); box-shadow: inset 0 0 26px 6px rgba(12, 20, 48, .6), inset 0 0 0 2px rgba(255, 241, 201, .35); }

/* ----- 中身 ----- */

.fox-content { width: min(calc(100% - 32px), 1080px); margin-inline: auto; }

/* 紹介: 文の横に掛け軸（灯りに照らされる） */
.fox-intro { display: grid; align-items: center; gap: 40px; padding: 76px 0 16px; font-size: clamp(1rem, 2vw, 1.15rem); }
.fox-intro p { max-width: none; margin: 0; }
.fox-intro p + p { margin-top: 14px; }

.kakejiku { position: relative; width: min(100%, 300px); margin-inline: auto; padding-top: 50px; }

/* 掛け軸のうしろの、灯籠の灯りのにじみ */
.kakejiku::before { position: absolute; z-index: -1; inset: 2% -30% -6%; content: ""; background: radial-gradient(closest-side, rgba(240, 212, 154, .16), transparent); }

/* 掛け紐と釘（上）・軸木（下） */
.kakejiku__mount::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 150px;
  height: 52px;
  content: "";
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 52'%3E%3Cpath d='M75 6 22 48M75 6l53 42' fill='none' stroke='%23c9a35a' stroke-width='2.5'/%3E%3Ccircle cx='75' cy='6' r='5' fill='%23302430' stroke='%23c9a35a' stroke-width='2'/%3E%3Crect x='6' y='44' width='138' height='8' rx='2' fill='%232b1c16'/%3E%3C/svg%3E") no-repeat center bottom / 100% 100%;
  transform: translateX(-50%);
}

.kakejiku__mount {
  position: relative;
  padding: 24px 20px 44px;
  border-right: 3px solid #b38f4a;
  border-left: 3px solid #b38f4a;
  background:
    radial-gradient(circle at 25% 25%, rgba(201, 163, 90, .16) 0 1.5px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(201, 163, 90, .12) 0 1.5px, transparent 2px),
    linear-gradient(#2c2550, #221d42);
  background-size: 18px 18px, 18px 18px, auto;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .45);
}

.kakejiku__mount::after {
  position: absolute;
  top: 100%;
  right: -16px;
  left: -16px;
  height: 16px;
  border-radius: 8px;
  content: "";
  background:
    radial-gradient(circle at 8px 50%, #d9b56c 0 7px, transparent 8px),
    radial-gradient(circle at calc(100% - 8px) 50%, #d9b56c 0 7px, transparent 8px),
    linear-gradient(#4a3226, #2b1c16);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .4);
}

/* 写真の上下の金の帯（一文字） */
.kakejiku__photo { position: relative; border-top: 9px solid #b38f4a; border-bottom: 9px solid #b38f4a; box-shadow: 0 0 0 1px rgba(240, 212, 154, .5); }
.kakejiku__photo::after { position: absolute; inset: 0; content: ""; box-shadow: inset 0 0 22px 4px rgba(12, 20, 48, .45); pointer-events: none; }

.fox-section { padding-top: 86px; }
.fox-section h2 { margin-bottom: 38px; color: var(--shironeri); font-size: clamp(1.7rem, 4vw, 2.35rem); }
.fox-section h2::after { display: block; width: 70px; height: 3px; margin-top: 10px; content: ""; background: linear-gradient(90deg, var(--shu) 0 65%, var(--tomoshibi) 65%); box-shadow: 0 0 8px rgba(240, 212, 154, .2); }

/* 機能のカード: 紅白の紐で吊るした、五角形の木の絵馬 */
.fox-features { display: grid; gap: 30px 24px; }

.fox-feature {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 78px 22px 30px;
  color: var(--ai);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .34));
}

/* 札の板（屋根の形の五角形・木目・紐を通す穴） */
.fox-feature::before {
  position: absolute;
  z-index: -1;
  inset: 30px 0 0;
  content: "";
  background:
    radial-gradient(circle at 50% 27px, #2e1d12 0 4px, #7a522f 5px 6px, transparent 7px),
    linear-gradient(transparent 0 40px, rgba(122, 82, 47, .35) 40px 42px, transparent 42px),
    repeating-linear-gradient(97deg, rgba(110, 70, 30, .07) 0 2px, transparent 2px 15px),
    linear-gradient(160deg, #e6cb98, #d2aa6f 58%, #c49859);
  clip-path: polygon(0 36px, 50% 0, 100% 36px, 100% 100%, 0 100%);
}

/* 紐: 穴から上へ輪になる紅白の紐（短い 2 本に切れて見えないよう、1 本の輪として描く） */
.fox-feature::after {
  position: absolute;
  top: 0;
  left: 50%;
  width: 46px;
  height: 60px;
  content: "";
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 60'%3E%3Cpath d='M23 57C5 44 4 5 23 3c19 2 18 41 0 54' fill='none' stroke='%23c23a2c' stroke-width='3.5' stroke-linecap='round'/%3E%3Cpath d='M23 57C5 44 4 5 23 3c19 2 18 41 0 54' fill='none' stroke='%23f2ede3' stroke-width='3.5' stroke-dasharray='3 6'/%3E%3Cellipse cx='23' cy='49' rx='5' ry='4' fill='%23c23a2c'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  transform: translateX(-50%);
}

.fox-feature h3 { color: var(--ai); font-size: 1.1rem; line-height: 1.5; text-align: center; }
.fox-feature p { margin: 11px 0 0; font-size: 1rem; }

.fox-howto ol { display: grid; margin: 0; padding: 0; list-style: none; counter-reset: fox-steps; gap: 20px; }
.fox-howto li { position: relative; min-width: 0; margin: 0; padding: 75px 23px 28px; border: 1px solid rgba(168, 224, 255, .21); border-top: 4px solid var(--shu); background: rgba(16, 25, 57, .78); box-shadow: 0 12px 25px rgba(0, 0, 0, .22); counter-increment: fox-steps; }
.fox-howto li::before { position: absolute; top: 8px; left: 20px; color: var(--tomoshibi); content: counter(fox-steps); font-family: "Dela Gothic One", sans-serif; font-size: 2.35rem; line-height: 1.2; text-shadow: 0 0 12px rgba(240, 212, 154, .2); }
.fox-video { margin: 32px 0 0; }
.fox-video video { display: block; width: 100%; height: auto; border: 1px solid rgba(168, 224, 255, .21); border-top: 4px solid var(--shu); background: #050814; box-shadow: 0 12px 25px rgba(0, 0, 0, .22); }
.fox-video figcaption { margin-top: 10px; color: var(--shironeri); font-size: .95rem; }

.fox-notes { display: grid; gap: 0 32px; }
.fox-list { min-width: 0; }
.fox-list ul { margin: 0; padding: 29px 28px 29px 49px; border: 1px solid rgba(168, 224, 255, .17); background: rgba(16, 25, 57, .76); box-shadow: 0 12px 25px rgba(0, 0, 0, .2); }
.fox-list li::marker { color: var(--onibi); }
.fox-list li + li { margin-top: 12px; }

/* ----- ワールド用: 狐の泡 ----- */

.world-bubble { position: relative; margin-top: 100px; padding: 72px clamp(16px, 5vw, 54px) 54px; border: 1px solid rgba(168, 224, 255, .26); background: linear-gradient(rgba(16, 32, 65, .82), rgba(7, 18, 40, .94)); box-shadow: 0 20px 55px rgba(0, 0, 0, .34), inset 0 0 70px rgba(83, 169, 207, .06); }
.world-bubble > h2 { margin-top: 0; }
.world-bubble__intro { display: grid; align-items: center; gap: 32px; }
.world-bubble__lead { margin-top: 0; color: var(--onibi-2); font-size: 1.15rem; font-weight: 700; word-break: keep-all; overflow-wrap: normal; }

.pond-art { position: relative; overflow: hidden; border: 1px solid rgba(168, 224, 255, .24); border-radius: 6px; box-shadow: 0 0 40px rgba(61, 144, 179, .12); aspect-ratio: 3 / 2; }
.pond-art svg { display: block; width: 100%; height: 100%; }
.pond-float { transform-box: fill-box; animation: bubble-bob 7s ease-in-out infinite alternate; }
.pond-float--late { animation-delay: -3.5s; }
.pond-fireflies circle { animation: hotaru 5s ease-in-out infinite; }
.pond-fireflies circle:nth-child(2) { animation-delay: -1.6s; }
.pond-fireflies circle:nth-child(3) { animation-delay: -3s; }
.pond-fireflies circle:nth-child(4) { animation-delay: -4.1s; }

.bubble-features { display: grid; gap: 15px; margin-top: 34px; }
.bubble-features article { min-width: 0; padding: 22px; border-left: 3px solid var(--onibi); background: rgba(10, 27, 54, .8); }
.bubble-features h3,
.bubble-requirements h3 { color: var(--onibi-2); font-size: 1.05rem; line-height: 1.5; }
.bubble-features p { margin: 9px 0 0; }
.bubble-requirements { margin-top: 26px; padding: 25px 25px 22px; border: 1px solid rgba(240, 212, 154, .28); background: rgba(38, 35, 48, .65); }
.bubble-requirements ul { margin-bottom: 0; }

.fox-notice--end { max-width: none; margin: 64px 0 0; text-align: center; }
.fox-back { display: inline-flex; min-height: 48px; align-items: center; margin-top: 40px; padding: 10px 20px; border: 2px solid var(--tomoshibi); color: #fff2ca; font-weight: 700; text-decoration: none; }
.fox-back:hover { color: #101630; background: var(--tomoshibi); }
.kitsune-page footer { padding-top: 78px; }

@keyframes onibi-float { from { transform: translate3d(-4px, 8px, 0) rotate(-3deg); opacity: .7; } to { transform: translate3d(8px, -12px, 0) rotate(4deg); opacity: 1; } }
@keyframes hotaru { 0%, 100% { opacity: .15; transform: translateY(0); } 45% { opacity: 1; } 70% { transform: translateY(-8px); } }
@keyframes lantern-flicker { from { opacity: .65; } to { opacity: 1; } }
@keyframes bubble-bob { from { transform: translateY(3px); } to { transform: translateY(-6px); } }

@media (min-width: 768px) {
  .fox-intro { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 52px; }
  .fox-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fox-howto ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .world-bubble__intro { grid-template-columns: minmax(300px, .95fr) minmax(0, 1.05fr); }
  .bubble-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* パソコン: 文は左、鳥居と窓の絵は右 */
@media (min-width: 900px) {
  .fox-hero__inner { grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); gap: 24px; }
  .fox-hero__copy { align-self: center; padding-bottom: 40px; }
  .shrine-stage { align-self: end; margin-right: -4%; }
  .fox-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (min-width: 1024px) {
  .fox-features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .fox-hero__inner { gap: 24px; }
  .shrine-stage { width: min(118%, 720px); margin-inline: auto; justify-self: center; }
}

/* スマホ: 文の下に絵。窓を大きくして写真の顔が小さくなりすぎないようにする */
@media (max-width: 560px) {
  .fox-hero__inner { padding-top: 32px; }
  .shrine-stage { width: 112%; margin-inline: -6%; }
  .fox-sky__moon { top: 28px; right: 18px; width: 70px; }
  .onibi--1 { top: 46%; left: 4%; }
  .onibi--2 { top: 8%; left: 62%; }
  .fox-section { padding-top: 68px; }
  .fox-intro { padding-top: 56px; }
  .world-bubble { margin-top: 78px; padding-top: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .onibi,
  .hotaru,
  .lantern-halo,
  .pond-float,
  .pond-fireflies circle { animation: none; }
}
