:root {
  --ink: #1b1d21;
  --muted: #6a7078;
  --line: #dcdfe4;
  --paper: #ffffff;
  --bg: #f4f4f2;
  --accent: #2f6fd0;
  --gutter: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  padding: 0 var(--gutter) 64px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

.site-header,
main,
.site-footer {
  max-width: 980px;
  margin: 0 auto;
}

.site-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--line);
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 5vw, 32px);
  letter-spacing: 0.02em;
}

.author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  font-size: 14px;
}

.author-label {
  color: var(--muted);
  font-size: 12px;
}

.author-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
}

.author-name {
  font-weight: 600;
}

.author-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--ink);
}

.author-link:hover {
  background: var(--line);
}

/* デモ動画とポスターを横に並べ、作例と同じ幅いっぱいに使う (右端が作例の右端と揃う)。
   高さを揃えるため、列幅の比を 16:9 と A4 (1684:2382) から決める:
   ポスター幅 = 動画幅 × 9/16 × 1684/2382 ≈ 0.398 倍。
   狭い画面では縦に積む */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.398fr);
  gap: 20px;
  margin-top: 20px;
}

.demo h2,
.poster h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.demo-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.demo-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.poster-link {
  aspect-ratio: 1684 / 2382;
  border-radius: 10px;
}

.poster-link img {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 640px) {
  .intro {
    grid-template-columns: 1fr;
  }

  .poster-link {
    max-width: 240px;
    margin: 0 auto;
  }
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.lead strong {
  color: var(--ink);
  font-weight: 600;
}

.status {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

.status.error {
  color: #b23b3b;
}

.entry {
  margin: 28px 0;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.entry:target,
.entry.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 208, 0.15);
}

.entry-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.entry h2 {
  margin: 2px 0 8px;
  font-size: clamp(17px, 3.6vw, 21px);
}

.entry-note {
  margin: 0 0 12px;
  white-space: pre-wrap;
  font-size: 14px;
}

.group {
  margin-top: 16px;
}

.group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

a.shot {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}

a.shot img {
  width: 100%;
  height: auto;
  display: block;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.pair-head {
  margin-bottom: 0;
}

.shot-missing {
  display: grid;
  place-items: center;
  min-height: 120px;
  height: 100%;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 56px 0;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 17, 19, 0.92);
  overflow: auto;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  height: auto;
  margin: auto;
}

.lightbox-close {
  position: fixed;
  top: 8px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

.lightbox-caption {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  max-width: calc(100% - 32px);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

@media (max-width: 480px) {
  .shots {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
