/* =========================================================================
   TIMELINE · REFINED
   -------------------------------------------------------------------------
   - 상단 호흡 확대
   - 왼쪽: 접고 펼치는 실제 타임라인
   - 오른쪽: NOW ON TIMELINE 고정 패널
   - 데스크톱 hover / 키보드 focus / 모바일 touch 모두 지원
   - 별도 JS 없이 <details> + CSS로 동작
   ========================================================================= */

/* -------------------------------------------------
   01. SECTION / PAGE HEADER
   ------------------------------------------------- */

.page-timeline .section-timeline {
  position: relative;
  overflow: clip;
  padding: clamp(64px, 8vh, 92px) var(--pad-x) clamp(64px, 8.8vh, 104px);
  background:
    radial-gradient(118% 58% at 14% -4%, rgba(104, 76, 184, 0.28) 0%, rgba(104, 76, 184, 0) 56%),
    radial-gradient(72% 44% at 88% 12%, rgba(58, 48, 130, 0.22) 0%, rgba(58, 48, 130, 0) 62%),
    radial-gradient(56% 30% at 78% 54%, rgba(239, 170, 205, 0.045) 0%, rgba(239, 170, 205, 0) 66%),
    radial-gradient(66% 38% at 40% 103%, rgba(243, 207, 154, 0.085) 0%, rgba(243, 207, 154, 0) 64%),
    linear-gradient(to bottom, #0a0917 0%, #0c0a1d 46%, var(--bg-deep) 100%);
}

.page-timeline .section-timeline::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 96%);
  height: 540px;
  background: radial-gradient(
    closest-side,
    rgba(150, 120, 232, 0.16),
    rgba(150, 120, 232, 0)
  );
  pointer-events: none;
}

.page-timeline .section-timeline::after {
  opacity: 0.3;
}

.page-timeline .timeline-inner {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 오른쪽 위 초승달 */
.page-timeline .timeline-inner::before {
  content: "";
  position: absolute;
  top: -28px;
  right: 6px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  box-shadow:
    -27px 22px 0 0 rgba(255, 232, 190, 0.34),
    -27px 22px 14px 0 rgba(243, 207, 154, 0.18),
    -27px 22px 34px 4px rgba(197, 180, 243, 0.08);
  pointer-events: none;
  z-index: -1;
}

.page-timeline .section-header {
  position: relative;
  max-width: 650px;
  margin-bottom: clamp(48px, 6vh, 70px);
}

.page-timeline .section-eyebrow {
  gap: 13px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: rgba(243, 207, 154, 0.82);
}

.page-timeline .section-eyebrow::before {
  width: clamp(22px, 3vw, 38px);
}

.page-timeline .section-title {
  margin: 12px 0 15px;
  font-size: clamp(42px, 5.6vw, 74px);
  letter-spacing: 0.1em;
  line-height: 1.05;
  text-shadow: 0 0 52px rgba(150, 122, 232, 0.34);
}

.page-timeline .section-title::after {
  width: clamp(44px, 8vw, 104px);
  margin-left: 22px;
  background: linear-gradient(
    to right,
    rgba(243, 207, 154, 0.55),
    rgba(197, 180, 243, 0.26) 55%,
    rgba(197, 180, 243, 0)
  );
}

.page-timeline .section-description {
  max-width: 54ch;
  font-size: clamp(14px, 1.15vw, 15.5px);
  line-height: 1.85;
  color: rgba(214, 207, 240, 0.7);
}

/* -------------------------------------------------
   02. TWO-COLUMN LAYOUT
   ------------------------------------------------- */

.page-timeline .timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: start;
  gap: clamp(44px, 6vw, 84px);
}

.page-timeline .timeline-stream {
  min-width: 0;
}

.page-timeline .timeline-stream-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 0 2px 12px 34px;
  border-bottom: 1px solid rgba(190, 176, 238, 0.1);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(206, 199, 238, 0.42);
}

.page-timeline .timeline-stream-head span:last-child {
  color: rgba(243, 207, 154, 0.45);
}

/* -------------------------------------------------
   03. INTERACTIVE TIMELINE
   ------------------------------------------------- */

