/* 令和一番祭 美術設定集 ── 跟 26niroku.com 作品集同一套樣式
   字型、色票、頁首頁尾照 iam26phi-site 的 src/styles/global.css 與 Header.astro / Base.astro */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #f2efea;
  --muted: rgb(242 239 234 / 0.56);
  --faint: rgb(242 239 234 / 0.32);
  --line: rgb(255 255 255 / 0.14);
  --serif: 'Instrument Serif', 'Noto Serif TC', 'Songti TC', 'Hiragino Mincho ProN', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, 'PingFang TC', 'Hiragino Sans', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang TC', 'Noto Sans TC', 'Hiragino Sans', sans-serif;
  --gutter: clamp(16px, 2.6vw, 36px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* 設定集自己用的：圖版底色、讀書線朱紅（只用在讀書線） */
  --plate: #111113;
  --sky: #a9c7da;
  --accent: #d9482b;
  --maxw: 1200px;
}
:root:lang(ja) {
  --serif: 'Instrument Serif', 'Hiragino Mincho ProN', 'Noto Serif JP', 'Yu Mincho', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, 'Hiragino Sans', 'Noto Sans JP', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans);
  font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100svh; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:lang(ja) { word-break: auto-phrase; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

html[data-lang="zh"] .ja, html[data-lang="ja"] .zh { display: none !important; }

.mono { font-family: var(--mono); font-size: 11px; font-weight: 400; line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.link { color: var(--muted); transition: color 0.25s var(--ease); }
.link:hover, .link[aria-current='page'], .link[aria-pressed='true'] { color: var(--fg); }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- 頁首（同 Header.astro） ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: calc(22px + env(safe-area-inset-top)) var(--gutter) 48px;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0)); pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.wordmark { position: relative; z-index: 2; font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 8px 30px; }
.langs { display: inline-flex; gap: 8px; margin-left: 10px; }
html[data-lang="zh"] [data-set-lang="zh"], html[data-lang="ja"] [data-set-lang="ja"] { color: var(--fg); }
.menu { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .menu { display: block; }
  .menu summary { list-style: none; cursor: pointer; position: relative; z-index: 2; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu .when-open, .menu[open] .when-closed { display: none; }
  .menu[open] .when-open { display: inline; }
  .menu-panel {
    position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: space-between;
    padding: calc(110px + env(safe-area-inset-top)) var(--gutter) calc(32px + env(safe-area-inset-bottom)); background: var(--bg);
  }
  .menu-panel nav { display: flex; flex-direction: column; gap: 18px; }
  .menu-panel nav a { font-size: 24px; line-height: 1.3; letter-spacing: 0.06em; color: var(--muted); }
  .menu-panel nav a[aria-current='page'] { color: var(--fg); }
  .menu-langs { display: flex; gap: 28px; font-size: 13px; }
  .menu-langs .faint { display: none; }
}

/* ---------- 頁尾（同 Base.astro） ---------- */
.site-footer {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
.brand { text-transform: none; }
.footer-links { display: flex; gap: 24px; }

/* ---------- 封面：滿版車窗 ---------- */
.hero { position: relative; background: var(--bg); }
.window {
  position: relative; width: min(100%, calc(100svh * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9;
  overflow: hidden; background: var(--sky); image-rendering: pixelated;
}
.window .layer {
  position: absolute; inset: 0; background-repeat: repeat-x; background-size: auto 100%;
  image-rendering: pixelated; animation: scroll linear infinite; will-change: background-position;
}
.window .far { animation-duration: 90s; }
.window .mid { animation-duration: 36s; }
.window .near { animation-duration: 9s; }
@keyframes scroll { from { background-position-x: 0; } to { background-position-x: calc(-1 * var(--period, 1000px)); } }
.window[data-time="day"] .far  { background-image: url("img/scene/bg_far_day.png"); }
.window[data-time="day"] .mid  { background-image: url("img/scene/bg_mid_day.png"); }
.window[data-time="day"] .near { background-image: url("img/scene/bg_near_day.png"); }
.window[data-time="night"] { background: #141a2c; }
.window[data-time="night"] .far  { background-image: url("img/scene/bg_far_night.png"), url("img/scene/bg_far_lights.png"); }
.window[data-time="night"] .mid  { background-image: url("img/scene/bg_mid_lights.png"), url("img/scene/bg_mid_night.png"); }
.window[data-time="night"] .near { background-image: url("img/scene/bg_near_lights.png"), url("img/scene/bg_near_night.png"); }
.window[data-time="space"] { background: #0b0a1a; }
.window[data-time="space"] .far { background-image: url("img/scene/bg_space_far.webp"); animation-duration: 160s; }
.window[data-time="space"] .mid { background-image: url("img/scene/bg_space_mid.png"); animation-duration: 70s; }
.window[data-time="space"] .near { background-image: none; }
.window .interior { position: absolute; inset: 0; width: 100%; height: 100%; }
.window .riders img { position: absolute; width: 10%; bottom: 6.67%; }
.window .r-niroku { left: 12%; } .window .r-han { left: 19.5%; } .window .r-kara { left: 37%; } .window .r-makoto { left: 47.5%; }
.window .cat { position: absolute; width: 13.33%; top: 40%; left: 50%; animation: catfly 14s linear infinite; }
@keyframes catfly { from { left: 110%; } to { left: -20%; } }
.window::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(to top, rgb(0 0 0 / 0.55), transparent); pointer-events: none; }
.window-ctl { position: absolute; right: var(--gutter); bottom: 18px; display: flex; gap: 20px; z-index: 2; }

/* ---------- 頁首標題（同 .page-title） ---------- */
.artbook { padding: 0 0 120px; }
.artbook > :not(.hero) { max-width: var(--maxw); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.page-head { padding-top: clamp(48px, 9vh, 96px); }
.page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 8vw, 112px); line-height: 1; margin: 14px 0 22px; }
.page-head .page-title { font-size: clamp(34px, 6.6vw, 96px); line-height: 1.15; }
.page-title .phrase { display: inline-block; }
.lede { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.5; margin: 0; }
.lede .muted { font-family: var(--sans); font-size: 14px; }

.toc { margin-top: clamp(48px, 8vh, 88px) !important; border-top: 1px solid var(--line); padding-top: 18px !important; }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 24px; }
.toc a { display: flex; gap: 12px; align-items: baseline; font-size: 15px; }
.toc-no { color: var(--faint); }

/* ---------- 章節 ---------- */
.ch { margin-top: clamp(96px, 16vh, 168px); margin-bottom: 36px; border-top: 1px solid var(--line); padding-top: 22px !important; }
.ch-no { margin: 0; }
.ch-title { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 64px); line-height: 1.1; margin: 14px 0 0; }
h3.sub { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.25; margin: 88px auto 18px; }
h4 { margin: 22px 0 8px; }

.prose { font-size: 16.5px; line-height: 1.95; }
.prose p { margin: 0 0 1.4em; max-width: 46em; }
.prose b { font-weight: 600; }

/* ---------- 序 ---------- */
.cols.intro { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; }
.spec { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: 14px; align-content: start; border-top: 1px solid var(--line); padding-top: 16px; }
.spec dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.spec dd { margin: 0; }

/* ---------- 規則 ---------- */
.rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 40px !important; border-top: 1px solid var(--line); }
.rule { padding: 22px 22px 26px 0; border-bottom: 1px solid var(--line); }
.rule > b { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; margin-bottom: 10px; }
.rule p { margin: 0; font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.chip i { width: 14px; height: 14px; background: var(--c); }

/* ---------- 圖版 ---------- */
.grid { display: grid; gap: 28px; margin-top: 28px !important; margin-bottom: 28px !important; }
.g1 { grid-template-columns: minmax(0, 960px); justify-content: center; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.layers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 28px !important; }
.fig { margin: 0; }
.plate { background: var(--plate); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.plate > img:not(.px) { width: 100%; }
.plate-night, .plate-paper { padding: 24px; }
.plate-sky { background: var(--sky); }
.plate-space { background: #0b0a1a; padding: 28px; }
.plate img.px:not(.sheet) { width: 100%; }
.plate img.px[style] { width: auto; }
.fig figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.65; }
.fno { color: var(--faint); margin-right: 10px; }
img.zoomable { cursor: zoom-in; }
img.sheet { width: 384px; max-width: 100%; }

/* ---------- 角色 ---------- */
.chars { display: grid; gap: 0; margin-top: 28px !important; }
.char {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "play body" "sheets sheets";
  gap: 28px 40px; padding: 40px 0 48px; border-top: 1px solid var(--line);
}
.char-play { grid-area: play; }
.char-body { grid-area: body; }
.char-sheets { grid-area: sheets; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 28px; align-items: start; }
.kicker { margin: 0; }
.char-name { margin: 6px 0 0; font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.15; }
.char-name small { margin-left: 16px; vertical-align: middle; }
.country { margin: 4px 0 14px; font-size: 14px; color: var(--muted); }
.char-body > p { max-width: 40em; }
.keys { margin: 0; padding-left: 1.1em; font-size: 14px; color: var(--muted); }
.keys li::marker { color: var(--faint); }

.player .stage {
  background: var(--plate); display: flex; align-items: flex-end; justify-content: center;
  height: 360px; padding-bottom: 20px; box-shadow: inset 0 -20px 0 #1c1a19;
}
.player .stage img { display: block; max-width: none; }
.player .actions { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.player .actions:has(button:only-child) { display: none; }

.pbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 28px !important; }
.pb-name { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.pb .plate { flex-wrap: wrap; gap: 16px; padding: 20px; }
.pb img.sheet { width: 192px; }

.guests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 28px !important; }
.guest p { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.guest .stage { height: 300px; }
.catfly .player .stage { height: auto; background: none; padding: 0; box-shadow: none; }

/* ---------- 道具 ---------- */
.eras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 28px !important; }
.era { margin: 0; }
.era .plate { padding: 0; }
.era .plate img.px { width: 100%; }
.era figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: baseline; }
.era figcaption > span:not(.era-no):not(.yr) { grid-column: 1 / -1; }
.era-no { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--accent); }
.era b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--fg); }
.yr { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); }
.ads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 28px !important; }
.ad { margin: 0; }
.ad .plate { padding: 16px; }
.ad img.px { width: 100%; }
.ad figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- 聲音 ---------- */
.audios { display: grid; gap: 0; margin-top: 28px !important; border-top: 1px solid var(--line); }
.audio { display: grid; grid-template-columns: 44px 1fr; gap: 20px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.audio.rej .aline { color: var(--muted); }
.play { width: 44px; height: 44px; border: 1px solid var(--faint); border-radius: 50%; display: grid; place-items: center; transition: border-color .25s var(--ease); }
.play:hover, .play.on { border-color: var(--fg); }
.play .tri { width: 0; height: 0; border-left: 11px solid var(--fg); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.play.on .tri { width: 11px; height: 13px; border: 0; margin: 0; background: linear-gradient(to right, var(--fg) 0 4px, transparent 4px 7px, var(--fg) 7px); }
.alabel { margin: 0 0 2px; }
.aline { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.55; }
.anote { margin: 4px 0 0; color: var(--faint); }

/* ---------- 製作過程 ---------- */
.timeline { list-style: none; padding: 0; margin-top: 32px !important; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); padding-top: 4px; }
.timeline p { margin: 0; font-size: 15px; }
.pipeline { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 28px !important; }
.arrow { font-family: var(--serif); font-size: 36px; color: var(--muted); }

.rejects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin-top: 28px !important; }
.reject { position: relative; padding: 40px 0 32px; border-top: 1px solid var(--line); }
.reject.wide { grid-column: 1 / -1; }
.stamp { position: absolute; top: 14px; left: 0; color: var(--muted); }
.pair { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.pair .to { font-family: var(--serif); font-size: 28px; color: var(--muted); }
.pair-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 20px; }
.pair-row .pair img.px:not([style]) { width: 42%; }

