@font-face {
  font-family: 'GenWan';
  src: url('assets/fonts/genwan/GenWanMin2JP-L.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GenWan';
  src: url('assets/fonts/genwan/GenWanMin2JP-R.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GenWan';
  src: url('assets/fonts/genwan/GenWanMin2JP-M.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: #1a1a1a;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'GenWan', serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== OJUU (お重) FRAME ========== */
#ojuu-wrapper {
  position: relative;
  width: 82vw;
  max-width: 960px;
  aspect-ratio: 4/3;
}

/* The lid (ふた) — sits on top, same size as inner */
#lid {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;

  /* D案: lid fades + lifts up */
  opacity: 1;
  transform: translateY(0px);
  transition:
    opacity 1.4s ease 0.8s,
    transform 1.4s ease 0.8s;
}

#lid.open {
  opacity: 0;
  transform: translateY(-30px);
}

/* Outer black frame */
.lid-outer {
  position: absolute;
  inset: 0;
  background: #180901;
  border-radius: 18px;
  box-shadow:
    0 8px 60px rgba(0,0,0,0.85),
    inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Red inner border */
.lid-red {
  position: absolute;
  inset: 22px;
  border: 5px solid #6B1A08;
  border-radius: 8px;
  background: #180901;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.5),
    0 0 0 2px rgba(0,0,0,0.5);
}

/* Logo on lid */
.lid-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ========== INNER (メイン画像) ========== */
#inner {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 60px rgba(0,0,0,0.85);
  /* 外側の黒枠 */
  background: #180901;
  /* starts invisible, fades in after lid lifts */
  opacity: 0;
  transition: opacity 1.2s ease 1.6s;
}

#inner.show {
  opacity: 1;
}

/* 赤枠（外側黒枠の内側） */
#inner::before {
  content: '';
  position: absolute;
  inset: 22px;
  border: 5px solid #6B1A08;
  border-radius: 8px;
  z-index: 3;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.5),
    0 0 0 2px rgba(0,0,0,0.5);
}

/* 画像は赤枠の内側に収まるようpaddingで調整 */
#inner img {
  position: absolute;
  top: 32px; left: 32px;
  right: 32px; bottom: 32px;
  width: calc(100% - 64px);
  height: calc(100% - 64px);
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 4px;
  z-index: 1;
}

/* Hero text overlay */
.hero-overlay-text {
  position: absolute;
  top: 50%;
  right: 11%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  gap: 0;
  z-index: 4;
  opacity: 0;
  transition: opacity 1.2s ease 2.6s;
}
.hero-overlay-text.show {
  opacity: 1;
}
.hero-text-col {
  writing-mode: vertical-rl;
  color: #fff;
  font-size: clamp(15px, 1.8vw, 22px);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  margin: 0 10px;
}

/* Copyright */
.copyright {
  position: absolute;
  bottom: 26px;
  right: 30px;
  color: rgba(255,255,255,0.5);
  font-size: 9px;
  letter-spacing: 0.06em;
  z-index: 5;
  opacity: 0;
  transition: opacity 1s ease 2.8s;
}
.copyright.show { opacity: 1; }

/* ========== SKIP BUTTON ========== */
#skip-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.3);
  font-family: 'GenWan', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 2px;
  z-index: 9999; /* lid(10)・inner(0)より必ず上 */
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  backdrop-filter: blur(4px);
  pointer-events: all; /* 常にクリック可能 */
}
#skip-btn:hover {
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
#skip-btn.hidden { display: none; }

.lid-logo-image {
  width: 60%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 640px) {
  #skip-btn {
    right: 18px;
    bottom: 24px;
    background: rgba(0,0,0,0.62);
    color: #fff;
    border-color: rgba(255,255,255,0.55);
    padding: 10px 18px;
    font-size: 11px;
    letter-spacing: 0.16em;
  }

  .hero-overlay-text {
    right: 8%;
  }

  .hero-text-col {
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.1em;
    margin: 0 3px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.68);
  }

  .copyright {
    left: 30px;
    right: 30px;
    bottom: 22px;
    font-size: 7px;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-align: left;
  }
}

@media (max-width: 390px) {
  .hero-overlay-text {
    right: 7%;
  }

  .hero-text-col {
    font-size: 11.5px;
    line-height: 1.45;
    letter-spacing: 0.08em;
  }
}
