:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #666666;
  --accent: #0a5f38;
  --border: #e2e2e2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #eaeaea;
    --bg: #121212;
    --muted: #a0a0a0;
    --accent: #4fd18b;
    --border: #2c2c2c;
  }
}

body {
  font-family: "Hiragino Sans", "Yu Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  line-height: 1.75;
  overflow-x: hidden;
}

.hero {
  position: relative;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  height: clamp(240px, 42vw, 520px);
  overflow: hidden;
  margin-top: -2rem;
  margin-bottom: 2rem;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keep the circled "FURUHASHI" face (near the top of the photo) in frame. */
  object-position: center 12%;
  display: block;
  filter: saturate(1.05);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, var(--bg) 100%);
  pointer-events: none;
}

header {
  padding-top: 0.5rem;
}

header p {
  color: var(--muted);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-top h1 {
  margin: 0;
}

.github-icon-link {
  flex-shrink: 0;
  color: var(--fg);
  display: inline-flex;
}

.github-icon-link:hover {
  color: var(--accent);
}

.license-line {
  font-size: 0.8rem;
}

/* 棒人間が、点線の道を順番に横断していくギミック。
   1人が渡りきって消える → 3人の集団が渡りきって消える →
   7人の集団が渡りきって消える → 最初に戻る、の3幕構成。
   各幕は重ならず、前の幕が画面外に消えてから次の幕が現れる。 */
.walk-track {
  position: relative;
  height: 36px;
  margin: 0.5rem 0 0.25rem;
  overflow: hidden;
}

.walk-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  border-bottom: 1px dashed var(--border);
}

.lap {
  position: absolute;
  top: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  color: var(--accent);
}

/* 全体を36秒周期とし、0-33%を1人、33-66%を3人、66-100%を7人の幕にする
   (通常速度の半分でゆっくり歩かせている)。
   自分の幕以外は画面外(トラック分の負のleft)に留めておく。 */
.lap-1 {
  animation: lap1-cross 36s linear infinite;
}

.lap-2 {
  animation: lap2-cross 36s linear infinite;
}

.lap-3 {
  animation: lap3-cross 36s linear infinite;
}

.walker-bob {
  animation: walker-bob 0.8s ease-in-out infinite alternate;
}

/* 2コマ足踏みアニメーション: 左右の脚を steps(1) で瞬時に切り替える。
   横断速度を半分にしたのに合わせて歩調も半分に。 */
.step-frame {
  animation: step-flip 0.8s steps(1) infinite;
}

.step-frame-b {
  animation-delay: -0.4s;
}

@keyframes lap1-cross {
  0% {
    left: -24px;
  }
  33.33% {
    left: 100%;
  }
  33.34%,
  100% {
    left: -24px;
  }
}

@keyframes lap2-cross {
  0%,
  33.33% {
    left: -70px;
  }
  66.66% {
    left: 100%;
  }
  66.67%,
  100% {
    left: -70px;
  }
}

@keyframes lap3-cross {
  0%,
  66.66% {
    left: -162px;
  }
  100% {
    left: 100%;
  }
}

@keyframes walker-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2.5px);
  }
}

@keyframes step-flip {
  0%,
  49.9% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lap-1,
  .lap-2,
  .lap-3,
  .walker-bob,
  .step-frame {
    animation: none;
  }

  .step-frame-b {
    opacity: 0;
  }

  .lap-2,
  .lap-3 {
    display: none;
  }
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  vertical-align: middle;
  margin-left: 0.5rem;
}

.version-badge a {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  text-decoration: none;
}

.version-badge a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

a {
  color: var(--accent);
}

#post-list {
  list-style: none;
  padding: 0;
}

#post-list li {
  padding: 0.9rem 0.75rem;
  margin: 0 -0.75rem;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

#post-list li:hover {
  background-color: color-mix(in srgb, var(--accent) 7%, transparent);
}

#post-list a {
  font-weight: 600;
  text-decoration: none;
}

#post-list a:hover {
  text-decoration: underline;
}

.meta {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

#post-title {
  font-size: clamp(1.6rem, 4.5vw, 2.35rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.6rem;
}

#post-meta {
  margin-bottom: 2rem;
}

.meta a {
  font-weight: 400;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.meta a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

article img {
  max-width: 100%;
  height: auto;
}

.source-link {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2rem;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-row a {
  font-size: 0.9rem;
}
