/* 05_parallax-landscape — 架空の町「霧音町」の案内。切り絵を重ねた山あいの風景と、紙の札 */
:root {
  --paper: #f4efe3;
  --paper-deep: #e9e1cf;
  --ink: #1b2a30;
  --ink-soft: #4c5b5e;
  --moss: #2f5f4c;
  --line: rgba(27, 42, 48, .18);
  --mincho: "Zen Antique Soft", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: "Zen Kaku Gothic Antique", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  --pad: clamp(20px, 5.4vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 15px;
  line-height: 2;
  letter-spacing: .05em;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  line-break: strict;
  overflow-wrap: anywhere;
}
.ph { display: inline-block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 冒頭の絵 ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 360px;
  overflow: hidden;
  overflow: clip;   /* hidden だと、フォーカスの移動などで中身が送られてしまうことがある */
  background: #9fd0ec;
}
.hero[data-time="asa"] { --sky: linear-gradient(180deg, #a9c9d8 0%, #f3d9c4 58%, #fbe9cf 100%); --m1: #9fb6c4; --m2: #7f9eab; --m3: #4f7f6e; background: #f3d9c4; }
.hero[data-time="hiru"] { --sky: linear-gradient(180deg, #4f9fd6 0%, #9fd0ec 55%, #dff0f4 100%); --m1: #86a9c9; --m2: #5f8fa8; --m3: #3f8a55; background: #9fd0ec; }
.hero[data-time="yu"] { --sky: linear-gradient(180deg, #3d3766 0%, #c9607a 55%, #f7b267 100%); --m1: #7a5f86; --m2: #5b466e; --m3: #35304f; background: #c9607a; }
.hero[data-time="yoru"] { --sky: linear-gradient(180deg, #070d24 0%, #14244a 60%, #2a3f6b 100%); --m1: #1d2c4f; --m2: #15213f; --m3: #0c152b; background: #14244a; }

.hero__scene { position: absolute; inset: 0; z-index: 1; pointer-events: none; }   /* 絵は触らせない（なぞりはページの送りに渡す） */
.hero__scene canvas { display: block; width: 100%; height: 100%; touch-action: auto !important; }

/* 絵が描けないときの代わり。PixiJS の用意ができたら隠す */
.hero__fallback { position: absolute; inset: 0; z-index: 0; background: var(--sky); }
.hero__fallback span { position: absolute; left: 0; right: 0; bottom: 0; }
.hero__fallback span:nth-child(1) { height: 52%; background: var(--m1); clip-path: polygon(0 38%, 12% 14%, 22% 34%, 36% 4%, 50% 36%, 62% 18%, 74% 40%, 88% 10%, 100% 30%, 100% 100%, 0 100%); }
.hero__fallback span:nth-child(2) { height: 40%; background: var(--m2); clip-path: polygon(0 20%, 16% 44%, 30% 16%, 46% 46%, 60% 24%, 78% 50%, 92% 22%, 100% 36%, 100% 100%, 0 100%); }
.hero__fallback span:nth-child(3) { height: 25%; background: var(--m3); clip-path: polygon(0 40%, 20% 12%, 42% 38%, 66% 8%, 84% 34%, 100% 16%, 100% 100%, 0 100%); }
.hero.is-live .hero__fallback { display: none; }

/* 題字の札（しおり）。紙の色の上に文字をのせる */
.plate {
  position: absolute; z-index: 3;
  left: var(--pad); top: 0;
  width: clamp(150px, 15vw, 214px);
  height: min(74%, 640px);
  padding: clamp(44px, 8vh, 84px) 0 clamp(20px, 4vh, 40px);
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(10, 20, 30, .28);
}
.plate::before {   /* ひもを通す穴 */
  content: ""; position: absolute; left: 50%; top: clamp(14px, 2.6vh, 28px);
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--ink); opacity: .82;
}
.plate::after {    /* 下のふち */
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 10px; top: 10px;
  border: 1px solid var(--line); pointer-events: none;
}
.plate p, .plate h1 { margin: 0; }
.plate__kana {
  grid-column: 1 / -1; grid-row: 1;
  font-size: 11px; font-weight: 500; letter-spacing: .34em; text-indent: .34em; line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: clamp(8px, 1.6vh, 18px) !important;
  white-space: nowrap;
}
.plate__title {
  grid-column: 3; grid-row: 2;
  writing-mode: vertical-rl;
  font-family: var(--mincho); font-weight: 400;
  font-size: clamp(38px, min(5.2vw, 9.6vh), 82px);
  line-height: 1.1; letter-spacing: .16em;
  white-space: nowrap;
}
.plate__lead {
  grid-column: 2; grid-row: 2;
  writing-mode: vertical-rl;
  margin-right: clamp(10px, 1.2vw, 20px) !important;
  padding-top: .4em;
  font-family: var(--mincho);
  font-size: clamp(13px, min(1.1vw, 2.3vh), 17px);
  line-height: 1.9; letter-spacing: .24em;
  white-space: nowrap;
}
.plate__lead span { display: block; }
.plate__lead span + span { padding-top: 1.6em; }
.plate__sub {
  grid-column: 1 / -1; grid-row: 3;
  margin-top: clamp(8px, 1.6vh, 18px) !important;
  padding: 3px 14px 4px;
  border: 1px solid var(--ink);
  font-size: 11.5px; font-weight: 500; letter-spacing: .3em; text-indent: .3em; line-height: 1.6;
  white-space: nowrap;
}

/* 時間帯の切り替え */
.clock {
  position: absolute; z-index: 3;
  right: var(--pad); bottom: clamp(18px, 4vh, 40px);
  display: flex; align-items: center; gap: 14px;
  padding: 7px 8px 7px 20px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(10, 20, 30, .26);
}
.clock__label { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .24em; line-height: 1; white-space: nowrap; }
.clock__buttons { display: flex; gap: 4px; }
.clock button {
  appearance: none;
  width: 44px; height: 44px;
  border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: var(--ink);
  font: 400 17px/1 var(--mincho);
  cursor: pointer;
  transition: background .3s, color .3s, border-color .3s;
}
.clock button:hover { border-color: var(--ink); }
.clock button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.clock button:focus-visible { outline: 3px solid #0b57c4; outline-offset: 2px; }

.hero__scroll {
  position: absolute; z-index: 3;
  left: 50%; bottom: clamp(16px, 3.4vh, 34px);
  margin: 0; transform: translateX(-50%);
  padding: 4px 14px 5px;
  border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: 11px; font-weight: 500; letter-spacing: .3em; text-indent: .3em; line-height: 1.6;
}
.hero__scroll span::after { content: "↓"; margin-left: .3em; letter-spacing: 0; }

/* 幅が狭いとき: 札は細く、切り替えは案内バーの上へ */
@media (max-width: 760px) {
  .plate { width: 150px; height: min(62%, 520px); padding-top: 42px; }
  .plate__title { font-size: clamp(36px, 7.2vh, 54px); }
  .plate__lead { font-size: clamp(12.5px, 1.8vh, 14px); line-height: 1.75; margin-right: 8px !important; }
  .plate__kana { font-size: 10px; letter-spacing: .24em; text-indent: .24em; }
  .plate__sub { font-size: 10.5px; padding: 2px 10px 3px; letter-spacing: .2em; text-indent: .2em; }
  .clock { right: 16px; bottom: 72px; padding-left: 16px; gap: 10px; }
  .hero__scroll { display: none; }
}
/* 幅 761〜1370px: 左下の案内バーと重ならないよう、「下へ」は出さない */
@media (min-width: 761px) and (max-width: 1370px) {
  .hero__scroll { display: none; }
}

/* 高さが低いとき（スマホ横・低いノートPC）: 札を横組みにする */
@media (max-height: 560px) {
  .plate {
    width: auto; height: auto;
    left: var(--pad); top: 0;
    padding: 34px 26px 18px 26px;
    display: block;
  }
  .plate::before { top: 12px; }
  .plate__title { writing-mode: horizontal-tb; font-size: clamp(34px, 11vh, 52px); letter-spacing: .14em; line-height: 1.3; }
  .plate__lead { writing-mode: horizontal-tb; margin: 2px 0 0 !important; padding: 0; font-size: 13px; letter-spacing: .14em; line-height: 1.8; }
  .plate__lead span { display: inline; }
  .plate__lead span + span { padding: 0; }
  .plate__kana { margin-bottom: 0 !important; text-indent: 0; }
  .plate__sub { display: inline-block; margin-top: 8px !important; }
  .clock { bottom: 14px; }
}
@media (max-height: 560px) and (max-width: 760px) {
  .clock { bottom: 66px; }
}

/* ---------- 本文 ---------- */
.about {
  position: relative; z-index: 2;
  padding: clamp(64px, 9vw, 140px) var(--pad) clamp(56px, 8vw, 120px);
  background: var(--paper);
}
.about__head { max-width: 46em; }
.about__label {
  margin: 0 0 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .3em; line-height: 1.6;
  color: var(--moss);
}
.about__label::before { content: ""; display: inline-block; width: 28px; height: 1px; margin-right: 14px; vertical-align: .35em; background: currentColor; }
.about__title {
  margin: 0;
  font-family: var(--mincho); font-weight: 400;
  font-size: clamp(26px, 3.1vw, 46px);
  line-height: 1.6; letter-spacing: .1em;
}
.about__text { margin: clamp(18px, 2vw, 30px) 0 0; font-size: clamp(14.5px, 1.1vw, 16px); line-height: 2.2; }

.spots {
  list-style: none;
  margin: clamp(44px, 6vw, 90px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 56px);
}
.spots li { padding-top: 22px; border-top: 1px solid var(--ink); }
.spots__no { display: block; font-family: var(--mincho); font-size: 15px; line-height: 1; color: var(--moss); }
.spots h3 { margin: 14px 0 8px; font-family: var(--mincho); font-weight: 400; font-size: clamp(19px, 1.6vw, 24px); letter-spacing: .12em; line-height: 1.6; }
.spots p { margin: 0; font-size: 14px; line-height: 2.1; color: #2c3b40; }

.legend {
  margin-top: clamp(48px, 6vw, 96px);
  padding: clamp(22px, 3vw, 40px) clamp(20px, 3vw, 44px) clamp(24px, 3vw, 42px);
  background: var(--paper-deep);
}
.legend__title { margin: 0 0 10px; font-family: var(--mincho); font-weight: 400; font-size: 19px; letter-spacing: .14em; line-height: 1.6; }
.legend p { margin: 0; max-width: 56em; font-size: 14px; line-height: 2.1; }
.legend__table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 13.5px; line-height: 1.8; }
.legend__table caption { text-align: left; font-weight: 700; font-size: 12px; letter-spacing: .2em; color: var(--moss); padding-bottom: 6px; }
.legend__table th, .legend__table td { padding: 9px 12px 9px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; }
.legend__table thead th { font-size: 12px; color: var(--ink-soft); letter-spacing: .14em; }
.legend__table tbody th { font-family: var(--mincho); font-size: 16px; white-space: nowrap; width: 4em; }
.legend__table td:nth-child(2) { white-space: nowrap; width: 11em; }

@media (max-width: 820px) {
  .spots { grid-template-columns: 1fr; gap: 28px; }
  .legend__table td:nth-child(2) { white-space: normal; width: 7em; }
}

/* ---------- フッター ---------- */
.foot {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px;
  padding: 30px var(--pad) 84px;   /* 左下の案内バーの分をあける */
  background: var(--ink);
  color: #c9d2d0;
  font-size: 12px; letter-spacing: .08em; line-height: 1.8;
}
.foot p { margin: 0; }
.foot__name { font-family: var(--mincho); font-size: 15px; letter-spacing: .2em; color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  .clock button { transition: none; }
}
