:root {
  --color-bg: #00c2ff;
  --color-text: #111;
  --color-muted: #333;
  --color-placeholder: #c8c8c8;
  --color-modal-backdrop: rgba(0, 0, 0, 0.57);
  --radius-modal: 40px;
  --radius-more: 28px;
  --content-max: 860px;
  --section-gap: clamp(72px, 10vw, 140px);
  --font-body: "fot-seurat-pron", "Hiragino Maru Gothic ProN", sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100%;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.7;
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  cursor: pointer;
}

/* ---------- Background layers ---------- */
.bg-layers {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-layers__grid {
  position: absolute;
  /* extended upward so the scroll parallax shift never reveals the layer's top edge */
  inset: -1400px 0 0;
  background-color: var(--color-bg);
  /* haikei-lines.png = haikei.png with the black base knocked out (white lines + alpha) */
  background-image: url("../assets/haikei-lines.png"); /* fallback */
  background-image: image-set(
    url("../assets/haikei-lines.webp") type("image/webp"),
    url("../assets/haikei-lines.png") type("image/png")
  );
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% auto;
  will-change: transform;
}

/* transform carrier for scroll parallax (the illust itself is animated separately) */
.bg-layers__illust-wrap {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.bg-layers__illust {
  position: absolute;
  /* float amplitude (reduced on small screens) */
  --float-amp: 0.5%;
  /* starts below the first view; the offset also absorbs the upward float drift */
  top: calc(max(100svh, 560px) + 48px);
  bottom: 0;
  left: 50%;
  width: 120%;
  background-image: url("../assets/bg-illust.png"); /* fallback */
  background-image: image-set(
    url("../assets/bg-illust.webp") type("image/webp"),
    url("../assets/bg-illust.png") type("image/png")
  );
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 100% auto;
  transform: translateX(-50%);
  animation: illust-float 20s ease-in-out infinite;
  will-change: transform;
}

@keyframes illust-float {
  0%,
  100% {
    transform: translateX(-50%) translate3d(0, 0, 0);
  }
  33% {
    transform: translateX(-50%) translate3d(var(--float-amp), calc(var(--float-amp) * -1), 0);
  }
  66% {
    transform: translateX(-50%) translate3d(calc(var(--float-amp) * -1), var(--float-amp), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-layers__illust {
    animation: none;
  }
}

/* ---------- Page shell ---------- */
.page {
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--section-gap) 20px 0;
}

.section__inner {
  width: min(100%, var(--content-max));
  margin-inline: auto;
}

.section__title {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto clamp(36px, 5vw, 56px);
}

.section__title img {
  width: 100%;
}

.event .section__title img,
.about .section__title img,
.profile .section__title img,
.instagram .section__title img {
  width: auto;
  height: 45px;
  margin-inline: auto;
}

/* ---------- First View ---------- */
.fv {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

.fv__slider,
.fv .splide,
.fv .splide__track,
.fv .splide__list,
.fv .splide__slide {
  height: 100%;
}

.fv .splide__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.fv__title {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.fv__title img {
  width: min(78vw, 740px);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.35));
}

.fv .splide__pagination {
  bottom: 28px;
}

.fv .splide__pagination__page {
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
}

.fv .splide__pagination__page.is-active {
  background: #111;
  transform: scale(1.15);
}

/* ---------- Cards shared ---------- */
.card-grid {
  display: grid;
  gap: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 36px);
}

.card-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.card--link {
  text-decoration: none;
  transition: transform 0.25s ease;
}

.card--link:hover,
.card--link:focus,
.card--link .card__title {
  text-decoration: none;
}

.card--link:hover {
  transform: translateY(-4px);
}

.card--button {
  cursor: pointer;
}

.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-placeholder);
}

