@import url("page-common.css");

body.story-page {
  position: relative;
  isolation: isolate;
}

body.story-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../img/story.jpeg") center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
}

.story-page .brand-mark {
  background: transparent;
  background-image: none;
  border: none;
}

.story-page .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-hero {
  position: relative;
  padding: 24px 0 20px;
  overflow: hidden;
}

.page-hero::after {
  content: none;
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(33, 87, 214, 0.2), transparent);
}

.page-hero-inner {
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgb(237, 241, 252), rgb(229, 244, 255));
  border: 1px solid rgb(228, 235, 250);
}

.page-title-en {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(36px, 5vw, 54px);
  letter-spacing: 2px;
  margin: 0;
  color: var(--ink-strong);
  text-transform: uppercase;
}

.page-title-jp {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.story-timeline {
  position: relative;
  display: grid;
  gap: 22px;
  padding: 8px 0;
}

.story-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(34, 65, 202, 0.45), rgba(34, 65, 202, 0.12));
}

.story-step {
  position: relative;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(34, 65, 202, 0.16);
  box-shadow: 0 12px 28px rgba(24, 38, 88, 0.1);
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  backdrop-filter: blur(2px);
  width: min(700px, calc(50% - 44px));
  margin-right: auto;
}

.story-step:nth-child(even) {
  margin-right: 0;
  margin-left: auto;
}

.story-step::before {
  content: "";
  position: absolute;
  left: calc(100% + 37px);
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f2a100;
  box-shadow: 0 0 0 6px rgba(242, 161, 0, 0.18);
}

.story-step::after {
  content: "";
  position: absolute;
  left: calc(100% + 10px);
  top: 40px;
  width: 30px;
  border-top: 3px dotted rgba(242, 161, 0, 0.9);
}

.story-step:nth-child(even)::before {
  left: -51px;
}

.story-step:nth-child(even)::after {
  left: -37px;
}

.story-step-content {
  display: grid;
  gap: 12px;
}

.story-step-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
}

.story-step-year {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #3e3025;
  font-family: "Barlow Condensed", "Noto Sans JP", sans-serif;
  font-size: clamp(30px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.story-step-label {
  color: var(--muted);
}

.story-step h3 {
  margin: 0;
  font-size: 18px;
}

.story-step p {
  margin: 0;
  color: #4a4038;
  line-height: 1.9;
  font-size: 16px;
}

.story-step-media {
  margin: 0;
  width: min(100%, var(--story-media-max, 420px));
  max-width: 100%;
  border-radius: 14px;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  justify-self: center;
  overflow: hidden;
}

.story-step-media:not(:has(img)) {
  border: 1px solid rgba(34, 65, 202, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(224, 233, 252, 0.6)),
    repeating-linear-gradient(-45deg, rgba(34, 65, 202, 0.08) 0, rgba(34, 65, 202, 0.08) 12px, transparent 12px, transparent 24px);
}

.story-step-media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.story-step-media img + span {
  display: none;
}

.story-step-media span {
  display: inline-block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(34, 65, 202, 0.62);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 65, 202, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

.story-cta {
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(16, 34, 67, 0.08), rgba(123, 199, 255, 0.2));
  border: 1px solid rgba(33, 87, 214, 0.12);
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.story-cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

main {
  padding: 48px 0 96px;
}

.breadcrumb {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

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

.section {
  margin-bottom: 72px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s ease forwards;
}

.section:nth-of-type(2) {
  animation-delay: 0.08s;
}

.section:nth-of-type(3) {
  animation-delay: 0.14s;
}

.section:nth-of-type(4) {
  animation-delay: 0.2s;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: #2241ca;
  margin: 0 0 12px;
  font-family: "Barlow Condensed", sans-serif;
}

.section-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(28px, 3.2vw, 40px);
  margin: 0 0 12px;
  color: var(--ink-strong);
  letter-spacing: 1px;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 900px) {
  main {
    padding-top: 32px;
  }
}

@media (max-width: 720px) {
  .story-timeline {
    padding-left: 56px;
  }

  .story-timeline::before {
    left: 18px;
    transform: none;
  }

  .story-step {
    gap: 14px;
    padding: 16px 16px 16px 18px;
    width: auto;
    margin: 0;
  }

  .story-step::before {
    left: -46px;
    top: 24px;
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 4px rgba(242, 161, 0, 0.18);
  }

  .story-step::after {
    left: -30px;
    top: 30px;
    width: 16px;
  }

  .story-step:nth-child(even)::before {
    left: -46px;
  }

  .story-step:nth-child(even)::after {
    left: -30px;
  }

  .story-step-year {
    font-size: clamp(22px, 7vw, 32px);
  }

  .story-step p {
    font-size: 14px;
    line-height: 1.8;
  }

  .story-step-media {
    width: 100%;
  }

  .story-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .story-step p br {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
