/* =========================================
   KAIZEN MENU — Splash Ad
   Mobile-first, fullscreen video promo
   ========================================= */

:root {
  --black: #0a0a0a;
  --warm-white: #f0ebe3;
  --cream: #d4cfc6;
  --ash: #9a9a9a;
  --gold: #c9a96e;
  --gold-bright: #dfc08a;
  --gold-dim: #8a7448;

  --ff-display: 'Cormorant Garamond', 'Noto Serif JP', serif;
  --ff-jp: 'Noto Serif JP', serif;
  --ff-body: 'Outfit', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--black);
  color: var(--warm-white);
  font-family: var(--ff-body);
}

a { color: inherit; text-decoration: none; }

/* ===== SPLASH ===== */
.splash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  height: 100vh; /* fallback */
  overflow: hidden;
}

/* ── Video: fill entire screen ── */
.splash__video-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Block pointer events so the embedded player can't be paused/clicked
     by the user. The skip button still works (higher z-index). */
  pointer-events: none;
}

/* iframe needs explicit cover behavior (object-fit doesn't apply to iframes).
   We size the iframe so it always covers the viewport, centering excess.
   Video aspect is 16:9 (1.778). On portrait phones, the iframe becomes taller
   than the screen; on landscape, wider. */
.splash__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, calc(100dvh * 16 / 9));
  height: max(100dvh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
  border: 0;
  display: block;
}

/* ── Overlays ── */
.splash__overlay-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(10,10,10,0.6), transparent);
  z-index: 2;
  pointer-events: none;
}

.splash__overlay-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(10,10,10,0.4) 30%,
    rgba(10,10,10,0.85) 65%,
    rgba(10,10,10,0.97) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.splash__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── Skip button ── */
.splash__skip {
  position: absolute;
  top: 0;
  right: 0;
  padding-top: max(16px, env(safe-area-inset-top, 16px));
  padding-right: max(16px, env(safe-area-inset-right, 16px));
  padding-top: calc(max(16px, env(safe-area-inset-top, 16px)) + 0px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--cream);
  background: rgba(10,10,10, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255, 0.08);
  padding: 10px 18px;
  margin: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px)) 0 0;
  border-radius: 100px;
  cursor: pointer;
  opacity: 1;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.splash__skip:active {
  background: rgba(255,255,255, 0.12);
}

.splash__skip svg {
  opacity: 0.7;
}

/* ── Bottom content area ── */
.splash__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  /* Adaptive bottom spacing: ~14% of viewport height, clamped — keeps CTA
     visible above the URL bar on tiny phones AND well-spaced on tall phones */
  padding-bottom: max(
    clamp(60px, 14dvh, 130px),
    calc(env(safe-area-inset-bottom, 12px) + 48px)
  );
}

/* Decorative line */
.splash__line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-bottom: 18px;
  opacity: 0;
}

/* Badge */
.splash__badge {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  border: 1px solid rgba(201,169,110, 0.35);
  padding: 6px 18px 5px;
  border-radius: 2px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(15px);
}

/* Title */
.splash__title {
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(20px);
  line-height: 1;
}

.splash__title-kanji {
  display: block;
  font-family: var(--ff-jp);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: 0.15em;
}

.splash__title-text {
  display: block;
  font-family: var(--ff-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  color: var(--warm-white);
  letter-spacing: -0.01em;
}

/* Description */
.splash__desc {
  font-family: var(--ff-body);
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--cream);
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(12px);
}

/* CTA */
.splash__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--black);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  padding: 15px 44px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin-bottom: 8px;
}

.splash__cta:active {
  transform: scale(0.96) !important;
  opacity: 0.9 !important;
}

/* ── Progress bar ── */
.splash__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255, 0.05);
  z-index: 20;
}

.splash__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width 0.2s linear;
}

/* ===== EXIT TRANSITION ===== */
.splash--exiting .splash__bottom,
.splash--exiting .splash__skip {
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0 !important;
  transform: translateY(-15px) !important;
}

.splash--exiting .splash__video {
  transition: transform 0.8s cubic-bezier(0.16,1,0.3,1), filter 0.8s ease;
  transform: scale(1.1);
  filter: brightness(0.2) saturate(0.3);
}

.splash--exiting::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 100;
  animation: fadeOut 0.5s 0.25s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== RESPONSIVE ===== */

/* Extra small phones (iPhone SE 1st gen, small Androids) */
@media (max-height: 580px) {
  .splash__title-kanji { font-size: 1.3rem; margin-bottom: 2px; }
  .splash__title-text { font-size: 1.7rem; }
  .splash__title { margin-bottom: 6px; }
  .splash__desc { font-size: 0.72rem; line-height: 1.4; margin-bottom: 10px; }
  .splash__badge { margin-bottom: 8px; padding: 4px 12px 3px; font-size: 0.52rem; }
  .splash__line { margin-bottom: 10px; }
  .splash__cta { padding: 10px 30px; font-size: 0.75rem; }
}

/* Small phones (SE 2nd/3rd gen, mini) */
@media (min-height: 581px) and (max-height: 680px) {
  .splash__title-kanji { font-size: 1.5rem; margin-bottom: 4px; }
  .splash__title-text { font-size: 1.9rem; }
  .splash__title { margin-bottom: 8px; }
  .splash__desc { font-size: 0.78rem; line-height: 1.45; margin-bottom: 12px; }
  .splash__badge { margin-bottom: 10px; font-size: 0.56rem; }
  .splash__cta { padding: 11px 34px; font-size: 0.78rem; }
}

/* Standard phones */
@media (min-height: 681px) and (max-height: 800px) {
  .splash__title-kanji { font-size: 1.8rem; }
  .splash__title-text { font-size: 2.3rem; }
  .splash__desc { font-size: 0.84rem; margin-bottom: 18px; }
}

/* Tall phones (Pro Max, etc.) */
@media (min-height: 850px) {
  .splash__bottom {
    padding-bottom: max(68px, calc(env(safe-area-inset-bottom, 16px) + 54px));
  }
  .splash__title-kanji { font-size: 2.6rem; }
  .splash__desc { margin-bottom: 28px; }
  .splash__cta { padding: 16px 50px; }
}

/* Landscape phones — compact layout */
@media (orientation: landscape) and (max-height: 500px) {
  .splash__overlay-bottom { height: 70%; }
  .splash__title-kanji { font-size: 1.2rem; margin-bottom: 2px; }
  .splash__title-text { font-size: 1.6rem; }
  .splash__title { margin-bottom: 6px; }
  .splash__badge { margin-bottom: 8px; padding: 4px 14px 3px; font-size: 0.55rem; }
  .splash__desc { font-size: 0.75rem; margin-bottom: 10px; }
  .splash__cta { padding: 10px 28px; font-size: 0.75rem; }
  .splash__line { margin-bottom: 10px; }
  .splash__bottom { padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 6px) + 18px)); }
}

/* Tablet / iPad */
@media (min-width: 768px) and (min-height: 900px) {
  .splash__bottom {
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 60px;
  }
  .splash__title-kanji { font-size: 3rem; }
  .splash__title-text { font-size: 4rem; }
  .splash__desc { font-size: 1.05rem; }
  .splash__badge { font-size: 0.7rem; }
  .splash__cta { padding: 18px 56px; font-size: 0.95rem; }
}
