/* 회사연혁 (intro3_1) — 테크 컨설팅 톤의 타임라인
   기존 CSS가 html{font-size:62.5%} 라서 rem 대신 px 를 쓴다. */

.hx {
  --hx-navy: #06182b;
  --hx-navy-2: #0a2540;
  --hx-brand: #065482;
  --hx-accent: #38c6f4;
  --hx-ink: #0e1c2b;
  --hx-sub: #5b6a7a;
  --hx-line: #dde4eb;
  --hx-soft: #f4f7fa;
  --hx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hx-top: 0px; /* 고정 헤더 높이 — history.js 가 채운다 */
  --hx-year-w: 250px;
  color: var(--hx-ink);
  text-align: left;
  line-height: 1.5;
  word-break: keep-all;
}

.hx *,
.hx *::before,
.hx *::after {
  box-sizing: border-box;
}

/* :where 로 우선순위를 0 으로 두어 아래 규칙들이 여백을 다시 줄 수 있게 한다 */
.hx :where(ol, ul, dl, dd, p, h2, h3, h4) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-in {
  width: 1200px;
  max-width: calc(100% - 40px);
  margin: 0 auto;
}

/* 분류 색 */
.hx [data-g="cert"],
.hx [data-filter="cert"] { --c: #0c8f7d; }
.hx [data-g="ip"],
.hx [data-filter="ip"] { --c: #5b4fd1; }
.hx [data-g="mou"],
.hx [data-filter="mou"] { --c: #c0367f; }
.hx [data-g="org"],
.hx [data-filter="org"] { --c: #1672c4; }
.hx [data-g="fund"],
.hx [data-filter="fund"] { --c: #b8730a; }
.hx [data-g="etc"],
.hx [data-filter="etc"] { --c: #4d5c6c; }

/* ───────── 히어로 ───────── */
.hx-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 0 0;
  color: #fff;
  background:
    radial-gradient(900px 420px at 82% 0%, rgba(56, 198, 244, 0.2), transparent 70%),
    radial-gradient(700px 500px at 0% 100%, rgba(6, 84, 130, 0.55), transparent 70%),
    linear-gradient(180deg, var(--hx-navy) 0%, var(--hx-navy-2) 100%);
}

.hx-hero__grid {
  position: absolute;
  inset: -64px 0 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 10%, #000 20%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 70% 10%, #000 20%, transparent 78%);
  animation: hx-grid 14s linear infinite;
}

@keyframes hx-grid {
  to { transform: translateY(64px); }
}

.hx-hero .hx-in {
  position: relative;
}

.hx-crumb {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.hx-crumb li + li::before {
  content: "/";
  margin-right: 10px;
  color: rgba(255, 255, 255, 0.28);
}

.hx-hero__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 48px;
  align-items: end;
  margin-top: 56px;
}

.hx-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--hx-accent);
}

.hx-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hx-eyebrow span {
  color: rgba(255, 255, 255, 0.5);
}

.hx .hx-title {
  margin-top: 18px;
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #fff;
}

.hx-lead {
  max-width: 460px;
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

/* 연도별 막대 */
.hx-chart__cap {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
}

.hx-chart__bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  margin-top: 14px;
}

.hx-bar {
  display: grid;
  grid-template-rows: 18px 120px 22px;
  justify-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.hx-bar__n {
  align-self: end;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.hx-bar__col {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.hx-bar__col i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--hx-accent), rgba(56, 198, 244, 0.25));
  transform-origin: bottom;
  transform: scaleY(var(--h));
  transition: transform 0.5s var(--hx-ease), filter 0.18s ease;
  animation: hx-rise 0.9s var(--hx-ease) calc(var(--i) * 45ms + 150ms) backwards;
}

@keyframes hx-rise {
  from { transform: scaleY(0); }
}

.hx-bar.is-empty .hx-bar__col i {
  display: none;
}

.hx-bar__y {
  align-self: end;
  letter-spacing: 0.04em;
}

.hx-bar__y::before {
  content: "'";
  opacity: 0.5;
}

a.hx-bar:hover,
a.hx-bar:focus-visible {
  color: #fff;
  outline: none;
}

a.hx-bar:hover .hx-bar__n,
a.hx-bar:focus-visible .hx-bar__n {
  opacity: 1;
  transform: none;
}

a.hx-bar:hover .hx-bar__col i,
a.hx-bar:focus-visible .hx-bar__col i {
  filter: brightness(1.25);
}

a.hx-bar:focus-visible .hx-bar__col {
  outline: 2px solid var(--hx-accent);
  outline-offset: 3px;
}

/* 수치 */
.hx-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 56px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hx-stat {
  padding: 26px 24px 34px 0;
}

.hx-stat + .hx-stat {
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.hx-stat dt {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.hx-stat dd {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
}

.hx-stat b {
  font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.hx-stat dd span {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.hx-stat .hx-stat__sub {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.42);
}

/* ───────── 필터 바 ───────── */
.hx-filter {
  position: sticky;
  top: var(--hx-top);
  z-index: 5;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hx-line);
}

.hx-filter .hx-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.hx-chips {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.hx-chips::-webkit-scrollbar {
  display: none;
}

.hx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hx-line);
  border-radius: 6px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: var(--hx-ink);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.hx-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c, var(--hx-brand));
}

.hx-chip span {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--hx-sub);
}

.hx-chip:hover {
  border-color: #b9c5d1;
}

.hx-chip:active {
  transform: scale(0.97);
}

.hx-chip:focus-visible {
  outline: 2px solid var(--hx-brand);
  outline-offset: 2px;
}

.hx-chip[aria-pressed="true"] {
  border-color: var(--hx-navy-2);
  background: var(--hx-navy-2);
  color: #fff;
}

.hx-chip[aria-pressed="true"]::before {
  background: var(--hx-accent);
}

.hx-chip[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.7);
}

.hx-now {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.hx-now span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--hx-sub);
}