/* ---------- 版權 ---------- */
.credits { margin-top: clamp(96px, 16vh, 168px) !important; border-top: 1px solid var(--line); padding-top: 22px !important; }
.credits dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 18px 0 0; font-size: 14px; max-width: 760px; }
.credits dt { padding-top: 3px; }
.credits dd { margin: 0; }
.credits .note { font-size: 13px; margin-top: 22px; }

/* ---------- 放大 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; }
.lightbox img.px { image-rendering: pixelated; background: var(--plate); }
.lb-cap { color: var(--muted); font-size: 13px; margin: 14px 0 0; text-align: center; max-width: 760px; }
.lb-close { position: absolute; top: 18px; right: var(--gutter); font-size: 28px; color: var(--muted); }

/* ---------- 窄螢幕 ---------- */
@media (max-width: 900px) {
  .cols.intro { grid-template-columns: 1fr; gap: 32px; }
  .g3, .eras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .char { grid-template-columns: 1fr; grid-template-areas: "body" "play" "sheets"; }
  .char-sheets { grid-template-columns: 1fr; }
  .ads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rejects { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .g2, .g3, .eras, .pbs, .guests, .layers, .rules { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc ol { grid-template-columns: 1fr; }
  .char-name { font-size: 40px; }
  .player .stage { height: 300px; }
  .player .stage img { width: 160px !important; }
  .pipeline { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); justify-self: center; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .window-ctl { position: static; justify-content: flex-end; padding: 12px var(--gutter) 0; }
  .site-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .window .layer, .window .cat { animation: none; }
  html { scroll-behavior: auto; }
}