.page-timeline .timeline-list {
  position: relative;
}

/* 세로선 */
.page-timeline .timeline-list::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 8px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(243, 207, 154, 0.6) 0%,
    rgba(230, 198, 196, 0.42) 22%,
    rgba(214, 190, 240, 0.34) 46%,
    rgba(185, 176, 238, 0.26) 68%,
    rgba(166, 187, 247, 0.12) 90%,
    rgba(166, 187, 247, 0) 100%
  );
}

.page-timeline .timeline-item {
  --accent: var(--gold);
  --accent-soft: rgba(243, 207, 154, 0.26);

  position: relative;
  margin: 0;
  border: 0;
}

/* 기본 summary 마커 제거 */
.page-timeline .timeline-summary {
  position: relative;
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: center;
  gap: clamp(16px, 2vw, 24px);
  min-height: 82px;
  padding: 15px 10px 15px 0;
  border-bottom: 1px solid rgba(190, 176, 238, 0.09);
  list-style: none;
  cursor: pointer;
  transition:
    background-color 0.35s var(--ease),
    padding-left 0.35s var(--ease);
}


/* hover/focus 배경 */
.page-timeline .timeline-summary::before {
  content: "";
  position: absolute;
  inset: 4px -12px;
  z-index: -1;
  border-radius: 18px;
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--accent) 8%, transparent),
    rgba(255, 255, 255, 0) 72%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.page-timeline .timeline-item:is(:hover, :focus-within, .is-open) .timeline-summary::before {
  opacity: 1;
}

/* marker */
.page-timeline .timeline-marker {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background:
    radial-gradient(
      closest-side,
      var(--accent) 0 58%,
      rgba(255, 255, 255, 0) 59%
    )
    center / 6px 6px no-repeat,
    rgba(9, 8, 20, 0.98);
  box-shadow:
    0 0 0 4px rgba(9, 8, 20, 0.96),
    0 0 15px var(--accent-soft);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.page-timeline .timeline-item:is(:hover, :focus-within, .is-open) .timeline-marker {
  transform: scale(1.1);
  box-shadow:
    0 0 0 4px rgba(9, 8, 20, 0.96),
    0 0 24px var(--accent-soft);
}

.page-timeline .timeline-summary-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.page-timeline .timeline-frequency {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.27em;
  line-height: 1.4;
  color: var(--accent);
}

.page-timeline .timeline-frequency::after {
  content: "";
  flex: none;
  width: clamp(20px, 5vw, 52px);
  height: 1px;
  background: linear-gradient(to right, var(--accent-soft), transparent);
}

.page-timeline .timeline-title {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.9vw, 35px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.16;
  color: rgba(244, 241, 255, 0.92);
  transition: color 0.35s var(--ease);
}

.page-timeline .timeline-item:is(:hover, :focus-within, .is-open) .timeline-title {
  color: #fffaf2;
}

/* + / × */
.page-timeline .timeline-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(190, 176, 238, 0.14);
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1;
  color: rgba(230, 225, 252, 0.58);
  transition:
    transform 0.4s var(--ease),
    border-color 0.35s var(--ease),
    color 0.35s var(--ease),
    background-color 0.35s var(--ease);
}

.page-timeline .timeline-item:is(:hover, :focus-within, .is-open) .timeline-toggle {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.page-timeline .timeline-item.is-open .timeline-toggle {
  transform: rotate(45deg);
}

/* reveal */
.page-timeline .timeline-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  padding-left: 42px;
  transition:
    grid-template-rows 0.45s var(--ease),
    opacity 0.35s var(--ease);
}

.page-timeline .timeline-content-inner {
  overflow: hidden;
}

.page-timeline .timeline-item:is(:hover, :focus-within, .is-open) .timeline-content {
  grid-template-rows: 1fr;
  opacity: 1;
}

.page-timeline .timeline-text {
  max-width: 54ch;
  margin: 0;
  padding: 4px 40px 22px 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: rgba(224, 218, 247, 0.76);
}

.page-timeline .timeline-text strong {
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-soft);
}

