:root {
  color: #211b16;
  background: #fff4b3;
  font-family: system-ui, sans-serif;
  line-height: 1.65;
  --ink: #211b16;
  --border: 3px solid var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid #1741aa; outline-offset: 3px; }

.content-width {
  width: min(100% - 2rem, 60rem);
  margin-inline: auto;
}

.hero {
  overflow: hidden;
  background: #fdf5e1 url("../assets/images/mv/bg-pattern/mv-bg-tile.png") repeat center top / 572px 378px;
}

.hero__stage {
  position: relative;
  isolation: isolate;
  max-width: 100rem;
  margin-inline: auto;
  aspect-ratio: 586 / 309;
}

/* Anchor each layer on the stage and animate only the image inside it. */
.hero__layer {
  position: absolute;
  top: var(--top, auto);
  left: var(--left);
  width: var(--width);
}

.hero picture,
.hero__layer img { display: block; }

.hero__layer img {
  width: 100%;
  height: auto;
}

.hero__background { --top: 0%; --left: 15.2%; --width: 69%; }

.hero__object--01 {
  --top: 2.6%;
  --left: 16.9%;
  --width: 18.6%;
  --tilt: -3deg;
  --travel-y: 4px;
  --leg-duration: 2.15s;
  --delay: .84s;
}

.hero__object--02 {
  --top: 50.8%;
  --left: 18.8%;
  --width: 24.6%;
  --tilt: 3deg;
  --travel-x: 5px;
  --leg-duration: 2.4s;
  --delay: 1.35s;
}

.hero__object--03 {
  --top: 2.6%;
  --left: 56%;
  --width: 25.1%;
  --tilt: 3deg;
  --travel-y: 5px;
  --leg-duration: 2.9s;
  --delay: 1.05s;
}

.hero__object--04 {
  --top: 53%;
  --left: 65.4%;
  --width: 22.9%;
  --tilt: -4deg;
  --travel-x: -4px;
  --leg-duration: 2.65s;
  --delay: 1.72s;
}

.hero__sfx { --top: 18.8%; --left: 14.9%; --width: 67%; }
.hero__logo { --top: 3.2%; --left: 25.8%; --width: 47.4%; }
.hero__person { --left: 6.5%; --width: 87%; bottom: 0; }

@media (max-width: 600px) {
  .hero {
    background-color: #faf4e2;
    background-image: linear-gradient(#faf4e2db, #faf4e2db), url("../assets/images/mv/bg-pattern/mv-bg-tile.png");
    background-size: auto, 286px 189px;
  }

  .hero__stage { aspect-ratio: 390 / 478; }
  .hero__background { --left: -3%; --width: 106%; }
  .hero__object--01 { --top: 1%; --left: 7%; --width: 33%; }
  .hero__object--02 { --top: 53%; --left: 4%; --width: 33%; }
  .hero__object--03 { --top: 1%; --left: 52%; --width: 48%; }
  .hero__object--04 { --top: 52%; --left: 61%; --width: 36%; }
  .hero__object--01 { --tilt: -2deg; --travel-y: 3px; --inset-y: 2px; }
  .hero__object--02 { --tilt: 2deg; --travel-x: 3.5px; }
  .hero__object--03 { --tilt: 2deg; --travel-y: 3.5px; --inset-x: -4px; --inset-y: 3px; }
  .hero__object--04 { --tilt: -2.75deg; --travel-x: -3px; }
  .hero__sfx { --top: 4%; --left: 1%; --width: 93%; }
  .hero__logo { --top: 8%; --left: 1%; --width: 98%; }
  .hero__person { --left: -21%; --width: 142%; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__logo img { animation: hero-logo-in 780ms cubic-bezier(.22, .65, .35, 1) both; }
  .hero__sfx img { animation: hero-sfx-in 480ms 360ms ease-out both; }
  .hero__object img { animation: hero-sway var(--leg-duration) var(--delay) ease-in-out infinite alternate backwards; }
}

@keyframes hero-logo-in {
  0% { opacity: 0; transform: scale(.72); }
  62% { opacity: 1; transform: scale(1.065); }
  82% { transform: scale(.985); }
  100% { transform: scale(1); }
}

@keyframes hero-sfx-in {
  0% { opacity: 0; transform: scale(.8); }
  65% { opacity: 1; transform: scale(1.055); }
  100% { transform: scale(1); }
}

@keyframes hero-sway {
  from {
    transform: translate(
      calc(var(--inset-x, 0px) - var(--travel-x, 0px)),
      calc(var(--inset-y, 0px) - var(--travel-y, 0px))
    ) rotate(calc(-1 * var(--tilt)));
  }
  to {
    transform: translate(
      calc(var(--inset-x, 0px) + var(--travel-x, 0px)),
      calc(var(--inset-y, 0px) + var(--travel-y, 0px))
    ) rotate(var(--tilt));
  }
}

h2 { font-size: clamp(1.45rem, 4vw, 2.4rem); }

.mail-section[hidden] { display: none; }

.mail-section {
  padding: clamp(1.25rem, 3vw, 2.5rem) 1rem clamp(2rem, 5vw, 4.5rem);
  background: #ffe548;
  color: #111;
}

.mail-section__title {
  width: clamp(9rem, 20vw, 18rem);
  margin-inline: auto;
}

.mail-section__title img {
  display: block;
  width: 100%;
  height: auto;
}

#mail-status,
.mail-section noscript { text-align: center; }

#mail-status { margin-top: 1rem; }

#mail-weeks {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 58rem;
  margin: clamp(1.75rem, 4vw, 3rem) auto 0;
}

#mail-weeks:empty { margin-top: 0; }

.week { min-width: 0; }

.week__frame {
  --arrow-space: 3.5rem;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--arrow-space) minmax(0, 1fr) var(--arrow-space);
  grid-template-areas: "prev slide next" ". dots .";
  align-items: center;
}

.week__frame .swiper,
.week__empty {
  grid-area: slide;
  width: 100%;
  min-width: 0;
}

.week__empty {
  padding: 5rem 1rem 2rem;
  background: #fffdfa;
  text-align: center;
}

.week__category {
  position: absolute;
  z-index: 2;
  top: -.85rem;
  left: calc(var(--arrow-space) - .55rem);
  display: grid;
  place-content: center;
  gap: .15em;
  width: clamp(8.5rem, 19vw, 16.5rem);
  aspect-ratio: 432 / 217;
  padding: 0 clamp(.65rem, 2.5vw, 2.25rem) clamp(.8rem, 2vw, 1.8rem);
  background: url("../assets/images/mail/mail-category-bg.png") center / contain no-repeat;
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.875rem);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 1px 2px 2px #000;
  -webkit-text-stroke: 1px #111;
  paint-order: stroke fill;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.week__category-sub { font-size: .78em; }

.week__impact {
  position: absolute;
  z-index: 3;
  top: -2rem;
  right: calc(var(--arrow-space) - .6rem);
  width: clamp(1.55rem, 4vw, 3.25rem);
  height: auto;
  pointer-events: none;
}

.week__frame .swiper-slide { height: auto; }

.mail-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  aspect-ratio: 1333 / 866;
  padding: 4% 3.3% 4.5%;
  background: url("../assets/images/mail/mail-paper.png") center / 100% 100% no-repeat;
}