.card__media img:not(.card__label) {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* sticker-style label overhanging the thumbnail corner */
.card__label {
  position: absolute;
  top: -30px;
  left: -30px;
  z-index: 1;
  width: 100px;
  height: auto;
  pointer-events: none;
}

.card__label[src*="label-natsutaya"] {
  width: 85px;
}

.card__label[src*="label-owari"] {
  width: 65px;
}

.card__label[src*="label-mousugu"] {
  width: 96px;
}

.card__body {
  margin-top: 14px;
}

/* Align the date row across columns: each card shares the parent grid's row
   tracks (media / title / [texts] / date), so the tallest title in a row
   defines the track and every date starts at the same height. */
.summer-fair .card,
.special-day .card,
.event .card {
  display: grid;
  grid-template-rows: subgrid;
  row-gap: 0;
}

.summer-fair .card {
  grid-row: span 3; /* media / title / date */
}

.special-day .card {
  grid-row: span 4; /* media / title / text / date */
}

.event .card {
  grid-row: span 4; /* media / title / desc (subtitle + text) / date */
}

.summer-fair .card__body,
.special-day .card__body,
.event .card__body {
  display: contents;
}

/* body margin is lost with display:contents — carry it on the title */
.summer-fair .card__title,
.special-day .card__title,
.event .card__title {
  margin-top: 14px;
}

.card__title {
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 700;
  line-height: 1.4;
}

.card__date {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
}

.card__date--boxed {
  display: inline-block;
  width: fit-content;
  justify-self: start; /* keep fit-content width as a subgrid item */
  align-self: start; /* own content height — don't stretch to the row's tallest date */
  margin-top: 12px;
  padding: 8px 16px;
  border: 1.5px solid var(--color-text);
  border-radius: var(--radius-more);
  word-break: break-all;
  line-height: 1.4;
}

.card__subtitle {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.card__text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-muted);
}

.card__text--long {
  font-size: 12px;
}

/* ---------- Special Day ---------- */
.special-day .card:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.special-day .card-grid {
  column-gap: 100px;
}

.special-day .card__title {
  font-size: 30px;
}

/* ---------- Summer Fair ---------- */
.summer-fair .card-grid {
  gap: 50px;
}

.summer-fair .card__title {
  font-size: 18px;
}

.summer-fair .card__date {
  line-height: 1;
}

/* ---------- Event ---------- */
.event .card-grid {
  column-gap: 120px;
}

.event .card__title {
  font-size: 24px;
}

.event .card__subtitle {
  font-size: 15px;
}

.event .card__date {
  font-size: 18px;
}

/* ---------- Content box (About / Profile) ---------- */
.content-box {
  border: 2px solid var(--color-text);
  border-radius: var(--radius-modal);
  background-color: var(--color-bg);
  background-image: url("../assets/haikei-lines.png"); /* fallback */
  background-image: image-set(
    url("../assets/haikei-lines.webp") type("image/webp"),
    url("../assets/haikei-lines.png") type("image/png")
  );
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 200% auto;
  padding: clamp(32px, 4vw, 52px) clamp(24px, 3.6vw, 40px);
}

/* ---------- Instagram ---------- */
.instagram__link {
  display: block;
  transition: transform 0.25s ease;
}

.instagram__link:hover {
  transform: translateY(-4px);
}

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

/* ---------- About ---------- */
.about__text {
  text-align: left;
  font-size: 22px;
  line-height: 2;
}

.about__text p + p {
  margin-top: 1.2em;
}

/* three images in a row inside the about box */
.about__gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.5vw, 16px);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.about__gallery li {
  list-style: none;
}

.about__gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ---------- Profile ---------- */
.profile-card__media {
  width: min(100%, 220px);
  background: #fff;
}

.profile-card__body {
  margin-top: 12px;
  text-align: left;
}

.profile-card__role {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.profile-card__name {
  font-size: 20px;
  font-weight: 700;
}

.profile-card__text {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--color-muted);
  text-align: left;
}

.profile-card__sns {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  word-break: break-all;
  font-size: 11px;
  font-weight: 700;
}

.profile-card__sns a {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #0000ff;
}