.hx-now b {
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hx-brand);
}

.hx-now b.is-tick {
  animation: hx-tick 0.35s var(--hx-ease);
}

@keyframes hx-tick {
  from { opacity: 0; transform: translateY(8px); }
}

/* ───────── 타임라인 ───────── */
.hx-body {
  position: relative;
  padding: 72px 0 140px;
}

/* 스크롤에 따라 채워지는 세로선 */
.hx-rail {
  position: absolute;
  top: 72px;
  bottom: 140px;
  left: var(--hx-year-w);
  width: 1px;
  background: var(--hx-line);
}

.hx-rail i {
  position: absolute;
  inset: 0 -0.5px;
  background: linear-gradient(180deg, var(--hx-brand), var(--hx-accent));
  transform-origin: top;
  transform: scaleY(var(--hx-p, 0));
}

.hx-rail i::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 9px;
  height: 9px;
  margin: 0 0 -4px -4.5px;
  border-radius: 50%;
  background: var(--hx-accent);
  box-shadow: 0 0 0 5px rgba(56, 198, 244, 0.2);
  /* 부모의 scaleY 를 되돌려 원이 찌그러지지 않게 */
  transform: scaleY(calc(1 / max(var(--hx-p, 0), 0.0001)));
}

.hx-year {
  display: grid;
  grid-template-columns: var(--hx-year-w) minmax(0, 1fr);
  scroll-margin-top: calc(var(--hx-top) + 88px);
}

.hx-year + .hx-year {
  margin-top: 72px;
}

.hx-year__head {
  position: sticky;
  top: calc(var(--hx-top) + 96px);
  align-self: start;
  padding-right: 32px;
}

.hx .hx-year__num {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: #c9d3dd;
  transition: color 0.4s ease;
}

.hx-year.is-current .hx-year__num {
  color: var(--hx-navy-2);
}

.hx-year__cnt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--hx-sub);
}

.hx-year__cnt::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.hx-year__cnt b {
  color: var(--hx-brand);
  font-variant-numeric: tabular-nums;
}

.hx-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  padding: 18px 20px 18px 40px;
  border-bottom: 1px solid var(--hx-line);
  transition: background-color 0.2s ease;
}

.hx-list > .hx-item:first-child {
  border-top: 1px solid var(--hx-line);
}

/* 세로선 위의 점 */
.hx-item::before {
  content: "";
  position: absolute;
  top: 27px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--c);
  transition: background-color 0.3s ease 0.15s, transform 0.2s var(--hx-ease);
}

.hx-item.is-in::before {
  background: var(--c);
}