.mail-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(.8rem, 2.7vw, 2.3rem) clamp(1rem, 4.2vw, 3.4rem) clamp(1.25rem, 4vw, 3rem);
  border: var(--border);
  --halftone-ink: color-mix(in srgb, var(--week-color), white 28%);
  --halftone: radial-gradient(circle, var(--halftone-ink) 1.65px, transparent 2px);
  background:
    var(--halftone) 0 0 / 8px 8px,
    var(--halftone) 4px 4px / 8px 8px,
    var(--week-color);
  text-align: center;
  overflow-wrap: anywhere;
}

.mail-card__date {
  align-self: flex-end;
  margin: 0 0 clamp(.85rem, 1.8vw, 1.4rem) 50%;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(.72rem, 1.55vw, 1.3rem);
  font-weight: 900;
  -webkit-text-stroke: 2px #111;
  paint-order: stroke fill;
}

.mail-card h4 {
  padding: .35rem 0;
  border-bottom: 1px solid #111;
  font-size: clamp(1rem, 1.9vw, 1.6rem);
  line-height: 1.35;
}

.mail-card__author {
  margin-top: .35rem;
  font-size: clamp(.75rem, 1.4vw, 1.1rem);
  font-weight: 800;
}

.mail-card__body-frame {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 0;
  min-height: 0;
  margin-top: clamp(.75rem, 2.3vw, 1.8rem);
}

