:root {
  --sea-dark: #020f1a;
  --sea-light: #0a3d54;
  --caustic-glow: #3ad3ff;

  --sea-deep: #01070f;
  --sea-cyan: #00f3ff;
  --sea-bright: #007399;

  --letter-stroke: #021a35;
  --letter-body-top: #aeeeff;
  --letter-body-mid: #299bf5;
  --letter-body-bottom: #094799;
  --letter-bevel-light: rgba(255, 255, 255, 0.85);

  --skull-white: #fafffe;
  --skull-shadow: #9cb1cc;
  --hat-straw: #fcd814;
  --hat-straw-shadow: #cfa300;
  --hat-ribbon: #df0012;

  --silhouette-red: #d60e15;

  --font-stack: "Times New Roman", Times, Baskerville, Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body,
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--sea-deep);
  font-family: var(--font-stack);
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

#cinema-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(
    circle at 50% 35%,
    var(--sea-light) 0%,
    var(--sea-dark) 60%,
    var(--sea-deep) 100%
  );
  z-index: 1;
  overflow: hidden;
  transition: background 2s ease-in-out;
}

#bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; 
  opacity: 0;
  z-index: 0;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1); 
}

.video-active #bg-video {
  opacity: 1;
}

.video-active .caustics,
.video-active .sunbeams,
.video-active .volumetric-fog {
  opacity: 0 !important;
  transition: opacity 2s ease-in-out;
}

.caustics {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-image:
    radial-gradient(
      circle at 50% 50%,
      transparent 50%,
      rgba(58, 211, 255, 0.18) 60%,
      transparent 70%
    ),
    radial-gradient(
      circle at 30% 40%,
      transparent 40%,
      rgba(58, 211, 255, 0.12) 50%,
      transparent 60%
    );
  background-size: 160px 160px;
  filter: blur(12px);
  opacity: 0.45;
  animation: underwaterFlow 20s infinite linear;
  mix-blend-mode: screen;
  z-index: 2;
  transition: opacity 1s ease;
}

.sunbeams {
  position: absolute;
  top: -20%;
  left: 0;
  width: 100%;
  height: 140%;
  background: repeating-linear-gradient(
    105deg,
    transparent 0%,
    rgba(58, 211, 255, 0.06) 4%,
    rgba(255, 255, 255, 0.1) 8%,
    rgba(58, 211, 255, 0.04) 12%,
    transparent 20%
  );
  background-size: 200% 100%;
  mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 0%,
    black 25%,
    transparent 75%
  );
  animation: shimmerRays 12s infinite linear;
  filter: blur(6px);
  z-index: 3;
  transition: opacity 1s ease;
}

.volumetric-fog {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(0deg, rgba(2, 15, 26, 0.9) 0%, transparent 100%);
  pointer-events: none;
  z-index: 4;
  transition: opacity 1s ease;
}

#logo-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  width: 1350px;
  height: 380px;
  transform: scale(0.95) translateZ(0);
  transform-style: preserve-3d;
  transition: all 0.5s ease;
}

.global-float {
  animation: globalFloat 6s ease-in-out infinite alternate;
}

#jp-subtitle {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 30;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.jp-char {
  font-family: "MS Mincho", "Hiragino Mincho ProN", serif;
  font-size: 22px;
  font-weight: 900;
  color: #d1f7ff;
  text-shadow:
    0 0 4px var(--letter-stroke),
    0 0 10px var(--sea-cyan),
    0 0 20px var(--sea-bright);
  letter-spacing: 2px;
  transform: scale(0.7);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.frame-line {
  position: absolute;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--sea-cyan) 0%,
    var(--letter-body-mid) 50%,
    var(--sea-cyan) 100%
  );
  border: 1px solid var(--letter-stroke);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.7);
  left: 15px;
  width: 0%;
  z-index: 12;
  transition:
    width 1.5s cubic-bezier(0.645, 0.045, 0.355, 1),
    opacity 0.5s ease;
}
#frame-top {
  top: 40px;
}
#frame-bottom {
  bottom: 42px;
}

.word-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  padding: 0 40px;
  transform-style: preserve-3d;
}

