.legal-wrap {
  width: min(900px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.legal-switch {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}

.legal-switch .btn {
  padding: 0.48rem 0.9rem;
}

.legal-back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.legal-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.legal-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Noto Sans", sans-serif;
  line-height: 1.65;
  color: var(--ink);
}

.secondary-intro {
  margin: 0 0 1rem;
  color: var(--soft-ink);
  font-weight: 500;
}

.secondary-page .legal-wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.secondary-page {
  --secondary-section-gap: 4rem;
}

.secondary-page .legal-wrap > h1 {
  margin: 0 0 1rem;
  padding: 0 0.15rem;
}

.secondary-team-page .legal-wrap > h1 {
  text-align: center;
}

.secondary-cast-page .legal-wrap > h1 {
  text-align: center;
}

.secondary-press-kit-page .legal-wrap > h1 {
  font-size: 0;
  line-height: 0;
  margin: 0 auto 1rem;
  width: min(540px, 94vw);
}

.secondary-press-kit-page .legal-wrap > h1::before {
  content: "";
  display: block;
  width: 100%;
  height: clamp(84px, 20vw, 168px);
  background: url("./assets/images/SushiBen_Logo.png") center center / contain no-repeat;
}

.secondary-group + .secondary-group {
  margin-top: var(--secondary-section-gap);
}

.secondary-page .legal-wrap a:not(.btn) {
  color: #214f92;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.secondary-page .legal-wrap a:not(.btn):hover,
.secondary-page .legal-wrap a:not(.btn):focus-visible {
  color: var(--link-hover-accent);
}

.secondary-panel {
  position: relative;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 16px;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  max-width: 980px;
}

.secondary-panel-narrow {
  max-width: 700px;
}

.secondary-panel-mid {
  max-width: 980px;
}

.secondary-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(
    94deg,
    rgb(255 255 255 / 68%) 0%,
    rgb(255 255 255 / 48%) 58%,
    rgb(255 255 255 / 14%) 100%
  );
  backdrop-filter: blur(1.5px);
}

.secondary-group h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.6vw, 2.45rem);
  line-height: 1.18;
}

.secondary-list {
  margin: 0;
  padding-left: 1.2rem;
}

.secondary-list li + li {
  margin-top: 0.3rem;
}

.credit-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.credit-card {
  flex: 0 1 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, #ffffff 92%, var(--paper-2)) 0%,
    color-mix(in srgb, #ffffff 84%, var(--paper)) 100%
  );
  padding: 0.6rem 0.7rem;
}

.secondary-team-page .credit-card {
  min-height: 114px;
  display: grid;
  align-content: center;
  row-gap: 0.12rem;
}

.secondary-team-page .credit-card .credit-name,
.secondary-team-page .credit-card .credit-role {
  margin: 0;
}

.credit-name {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.secondary-team-page .credit-name {
  font-size: 1.2rem;
  line-height: 1.25;
}


.secondary-cast-page .credit-role {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.35rem;
  overflow-wrap: anywhere;
}

.secondary-cast-page .credit-role strong {
  font-weight: 700;
}

.secondary-cast-page .credit-role-value {
  min-width: 0;
}

.secondary-cast-page .credit-role-romanized {
  display: block;
  margin-top: 0.08rem;
}

.secondary-cast-page .credit-name {
  font-size: 1.2rem;
  line-height: 1.25;
  text-align: center;
  margin-bottom: 0.28rem;
}

.secondary-cast-page {
  --cast-headshot-bg-size: 300%;
  --cast-headshot-bg-x: 15%;
  --cast-headshot-bg-y: 50%;
  --cast-headshot-film: 0.3;
}

.secondary-cast-page .credit-headshot {
  display: block;
  width: min(150px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  margin: 0.35rem auto 0.5rem;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--line) 75%, #ffffff);
  background:
    linear-gradient(
      165deg,
      rgb(255 255 255 / calc(var(--cast-headshot-film) + 0.1)) 0%,
      rgb(255 255 255 / var(--cast-headshot-film)) 100%
    ),
    url("./assets/images/Kotobukicho_BG.png");
  background-size: auto, var(--cast-headshot-bg-size);
  background-position: center, var(--cast-headshot-bg-x) var(--cast-headshot-bg-y);
  background-repeat: no-repeat, no-repeat;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.28),
    0 8px 18px rgb(17 46 64 / 0.16);
}

@media (max-width: 880px) {
  .secondary-page {
    --secondary-section-gap: 4rem;
  }
}

:root[data-theme="dark"] .secondary-panel::before {
  background: linear-gradient(
    94deg,
    rgb(13 24 35 / 78%) 0%,
    rgb(14 26 38 / 60%) 58%,
    rgb(14 26 38 / 30%) 100%
  );
}

:root[data-theme="dark"] .credit-card {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, #1a2b3b 88%, var(--paper-2)) 0%,
    color-mix(in srgb, #142433 90%, var(--paper)) 100%
  );
  border-color: var(--line);
}

:root[data-theme="dark"] .legal-text {
  color: var(--ink);
}

:root[data-theme="dark"] .secondary-page .legal-wrap a:not(.btn) {
  color: #8fc0ff;
}