/* 위에서 아래로 색 흐름 */
.page-timeline .timeline-item:nth-child(1) {
  --accent: #e9c9b8;
  --accent-soft: rgba(233, 201, 184, 0.28);
}

.page-timeline .timeline-item:nth-child(2) {
  --accent: var(--rose);
  --accent-soft: rgba(239, 170, 205, 0.26);
}

.page-timeline .timeline-item:nth-child(3) {
  --accent: var(--lavender);
  --accent-soft: rgba(197, 180, 243, 0.28);
}

.page-timeline .timeline-item:nth-child(4) {
  --accent: #b9b0ee;
  --accent-soft: rgba(185, 176, 238, 0.26);
}

.page-timeline .timeline-item:nth-child(5) {
  --accent: var(--periwinkle);
  --accent-soft: rgba(166, 187, 247, 0.26);
}

/* -------------------------------------------------
   04. RIGHT NOW PANEL
   ------------------------------------------------- */

.page-timeline .timeline-now-panel {
  position: sticky;
  top: clamp(108px, 13vh, 136px);
  overflow: hidden;
  padding: clamp(24px, 2.6vw, 34px);
  border: 1px solid rgba(202, 188, 246, 0.14);
  border-radius: 26px;
  background:
    linear-gradient(
      155deg,
      rgba(31, 25, 66, 0.54) 0%,
      rgba(13, 11, 30, 0.44) 100%
    );
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow:
    0 28px 64px rgba(4, 3, 12, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.page-timeline .timeline-now-panel::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(243, 207, 154, 0.12),
    rgba(197, 180, 243, 0.045) 48%,
    transparent 72%
  );
  pointer-events: none;
}

.page-timeline .timeline-now-kicker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(243, 207, 154, 0.82);
}

.page-timeline .timeline-now-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(243, 207, 154, 0.72);
  animation: timeline-now-pulse 4.8s ease-in-out infinite;
}

.page-timeline .timeline-now-title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 39px);
  font-weight: 500;
  letter-spacing: 0.07em;
  line-height: 1.15;
  color: var(--text);
}

.page-timeline .timeline-now-text {
  position: relative;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(222, 216, 246, 0.68);
}

.page-timeline .timeline-now-list {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}

.page-timeline .timeline-now-list li {
  display: grid;
  gap: 3px;
  padding: 14px 0;
  border-top: 1px solid rgba(190, 176, 238, 0.1);
}

.page-timeline .timeline-now-list strong {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(243, 207, 154, 0.76);
}

.page-timeline .timeline-now-list span {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(234, 229, 252, 0.84);
}

/* -------------------------------------------------
   05. NEXT
   ------------------------------------------------- */

.page-timeline .timeline-next {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  margin-top: clamp(70px, 8vh, 104px);
  text-align: right;
}

.page-timeline .timeline-next::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * clamp(26px, 3.2vh, 38px));
  height: 1px;
  background: linear-gradient(
    to left,
    rgba(243, 207, 154, 0.26) 0%,
    rgba(190, 176, 238, 0.09) 46%,
    rgba(190, 176, 238, 0) 100%
  );
  pointer-events: none;
}

.page-timeline .timeline-next-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  width: 100%;
  margin: 0 2px clamp(9px, 1.3vh, 13px) 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: rgba(243, 207, 154, 0.6);
}

.page-timeline .timeline-next-label::before {
  content: "✦";
  font-size: 8.5px;
  letter-spacing: 0;
  opacity: 0.8;
}

.page-timeline .timeline-next-label::after {
  content: "";
  order: -1;
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(
    to left,
    rgba(190, 176, 238, 0.18),
    rgba(190, 176, 238, 0) 80%
  );
}

.page-timeline .timeline-next-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 22px);
  padding: 2px 2px 6px;
  font-family: var(--font-display);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 500;
  letter-spacing: 0.11em;
  line-height: 1.2;
  color: rgba(244, 240, 255, 0.92);
  transition: color 0.4s var(--ease);
}

