html {
  scroll-behavior: smooth;
  @media (768px <= width) {
    font-size: 62.5%;
  }
  @media (width < 768px) {
    font-size: calc(100vw / 37.5);
  }
}

body {
  font-family: var(--font-main);
  font-size: 1.6rem;
  font-optical-sizing: auto;
  font-feature-settings: "palt";
  line-height: 1.6;
  letter-spacing: .1em;
  position: relative;
  @media (768px <= width) {
    display: grid;
    grid-template-columns: 1fr minmax(500px, 600px) minmax(5vw, 110px);
    background: rgb(16, 16, 16) url("../img/bg.webp") center center / cover no-repeat fixed;
    background-size: cover;
  }
  @media (width < 768px) {
    font-size: 1.4rem;
    &::before{
      content: '';
      position: fixed;
      inset: 0;
      z-index: -1;
      background: rgb(16, 16, 16) url("../img/bg-sp.webp") center center / cover no-repeat;
    }
  }
}

.toggle-btn {
  display: none;
  @media (width < 768px) {
    display: block;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 90;
    background: var(--color-white);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    &.show {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }
    &::before, &::after {
      content: '';
      position: absolute;
      left: 20%;
      width: 60%;
      height: 1px;
      background: #000;
      transition: all .3s ease;
      top: 50%;
    }
    &::before {
      margin-top: -4px;
    }
    &::after {
      margin-top: 4px;
    }

    /* アクティブ状態（×マーク） */
    &.is-active {
      &::before {
        margin-top: 0;
        transform: rotate(45deg);
      }
      &::after {
        margin-top: 0;
        transform: rotate(-45deg);
      }
    }
  }
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0 30px;
  @media (width < 768px) {
    width: 100%;
    position: fixed;
    background: url('../img/bg-sp.webp') no-repeat center center fixed;
    z-index: 80;
    transform: translateY(-100%);
    transition: transform 0.3s ease;

    &.is-active {
      transform: translateX(0);
    }
  }
  nav {
    margin-top: 40px;
    a {
      display: block;
      color: #ffffff;
      text-align: center;
      font-family: var(--font-en);
      transition: all .5s var(--ease);
      @media (768px <= width) {
        font-size: 3.6rem;
      }
      @media (width < 768px) {
        font-size: 2.6rem;
      }
      &:hover {
        opacity: .6;
      }
    }
  }
}

/* メニューオープン時のbody固定 */
body.menu-open {
  @media (width < 768px) {
    overflow: hidden;
  }
}

.mv {
  background: #fff;
  overflow: hidden;
  height: 100dvh;
  @media (768px <= width) {
    display: flex;
    flex-direction: column;
  }
  .img-slider {
    display: flex;
    height: calc( ( 100vh - 160px ) / 2);
    width: max-content;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    img {
      height: 100%;
      width: auto;
      object-fit: cover;
    }
    &.left {
      animation-name: slideLeft;
      animation-duration: 20s;
    }
    &.right {
      animation-name: slideRight;
      animation-duration: 25s;
    }
  }
  .logo {
    height: 160px;
    display: grid;
    place-content: center;
    img {
      width: 440px;
      max-width: 90%;
      margin: 0 auto;
      filter: invert(100%);
    }
  }
}

@keyframes slideLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes slideRight {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

.section-title {
  text-align: center;
  font-family: var(--font-en);
  font-size: 4.8rem;
  + * {
    margin-top: 40px;
  }
  &::before{
    content: '-';
    margin-right: 10px;
  }
  &::after{
    content: '-';
    margin-left: 10px;
  }
  @media (width < 768px) {
    font-size: 3.6rem;
  }
  &.is-white {
    color: var(--color-white);
    &::before, &::after {
      color: var(--color-white);
    }
  }
}

.btn {
  display: block;
  width: 260px;
  background: var(--color-black);
  color: var(--color-white);
  padding: 12px 24px;
  text-align: center;
  margin: 0 auto;
  span {
    display: inline-block;
    padding-right: 40px;
    position: relative;
    &::before, &::after {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }
    &::before {
      content: "■";
      right: 0;
      font-size: .8rem;
      transition: all .4s var(--ease);
    }
    &::after{
      content: '';
      right: 1.5rem;
      width: 12px;
      height: 1px;
      background: #fff;
    }
  }
  &:hover {
    span::before{
      transform: translateX(4px) translateY(-50%);
    }
  }
  &.is-white {
    background: var(--color-white);
    color: var(--color-black);
    span {
      &::before {
        color: var(--color-black);
      }
      &::after {
        background: var(--color-black);
      }
    }
  }
}

* + .btn {
  margin-top: 40px;
}

.t-center {
  text-align: center;
}

.mark-list {
	list-style-type: disc;
	padding-left: 1em;
}

section {
  padding: 112px 0;
}

.inner {
  width: 90%;
  margin: 0 auto;
}

#about {
  background: var(--color-black);
  color: var(--color-white);
  p {
    line-height: 2.2;
  }
}

