.roots .roots-intro__head {
  width: fit-content;
  margin-inline: auto;
}

.roots .roots-intro__jp {
  margin-top: -0.5em;
  text-align: right;
}

@media screen and (max-width: 768px) {
  .roots .gallery-hero__img-wrap {
    aspect-ratio: 35/24;
  }
}
@media screen and (max-width: 768px) {
  .roots .gallery-hero__page-label {
    display: block;
  }
}

.roots-episodes {
  background: #029b79;
  padding-top: clamp(40px, 4.1vw, 79px);
}
.roots-episodes__head {
  padding-inline: clamp(20px, 11.77vw, 226px);
  margin-bottom: clamp(20px, 2vw, 40px);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: clamp(16px, 2vw, 40px);
}
.roots-episodes__head-en {
  grid-column: 1;
  grid-row: 1;
  font-family: "Jost", sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.5rem, 5.21vw, 6.25rem);
  line-height: 1;
  color: #ffffff;
  letter-spacing: -0.022em;
}
.roots-episodes__head-note {
  margin-bottom: clamp(16px, 2.4vh, 36px);
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 0.9vw, 16px);
  border: 1px solid #ffffff;
  padding: clamp(6px, 0.6vw, 12px) clamp(12px, 1.2vw, 24px);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(0.75rem, 1.1vw, 1.125rem);
  line-height: 1;
  color: #ffffff;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.roots-episodes__head-note-icon {
  flex-shrink: 0;
  width: clamp(16px, 1.4vw, 26px);
  height: auto;
  aspect-ratio: 1/1;
}
@media screen and (max-width: 768px) {
  .roots-episodes__head {
    grid-template-columns: 1fr;
  }
}
@media screen and (max-width: 1024px) {
  .roots-episodes__head-note {
    white-space: normal;
    gap: 6px;
    padding: 6px 8px;
    font-size: clamp(0.625rem, 2.6vw, 0.875rem);
    line-height: 1.4;
    letter-spacing: 0.04em;
  }
  .roots-episodes__head-note-icon {
    width: clamp(12px, 3vw, 20px);
  }
}
.roots-episodes__head-jp {
  grid-column: 1/-1;
  grid-row: 2;
  margin-top: clamp(6px, 0.6vw, 12px);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 1.04vw, 1.25rem);
  color: #ffffff;
  letter-spacing: 0.128em;
}
.roots-episodes__layout {
  display: flex;
  align-items: flex-start;
}
.roots-episodes__nav {
  position: sticky;
  top: 0;
  flex: 0 0 50%;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding-inline: 0;
}
.roots-episodes__nav-list {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.8vh, 30px);
  list-style: none;
  width: 100%;
  padding-right: clamp(10px, 2vw, 40px);
}
.roots-episodes__nav-item {
  text-align: right;
  opacity: 0.3;
  transition: opacity 0.4s ease;
}
.roots-episodes__nav-item a {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}
.roots-episodes__nav-item.is-active {
  opacity: 1;
}
.roots-episodes__nav-en {
  font-family: "Jost", sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5625rem, 8vh, 5.625rem);
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.022em;
  transition: font-size 0.4s ease;
}
.is-active .roots-episodes__nav-en {
  font-size: clamp(1.875rem, 12vh, 7.5rem);
}
.roots-episodes__nav-sub {
  margin-top: clamp(4px, 0.4vw, 8px);
  display: inline-block;
  background: #029b79;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(0.6875rem, 1.5vh, 1.125rem);
  color: #ffffff;
  letter-spacing: 0.128em;
  line-height: 1.5;
}
.roots-episodes__content {
  flex: 1 1 50%;
  min-width: 0;
}
@media screen and (max-width: 1024px) {
  .roots-episodes__nav {
    flex: 0 0 auto;
    width: clamp(76px, 26vw, 200px);
    padding-inline: 0;
    align-items: flex-start;
  }
  .roots-episodes__nav-list {
    gap: clamp(10px, 2.4vh, 24px);
  }
  .roots-episodes__nav-item {
    text-align: right;
  }
  .roots-episodes__nav-item a {
    align-items: flex-end;
  }
  .roots-episodes__nav-en {
    font-size: clamp(1rem, 4.4vw, 1.75rem);
  }
  .is-active .roots-episodes__nav-en {
    font-size: clamp(1rem, 5vw, 1.875rem);
  }
  .roots-episodes__nav-sub {
    font-size: clamp(0.5625rem, 2.5vw, 0.8125rem);
    line-height: 1.4;
  }
}

