/*
 * Manga visual system — V2
 * Loaded after styles.css so the original layout remains a safe fallback.
 */

.hero-shell {
  grid-template-columns: minmax(470px, 0.8fr) minmax(650px, 1.2fr);
  gap: 34px;
}

.hero-universe {
  height: 690px;
}

.hero-universe > :not(.hero-manga-frame) {
  display: none;
}

.hero-manga-frame {
  position: absolute;
  inset: 48px 0 46px 12px;
  margin: 0;
  border: 1px solid rgba(130, 233, 242, 0.46);
  border-radius: 36px;
  background: #0c1838;
  box-shadow:
    0 45px 100px rgba(0, 5, 25, 0.52),
    0 0 0 8px rgba(255, 255, 255, 0.035),
    inset 0 1px rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-2.5deg) rotateZ(0.8deg);
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.hero-manga-frame:hover {
  transform: perspective(1200px) rotateY(0deg) rotateZ(0deg) translateY(-5px);
  box-shadow:
    0 55px 115px rgba(0, 5, 25, 0.58),
    0 0 0 8px rgba(255, 255, 255, 0.05),
    0 0 65px rgba(88, 217, 232, 0.13);
}

.hero-manga-frame::before,
.hero-manga-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.hero-manga-frame::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 17, 40, 0.18), transparent 28%),
    linear-gradient(180deg, transparent 72%, rgba(7, 17, 40, 0.35));
}

.hero-manga-frame::after {
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 25px;
}

.hero-manga-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(0.96) contrast(1.02);
}

.hero-manga-frame figcaption {
  position: absolute;
  z-index: 4;
  left: 25px;
  bottom: 24px;
  min-width: 190px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(7, 17, 40, 0.68);
  box-shadow: 0 12px 28px rgba(0, 5, 25, 0.28);
  backdrop-filter: blur(14px);
}

.hero-manga-frame figcaption span,
.hero-manga-frame figcaption strong {
  display: block;
}

.hero-manga-frame figcaption span {
  color: var(--mint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.hero-manga-frame figcaption strong {
  margin-top: 5px;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.product-card {
  isolation: isolate;
}

.product-card-featured {
  grid-template-columns: minmax(330px, 0.82fr) minmax(480px, 1.18fr);
  gap: 34px;
  min-height: 610px;
  padding: 38px;
}

.vocab-showcase {
  min-height: 530px;
  border-radius: 30px;
  overflow: hidden;
  box-shadow:
    0 35px 72px rgba(0, 5, 29, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: rotate(1.1deg);
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}

.vocab-showcase:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow:
    0 45px 90px rgba(0, 5, 29, 0.4),
    0 0 0 1px rgba(124, 230, 186, 0.3);
}

.vocab-showcase > :not(.manga-product-art) {
  display: none;
}

.manga-product-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.75s var(--ease);
}

.vocab-showcase:hover .manga-product-art {
  transform: scale(1.025);
}

.listening-product,
.schedule-product,
.starcard-product,
.anime-product {
  min-height: 650px;
  padding: 25px 27px 31px;
}

.product-icon {
  height: 300px;
  margin: -2px -4px 25px;
  border: 1px solid rgba(16, 23, 53, 0.08);
  border-radius: 24px;
  display: block;
  background: #fff;
  box-shadow: 0 22px 45px rgba(36, 51, 91, 0.12);
  overflow: hidden;
  transform: translateZ(0);
}

.product-icon > :not(.manga-card-art) {
  display: none;
}

.manga-card-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
}

.product-card:hover .manga-card-art {
  transform: scale(1.045);
  filter: saturate(1.04) contrast(1.02);
}

.starcard-product .product-icon {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px rgba(0, 6, 31, 0.3);
}

.custom-product {
  min-height: 520px;
  grid-template-columns: minmax(360px, 0.76fr) minmax(540px, 1.24fr);
  padding: 48px 54px;
}

.custom-map {
  min-height: 420px;
  border: 1px solid rgba(120, 104, 242, 0.13);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(35, 49, 90, 0.14);
  overflow: hidden;
  transform: rotate(-0.7deg);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.custom-map:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 0 38px 78px rgba(35, 49, 90, 0.18);
}

.custom-map > :not(.custom-manga-art) {
  display: none;
}

.custom-manga-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.custom-map:hover .custom-manga-art {
  transform: scale(1.025);
}

.method-flow li {
  overflow: hidden;
}

.method-flow li::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -40px;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 217, 232, 0.14), transparent 70%);
  pointer-events: none;
}

.method-flow .flow-symbol {
  width: 78px;
  height: 78px;
  border: 3px solid #fff;
  border-radius: 22px;
  color: transparent;
  background-color: #fff;
  background-position: center;
  background-size: 185%;
  box-shadow: 0 12px 30px rgba(37, 52, 91, 0.17);
  overflow: hidden;
}

.method-flow li:nth-child(1) .flow-symbol {
  background-image: url("./assets/illustrations/vocab-manga.jpg");
}

.method-flow li:nth-child(2) .flow-symbol {
  background-image: url("./assets/illustrations/anime-manga.jpg");
}

.method-flow li:nth-child(3) .flow-symbol {
  background-image: url("./assets/illustrations/starcards-manga.jpg");
}

.method-flow li:nth-child(4) .flow-symbol {
  background-image: url("./assets/illustrations/custom-manga.jpg");
}

.starcards-stage {
  height: 590px;
  display: grid;
  place-items: center;
}

.starcards-stage > :not(.starcards-feature-visual) {
  display: none;
}