.bnr-area {
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(2px);

  .bnr-list {
    display: flex;
    flex-direction: column;
    gap: 24px;

    /* バナーがある場合のみpadding適用 */
    &:has(.bnr-item),
    &.has-items {
      padding: 120px 0 0;
    }
  }

  .bnr-item {
    a {
      display: block;
      transition: all .5s;
      &:hover {
        opacity: .6;
      }
    }
  }
}

#news {
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(2px);
  h2 {
    color: var(--color-white);
  }
  .news-area {
    background: var(--color-white);
    padding: 20px 30px 40px;
  }
  .news-list {
    li {
      border-bottom: 1px solid var(--color-gray-light);
    }
    a {
      display: block;
      padding: 20px 0;
      width: 100%;
      display: flex;
      gap: 0 10px;
      flex-wrap: wrap;
      align-items: center;
    }
    time {
      font-size: 1.8rem;
      font-family: var(--font-en);
      color: var(--color-gray-dark);
    }
    .category {
      border: 1px solid #000;
      padding: 4px 6px 2px;
      line-height: 1;
      font-size: 1.4rem;
      font-family: var(--font-en);
      line-height: 1;
      &.category-castinfo {
        background-color: var(--color-black);
        color: var(--color-white);
      }
    }
    .news-content {
      width: 100%;
      margin-top: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .external-link-icon {
      position: relative;
      width: 1.3rem;
      height: 1.3rem;
      &::after,
      &::before {
        content: "";
        position: absolute;
        width: 1rem;
        height: 1rem;
        border: 2px solid var(--color-gray-dark);
        background: #fff;
        box-sizing: border-box;
        border-radius: 2px;
      }
      &::before {
        top: 0;
        right: 0;
        z-index: 2;
      }
      &::after {
        top: 0.3rem;
        right: 0.3rem;
        z-index: 1;
      }
    }
  }
  .read-more-btn {
    font-family: var(--font-en);
    text-align: center;
    width: 100%;
    font-size: 1.8rem;
    margin-top: 10px;
    padding: 10px 0 0;
  }
}

#cast {
  background: var(--color-black);
  color: var(--color-white);
  .cast-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
  .category {
    border: 1px solid #fff;
    color: #fff;
    padding: 8px;
    line-height: 1;
    font-size: 1.8rem;
    font-family: var(--font-en);
    line-height: 1;
    display: inline-block;
    margin-top: 16px;
  }
  .name {
    font-size: 2.4rem;
    margin-top: 16px;
    span {
      display: block;
    }
    .jp {
      font-weight: 600;
    }
    .en {
      font-size: 1.8rem;
      font-family: var(--font-en);
    }
  }
}

#wanted {
  background: var(--color-white);
}

#contact {
  background: var(--color-black);
  color: var(--color-white);
}

footer {
  background: var(--color-white);
  .inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 30px;
    overflow: hidden;
  }
  .logo {
    margin-bottom: 30px;
    display: block;
    transition: all .5s var(--ease);
    @media (width < 768px) {
      width: 120px;
    }
    &:hover {
      opacity: .6;
    }
  }
  .sns-list {
    margin-bottom: 30px;
    padding-left: 10vw;
    display: flex;
    gap: 20px;
    img {
      height: 24px;
    }
  }
  .pagetop {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 10px 0 0 10px;
    .text {
      font-family: var(--font-en);
      font-size: 1.8rem;
    }
    svg {
      display: block;
      transform: translateY(5px);
      transition: all .5s var(--ease);
    }
    &:hover {
      svg {
        transform: translateY(0);
      }
    }
  }
}

aside {
  display: flex;
  justify-content: center;
  align-items: center;
  @media (768px <= width) {
    height: 100vh;
    position: sticky;
    top: 0;
  }
  @media (width < 768px) {
    display: none;
  }
  small {
    color: #fff;
    font-family: var(--font-en);
    white-space: nowrap;
    @media (768px <= width) {
      transform: rotate(-90deg);
      font-size: 1.1rem;
    }
  }
}