.roots-ep {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, max-content);
  justify-content: center;
  align-content: center;
  padding: clamp(40px, 6vw, 120px) clamp(24px, 5vw, 100px);
  overflow: hidden;
}
.roots-ep__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.roots-ep__title {
  position: relative;
  z-index: 1;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.08vw, 2.5rem);
  color: #ffffff;
  line-height: 1.4;
  letter-spacing: 0.06em;
  margin-bottom: clamp(20px, 1.56vw, 30px);
}
.roots-ep__body {
  position: relative;
  z-index: 1;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(0.9375rem, 1.25vw, 1.5rem);
  color: #ffffff;
  line-height: 2;
  letter-spacing: 0.04em;
}
.roots-ep__body > p + p {
  margin-top: 2em;
}
@media screen and (max-width: 1024px) {
  .roots-ep {
    padding: clamp(30px, 8vw, 60px) clamp(16px, 4vw, 32px);
  }
}
.roots-ep .roots-ep__title::before,
.roots-ep .roots-ep__body::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.85);
  z-index: 1;
  transform: scaleY(0);
  transition: transform 0.6s ease;
}
.roots-ep .roots-ep__title::before {
  bottom: 100%;
  height: 55vh;
  transform-origin: bottom center;
}
.roots-ep .roots-ep__body::after {
  top: 100%;
  height: 55vh;
  transform-origin: top center;
}
.roots-ep:first-child .roots-ep__title::before {
  content: none;
}
.roots-ep:last-child .roots-ep__body::after {
  content: none;
}

.roots-ep__title.is-inview::before,
.roots-ep__body.is-inview::after {
  transform: scaleY(1);
}

.roots-history {
  background: #029b79;
  padding: clamp(20px, 3vw, 60px) clamp(16px, 2vw, 40px) clamp(40px, 5vw, 100px);
}
.roots-history__inner {
  max-width: 1720px;
  margin-inline: auto;
  background: #ffffff;
  border: clamp(8px, 2.66vw, 51px) solid #029b79;
  padding: clamp(30px, 5.21vw, 100px) clamp(16px, 6vw, 150px) clamp(40px, 7.8vw, 150px);
}
@media screen and (max-width: 768px) {
  .roots-history__inner {
    padding-left: 0;
    padding-right: 0;
  }
}
.roots-history__head {
  margin-bottom: clamp(24px, 2.76vw, 53px);
}
@media screen and (max-width: 768px) {
  .roots-history__head {
    padding: 0 clamp(16px, 6vw, 150px);
    text-align: center;
  }
}
.roots-history__head-en {
  font-family: "Jost", sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.75rem, 5.21vw, 6.25rem);
  line-height: 1;
  color: #029b79;
  letter-spacing: -0.022em;
}
.roots-history__head-jp {
  margin-top: clamp(6px, 0.6vw, 12px);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 1.04vw, 1.25rem);
  color: #029b79;
  letter-spacing: 0.128em;
}
.roots-history__timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(12px, 1.3vw, 25px) 0;
}
@media screen and (max-width: 768px) {
  .roots-history__timeline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 3vw, 20px);
    align-items: stretch;
  }
}

.rh-break {
  flex: 0 0 100%;
  width: 100%;
  height: 0;
  margin: 0;
}
@media screen and (max-width: 1024px) {
  .rh-break {
    display: none;
  }
}

