/*
 * よふかしマップ — AFTER MIDNIGHT INDEX
 *
 * 方針: 誌面のような編集レイアウト。カードで囲わず、罫線と余白で構造を作る。
 *       夜の暗さは出すが、ネオン・サイバー方向には振らない。
 *
 * アクセント(#E9A63A)は「営業中の件数・現在地・選択中・細い線」だけに使う。
 * 使う場所を絞るほど、使ったときに意味が伝わる。
 *
 * 営業状態は色だけでなく必ず文字（営業中／いまは閉店）でも示す。
 * 色覚特性やモノクロ表示でも情報が落ちないようにするため。
 *
 * Webフォントは読み込まない。日本語フォントは数MBあり、深夜に電波の悪い場所で
 * 開かれることを考えると割に合わない。OS標準のゴシック体を使う。
 */

:root {
  --bg: #111111;
  --bg-2: #181818;
  --fg: #e7e7e3;          /* 温度感のあるオフホワイト */
  --fg-2: #94949a;        /* 6.1:1 */
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.32);
  --accent: #e9a63a;      /* 8.9:1 */
  --open: #51d890;        /* 10.4:1 */

  --wrap: 1280px;
  --pad: 24px;

  --label: 11px;
  --track: 0.16em;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Inter, Helvetica, Arial,
               "Hiragino Kaku Gothic ProN", "Hiragino Sans",
               "BIZ UDPGothic", "Yu Gothic Medium", "Yu Gothic",
               "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-width: 0;
}
.wrap.narrow { max-width: 760px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px; top: 12px; z-index: 200;
  background: var(--fg); color: var(--bg); padding: 10px 16px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 英字の小ラベル。装飾ではなく分類の目印として使う */
.kicker, .sec-en, .menu-heading, .hs-unit,
.stat dt, .pref-en, .ag-en, .foot-en {
  font-size: var(--label);
  letter-spacing: var(--track);
  line-height: 1.4;
}

/* 営業中を示す点。色だけに頼らないよう、必ず数字と語（OPEN）を添える */
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--open);
  margin-right: 8px;
  vertical-align: 0.12em;
  animation: pulse 2.8s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------------- ヘッダー ---------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  /* ヘッダーは案内板であって主役ではない。低く抑えて本文に画面を渡す */
  min-height: 48px;
}

/* 和文と英字を1行に並べる。2段に積むとヘッダーが倍の高さになる */
.brand { display: inline-flex; align-items: baseline; gap: 10px; line-height: 1.2; }
.brand-ja { font-size: 15px; letter-spacing: 0.04em; }
.brand-en {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--fg-2);
  white-space: nowrap;
}

.head-nav { display: flex; gap: 26px; justify-self: end; }
.head-nav a {
  font-size: var(--label);
  letter-spacing: var(--track);
  color: var(--fg-2);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s var(--ease);
}
.head-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.head-nav a:hover { color: var(--fg); }
.head-nav a:hover::after { transform: scaleX(1); }

.head-status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hs-open { display: inline-flex; align-items: center; }
.hs-open b { color: var(--open); font-weight: 400; font-size: 15px; }
.hs-unit { margin-left: 7px; color: var(--fg-2); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: var(--label);
  letter-spacing: var(--track);
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
}
.menu-bar {
  width: 20px; height: 7px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transition: transform 0.25s var(--ease);
}
.js-menu-toggle[aria-expanded="true"] .menu-bar { transform: rotate(90deg); }

.site-menu { display: none; border-top: 1px solid var(--line); padding: 22px 0 30px; }
.menu-heading { margin: 0 0 12px; color: var(--fg-2); }
.menu-list { margin: 0 0 26px; }
.menu-list a {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  min-height: 44px;
}

/* ---------------- ヒーロー ---------------- */

.hero {
  border-bottom: 1px solid var(--line);
  padding: clamp(36px, 5vw, 64px) 0 clamp(32px, 4vw, 52px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 60%) minmax(0, 40%);
  align-items: center;
  gap: 40px;
}

.kicker { margin: 0 0 14px; color: var(--accent); }