.page-timeline .timeline-next-link::before {
  content: "";
  position: absolute;
  right: clamp(48px, 6vw, 62px);
  left: calc(100% - clamp(48px, 6vw, 62px));
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    to left,
    rgba(243, 207, 154, 0.7),
    rgba(197, 180, 243, 0.3)
  );
  transition: left 0.55s var(--ease);
}

.page-timeline .timeline-next-link:hover::before {
  left: 2px;
}

.page-timeline .timeline-next-link:hover {
  color: #fff6e6;
}

.page-timeline .timeline-next-link span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(243, 207, 154, 0.3);
  border-radius: 50%;
  background: rgba(243, 207, 154, 0.05);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gold);
  transition:
    transform 0.4s var(--ease),
    background-color 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.page-timeline .timeline-next-link:hover span {
  transform: translateX(4px);
  border-color: rgba(243, 207, 154, 0.55);
  background: rgba(243, 207, 154, 0.12);
}

/* -------------------------------------------------
   06. RESPONSIVE
   ------------------------------------------------- */

@media (max-width: 960px) {
  .page-timeline .timeline-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .page-timeline .timeline-now-panel {
    position: relative;
    top: auto;
    order: -1;
  }

  .page-timeline .timeline-now-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
}

@media (max-width: 640px) {
  .page-timeline .section-timeline {
    padding-top: clamp(42px, 6vh, 58px);
  }

  .page-timeline .timeline-inner::before {
    top: -14px;
    right: -8px;
    transform: scale(0.82);
    transform-origin: top right;
  }

  .page-timeline .section-header {
    margin-bottom: 40px;
  }

  .page-timeline .timeline-stream-head {
    padding-left: 28px;
    font-size: 8.5px;
    letter-spacing: 0.22em;
  }

  .page-timeline .timeline-summary {
    grid-template-columns: 16px minmax(0, 1fr) 26px;
    gap: 14px;
    min-height: 76px;
  }

  .page-timeline .timeline-title {
    font-size: clamp(24px, 8vw, 30px);
  }

  .page-timeline .timeline-content {
    padding-left: 30px;
  }

  .page-timeline .timeline-text {
    padding-right: 10px;
    font-size: 14px;
    line-height: 1.82;
  }

  .page-timeline .timeline-now-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .page-timeline .timeline-now-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-timeline .timeline-next {
    margin-top: 76px;
  }
}

/* -------------------------------------------------
   07. MOTION / ACCESSIBILITY
   ------------------------------------------------- */

@keyframes timeline-now-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (hover: none), (pointer: coarse) {
  /* 터치에서는 JS가 .is-open을 토글 */
  .page-timeline .timeline-item .timeline-content {
    grid-template-rows: 0fr;
    opacity: 0;
  }

  .page-timeline .timeline-item.is-open .timeline-content {
    grid-template-rows: 1fr;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-timeline .timeline-now-dot {
    animation: none;
  }

  .page-timeline .timeline-summary,
  .page-timeline .timeline-marker,
  .page-timeline .timeline-toggle,
  .page-timeline .timeline-content,
  .page-timeline .timeline-next-link,
  .page-timeline .timeline-next-link span {
    transition: none !important;
  }
}


/* -------------------------------------------------
   DESKTOP HOVER · 강제 보강
   ------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .page-timeline .timeline-item:hover .timeline-content,
  .page-timeline .timeline-item:focus-within .timeline-content {
    grid-template-rows: 1fr;
    opacity: 1;
  }

  .page-timeline .timeline-item:hover .timeline-toggle,
  .page-timeline .timeline-item:focus-within .timeline-toggle {
    transform: rotate(45deg);
  }
}


/* =========================================================
   MOTION FIX v5
   JS가 실제 height(px)를 직접 애니메이션합니다.
   grid-template-rows / sticky hover 영향 제거.
   ========================================================= */
.page-timeline .timeline-content {
  display: block !important;
  grid-template-rows: none !important;
  opacity: 1;
  overflow: hidden;
  transition: none !important;
}

.page-timeline .timeline-content[hidden] {
  display: none !important;
}

.page-timeline .timeline-content-inner {
  overflow: visible;
}

.page-timeline .timeline-item.is-open .timeline-content {
  grid-template-rows: none !important;
  opacity: 1;
}