.glyph-block {
  position: relative;
  height: 300px;
  width: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  z-index: 10;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.energy-trace {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(0, 243, 255, 0.35);
  border-radius: 8px;
  opacity: 0;
  transform: scale(1.15);
  pointer-events: none;
  filter: blur(2px);
  transition: opacity 0.5s ease;
}

.core-serif-text {
  font-size: 240px;
  font-weight: 900;
  position: relative;
  color: var(--letter-body-mid);
  line-height: 1;
  cursor: default;
  user-select: none;
  opacity: 0;
  transform: scale(0.6) translateZ(-100px);
  filter: blur(20px);
  transition:
    transform 1.2s cubic-bezier(0.075, 0.82, 0.165, 1),
    opacity 1s ease-out,
    filter 0.8s ease-out;
}

.core-serif-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: transparent;
  -webkit-text-stroke: 14px var(--letter-stroke);
  z-index: -1;
}

.core-serif-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--letter-body-top) 0%,
    var(--letter-body-mid) 48%,
    var(--letter-body-bottom) 52%,
    var(--letter-stroke) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 2;
}

.inner-bevel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: overlay;
}
.inner-bevel::after {
  content: attr(data-text);
  position: absolute;
  top: 2px;
  left: 3px;
  width: 100%;
  height: 100%;
  color: transparent;
  -webkit-text-stroke: 3px var(--bevel-light);
  filter: blur(0.5px);
}

#glyph-o-group {
  width: 195px;
  height: 290px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.4s ease;
  margin-right: 20px;
  z-index: 100;
}

#glyph-o-group.btn-ready {
  cursor: pointer;
}
#glyph-o-group.btn-ready:hover {
  transform: scale(1.08) translateY(-5px);
  filter: drop-shadow(0 0 30px rgba(0, 243, 255, 0.8));
}
#glyph-o-group.btn-ready:active {
  transform: scale(0.98);
}

.o-ring-base {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    var(--letter-body-top) 0%,
    var(--letter-body-mid) 45%,
    var(--letter-body-bottom) 80%,
    var(--letter-stroke) 100%
  );
  border: 9px solid var(--letter-stroke);
  box-shadow:
    inset 0 0 25px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(0, 140, 181, 0.5);
  z-index: 4;
}

.bone-structure {
  position: absolute;
  width: 250px;
  height: 28px;
  background: linear-gradient(
    180deg,
    var(--skull-white) 0%,
    var(--skull-shadow) 100%
  );
  border: 4px solid var(--letter-stroke);
  border-radius: 12px;
  z-index: 3;
  transform-origin: center center;
  opacity: 0;
  transition:
    transform 1.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 1s;
}
#bone-diagonal-1 {
  transform: rotate(0deg) scale(0);
}
#bone-diagonal-2 {
  transform: rotate(0deg) scale(0);
}

.bone-structure::before,
.bone-structure::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  background: inherit;
  border: 4px solid var(--letter-stroke);
  border-radius: 50%;
  top: -12px;
}
.bone-structure::before {
  left: -28px;
  box-shadow: 0 6px 0 var(--letter-stroke);
}
.bone-structure::after {
  right: -28px;
  box-shadow: 0 6px 0 var(--letter-stroke);
}