.mail-card__body {
  padding: clamp(.7rem, 2.5vw, 1.65rem);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #805a68 transparent;
  text-align: left;
  font-size: clamp(.82rem, 1.4vw, 1.05rem);
  line-height: 1.75;
}

.mail-card__body p { white-space: pre-wrap; }

.mail-card__body:focus-visible { outline-offset: -3px; }

/* Keep the textured paper stationary while the text scrolls. */
.mail-card__body-frame::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(rgb(80 30 45 / .075) .5px, transparent .8px) 0 0 / 4px 4px,
    rgb(255 250 252 / .83);
  content: "";
}

.mail-card__body-frame[data-more]::after {
  position: absolute;
  inset: auto 4px 3px;
  height: 1.15rem;
  background: linear-gradient(transparent, rgb(255 250 252 / .9));
  pointer-events: none;
  content: "";
}

.carousel-arrow {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.week[data-week="1"] { --arrow-image: url("../assets/images/mail/mail-arrow-01.png"); }
.week[data-week="2"] { --arrow-image: url("../assets/images/mail/mail-arrow-02.png"); }
.week[data-week="3"] { --arrow-image: url("../assets/images/mail/mail-arrow-03.png"); }
.week[data-week="4"] { --arrow-image: url("../assets/images/mail/mail-arrow-04.png"); }
.week[data-week="5"] { --arrow-image: url("../assets/images/mail/mail-arrow-05.png"); }
.week[data-week="6"] { --arrow-image: url("../assets/images/mail/mail-arrow-06.png"); }
.week[data-week="7"] { --arrow-image: url("../assets/images/mail/mail-arrow-07.png"); }

.carousel-prev {
  grid-area: prev;
  --arrow-rest-image: url("../assets/images/mail/mail-arrow-prev.png");
}

.carousel-next {
  grid-area: next;
  --arrow-rest-image: url("../assets/images/mail/mail-arrow-next.png");
}

.carousel-arrow::before,
.carousel-arrow::after {
  grid-area: 1 / 1;
  width: clamp(1.25rem, 2.7vw, 2.35rem);
  content: "";
}

.carousel-arrow::before {
  aspect-ratio: 57 / 34;
  background: var(--arrow-rest-image) center / contain no-repeat;
}

.carousel-arrow::after {
  aspect-ratio: 69 / 47;
  background: var(--arrow-image) center / contain no-repeat;
  opacity: 0;
}

.carousel-prev::after { transform: scaleX(-1); }
.carousel-arrow:enabled:focus-visible::before { opacity: 0; }
.carousel-arrow:enabled:focus-visible::after { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .carousel-arrow:enabled:hover::before { opacity: 0; }
  .carousel-arrow:enabled:hover::after { opacity: 1; }
}

.carousel-arrow:disabled { opacity: .42; cursor: default; }

.carousel-pagination {
  grid-area: dots;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .125rem;
}

.carousel-pagination .swiper-pagination-bullet {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  opacity: 1;
  cursor: pointer;
}

.carousel-pagination .swiper-pagination-bullet::before {
  width: clamp(.58rem, 1vw, .83rem);
  aspect-ratio: 1;
  border: 1px solid #111;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.carousel-pagination .swiper-pagination-bullet-active::before {
  background: var(--week-color);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .carousel-arrow::after { transition: scale 180ms ease-out; }
  .carousel-arrow:enabled:hover::after { scale: 1.1; }
}

@media (max-width: 600px) {
  .mail-section {
    --mail-gutter: clamp(1.25rem, 6vw, 1.85rem);
    padding: .5rem var(--mail-gutter) clamp(2.2rem, 7vw, 3.25rem);
  }

  .mail-section__title { width: clamp(9.5rem, 47vw, 13rem); }

  #mail-weeks {
    gap: calc(clamp(2.35rem, 9.5vw, 3.4rem) + 30px);
    margin-top: clamp(2.7rem, 10vw, 3.5rem);
  }

  .week__frame {
    --arrow-space: 2.75rem;
    grid-template-areas: "slide slide slide" ". dots .";
  }

  .week__category {
    top: -1.25rem;
    left: -.5rem;
    place-content: center stretch;
    width: clamp(8.6rem, 40vw, 11.5rem);
    padding: 0 clamp(.72rem, 3vw, 1.25rem) clamp(.85rem, 4.25vw, 1.5rem);
    font-size: clamp(1.02rem, 5.1vw, 1.38rem);
    line-height: 1.2;
  }

  .week__category > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .week__category-sub { font-size: .83em; }
  .week__impact { top: -1.7rem; right: -.35rem; }
  .mail-stack { aspect-ratio: 1 / 1.045; padding: 4.5% 3.2% 5%; }

  .mail-card {
    padding: .8rem clamp(.72rem, 3.8vw, 1.2rem) 1.3rem;
    border-width: 2px;
  }

  .mail-card__date {
    margin-bottom: clamp(.9rem, 4vw, 1.15rem);
    font-size: clamp(.71rem, 3vw, .875rem);
  }

  .mail-card h4 { font-size: clamp(.95rem, 4vw, 1.15rem); }
  .mail-card__author { margin-top: .33rem; font-size: clamp(.75rem, 3.15vw, .9rem); }
  .mail-card__body-frame { margin-top: clamp(.65rem, 3vw, .95rem); }
  .mail-card__body { padding: clamp(.65rem, 3.1vw, .95rem); }

  .carousel-arrow {
    position: absolute;
    grid-area: auto;
    z-index: 2;
    top: calc(50% - 2rem);
  }

  .carousel-prev { left: calc(-1 * var(--mail-gutter)); }
  .carousel-next { right: calc(-1 * var(--mail-gutter)); }
  .carousel-arrow::before,
  .carousel-arrow::after { width: clamp(.9rem, 4.4vw, 1.15rem); }
  .carousel-prev::before,
  .carousel-prev::after { justify-self: start; margin-left: .22rem; }
  .carousel-next::before,
  .carousel-next::after { justify-self: end; margin-right: .22rem; }
  .carousel-pagination {
    --swiper-pagination-bullet-horizontal-gap: 0px;
    margin-top: .25rem;
    gap: 0;
  }

  .carousel-pagination .swiper-pagination-bullet { width: 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .mail-section__title.is-visible img {
    animation: mail-title-in 600ms ease-out both;
  }

  .week__impact { animation: mail-impact-shake 3.4s ease-in-out infinite; }
}

@keyframes mail-title-in {
  from { scale: .75; opacity: 0; }
  65% { scale: 1.06; opacity: 1; }
  to { scale: 1; opacity: 1; }
}

@keyframes mail-impact-shake {
  0%, 72%, 100% { rotate: 0deg; }
  78%, 88% { rotate: -4deg; }
  83%, 94% { rotate: 3deg; }
}

.footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1rem 1rem 1.65rem;
  background: #ffe548;
  color: #111;
  text-align: center;
}

