@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap");

* {
  box-sizing: border-box;
}

:root {
  --hero-progress: 0;
}

body {
  font-family: "IBM Plex Mono", "Helvetica", monospace;
  font-weight: 400;
  margin: 0;
  padding: 0;
  background: #fff; /* 他ページではデフォの白 */
}

.home {
  height: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background: #000;
  min-height: 100vh;
}

#main-visual {
  position: fixed;
  inset: 0;
  z-index: 3;
  text-align: center;
  padding: 50px;
  color: #fff;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  pointer-events: auto; /* ヒーローが生きている間はクリックを受ける */
  background: #000; /* 本体は黒。画像は疑似要素で管理 */
}

#main-visual::before,
#main-visual::after {
  content: "";
  position: absolute;
  inset: -3%; /* はみ出し防止に少し余白を広げる */
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("../assets/background-2.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform, clip-path, opacity;
  transition: transform 0.9s cubic-bezier(0.25, 0.9, 0.3, 1),
    opacity 0.9s cubic-bezier(0.25, 0.9, 0.3, 1),
    clip-path 0.9s cubic-bezier(0.25, 0.9, 0.3, 1);
}

#main-visual::before {
  clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
  transform: translateY(calc(-1 * var(--hero-progress, 0) * 120%)) scale(1.05);
  opacity: calc(0.9 - var(--hero-progress, 0) * 0.6);
}

#main-visual::after {
  clip-path: polygon(0% 50%, 100% 50%, 100% 100%, 0% 100%);
  transform: translateY(calc(var(--hero-progress, 0) * 120%)) scale(1.05);
  opacity: calc(0.9 - var(--hero-progress, 0) * 0.6);
}

#main-visual.hero-finished {
  display: none;
}

.title-container {
  position: relative;
  z-index: 2;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(calc(var(--hero-progress, 0) * -30px));
  opacity: clamp(
    0,
    calc(1 - var(--hero-progress, 0) * 1.5),
    1
  ); /* 早めにフェードアウト */
  transition: opacity 0.6s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

#main-visual.hero-finished .title-container {
  opacity: 0;
  display: none;
}

.book-title {
  font-family: "IBM Plex Mono", "Helvetica", monospace;
  font-size: 40px;
  color: white;
  font-weight: 400; /* 少し細め */
  white-space: nowrap; /* 文字を1行に保持 */
}

.author {
  font-size: 16px;
}

#sketch-links {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  min-height: auto;
  opacity: clamp(0.55, calc(0.55 + var(--hero-progress, 0) * 0.7), 1);
  transform: translateY(calc(16px * (1 - var(--hero-progress, 0))));
  transition: opacity 0.8s cubic-bezier(0.25, 0.9, 0.3, 1),
    transform 0.8s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.sketch-intro {
  background: #282828;
  border-radius: 5px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}

#sketch-links .sketch-header {
  font-family: "IBM Plex Mono", "Helvetica", monospace;
  font-size: 20px;
  font-weight: 700;
  color: #e0e0e0;
  margin: 0;
}

.sketch-logo {
  display: block;
  width: 120px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.sketch-item {
  background-color: #282828;
  text-align: center;
  color: #e0e0e0;
  text-decoration-line: none;
  padding: 24px 20px 28px; /* 下側に余白を多めに */
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: color 0.2s ease;
}

.sketch-date {
  font-size: 14px;
  color: #aaa;
  letter-spacing: 0.02em;
}

.sketch-title {
  font-size: 16px;
  font-weight: 500; /* 少し細めに */
  text-align: center;
  word-break: break-word;
}

.sketch-item:hover {
  color: #276ef1;
}

/* カーソルが点滅するアニメーション */
#cursor {
  display: inline-block;
  vertical-align: text-bottom;
  background-color: white;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
/* カーソルが点滅するアニメーション end */
