/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #0a0a0a;
  color: #fff;
  font-family: Georgia, "Times New Roman", Times, serif;
}

/* ===== Section 1: Hero ===== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: #0a0a0a;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.top-links {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px 16px 0;
  pointer-events: none; /* ボタン以外の余白ではコインのドラッグを邪魔しない */
}

/* 上部リンク: 各サービスのアイコン付きの丸いボタン */
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 6px;
  border: 2px solid #12335a;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #12335a;
  font-family: "Fredoka", "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 0 #12335a, 0 8px 14px rgba(10, 40, 80, 0.25);
  pointer-events: auto;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.top-link img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
}

.top-link:hover,
.top-link:focus-visible {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #12335a, 0 12px 18px rgba(10, 40, 80, 0.3);
  outline: none;
}

.top-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #12335a, 0 3px 6px rgba(10, 40, 80, 0.25);
}

.hero-text {
  position: absolute;
  top: 9vh;
  left: 0;
  right: 0;
  padding: 0 20px;
  text-align: center;
  font-family: "Fredoka", "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", sans-serif;
  pointer-events: none; /* コインのドラッグを邪魔しない */
}

/* タイトル: 丸い字体の白文字に紺の縁取り */
.hero-text h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5.8vw, 4.5rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-indent: 0.1em; /* 末尾のletter-spacing分を補正して中央に見せる */
  line-height: 1.25;
  color: #fff;
  text-shadow:
    2px 0 0 #12335a, -2px 0 0 #12335a, 0 2px 0 #12335a, 0 -2px 0 #12335a,
    2px 2px 0 #12335a, -2px 2px 0 #12335a, 2px -2px 0 #12335a, -2px -2px 0 #12335a,
    0 0.08em 0 #12335a, 0 0.12em 0.2em rgba(10, 40, 80, 0.45);
}

/* $MICKEY: 1文字ずつ白い丸で囲み、丸どうしを少し重ねて連結する。丸は1つずつずれたタイミングで揺れる */
.ticker {
  display: flex;
  justify-content: center;
  margin: 0.3em 0 0.32em;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  /* 親にかけると、重なった丸全体がひとつの形として縁取られる */
  filter: drop-shadow(0 0.05em 0 #9cc4e4) drop-shadow(0 0.1em 0.1em rgba(10, 50, 100, 0.35));
}

.puff {
  display: grid;
  place-items: center;
  width: 1.3em;
  height: 1.3em;
  margin: 0 -0.1em;
  border-radius: 50%;
  /* 左上から光が当たった玉に見えるよう、右下の縁へ向かって薄い青の陰を付ける(js/jelly.jsの絵と同じ値) */
  background: radial-gradient(circle 0.84em at 38% 30%, #fff 50%, #e3eef8 78%, #b9d0e6 100%);
  animation: puff-float 2.6s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.55s);
}

@keyframes puff-float {
  from { transform: translateY(0.07em) rotate(-5deg); }
  to   { transform: translateY(-0.07em) rotate(5deg); }
}

.ticker-text {
  display: inline-block;
  font-size: 1em;
  color: #f2c230;
  /* 上の層: 斜めに横切る光沢 / 下の層: 金のグラデーション */
  background:
    linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.95) 50%, transparent 58%) 150% 0 / 250% 100% no-repeat,
    linear-gradient(180deg, #fff3b8 0%, #ffe066 22%, #f7c52d 55%, #d98a0a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* 順に: 文字の側面(厚み) → 焦げ茶の縁取り → 底の縁 → 丸の上に落ちる影 */
  filter:
    drop-shadow(0 0.06em 0 #b8740a)
    drop-shadow(0 0 1px #3a2500) drop-shadow(0 0 1px #3a2500) drop-shadow(0 0 1px #3a2500)
    drop-shadow(0 0.04em 0 #3a2500)
    drop-shadow(0 0.07em 0.06em rgba(30, 70, 120, 0.35));
  animation: ticker-shine 4.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.12s);
}

@keyframes ticker-shine {
  0%, 55% { background-position: 150% 0, 0 0; }
  100%    { background-position: -50% 0, 0 0; }
}

/* ゼリー表示(js/jelly.js): Three.jsのCanvasを$MICKEYに重ね、元の丸は場所だけ残して隠す */
.ticker {
  position: relative;
}

.jelly-canvas {
  position: absolute;
  display: block;
  pointer-events: none; /* 操作はjelly.jsが.hero側で受ける */
}

.ticker.is-jelly .puff {
  visibility: hidden;
}

.ticker.is-jelly .puff,
.ticker.is-jelly .ticker-text {
  animation: none;
}

.tagline {
  margin: 0.9em 0 0;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  font-style: italic;
  letter-spacing: 0.06em;
  color: #14293d;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: #c8a97e;
  text-decoration: none;
  animation: scroll-bob 1.8s ease-in-out infinite;
}

@keyframes scroll-bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.55; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ===== Section 2: About ===== */
.about {
  background: #f0ebe0;
  color: #2a2218;
  padding: 28px 24px 72px;
}

.hint {
  margin: 0 0 36px;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #8a7a62;
}

.about-wrap {
  max-width: 1040px;
  margin: 0 auto;
}

#about-canvas {
  display: block;
  width: 100%;
}

/* ===== Section 3: Links ===== */
.links {
  background: #0a0a0a;
  padding: 96px 24px 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.links h2 {
  margin: 0 0 44px;
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: #fff;
}

.link-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.link-button {
  padding: 13px 24px;
  border: 1px solid #fff;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.link-button:hover,
.link-button:focus-visible {
  background: #fff;
  color: #0a0a0a;
  outline: none;
}

/* ボタン内のアイコン: 文字と同じ色で描くので、ホバーで反転しても見える */
.link-icon {
  width: 1em;
  height: 1em;
  margin-right: 0.55em;
  vertical-align: -0.12em;
  fill: currentColor;
}

/* 画像アイコン: 大きく見せつつ、上下の負マージンでボタンの高さは変えない */
.link-icon.is-image {
  width: 2em;
  height: 2em;
  margin: -0.5em 0.5em -0.5em 0;
  vertical-align: middle;
}

/* 中身が未定の枠:幅だけ確保し、ホバーにも反応させない */
.link-button.is-empty {
  min-width: 150px;
  pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .top-links {
    gap: 6px;
    padding: 12px 10px 0;
  }

  .top-link {
    gap: 6px;
    padding: 3px 11px 3px 4px;
    font-size: 0.8rem;
  }

  .top-link img {
    width: 22px;
    height: 22px;
  }

  /* 上部リンクが2段に折り返してもタイトルと重ならないようにする */
  .hero-text {
    top: max(9vh, 110px);
  }

  .about {
    padding: 22px 16px 56px;
  }

  .hint {
    margin-bottom: 26px;
    font-size: 0.68rem;
  }

  .links {
    padding: 72px 16px 88px;
  }

  .link-button {
    padding: 12px 18px;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-cue,
  .puff,
  .ticker-text {
    animation: none;
  }
}