.skull-face {
  position: absolute;
  width: 94px;
  height: 84px;
  background: linear-gradient(180deg, var(--skull-white) 0%, #dee7f2 100%);
  border: 4px solid var(--letter-stroke);
  border-radius: 46px 46px 38px 38px / 50px 50px 34px 34px;
  z-index: 6;
  top: 102px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.skull-eye {
  position: absolute;
  top: 26px;
  width: 24px;
  height: 30px;
  background-color: var(--letter-stroke);
  border-radius: 50% 50% 45% 45%;
}
.eye-left {
  left: 15px;
  transform: rotate(6deg);
}
.eye-right {
  right: 15px;
  transform: rotate(-6deg);
}

.skull-nose {
  position: absolute;
  top: 54px;
  left: 41px;
  width: 12px;
  height: 12px;
  background-color: var(--letter-stroke);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.skull-jaw {
  position: absolute;
  bottom: -15px;
  left: 22px;
  width: 50px;
  height: 18px;
  background: var(--skull-white);
  border: 4px solid var(--letter-stroke);
  border-top: none;
  border-radius: 0 0 8px 8px;
  display: flex;
  overflow: hidden;
  z-index: 5;
}
.tooth-line {
  flex: 1;
  border-right: 2px solid var(--letter-stroke);
  height: 100%;
}
.tooth-line:last-child {
  border-right: none;
}

.straw-hat-container {
  position: absolute;
  top: 52px;
  width: 195px;
  height: 70px;
  z-index: 7;
  transform: translateY(-40px);
  opacity: 0;
  transition:
    transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 1s;
}
.hat-brim {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(
    180deg,
    var(--hat-straw) 0%,
    var(--hat-straw-shadow) 100%
  );
  border: 4px solid var(--letter-stroke);
  border-radius: 50%;
  z-index: 8;
}
.hat-crown {
  position: absolute;
  bottom: 11px;
  left: 35px;
  width: 125px;
  height: 55px;
  background: linear-gradient(
    180deg,
    var(--hat-straw) 0%,
    #ecd01c 40%,
    var(--hat-straw-shadow) 100%
  );
  border: 4px solid var(--letter-stroke);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 7;
}
.hat-ribbon {
  position: absolute;
  bottom: 11px;
  left: 36px;
  width: 123px;
  height: 15px;
  background: linear-gradient(180deg, #ff3b47 0%, var(--hat-ribbon) 100%);
  border-top: 3px solid var(--letter-stroke);
  border-bottom: 2px solid var(--letter-stroke);
  z-index: 9;
}

.luffy-i-block {
  width: 135px;
  height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -5px;
  margin-right: -5px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#glyph-i-silhouette {
  width: 100%;
  height: 100%;
  position: relative;
  opacity: 0;
  transform: scale(0.6) translateZ(-50px);
  transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 15;
}

.luffy-shape {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--silhouette-red);
  filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.45));

  clip-path: polygon(
    40% 0%,
    45% 30%,
    50% 30%,
    55% 30%,
    60% 20%,
    78% 7%,
    65% 8.5%,
    50% 9.5%,
    35% 8.5%,
    22% 7%,
    28% 8.5%,
    33% 9.5%,
    33% 15%,
    38% 21%,
    50% 23%,
    62% 21%,
    67% 15%,
    67% 9.5%,
    72% 8.5%,
    56% 23%,
    55% 29%,
    45% 29%,
    44% 23%,
    42% 29%,
    34% 32%,
    26% 38%,
    21% 45%,
    21% 52%,
    25% 60%,
    31% 61%,
    35% 59.5%,
    38% 51%,
    41% 44%,
    44% 42%,
    43.5% 58.5%,
    42.5% 64%,
    37.5% 69.5%,
    35% 72%,
    41% 72%,
    39% 76.5%,
    43% 76.5%,
    41.5% 81%,
    40.5% 88.5%,
    36.5% 97.5%,
    34% 100%,
    46% 100%,
    45.5% 93%,
    47% 84.5%,
    50% 76.5%,
    53% 84.5%,
    54.5% 93%,
    54% 100%,
    66% 100%,
    63.5% 97.5%,
    59.5% 88.5%,
    58.5% 81%,
    57% 76.5%,
    61% 76.5%,
    59% 72%,
    65% 72%,
    62.5% 69.5%,
    57.5% 64%,
    56.5% 58.5%,
    56% 42%,
    59% 44%,
    62% 51%,
    65% 59.5%,
    69% 61%,
    75% 60%,
    79% 52%,
    79% 45%,
    74% 38%,
    66% 32%,
    58% 29%
  );
}

.shimmer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 40%,
    rgba(255, 255, 255, 0.7) 44%,
    transparent 48%
  );
  background-size: 300% 100%;
  background-position: 150% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 5;
  mix-blend-mode: overlay;
}

.active-shimmer {
  animation: textShimmer 7s infinite linear;
}

.action-triggered .glyph-block,
.action-triggered .luffy-i-block,
.action-triggered #jp-subtitle,
.action-triggered .frame-line {
  opacity: 0 !important;
  transform: scale(0.4) translateY(30px) !important;
  filter: blur(15px);
  pointer-events: none;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.action-triggered #glyph-o-group {
  animation: oCinematicSweep 4.5s cubic-bezier(0.25, 1, 0.3, 1) forwards !important;
  pointer-events: none;
}

@keyframes oCinematicSweep {
  0% {
    transform: translateX(0) scale(1);
  }
  30% {
    transform: translateX(450px) scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 40px var(--sea-cyan));
  }
  60% {
    transform: translateX(480px) scale(1.15) rotate(0deg);
    filter: drop-shadow(0 0 50px var(--caustic-glow));
  }
  100% {
    transform: translateX(540px) scale(1.5);
    filter: drop-shadow(0 0 60px rgba(0, 243, 255, 0.9));
  }
}

@keyframes underwaterFlow {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(4deg) scale(1.08);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}
@keyframes shimmerRays {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
@keyframes globalFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-12px) rotate(0.5deg);
  }
}
@keyframes textShimmer {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -150% 0;
  }
}
