/* =========================================================
   Opening animation (top page only)
   Overlay is shown only while <html class="js-opening"> is set.
   ========================================================= */
#opening { display: none; }

html.js-opening { overflow: hidden; }

html.js-opening #opening {
  --logo-w: min(84vw, 640px);
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  isolation: isolate;
  background: #F9F9F7;
  will-change: transform;
}

#opening-paper,
#opening-grain,
#opening-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#opening-paper { background: #F9F9F7; }

/* キャンバス地の織り目：絵の具の上にもごく薄く重ねて、全体を一枚の画布に見せる */
#opening-grain {
  opacity: 0;
  background-repeat: repeat;
  background-size: 96px 96px;
  pointer-events: none;
  animation: openingGrain 0.3s ease-out forwards;
}

@keyframes openingGrain { to { opacity: 0.85; } }

#opening-canvas {
  display: block;
}

#opening-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--logo-w);
  height: auto;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.55);
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}

#opening-skip {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 18px;
  font-family: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #14213D;
  background: rgba(250, 249, 246, 0.72);
  border: 1px solid rgba(20, 33, 61, 0.2);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#opening-skip span {
  display: inline-block;
  transition: transform 0.2s ease;
}

#opening-skip:hover,
#opening-skip:focus-visible {
  background: #14213D;
  color: #FAF9F6;
  border-color: #14213D;
}

#opening-skip:hover span,
#opening-skip:focus-visible span { transform: translateX(3px); }

#opening-skip:focus-visible {
  outline: 2px solid #C85A32;
  outline-offset: 3px;
}