.rh-item {
  position: relative;
  flex: 0 0 auto;
  min-width: clamp(120px, 12vw, 240px);
  padding: clamp(12px, 1.04vw, 20px) clamp(10px, 1vw, 20px);
  text-align: center;
}
.rh-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid #029b79;
  transform: scale(0.92);
  opacity: 0;
}
.rh-item--pink::before {
  border-color: #f5577f;
}
.rh-item__year {
  position: relative;
  display: block;
  font-family: "Jost", sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.5rem, 5.21vw, 6.25rem);
  line-height: 1;
  color: #029b79;
  letter-spacing: -0.022em;
  opacity: 0;
}
.rh-item--pink .rh-item__year {
  color: #f5577f;
}
.rh-item__desc {
  position: relative;
  margin-top: clamp(6px, 0.6vw, 12px);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 1.04vw, 1.25rem);
  color: #029b79;
  letter-spacing: 0.128em;
  line-height: 1.5;
  opacity: 0;
}
.rh-item.is-in::before {
  animation: rh-border 0.4s ease forwards;
}
.rh-item.is-in .rh-item__year {
  animation: rh-num 0.5s ease forwards 0.35s;
}
.rh-item.is-in .rh-item__desc {
  animation: rh-jp 0.5s ease forwards 0.7s;
}
@media screen and (max-width: 1024px) {
  .rh-item {
    min-width: 0;
    padding: clamp(8px, 1.4vw, 16px) clamp(8px, 1.2vw, 16px);
  }
  .rh-item__year {
    font-size: clamp(1.75rem, 4vw, 3rem);
  }
  .rh-item__desc {
    font-size: clamp(0.625rem, 1.3vw, 0.8125rem);
    margin-top: 4px;
    text-align: left;
  }
}
@media screen and (max-width: 768px) {
  .rh-item {
    grid-column: var(--gc);
    grid-row: var(--gr);
    min-width: 0;
    padding: clamp(12px, 3vw, 20px) clamp(14px, 4vw, 24px);
  }
  .rh-item__year {
    font-size: clamp(1.75rem, 9vw, 2.75rem);
  }
}
@media screen and (max-width: 768px) and (max-width: 768px) {
  .rh-item__year {
    font-size: clamp(20px, 1.5rem, 24px);
  }
}
@media screen and (max-width: 768px) {
  .rh-item__desc {
    font-size: clamp(0.8125rem, 3.2vw, 0.9375rem);
    margin-top: 4px;
  }
}
@media screen and (max-width: 768px) and (max-width: 768px) {
  .rh-item__desc {
    font-size: 16px;
  }
}
@media screen and (max-width: 768px) {
  .rh-item[data-conn]::after {
    content: "";
    position: absolute;
    background: #029b79;
    z-index: 2;
  }
  .rh-item[data-conn=hr]::after {
    top: 50%;
    left: 100%;
    width: clamp(10px, 3vw, 20px);
    height: 2px;
    transform: translateY(-50%);
  }
  .rh-item[data-conn=hl]::after {
    top: 50%;
    right: 100%;
    width: clamp(10px, 3vw, 20px);
    height: 2px;
    transform: translateY(-50%);
  }
  .rh-item[data-conn=v]::after {
    left: 50%;
    top: 100%;
    width: 2px;
    height: clamp(10px, 3vw, 20px);
    transform: translateX(-50%);
  }
}

.rh-link {
  flex: 1 1 auto;
  min-width: clamp(14px, 1.8vw, 44px);
  height: 2px;
  background: #029b79;
  transform: scaleX(0);
  transform-origin: left center;
}
.rh-link.is-in {
  animation: rh-line 0.35s ease forwards;
}
.rh-link:has(+ .rh-item--pink) {
  flex-grow: 2.4;
}
.rh-link:has(+ .rh-item[data-year="2004"]) {
  flex-grow: 1.89;
}
.rh-link:has(+ .rh-item[data-year="2026"]) {
  flex-grow: 1.03;
}
@media screen and (max-width: 768px) {
  .rh-link {
    display: none;
    width: 2px;
    height: clamp(16px, 5vw, 30px);
    transform: scaleY(0);
    transform-origin: top center;
    margin-inline: auto;
  }
  .rh-link.is-in {
    animation: rh-line-v 0.35s ease forwards;
  }
}

@keyframes rh-border {
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes rh-num {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rh-jp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes rh-line {
  to {
    transform: scaleX(1);
  }
}
@keyframes rh-line-v {
  to {
    transform: scaleY(1);
  }
}
@media (min-width: 769px) {
  .roots .gallery-hero {
    aspect-ratio: 1920/1165;
  }
}