.profile-card__sns a:hover {
  text-decoration: none;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: clamp(64px, 8vw, 100px) 20px 40px;
  text-align: center;
}

.site-footer__copy {
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-modal-backdrop);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  /* tall enough for the current content; overflow kicks in only if content grows */
  max-height: min(94svh, 1000px);
  overflow: auto;
  border-radius: var(--radius-modal);
  background-color: var(--color-bg);
  background-image: url("../assets/haikei-lines.png"); /* fallback */
  background-image: image-set(
    url("../assets/haikei-lines.webp") type("image/webp"),
    url("../assets/haikei-lines.png") type("image/png")
  );
  background-repeat: repeat;
  background-position: center;
  background-size: 100% auto;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s ease;
}

.modal.is-open .modal__dialog {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 24px;
  line-height: 1;
}

.modal__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(28px, 4vw, 48px);
}

.modal__title {
  font-size: 35px;
  font-weight: 700;
  line-height: 1.4;
  padding-right: 36px;
}

.modal__text {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--color-muted);
}

.modal__date {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modal__date--boxed {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 20px;
  border: 1.5px solid var(--color-text);
  border-radius: var(--radius-more);
  line-height: 1.4;
}

.modal__media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 24px;
}

/* one image: single full-width column */
.modal__media--single {
  grid-template-columns: 1fr;
}

.modal__media-item {
  background: var(--color-placeholder);
  overflow: hidden;
}

/* placeholder box when no image is set */
.modal__media-item--empty {
  aspect-ratio: 1 / 1;
}

.modal__media img {
  display: block;
  width: 100%;
  height: auto;
}

.modal__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  margin-top: 28px;
  padding: 12px 48px;
  border: 1.5px solid var(--color-text);
  border-radius: var(--radius-more);
  background: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal__more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.modal__more[hidden] {
  display: none;
}

body.is-modal-open {
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .card-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .special-day .card-grid,
  .event .card-grid {
    column-gap: clamp(24px, 10vw, 100px);
  }

  .modal__title {
    font-size: clamp(24px, 4.5vw, 35px);
  }
}

@media (max-width: 640px) {
  .card-grid--2,
  .card-grid--3 {
    grid-template-columns: 1fr;
  }
  
  .card__date {
    font-size: 15px;
  }
  .card__text {
    margin-top: 0;
  }

  /* portrait first view matching the SP slide images */
  .fv {
    height: auto;
    aspect-ratio: 1080 / 1920;
    min-height: 0;
  }

  .fv .splide__slide img {
    /* object-fit: cover; */
  }

  /* illust layer follows the portrait FV height (100vw * 1920/1080), starting below it */
  .bg-layers__illust {
    --float-amp: 0.35%;
    top: calc(100vw * 1920 / 1080 + 32px);
    width: 140%;
  }

  /* 40px side padding for all content */
  .section {
    padding-inline: 40px;
  }

  /* double the desktop row gaps for stacked (1-column) grids */
  .card-grid {
    row-gap: clamp(56px, 8vw, 96px);
  }

  .summer-fair .card-grid {
    row-gap: 50px;
  }

  /* title sits at the bottom of the slide area, clear of the illustration */
  .fv__title {
    place-items: end center;
    padding-bottom: 16px;
  }

  /* slightly larger first-view title */
  .fv__title img {
    width: 88vw;
  }

  /* about text */
  .about__text {
    font-size: 20px;
  }

  .special-day .card__title {
    font-size: 24px;
  }

  /* section titles at 2/3 size */
  .section__title img {
    width: 66.7%;
    margin-inline: auto;
  }

  .event .section__title img,
  .about .section__title img,
  .profile .section__title img,
  .instagram .section__title img {
    width: auto;
    height: 30px;
  }
  
  .event .card__subtitle {
    margin-top: -8px;
  }
  .event .card__text {
    margin-top: 4px;
  }
  
  .profile-card__media {
    margin-inline: 30px;
    width: auto;
  }
}