.footer__content {
  position: relative;
  z-index: 1;
}

.footer img {
  display: block;
  height: auto;
}

.footer__festival {
  display: block;
  width: clamp(16rem, 40vw, 32rem);
  max-width: 100%;
  margin-inline: auto;
}

.footer__festival img {
  width: 100%;
  border: 1px solid #222;
  box-shadow: 2px 3px #222;
}

.bubble-link {
  position: relative;
  display: block;
  color: #111;
  font-family: var(--font-display);
  text-decoration: none;
  transition: color 180ms ease-out;
}

.bubble-link img {
  display: block;
  width: 100%;
  height: auto;
}

.bubble-link::before {
  position: absolute;
  inset: 0;
  background: url("../assets/images/about/about-button-hover-bg.png") center / contain no-repeat;
  opacity: 0;
  transition: opacity 180ms ease-out;
  pointer-events: none;
  content: "";
}

.bubble-link span {
  position: absolute;
  inset: 0 2% 29% 0;
  display: grid;
  place-items: center;
  padding-inline: .5rem;
}

.bubble-link:focus-visible { color: #fff; text-shadow: 0 1px 2px #6f2031; }
.bubble-link:focus-visible::before { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .bubble-link:hover { color: #fff; text-shadow: 0 1px 2px #6f2031; }
  .bubble-link:hover::before { opacity: 1; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .bubble-link { transition: color 180ms ease-out, scale 180ms ease-out; }
  .bubble-link:hover { scale: 1.04; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-link,
  .bubble-link::before { transition: none; }
}

.footer__partners img { width: 100%; }

.footer__partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4rem, 16vw, 15rem);
  margin-top: clamp(4rem, 9vw, 8rem);
}

.footer__ann { width: clamp(7rem, 12vw, 10.75rem); }
.footer__shueisha { width: clamp(5.5rem, 8vw, 7.25rem); }

.footer__copyright {
  display: block;
  margin: clamp(3.2rem, 6vw, 5.5rem) auto 0;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.4;
}

.footer__deco {
  position: absolute;
  pointer-events: none;
}

.footer__deco img { width: 100%; }

.footer__deco--left {
  bottom: clamp(-9rem, -10vw, -4rem);
  left: clamp(-12rem, -13vw, -5rem);
  width: clamp(21rem, 49vw, 49rem);
  transform-origin: left bottom;
}

.footer__deco--right {
  right: clamp(-11rem, -11vw, -4rem);
  bottom: clamp(-8rem, -9vw, -4rem);
  width: clamp(20rem, 45vw, 44rem);
  transform-origin: right bottom;
}

@media (max-width: 600px) {
  .footer { padding-top: .15rem; padding-bottom: 1.35rem; }

  .footer__festival { width: clamp(15rem, 79vw, 20rem); }

  .footer__partners {
    flex-direction: column;
    gap: clamp(2.8rem, 12vw, 3.55rem);
    margin-top: 2.65rem;
  }

  .footer__ann { width: clamp(7.75rem, 37vw, 9.75rem); }
  .footer__shueisha { width: clamp(5.75rem, 27vw, 7.25rem); }
  .footer__copyright { margin-top: 2.75rem; font-size: .62rem; }

  .footer__deco--left {
    bottom: clamp(-6rem, -17vw, -3.5rem);
    left: clamp(-9.5rem, -24vw, -5.5rem);
    width: clamp(11rem, 60vw, 18rem);
  }

  .footer__deco--right {
    right: clamp(-11rem, 9.9rem - 64vw, -4.75rem);
    bottom: clamp(-6.5rem, -13.5vw, -3.25rem);
    width: clamp(11.75rem, 64vw, 19rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .footer__deco--left { animation: footer-deco-breathe 7.5s ease-in-out infinite; }
  .footer__deco--right { animation: footer-deco-breathe 9s -3s ease-in-out infinite; }
}

@keyframes footer-deco-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