.hero-title {
  margin: 0 0 clamp(24px, 3vw, 36px);
  font-size: clamp(22px, 2.9vw, 34px);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
  /* 読み込み時にわずかに下から立ち上げる */
  animation: rise 0.7s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* NOW / OPEN NOW / LISTED */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 18px 34px 18px 0;
  margin-right: 34px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat dt { margin: 0 0 6px; color: var(--fg-2); }
.stat dd {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
}
.stat-open dd { color: var(--open); }

.hero-note { margin: 0 0 22px; font-size: 12px; color: var(--fg-2); }

.hero-go {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  min-height: 44px;
  font-size: 15px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s var(--ease);
}
.hero-go .arrow { transition: transform 0.3s var(--ease); color: var(--accent); }
.hero-go:hover { color: var(--accent); }
.hero-go:hover .arrow { transform: translateX(7px); }

/* 装飾の線。深夜の移動の軌跡を思わせる控えめな描画 */
.hero-art { justify-self: end; width: 100%; max-width: 300px; }
.hero-art svg { width: 100%; height: auto; display: block; }
.trace {
  stroke: var(--line-strong);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 18s var(--ease) forwards;
}
.trace-2 { stroke: var(--line); animation-duration: 22s; animation-delay: 1.4s; }
.trace-3 { stroke: var(--line); animation-duration: 26s; animation-delay: 2.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.node { fill: var(--accent); opacity: 0; animation: appear 1.2s var(--ease) 7s forwards; }
.node-2 { animation-delay: 9.5s; }
@keyframes appear { to { opacity: 1; } }

/* ---------------- セクション共通 ---------------- */

.sec { padding: clamp(56px, 8vw, 104px) 0; border-bottom: 1px solid var(--line); }
.sec:last-of-type { border-bottom: 0; }

.sec-title {
  margin: 0 0 clamp(28px, 3.5vw, 48px);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
  display: grid;
  gap: 12px;
}
.sec-en { color: var(--accent); font-weight: 400; }
.sec-lead { margin: -24px 0 30px; font-size: 14px; color: var(--fg-2); max-width: 42em; }

/* スクロールで各節をわずかに立ち上げる */
.reveal-ready { opacity: 0; transform: translateY(14px); }
.reveal-ready.is-visible {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

/* ---------------- 都道府県 ---------------- */

.prefs { border-top: 1px solid var(--line); }
.pref a {
  display: grid;
  grid-template-columns: 3.4em 1fr auto;
  align-items: baseline;
  gap: 8px 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease), padding 0.25s var(--ease);
}
.pref a:hover, .pref a:focus-visible { background: var(--bg-2); padding-left: 14px; }
.pref-num { color: var(--fg-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.pref-en { color: var(--fg-2); }
.pref-ja { font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.01em; grid-column: 2; }
.pref a:hover .pref-ja { color: var(--accent); }
.pref-count {
  grid-row: 1 / span 2;
  grid-column: 3;
  align-self: center;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.pref-count .unit { font-size: 11px; color: var(--fg-2); margin-left: 4px; }

/* ---------------- 駅インデックス ---------------- */

.area-group { border-top: 1px solid var(--line); }
.area-group:last-of-type { border-bottom: 1px solid var(--line); }
.area-group summary {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}
.area-group summary::-webkit-details-marker { display: none; }
.ag-en { color: var(--accent); }
.ag-ja { font-size: 17px; }
.ag-count { margin-left: auto; font-size: 12px; color: var(--fg-2); }

.stations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 44px;
  padding-bottom: 18px;
}
.stations a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
  transition: color 0.2s var(--ease);
}
.st-name {
  font-size: 17px;
  transition: transform 0.25s var(--ease);
  transform-origin: left;
}
.stations a:hover .st-name,
.stations a:focus-visible .st-name { transform: translateX(8px); }
.st-count {
  margin-left: auto;
  font-size: 14px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.stations a:hover .st-count { color: var(--accent); }
.st-arrow { color: var(--fg-2); opacity: 0; transition: opacity 0.2s var(--ease); }
.stations a:hover .st-arrow, .stations a:focus-visible .st-arrow { opacity: 1; color: var(--accent); }

/* ---------------- 目的から探す ---------------- */

.cats { border-top: 1px solid var(--line); }
.cat {
  display: grid;
  grid-template-columns: minmax(0, 15em) 1fr auto;
  align-items: baseline;
  gap: 6px 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease), padding 0.25s var(--ease);
}
.cat:hover, .cat:focus-visible { background: var(--bg-2); padding-left: 14px; }
.cat-name { font-size: 18px; }
.cat:hover .cat-name { color: var(--accent); }
.cat-lead { font-size: 13px; color: var(--fg-2); }
.cat-count { font-size: 16px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ---------------- 店舗の行 ---------------- */

.rows { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 8.5em 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.row-status { font-size: var(--label); letter-spacing: 0.06em; white-space: nowrap; }
.status.is-open { color: var(--open); }
.status.is-soon { color: var(--accent); }
.status.is-closed { color: var(--fg-2); }

.row-main { min-width: 0; }
.row-name { margin: 0; font-size: 17px; font-weight: 400; line-height: 1.5; }
.row-name a { transition: color 0.2s var(--ease); }
.row-name a:hover { color: var(--accent); }
.row-meta {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--fg-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.row-hours {
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.row[data-open="0"] .row-name,
.row[data-open="0"] .row-hours { color: var(--fg-2); }
.row-tags {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 6px 0 0;
  font-size: var(--label); letter-spacing: 0.04em; color: var(--fg-2);
}

.empty { padding: 44px 0; color: var(--fg-2); font-size: 14px; border-bottom: 1px solid var(--line); }

/* ---------------- ABOUT ---------------- */

.sec-about { border-bottom: 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 22%) minmax(0, 1fr); gap: 40px; }
.about-body { max-width: 44em; }
.about-lead { margin: 0 0 26px; font-size: clamp(19px, 2.2vw, 25px); line-height: 1.6; }
.about-body p { color: var(--fg-2); font-size: 15px; }
.about-links { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 32px; }
.about-links a {
  font-size: 14px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  transition: color 0.2s var(--ease);
}
.about-links a:hover { color: var(--accent); }

/* ---------------- 下層ページ ---------------- */

.page-head { padding: clamp(40px, 5vw, 72px) 0 clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.page-head h1 {
  margin: 0 0 18px;
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-head .lead { margin: 0 0 14px; color: var(--fg-2); font-size: 15px; max-width: 42em; }
.page-head .count { margin: 0; font-size: var(--label); letter-spacing: var(--track); color: var(--accent); }

.crumbs {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 22px 0 0;
  font-size: var(--label); letter-spacing: 0.08em; color: var(--fg-2);
}
.crumbs a { transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--fg); }
.crumbs a::after { content: " /"; color: var(--line-strong); padding-left: 10px; }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; margin: 26px 0 0; padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; min-height: 44px; }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin: 0;
  border: 1px solid var(--fg-2); background: transparent;
  flex: none; cursor: pointer; position: relative;
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid var(--bg); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.filter-note { margin: 0; font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
body.open-only .row[data-open="0"] { display: none; }

.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.link {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; min-height: 44px;
  transition: color 0.2s var(--ease);
}
.link:hover { color: var(--accent); }
.link b { font-weight: 400; font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

.store { padding: 40px 0 0; }
.store-head { padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.store-head .status { font-size: var(--label); letter-spacing: 0.06em; }
.store-head h1 {
  margin: 16px 0 12px;
  font-size: clamp(24px, 4.2vw, 40px);
  font-weight: 700; line-height: 1.25; letter-spacing: -0.02em;
}
.store-sub { margin: 0; color: var(--fg-2); font-size: 13px; }
.store-sec { padding: 32px 0; border-bottom: 1px solid var(--line); }
.store-sec h2 { margin: 0 0 18px; font-size: var(--label); letter-spacing: var(--track); font-weight: 400; color: var(--accent); }

.hours-table, .spec { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.hours-table th, .spec th {
  text-align: left; padding: 10px 20px 10px 0;
  color: var(--fg-2); font-weight: 400; white-space: nowrap; vertical-align: top; width: 7em;
}
.hours-table td, .spec td { padding: 10px 0; word-break: break-word; }
.spec a { text-decoration: underline; text-underline-offset: 3px; }

.note { margin: 16px 0 0; font-size: 12px; line-height: 1.8; color: var(--fg-2); max-width: 44em; }
.source p { font-size: 12px; color: var(--fg-2); margin: 0 0 8px; }
.source a { text-decoration: underline; text-underline-offset: 3px; }
.also { padding: 48px 0; }
.also > h2 { margin: 0 0 20px; font-size: var(--label); letter-spacing: var(--track); font-weight: 400; color: var(--accent); }

.doc { padding: 34px 0 64px; }
.doc h1 { margin: 0 0 40px; font-size: clamp(26px, 4.4vw, 44px); font-weight: 700; letter-spacing: -0.02em; }
.doc h2 { margin: 48px 0 14px; font-size: var(--label); letter-spacing: var(--track); font-weight: 400; color: var(--accent); }
.doc p, .doc li { color: var(--fg-2); font-size: 15px; max-width: 40em; }
.doc b { color: var(--fg); font-weight: 400; }
.doc ul { padding-left: 1.1em; list-style: disc; }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.pref-title { margin: 30px 0 12px; font-size: 13px; font-weight: 400; color: var(--fg-2); }

/* ---------------- フッター ---------------- */

.site-foot { padding: clamp(48px, 6vw, 80px) 0 56px; border-top: 1px solid var(--line); }
.foot-inner {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 32px 40px; align-items: start;
  padding-bottom: 36px; border-bottom: 1px solid var(--line);
}
.foot-brand { margin: 0 0 5px; font-size: 16px; }
.foot-en { margin: 0; color: var(--fg-2); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: flex-end; }
.foot-nav a { font-size: 14px; color: var(--fg-2); padding: 6px 0; transition: color 0.2s var(--ease); }
.foot-nav a:hover { color: var(--fg); }

.foot-fine { padding-top: 26px; font-size: 12px; color: var(--fg-2); }
.foot-fine p { margin: 0 0 10px; line-height: 1.8; max-width: 52em; }
.foot-fine a { text-decoration: underline; text-underline-offset: 3px; }
.foot-copy { letter-spacing: var(--track); }

/* ---------------- 1024px以下 ---------------- */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-art { justify-self: start; max-width: 340px; opacity: 0.75; }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cat { grid-template-columns: minmax(0, 1fr) auto; }
  .cat-lead { grid-column: 1 / -1; }
}

/* ---------------- 768px以下（スマートフォン） ---------------- */

@media (max-width: 767px) {
  :root { --pad: 20px; }

  /* ヘッダーはロゴ・営業中件数・メニューだけにする */
  .head-inner { grid-template-columns: 1fr auto auto; gap: 14px; min-height: 46px; }
  .head-nav { display: none; }
  .hs-time { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-menu { display: block; }
  .site-menu[hidden] { display: none; }

  .hero { padding: 28px 0 32px; }
  .hero-title { font-size: clamp(20px, 5.4vw, 26px); line-height: 1.4; }
  /* 装飾より情報を先に読ませる */
  .hero-art { display: none; }

  .stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 14px 12px 14px 0; margin-right: 12px; }
  .stat dd { font-size: 19px; }

  .prefs .pref a { grid-template-columns: 2.6em 1fr auto; gap: 4px 14px; padding: 18px 0; }
  .pref-ja { font-size: 20px; }
  .pref-count { font-size: 17px; }

  .stations { grid-template-columns: 1fr; gap: 0; }

  .cat { grid-template-columns: 1fr auto; gap: 4px 14px; padding: 18px 0; }

  /* 行は2段に。状態と営業時間を上、店名を下に置くと
     縦に舐めたときに「開いているか」が先に目に入る */
  .row { grid-template-columns: 1fr auto; gap: 4px 14px; padding: 18px 0; }
  .row-status { grid-column: 1; }
  .row-hours { grid-column: 2; grid-row: 1; font-size: 13px; }
  .row-main { grid-column: 1 / -1; }

  .foot-inner { grid-template-columns: 1fr; }
  .foot-nav { justify-content: flex-start; }
  .filterbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------------- 動きを減らす設定 ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* 線は動かさず、描き終わった状態で見せる */
  .trace { stroke-dashoffset: 0; }
  .node { opacity: 1; }
  .reveal-ready { opacity: 1; transform: none; }
}

/* ---------------- 背景の夜空 ---------------- */
/*
 * 星は装飾であって主役ではない。深夜に文字を読むサイトなので、
 * 可読性を落とさないことを最優先にしている。
 *
 *  - 画面の上ほど濃く、下へ向けて消える（一覧の文字と重なる帯を空ける）
 *  - position:fixed で背後に固定。スクロールしても星が流れず、目が疲れない
 *  - またたきは34個だけ。240個すべてを動かすと低スペック機で描画が詰まる
 *  - 動かすのは opacity と transform のみ（レイアウトを起こさない）
 */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* 上を空、下を地上に見立てて減衰させる */
  -webkit-mask-image: linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0) 88%);
  mask-image: linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0) 88%);
}

/* 写真の夜空にある、ごくわずかな青みを足す。文字のコントラストは変えない濃さ */
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 70% -10%, rgba(58, 78, 130, 0.22), transparent 60%),
    radial-gradient(90% 60% at 10% 0%, rgba(38, 52, 92, 0.18), transparent 65%);
}

/* 動かない星は外部SVG（1回読めば全ページで使い回される）。
   またたく星だけが要素として存在する。両者を同じ速さで流して一体に見せる。 */
.sky-field, .sky-tw {
  position: absolute;
  inset: -4%;              /* ゆっくり動かしても端が見えないよう少し広く取る */
  width: 108%;
  height: 108%;
  /* 地球の自転のような、気づくかどうかの速さで流す */
  animation: drift 210s linear infinite alternate;
}
.sky-field {
  /* background-image は base.html 側で指定している（キャッシュ用のバージョン付与のため） */
  background-size: cover;
  background-position: center;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1.6%, 1.1%, 0); }
}

