/* メイン：ななめ見おろし（アイソメトリック）の見せ方
   広い画面では「箱庭」と「ウィンドウ」を左右交互に並べ、せまい画面では箱庭の下にウィンドウを置く */
.iso { padding: 28px 0 36px; }
.iso-row { max-width: 1180px; display: grid; gap: 12px; align-items: center; }
/* 島の高さはドット数で決める（1ドット＝--px） */
.stage { height: calc(var(--px) * 225); }
.stage-hero { height: calc(var(--px) * 270); }
.iso-row.stack .stage { order: -1; }
.site-footer { padding: 8px 0 28px; }
.controls a.pxbtn { text-decoration: none; display: inline-block; }

@media (min-width: 1100px) {
  .iso-row { grid-template-columns: 1fr 1fr; gap: 32px; }
  .iso-row.flip .stage { order: -1; }
  .iso-row.stack { grid-template-columns: 1fr; }
}
@media (max-width: 1099px) {
  .iso-row .stage { order: -1; }
}

/* ---------- ヘッダー：メニュー（移動）と、昼夜スイッチ（切りかえ）を形で分ける ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}
/* 夜もヘッダーは明るく（ロゴが見えるように）。下の町は夜のまま */
body.night .site-header { background: rgba(246,236,217,.92); }
body.night .site-header .wrap { color: var(--ink); }
.site-header .wrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 18px; padding-top: 8px; padding-bottom: 8px; }
.iso, .site-footer { scroll-margin-top: 96px; }

/* メニュー：押しやすい大きさのタブ。いま見ている段は色が変わる */
.gnav { display: flex; justify-content: center; gap: 6px; flex-wrap: nowrap; font-family: "Zen Maru Gothic", sans-serif; }
.gnav a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 0 var(--ink); transition: transform .1s, background .15s;
}
.gnav a:hover { background: #fff6d6; text-decoration: none; transform: translateY(-1px); }
.gnav a:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.gnav a[aria-current="true"] { background: var(--gold); }
.gnav .gi { font-size: 18px; line-height: 1; }
.gnav a:focus-visible, .theme-switch:focus-visible { outline: 3px solid var(--fire); outline-offset: 2px; }

/* 昼夜スイッチ：つまみが左右に動く「スイッチ」の形 */
.theme-switch {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px; min-height: 44px;
  background: none; border: 0; cursor: pointer; font: 700 15px "Zen Maru Gothic", sans-serif; color: var(--hdr);
}
.ts-track {
  position: relative; width: 64px; height: 34px; border-radius: 999px; border: 2px solid var(--ink);
  background: #8fd3ff; transition: background .25s; flex: none;
}
.ts-knob {
  position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 14px; line-height: 1;
  transition: left .25s;
}
.theme-switch[aria-checked="true"] .ts-track { background: #1b2340; }
.theme-switch[aria-checked="true"] .ts-knob { left: 32px; background: #fff3c4; }
.ts-label { min-width: 1.2em; }

/* スマホ：1段目はロゴとスイッチ、2段目はメニューを5つ並べたタブ（絵の下に文字） */
@media (max-width: 900px) {
  .site-header .wrap { grid-template-columns: 1fr auto; padding-top: 6px; padding-bottom: 6px; }
  .gnav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .gnav a { flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border-radius: 10px; font-size: 11.5px; }
  .gnav .gi { font-size: 20px; }
  .iso, .site-footer { scroll-margin-top: 140px; }
  .brand .name { font-size: 13px; }
  .brand .name small { font-size: 12px; }
}
body.night .theme-switch { color: var(--ink); }
body.night .gnav a { box-shadow: 0 2px 0 rgba(0,0,0,.5); }

/* ---------- ロゴ（assets/img/logo.webp は 1536×1024。まわりの余白を切り取って表示） ---------- */
/* ロゴのある範囲：横 420〜1115、縦 205〜765（695×560） */
.brand-logo, .logo-pic {
  display: inline-block; flex: none; aspect-ratio: 695 / 560;
  background: url("../img/logo.webp") no-repeat; background-size: 221%; background-position: 49.9% 44.2%;
}
/* ヘッダーのロゴ：背景を透明にした logo.png（368×295）。線で囲わない */
.brand-logo { width: 58px; aspect-ratio: 368 / 295; background: url("../img/logo.png") no-repeat center / contain; }
.logo-story { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 2px dashed rgba(255,255,255,.3); }
.logo-pic { width: 150px; border-radius: 10px; background-color: #fbf8f2; border: 3px solid #fff; }
.logo-story h3 { margin: 0 0 6px; font-size: 22px; color: var(--gold); }
.logo-story h3 small { display: block; font-family: "Press Start 2P", monospace; font-size: 11px; color: var(--link); margin-bottom: 4px; }
.logo-story p { margin: 0 0 6px; }
@media (max-width: 640px) {
  .logo-story { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .logo-pic { width: 180px; }
  .brand-logo { width: 48px; }
}
.brand .name, .brand .name small { white-space: nowrap; }
body.night .site-header .brand .name { text-shadow: 2px 2px 0 rgba(255,255,255,.5); }
