/* Base */
:root {
  --yellow: #ffd700;
  /* overlay color: #d8c366 with alpha */
  --overlayYellow: rgba(255, 239, 12, 0.356);
  --textureOpacity: 0.35; /* medium */
  --ink: rgba(20, 20, 20, 0.92);
  --shadowLight: rgba(255, 255, 255, 0.65);
  --fontPrimary: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  font-family: var(--fontPrimary);
}

body.modalOpen {
  overflow: hidden;
}

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

/* Splash */
#splash {
  position: fixed;
  inset: 0;
  background: var(--yellow);
  display: grid;
  place-items: center;
  isolation: isolate; /* contain blend mode inside splash */
  z-index: 10;
  opacity: 1;
  transition: opacity 0.8s ease;
}

#splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/texture.png");
  background-repeat: repeat;
  opacity: var(--textureOpacity);
  mix-blend-mode: screen;
  z-index: 0;
  pointer-events: none;
}

#splash.isHidden {
  opacity: 0;
  pointer-events: none;
}

.splashLogo {
  position: relative;
  z-index: 1;
  width: min(520px, 68vw);
  max-height: 32vh;
  object-fit: contain;
}

/* Main */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  isolation: isolate; /* contain blend modes within the app */
}

#app.isVisible {
  opacity: 1;
}

/* Background video */
#bgFallback {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -3;
}

#bgVideo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* PCはそのまま、スマホは左右がクロップされる */
  object-position: center;
  z-index: -2;
}

#bgFallback.isHidden {
  opacity: 0;
  pointer-events: none;
}

/* 画面が縦長のとき、クロップ中心を微調整したい場合はここで調整 */
@media (max-aspect-ratio: 9/16) {
  #bgVideo {
    object-position: 50% 50%;
  }
}

/* Yellow overlay for readability */
#videoOverlay {
  position: fixed;
  inset: 0;
  background: var(--overlayYellow);
  z-index: 0;
}

/* Texture overlay (background-only) */
#videoOverlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/texture2.png");
  background-repeat: repeat;
  opacity: var(--textureOpacity);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Photo collage (desktop: fixed, mobile: flow) */
.photoCollage {
  position: fixed;
  inset: 0;
  /* above transparent #content so clicks work on desktop */
  z-index: 2;
  pointer-events: none;
}

.photoItem {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transform-origin: center;
}

.photoItem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Left side */
.photoItem--1 {
  left: 5vw;
  top: 16vh;
  width: min(340px, 28vw);
  height: min(220px, 18vw);
  transform: rotate(-6deg);
}

.photoItem--2 {
  left: 9vw;
  bottom: 12vh;
  width: min(320px, 26vw);
  height: min(210px, 17vw);
  transform: rotate(6deg);
}

.photoItem--6 {
  left: 7vw;
  top: 46vh;
  width: min(280px, 23vw);
  height: min(180px, 15vw);
  transform: rotate(2deg);
}

/* Right side */
.photoItem--3 {
  right: 6vw;
  top: 16vh;
  width: min(300px, 24vw);
  height: min(190px, 15vw);
  transform: rotate(7deg);
}

.photoItem--4 {
  right: 8vw;
  top: 48vh;
  width: min(280px, 22vw);
  height: min(170px, 14vw);
  transform: rotate(-4deg);
}

.photoItem--5 {
  right: 6vw;
  bottom: 10vh;
  width: min(320px, 26vw);
  height: min(210px, 17vw);
  transform: rotate(4deg);
}

/* Foreground content */
#content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(18px, 5vh, 56px) clamp(16px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  z-index: 1;
}

.top,
.center,
.bottom {
  width: 100%;
  display: flex;
  justify-content: center;
}

.center {
  position: relative;
}

.bottom {
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.logo {
  width: min(420px, 85vw);
  filter: drop-shadow(0 2px 8px var(--shadowLight));
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.modalTrigger {
  cursor: pointer;
}

/* Make header logo larger on wide screens */
@media (min-width: 900px) {
  .logo {
    width: min(600px, 44vw);
  }
}

.keyVisual {
  width: min(760px, 92vw);
  max-height: 62vh;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px var(--shadowLight));
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 1s ease, transform 1s ease;
}

/* Key visual overlay text */
.keyVisualWrap {
  position: relative;
  display: inline-block;
}

.keyText {
  position: absolute;
  bottom: clamp(16px, 8vh, 72px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  font-family: var(--fontPrimary);
  /* use horizontal space to avoid odd wraps */
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 11px;
  padding-right: 11px;
  margin-top: -49px;
  margin-bottom: -49px;
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.keyTelop {
  width: min(700px, 86vw);
  max-height: 30vh;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}

.keyTextLine {
  margin: 0;
  display: block; /* keep 3 lines even on wide screens */
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.keyTextLine--lg {
  /* mostly fixed, slight responsive adjustment */
  font-size: clamp(28px, 2.2rem + 0.6vw, 44px);
  font-weight: 900;
  white-space: nowrap;
}

.keyTextLine--md {
  margin-top: 12px;
  max-width: min(92vw, 760px);
  font-size: clamp(16px, 1.15rem + 0.25vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.keyTextLine--md2 {
  margin-top: 6px;
}

.snsLinks {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.snsLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.snsLink img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px var(--shadowLight));
}

.snsLink:hover {
  transform: translateY(-1px);
}

.snsLink:focus-visible {
  outline: 2px solid rgba(20, 20, 20, 0.75);
  outline-offset: 3px;
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
}

.modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modalPanel {
  position: relative;
  width: min(920px, 92vw);
  max-width: 100%;
  max-height: min(calc(100svh - 8vh), 820px);
  margin: 4vh auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.modal[data-theme="logo"] .modalPanel {
  background: #e1cb3a;
}

.modalClose {
  position: sticky;
  top: 0;
  margin-left: auto;
  border: 0;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.modalImage {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.modal[data-size="compact"] .modalImage {
  max-width: min(86vw, 720px);
  max-height: 60vh;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.modalCaption {
  margin: 12px 6px 6px;
  white-space: pre-line;
  line-height: 1.6;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
}

.modalCaption a {
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
}

.modal[data-theme="logo"] .modalCaption {
  text-align: center;
  color: #ffffff;
  font-size: 1.2rem;
}

/* Mobile: allow scroll + photos appear below */
@media (max-width: 900px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  #app {
    height: auto;
  }

  #content {
    height: auto;
    min-height: 100vh;
  }

  .photoCollage {
    position: relative;
    inset: auto;
    width: 100%;
    padding: 18px 16px 28px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    pointer-events: auto;
  }

  .photoItem {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    transform: none;
    border-radius: 10px;
  }
}

/* Desktop: keep telop above collage */
@media (min-width: 901px) {
  #content {
    z-index: auto;
  }

  .keyText {
    z-index: 3;
  }
}

/* Step-in animations */
.logo.isVisible {
  opacity: 1;
  transform: translateY(0);
}

.keyVisual.isVisible {
  opacity: 1;
  transform: scale(1);
}

.keyText.isVisible {
  opacity: 1;
}

.snsLinks.isVisible {
  opacity: 1;
  transform: translateY(0);
}

/* Small tweaks */
@media (max-width: 480px) {
  .keyTextLine {
    letter-spacing: 0.12em;
  }

  .keyTextLine--md {
    letter-spacing: 0.16em;
  }
}