/* またたき。8種類の周期をずらして、同時に瞬かないようにする */
.tw { animation: twinkle 5.5s ease-in-out infinite; }
.tw-0 { animation-delay: 0s;    animation-duration: 4.2s; }
.tw-1 { animation-delay: 0.8s;  animation-duration: 6.1s; }
.tw-2 { animation-delay: 1.7s;  animation-duration: 5.0s; }
.tw-3 { animation-delay: 2.4s;  animation-duration: 7.3s; }
.tw-4 { animation-delay: 3.1s;  animation-duration: 4.8s; }
.tw-5 { animation-delay: 3.9s;  animation-duration: 6.6s; }
.tw-6 { animation-delay: 4.6s;  animation-duration: 5.7s; }
.tw-7 { animation-delay: 5.2s;  animation-duration: 8.0s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.22; }
  50%      { opacity: 0.9; }
}

/* 流れ星。写真にも1本だけ写っている程度の頻度に留める（20秒に1回前後） */
.meteor {
  position: absolute;
  top: -6%;
  width: 1px;
  height: 88px;
  background: linear-gradient(to bottom, rgba(223, 231, 255, 0), rgba(223, 231, 255, 0.75));
  opacity: 0;
  transform: rotate(28deg);
  animation: shoot 19s linear infinite;
}
.meteor-1 { left: 72%; }
.meteor-2 { left: 34%; animation-duration: 27s; animation-delay: 11s; }
@keyframes shoot {
  /* 動いているのは全体の3%ほどの時間だけ。あとは消えて待機している */
  0%, 96%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(28deg); }
  96.6%     { opacity: 0.85; }
  100%      { opacity: 0; transform: translate3d(-190px, 380px, 0) rotate(28deg); }
}

/* 狭い画面では最も暗い粒を描かない（描画量を4割ほど減らす） */
@media (max-width: 767px) {
  .sky-field { opacity: 0.72; }
  .meteor-2 { display: none; }
}

/* 動きを減らす設定では、星は出すが動かさない */
@media (prefers-reduced-motion: reduce) {
  .sky-field, .sky-tw { animation: none; }
  .tw { animation: none; opacity: 0.6; }
  .meteor { display: none; }
}

/* 誤りを報告する導線。目立たせすぎず、しかし必ず見つかる位置に置く */
.store-sec.report p { font-size: 13px; color: var(--fg-2); margin: 0 0 10px; max-width: 44em; }
.store-sec.report a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