/* ===== キャストモーダル・スライダー ===== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 90;
}

.cast-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  .modal-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-white);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    @media (768px <= width) {
      width: 1200px;
      padding: 56px;
      display: grid;
      grid-template-columns: 420px auto;
      gap: 56px;
    }
    @media (width < 768px) {
      width: 90vw;
      padding: 40px 20px;
    }
  }
  .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    background: var(--color-black);
    z-index: 10;
    @media (width < 768px) {
      width: 22px;
      height: 22px;
      top: 10px;
      right: 10px;
    }
    &::before, &::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 24px;
      height: 2px;
      background: #fff;
      transform-origin: center;
    }
    &::before {
      transform: translate(-50%, -50%) rotate(45deg);
    }
    &::after {
      transform: translate(-50%, -50%) rotate(-45deg);
    }
  }
  .close-area {
    display: block;
    margin-top: 30px;
    font-family: var(--font-en);
    font-size: 1.8rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    transition: all 0.4s ease 0.5s;
    background: var(--color-black);
    color: var(--color-white);
    margin: 30px -20px -40px;
    padding: 5px 10px;
    @media (768px <= width) {
      display: none;
    }
    &:hover {
      span {
        transform: translateX(-4px);
      }
    }
  }
  .detail-box {
    @media (width < 768px) {
      margin-top: 30px;
    }
    .category {
      border: 1px solid var(--color-black);
      padding: 8px;
      line-height: 1;
      font-size: 1.8rem;
      font-family: var(--font-en);
      line-height: 1;
      display: inline-block;
      margin-top: 16px;
    }
    .name {
      font-size: 3.2rem;
      span {
        display: block;
      }
      .jp {
        margin-top: 10px;
        font-weight: 600;
      }
      .en {
        font-size: 1.8rem;
        font-family: var(--font-en);
      }
    }
    .sns-list {
      display: flex;
      gap: 20px;
      align-items: center;
      justify-content: flex-end;
      margin-top: -20px;
      img {
        max-height: 24px;
        object-fit: contain;
      }
    }
    .profile {
      border-top: 1px solid var(--color-black);
      padding-top: 20px;
      margin-top: 20px;
      > dl {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 5px 20px;
        dd {
          font-weight: 600;
        }
      }
      .text-area {
        margin-top: 20px;
        dl {
          display: grid;
          grid-template-columns: auto 1fr;
          gap: 5px .5em;
          font-size: 1.5rem;
          @media (width < 768px) {
            font-size: 1.3rem;
          }
          dt {
            &::after {
              content: '：';
              margin-left: .5em;
            }
          }
        }
        h4 {
          font-weight: 600;
        }
        > * + * {
          margin-top: 20px;
        }
        > p {
          margin-top: 10px;
        }
        > h4 + ul {
          margin-top: 10px;
        }
      }
    }
  }
}

.cast-item {
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  &:hover {
    transform: scale(1.02);
  }
  &:nth-child(-n+2) {
    padding-bottom: 36px;
  }
  &:nth-child(1)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(200% + 36px);
    height: 1px;
    background: var(--color-white);
  }
}

.img-slide {
  position: relative;
}

.slider-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px; /* 画像とドットの間隔 */
}

.slider-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 420 / 582; /* 約 5:7 の縦長画像 */
}

.img-slider {
  display: flex;
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.slide {
  min-width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.slide.active {
  opacity: 1;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background 0.2s ease;
    &.active {
      background: rgba(0, 0, 0, 0.8);
    }
  }
}

article {
  background: #FFFFFF33;
  min-height: 100vh;
  padding: 112px 0;
  .news-detail {
    background: var(--color-white);
    width: 90%;
    margin: 40px auto;
    padding: 56px 30px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    &.loaded {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .publishedAt {
    font-family: var(--font-en);
    font-size: 1.8rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.2s;

    .loaded & {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .title {
    font-size: 2rem;
    font-weight: 600;
    border-bottom: 1px solid #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.3s;

    .loaded & {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .content {
    font-size: 1.4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.4s;
    word-break: break-all;
    .loaded & {
      opacity: 1;
      transform: translateY(0);
    }
    > p + p {
      margin-top: 20px;
    }
    > * + * {
      margin-top: 30px;
    }
  }
  .back {
    display: block;
    margin-top: 30px;
    font-family: var(--font-en);
    font-size: 1.8rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.5s;
    .loaded & {
      opacity: 1;
      transform: translateY(0);
    }
    span {
      transition: all .4s ease;
    }
    &:hover {
      span {
        transform: translateX(-4px);
      }
    }
  }
  .error-article {
    text-align: center;
    padding: 30px 0 40px;
    .error-title {
      font-size: 2rem;
    }
    .error-message {
      margin-top: 20px;
      color: var(--color-gray-dark);
      font-size: 1.4rem;
    }
  }

  .preview-badge {
    background: var(--color-gray-dark);
    font-family: var(--font-en);
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-size: 1.4rem;
    z-index: 100;
    margin: -56px -30px 20px -30px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease 0.1s;

    .loaded & {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ===== Intersection Observer アニメーション ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;

  &.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-delay {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;

  &.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-scale {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.5s ease;

  &.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;

  &.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ロゴ弾力アニメーション ===== */
@keyframes logoBounce {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  75% {
    opacity: 1;
    transform: scale(1.1, 0.9) translate(0%, 5%);
  }
  80% {
    transform: scale(0.95, 1.05) translate(0%, -3%);
  }
  100% {
    opacity: 1;
    transform: scale(1, 1) translate(0%, 0%);
  }
}

.logo-bounce {
  animation: logoBounce 0.8s ease-out;
  animation-fill-mode: both;
}

/* ヘッダーロゴ用（TOPページのみ初期非表示） */
body.top-page header .site-logo {
  opacity: 0;
  transform: scale(0);

  &.logo-bounce {
    animation: logoBounce 0.8s ease-out 0.3s;
    animation-fill-mode: both;
  }
}

/* ヘッダーメニュー用（TOPページのみ初期非表示） */
body.top-page header nav {
  opacity: 0;
  transition: all 0.3s ease;

  &.nav-fade-in {
    animation: navFadeIn 0.6s ease-out 0.5s;
    animation-fill-mode: both;
  }
}

@keyframes navFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