.starcards-feature-visual {
  position: relative;
  width: min(100%, 570px);
  aspect-ratio: 1;
  margin: 0;
  border: 1px solid rgba(124, 230, 186, 0.28);
  border-radius: 35px;
  background: #fff;
  box-shadow:
    0 45px 90px rgba(0, 5, 29, 0.45),
    0 0 0 8px rgba(255, 255, 255, 0.04),
    0 0 70px rgba(88, 217, 232, 0.1);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-5deg) rotateZ(1deg);
  transition: transform 0.75s var(--ease), box-shadow 0.75s var(--ease);
}

.starcards-feature-visual:hover {
  transform: perspective(1000px) rotateY(0deg) rotateZ(0deg) translateY(-7px);
  box-shadow:
    0 55px 110px rgba(0, 5, 29, 0.52),
    0 0 0 8px rgba(255, 255, 255, 0.055),
    0 0 90px rgba(88, 217, 232, 0.15);
}

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

.comic-strip {
  display: block;
}

.comic-strip > article {
  display: none;
}

.anime-feature-visual {
  width: 100%;
  margin: 0;
  padding: 17px;
  border: 4px solid var(--navy);
  border-radius: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 17px;
  background: #fff;
  box-shadow: 14px 16px 0 rgba(16, 23, 53, 0.09), 0 35px 80px rgba(37, 51, 92, 0.12);
  overflow: hidden;
}

.anime-feature-visual img {
  display: block;
  width: 100%;
  height: 640px;
  border-radius: 21px;
  object-fit: cover;
  object-position: center;
}

.anime-feature-visual figcaption {
  padding: 25px 18px;
  border-radius: 21px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(circle at 80% 10%, rgba(88, 217, 232, 0.24), transparent 30%),
    linear-gradient(145deg, #101735, #293670);
}

.anime-feature-visual figcaption span {
  position: relative;
  padding: 18px 16px 18px 44px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  color: rgba(255, 255, 255, 0.87);
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
  font-weight: 750;
}

.anime-feature-visual figcaption span::before {
  content: "✦";
  position: absolute;
  left: 17px;
  top: 50%;
  color: var(--mint);
  transform: translateY(-50%);
}

@media (max-width: 1260px) {
  .hero-shell {
    grid-template-columns: minmax(410px, 0.84fr) minmax(560px, 1.16fr);
  }

  .hero-manga-frame {
    inset: 72px 0 68px 0;
  }

  .product-card-featured {
    grid-template-columns: minmax(350px, 0.82fr) minmax(470px, 1.18fr);
  }
}

@media (max-width: 1020px) {
  .hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-universe {
    height: 630px;
    transform: none;
  }

  .hero-manga-frame {
    inset: 25px 0 30px;
    transform: rotate(0.6deg);
  }

  .product-card-featured {
    grid-template-columns: minmax(320px, 0.82fr) minmax(390px, 1.18fr);
  }

  .custom-product {
    grid-template-columns: 1fr;
  }

  .anime-feature-visual {
    grid-template-columns: 1fr 230px;
  }

  .anime-feature-visual img {
    height: 560px;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 1030px;
  }

  .hero-universe {
    height: 440px;
    margin: 25px 0 0;
    transform: none;
  }

  .hero-manga-frame {
    inset: 12px 0 18px;
    border-radius: 25px;
    transform: rotate(0deg);
  }

  .hero-manga-frame::after {
    inset: 9px;
    border-radius: 18px;
  }

  .hero-manga-frame figcaption {
    left: 15px;
    bottom: 14px;
    min-width: 165px;
    padding: 9px 12px;
  }

  .product-card-featured {
    display: block;
    min-height: 0;
    padding: 27px;
  }

  .vocab-showcase {
    min-height: 390px;
    margin-top: 32px;
    transform: rotate(0deg);
  }

  .listening-product,
  .schedule-product,
  .starcard-product,
  .anime-product {
    min-height: 0;
    padding: 22px 22px 30px;
  }

  .product-icon {
    height: auto;
    aspect-ratio: 1;
    margin: 0 0 25px;
  }

  .custom-product {
    min-height: 0;
    padding: 35px 27px;
  }

  .custom-map {
    min-height: 0;
    aspect-ratio: 1;
    margin-top: 30px;
    transform: none;
  }

  .custom-manga-art {
    min-height: 0;
    aspect-ratio: 1;
  }

  .method-flow .flow-symbol {
    width: 86px;
    height: 86px;
  }

  .starcards-section {
    min-height: 970px;
  }

  .starcards-stage {
    height: auto;
    margin-top: 20px;
    transform: none;
  }

  .starcards-feature-visual {
    width: 100%;
    border-radius: 27px;
    transform: none;
  }

  .anime-feature-visual {
    padding: 11px;
    border-width: 3px;
    border-radius: 23px;
    grid-template-columns: 1fr;
    box-shadow: 8px 9px 0 rgba(16, 23, 53, 0.09), 0 28px 65px rgba(37, 51, 92, 0.11);
  }

  .anime-feature-visual img {
    height: auto;
    aspect-ratio: 1;
    border-radius: 16px;
  }

  .anime-feature-visual figcaption {
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .hero {
    min-height: 980px;
  }

  .hero-universe {
    height: 370px;
  }

  .hero-manga-frame img {
    object-position: 50% 50%;
  }

  .vocab-showcase {
    min-height: 330px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-manga-frame,
  .vocab-showcase,
  .custom-map,
  .starcards-feature-visual {
    transform: none;
  }
}