.hx-m {
  padding-top: 3px;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--hx-ink);
}

.hx-m small {
  margin-left: 1px;
  font-size: 13px;
  font-weight: 400;
  color: var(--hx-sub);
}

.hx .hx-c h4 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--hx-ink);
}

.hx-tag {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 10%, #fff);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--c);
  vertical-align: 2px;
  white-space: nowrap;
}

.hx-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  /* 구분선은 각 조각의 왼쪽에 두고, 줄 맨 앞에 온 것은 잘라 낸다 */
  margin: 6px 0 0 -21px;
  clip-path: inset(0 0 0 21px);
  font-size: 14px;
  line-height: 1.6;
  color: var(--hx-sub);
  word-break: normal;
  overflow-wrap: anywhere;
}

.hx-meta span {
  position: relative;
  padding-left: 21px;
}

.hx-meta span::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 10px;
  width: 1px;
  height: 10px;
  background: #c3cdd7;
}

.hx-item.is-key {
  background: linear-gradient(90deg, rgba(6, 84, 130, 0.07), transparent 70%);
}

.hx-item.is-key .hx-tag {
  background: var(--hx-brand);
  color: #fff;
}

.hx-item.is-key::before {
  --c: var(--hx-brand);
  width: 11px;
  height: 11px;
  left: -6px;
  top: 25px;
  border-radius: 2px;
  rotate: 45deg;
}

@media (hover: hover) {
  .hx-item:hover {
    background-color: var(--hx-soft);
  }

  .hx-item:hover::before {
    transform: scale(1.5);
  }
}

.hx-item[hidden],
.hx-year[hidden] {
  display: none;
}

.hx-empty {
  padding: 80px 0;
  text-align: center;
  font-size: 16px;
  color: var(--hx-sub);
}

/* ───────── 등장 모션 (JS 가 켜져 있을 때만) ───────── */
.hx-js .hx-item {
  opacity: 0;
  transform: translateY(14px);
}

.hx-js .hx-item.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.5s ease var(--d, 0ms),
    transform 0.6s var(--hx-ease) var(--d, 0ms),
    background-color 0.2s ease;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}

/* ───────── 반응형 ───────── */
@media (max-width: 1000px) {
  .hx {
    --hx-year-w: 170px;
  }

  .hx-hero__top {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
  }

  .hx .hx-year__num {
    font-size: 52px;
  }

  .hx-now {
    display: none;
  }
}

@media (max-width: 700px) {
  .hx-hero {
    padding-top: 28px;
  }

  .hx-lead {
    font-size: 16px;
  }

  .hx-bar {
    grid-template-rows: 18px 84px 22px;
    font-size: 11px;
  }

  .hx-chart__bars {
    gap: 4px;
  }

  .hx-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 40px;
  }

  .hx-stat {
    padding: 20px 16px 22px 0;
  }

  .hx-stat + .hx-stat {
    padding-left: 16px;
  }

  .hx-stat:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .hx-stat:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  /* 칩은 화면 끝까지 밀리며 스크롤 */
  .hx-filter .hx-in {
    max-width: 100%;
  }

  .hx-chips {
    padding: 10px 20px;
  }

  .hx-body {
    padding: 40px 0 88px;
  }

  .hx-rail {
    top: 40px;
    bottom: 88px;
    left: 3px;
  }

  .hx-year {
    display: block;
  }

  .hx-year + .hx-year {
    margin-top: 48px;
  }

  .hx-year__head {
    position: static;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 0 14px 22px;
  }

  .hx .hx-year__num {
    font-size: 40px;
    color: var(--hx-navy-2);
  }

  .hx-year__cnt {
    margin-top: 0;
  }

  .hx-list {
    margin-left: 3px;
  }

  .hx-item {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 4px;
    padding: 16px 0 16px 19px;
  }

  .hx-m {
    font-size: 15px;
  }

  .hx .hx-c h4 {
    font-size: 16px;
  }

  .hx-tag {
    margin-right: 8px;
  }

  .hx-meta {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-hero__grid,
  .hx-bar__col i,
  .hx-now b.is-tick {
    animation: none;
  }

  .hx-js .hx-item,
  .hx-js .hx-item.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hx-rail i {
    transform: none;
  }

  .hx-rail i::after {
    display: none;
  }
}
