/* 홈 페이지의 기본: 히어로, 경로 패널, 세 가지 질문 장면(journey) */
.home-page {
  --radius: var(--radius-media);
  --radius-lg: var(--radius-panel);
  --button-radius: 999px;
  --home-more-size: 17px;
  --home-description-size: clamp(16px, calc(11px + 0.35vw), 18px);
}

.home-page :is(h1, h2, h3, p, li, dt, dd, summary) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.home-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.home-page main p {
  color: var(--muted);
  font-weight: var(--fw-body);
}

/* 히어로 */
/* 넓은 화면에서는 경로 패널이 무대 아래쪽에 겹치므로 글을 그 위 공간의 가운데에 둔다.
   1081px 미만에서는 패널이 무대 뒤에 이어진다. */
.home-page .hero {
  --scene-background: #1a2028;
  --hero-routes-space: 92px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  isolation: isolate;
  overflow: clip;
  background: var(--scene-background);
}
.home-page .hero-stage {
  position: relative;
  display: grid;
  grid-area: 1 / 1;
  min-width: 0;
  min-block-size: var(--scene-height);
}
.home-page .hero-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  padding-block: clamp(56px, 8svh, 104px) calc(clamp(40px, 6svh, 80px) + var(--hero-routes-space));
}
.home-page .hero .hero-title {
  width: fit-content;
  max-width: 100%;
  color: white;
  font-size: var(--fs-h1-hero);
  font-weight: var(--fw-heading);
  letter-spacing: -0.04em;
  line-height: 1.18;
}
.home-page .hero-title-line {
  display: block;
  overflow: clip;
  padding-block: 0.035em;
}
.home-page .hero-title-line > span {
  display: block;
}
.home-page .hero .hero-title em {
  color: var(--blue-on-dark);
  font-style: normal;
}
/* 첫 화면은 여백을 둔 세 단: 제목, 한 문장, 버튼과 근거 */
.home-page .hero-subtitle {
  max-width: 32rem;
  margin-top: 28px;
  color: #e0e8ef;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.8;
  text-wrap: pretty;
}
.home-page .hero-copy {
  min-width: 0;
  max-width: min(62%, 850px);
}
.home-page .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 36px;
}
.home-page .hero-actions .button-primary {
  min-height: var(--button-height-lg);
  padding-inline: 28px;
  font-size: 16px;
  font-weight: var(--fw-heading);
}
.home-page .hero-company-link {
  display: inline-flex;
  min-height: var(--button-height-lg);
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: 1px solid rgb(255 255 255 / 40%);
  border-radius: var(--button-radius);
  color: white;
  font-size: 16px;
  font-weight: var(--fw-strong);
}
.home-page .hero-company-link:hover {
  background: rgb(255 255 255 / 10%);
  border-color: white;
}
.home-page .hero a:focus-visible {
  outline-color: white;
}

/* 갈림길: 다음 구간의 흰 바탕이 히어로 안으로 올라오며 기업용·기관용 입구를 하나씩 둔다. */
.home-page .hero-routes {
  position: relative;
  z-index: 2;
  grid-area: 1 / 1;
  align-self: end;
}
.home-page .hero-routes-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) repeat(2, minmax(0, 1fr));
  overflow: clip;
  border-radius: var(--hs-radius) var(--hs-radius) 0 0;
  background: white;
}
.home-page .hero-routes h2 {
  align-self: center;
  padding: 18px clamp(24px, 2.6vw, 40px);
  color: var(--hs-ink);
  font-size: clamp(17px, 1.3vw, 19px);
  font-weight: var(--fw-heading);
  line-height: 1.45;
  letter-spacing: -0.03em;
}
.home-page .hero-routes ul {
  display: contents;
}
.home-page .hero-routes li {
  display: flex;
  border-left: 1px solid var(--line);
}
.home-page .hero-routes a {
  display: grid;
  flex: 1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px clamp(24px, 2.4vw, 36px);
  color: inherit;
  text-decoration: none;
}
.home-page .hero-routes a:hover {
  background: var(--hs-soft);
}
.home-page .hero-routes a:focus-visible {
  outline: 2px solid var(--hs-blue);
  outline-offset: -6px;
}
.home-page .hero-route-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--hs-soft);
  color: var(--brand);
}
.home-page .hero-routes a:hover .hero-route-icon {
  background: white;
}
.home-page .hero-route-icon svg {
  width: 28px;
  height: 28px;
}
.home-page .hero-route-text {
  display: block;
  min-width: 0;
  color: var(--hs-ink);
  font-size: clamp(16px, 1.25vw, 18px);
  font-weight: var(--fw-heading);
  line-height: 1.45;
  letter-spacing: -0.03em;
}
.home-page .hero-route-arrow {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: white;
}
.home-page .hero-routes a:hover .hero-route-arrow {
  background: var(--brand-hover);
}
.home-page .hero-route-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 상세 페이지로 이어지는 링크 */
.home-page .text-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: var(--space-2);
  color: var(--action);
  font-size: var(--text-small);
  font-weight: var(--fw-heading);
}
.home-page .text-link:not(.home-more-link):hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.home-page .text-link.home-more-link {
  --more-icon-size: 32px;
  gap: 12px;
  font-size: var(--home-more-size);
  font-weight: var(--fw-strong);
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
}
.home-page .home-more-label {
  position: relative;
  padding-block: 3px;
}
.home-page .home-more-label::after {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  content: '';
}
.home-page .home-more-icon {
  display: block;
  flex: 0 0 var(--more-icon-size);
  width: var(--more-icon-size);
  height: var(--more-icon-size);
  overflow: hidden;
  border-radius: 0;
  background: var(--brand);
  color: var(--white);
}
.home-page .home-more-arrow-track {
  display: flex;
  width: 200%;
  height: 100%;
  transform: translateX(-50%);
}
.home-page .home-more-arrow {
  display: grid;
  flex: 0 0 50%;
  place-items: center;
}
.home-page .home-more-arrow .ui-icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}
.home-page .home-more-link:focus-visible .home-more-label::after {
  transform: scaleX(1);
}
@media (hover: hover) and (pointer: fine) {
  .home-page .home-more-link:hover .home-more-label::after {
    transform: scaleX(1);
  }
}

/* 구간 */
.home-page .home-scenes {
  --scene-height: calc(100svh - var(--header-height));
  position: relative;
}
.home-page .home-scene {
  position: relative;
  isolation: isolate;
}
.home-page .home-scene:focus-visible {
  outline-offset: -4px;
}

/* 세 가지 질문: 좁은 화면은 순서대로 읽고, 넓은 화면은 고정된 무대로 보여 준다. */
.home-page .journey-scene {
  background: white;
}
/* 영상이 끝나면 포커스가 이 구간으로 넘어온다: 구간의 고리만 없애고 안의 조작 요소 고리는 남긴다. */
.home-page .journey-scene[tabindex='-1']:focus {
  outline: none;
}
.home-page .journey-shell {
  display: contents;
}
.home-page .journey-stage,
.home-page .journey-rail {
  display: none;
}
.home-page .journey-steps {
  display: grid;
  width: min(calc(100% - 2 * var(--gutter)), var(--site-width));
  margin-inline: auto;
  gap: clamp(64px, 11vw, 104px);
  padding-block: clamp(64px, 12vw, 104px);
}
.home-page .journey-step {
  display: grid;
  gap: clamp(24px, 4vw, 36px);
}
.home-page .journey-step-media {
  position: relative;
  overflow: hidden;
  background: var(--hs-panel);
}
.home-page .journey-step-number {
  position: absolute;
  z-index: 1;
  bottom: 14px;
  left: 18px;
  color: var(--brand);
  font-size: clamp(48px, 13vw, 72px);
  font-weight: var(--fw-heading);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.home-page .journey-visual {
  width: 100%;
  height: 100%;
  margin: 0;
}
/* 질문마다 옅은 파랑 위에서 답한다: 진입 경로, 증빙 순서, GICUS 화면 */
.home-page .journey-visual--board {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px 20px 40px;
  background: var(--hs-panel);
}
.home-page .journey-board {
  display: block;
  width: min(100%, 520px);
  height: auto;
  font-family: inherit;
}
/* 그림 아래에 단계 번호가 들어갈 자리를 둔다. */
.home-page .journey-step-media .journey-visual--board {
  padding-bottom: clamp(76px, 20vw, 96px);
}
.home-page .journey-step-copy h3 {
  color: var(--navy);
  font-size: var(--fs-h2);
  font-weight: var(--fw-heading);
  line-height: 1.3;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.home-page main .journey-step-body {
  max-width: 34rem;
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--home-description-size);
  line-height: 1.8;
  text-wrap: pretty;
}
.home-page .journey-step-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  max-width: 40rem;
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}
.home-page .journey-step-items li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: var(--fw-strong);
  line-height: 1.55;
}
.home-page main .journey-step-note {
  margin-top: var(--space-3);
  color: var(--quiet);
  font-size: var(--fs-caption);
  line-height: 1.7;
}
.home-page .journey-step-action {
  margin-top: var(--space-5);
}

/* 무대를 고정하지 않는 넓은 화면(움직임 줄이기, 낮은 화면): 단계마다 그림 옆에 글을 둔다. */
@media (min-width: 1081px) and (prefers-reduced-motion: reduce), (min-width: 1081px) and (max-height: 619px) {
  .home-page .journey-step {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(40px, 5vw, 88px);
  }
}
@media (min-width: 1081px) and (min-height: 620px) and (prefers-reduced-motion: no-preference) {
  /* 장면(무대+글)은 세 단계 길이를 스크롤하는 동안 한 화면에 고정된다.
     단계마다 3분의 1씩 쓰고, 마지막 3분의 1이 끝나야 풀린다. */
  .home-page .journey {
    --journey-height: calc(100svh - var(--header-height));
    --journey-step-scroll: 48svh;
    --journey-ease: cubic-bezier(0.22, 0.8, 0.2, 1);
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    height: calc(var(--journey-height) + 3 * var(--journey-step-scroll));
  }
  .home-page :is(.journey-stage, .journey-steps) {
    position: sticky;
    top: var(--header-height);
    align-self: start;
    height: var(--journey-height);
  }
  .home-page .journey-stage {
    display: block;
    overflow: hidden;
    background: var(--hs-panel);
  }
  .home-page .journey-layers,
  .home-page .journey-layer {
    position: absolute;
    inset: 0;
  }
  /* 다음 단계는 앞 단계 위로 쓸어 올라오고, 되돌리면 다시 쓸려 내려간다. */
  .home-page .journey-layer {
    clip-path: inset(100% 0 0 0);
  }
  .home-page .journey-layer:is([data-state='past'], [data-state='current']) {
    clip-path: inset(0);
  }
  /* 큰 단계 번호 위 공간의 가운데에 둔다. */
  .home-page .journey-layer .journey-visual--board {
    place-items: center;
    padding: clamp(48px, 8svh, 96px) clamp(40px, 5vw, 88px) clamp(180px, 26svh, 260px);
  }
  /* 낮은 화면에서는 보드를 좁혀 큰 단계 번호 위에서 끝나게 한다.
     겹이 들어올 때 보드는 마지막 몇 픽셀을 올라와 자리 잡는다. */
  .home-page .journey-layer .journey-board {
    width: min(100%, 540px, calc(100svh - 360px));
    translate: 0 28px;
  }
  .home-page .journey-layer[data-state='current'] .journey-board {
    translate: none;
  }

  .home-page .journey-numerals {
    position: absolute;
    z-index: 2;
    bottom: clamp(64px, 9svh, 96px);
    left: clamp(32px, 4vw, 64px);
    height: 1em;
    width: 2.2em;
    overflow: hidden;
    color: var(--brand);
    font-size: clamp(104px, 10vw, 156px);
    font-weight: var(--fw-heading);
    line-height: 1;
    letter-spacing: -0.055em;
    font-variant-numeric: tabular-nums;
  }
  .home-page .journey-numerals span {
    position: absolute;
    inset: 0 auto auto 0;
    translate: 0 105%;
  }
  .home-page .journey-numerals span[data-current] {
    translate: none;
  }
  .home-page .journey[data-active='1'] .journey-numerals span:nth-child(1),
  .home-page .journey[data-active='2'] .journey-numerals span:is(:nth-child(1), :nth-child(2)) {
    translate: 0 -105%;
  }
  .home-page .journey-progress {
    position: absolute;
    z-index: 2;
    right: clamp(32px, 4vw, 64px);
    bottom: 36px;
    left: clamp(32px, 4vw, 64px);
    height: 2px;
    background: #d3dae2;
  }
  .home-page .journey-progress span {
    display: block;
    height: 100%;
    background: var(--brand);
    transform: scaleX(var(--journey-progress, 0));
    transform-origin: left center;
  }

  /* 글: 위에 진행 표시줄, 아래 한 칸에 세 단계를 겹쳐 둔다. */
  .home-page .journey-steps {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: auto;
    margin: 0;
    gap: 0;
    padding: 0 clamp(40px, 5.5vw, 104px);
  }
  .home-page .journey-rail {
    display: flex;
    gap: clamp(20px, 2.4vw, 36px);
    margin: 0;
    padding: 28px 0 18px;
    border-bottom: 1px solid var(--line);
    list-style: none;
  }
  .home-page .journey-rail a {
    display: inline-flex;
    min-height: 32px;
    align-items: baseline;
    gap: 8px;
    color: var(--quiet);
    font-size: var(--fs-small);
    font-weight: var(--fw-strong);
    text-decoration: none;
  }
  .home-page .journey-rail b {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-heading);
  }
  .home-page .journey-rail a[aria-current] {
    color: var(--brand);
  }
  .home-page .journey-rail a:hover {
    color: var(--brand-hover);
  }
  .home-page .journey-step {
    grid-area: 2 / 1;
    align-content: center;
    padding-block: 32px;
    opacity: 0;
    translate: 0 28px;
    pointer-events: none;
  }
  .home-page .journey-step[data-current] {
    opacity: 1;
    translate: none;
    pointer-events: auto;
  }
  .home-page .journey-step-media {
    display: none;
  }
}
@media (min-width: 1081px) and (min-height: 620px) and (prefers-reduced-motion: no-preference) {
  .home-page .journey-layer {
    transition: clip-path 650ms var(--journey-ease);
  }
  .home-page .journey-layer .journey-board {
    transition: translate 800ms var(--journey-ease);
  }
  .home-page .journey-numerals span {
    transition: translate 700ms var(--journey-ease);
  }
  .home-page .journey-step {
    transition:
      opacity 450ms ease,
      translate 700ms var(--journey-ease);
  }
  .home-page .journey-step[data-current] {
    transition-delay: 40ms;
  }
  .home-page .journey-rail a {
    transition: color 200ms ease;
  }
}

/* 노트북 화면: 글과 경로 패널이 낮은 첫 화면을 나눠 쓴다. */
@media (min-width: 1081px) and (max-height: 820px) {
  .home-page .hero-main {
    padding-block: 40px calc(24px + var(--hero-routes-space));
  }
}

@media (max-width: 1080px) {
  .home-page {
    --home-description-size: 16px;
    --home-more-size: 16px;
  }
  /* 무대를 세로로 쌓고 짧게 둔다: 도착했을 때 경로 패널의 질문이 보여야 한다. */
  .home-page .hero-stage {
    display: flex;
    min-block-size: 0;
    flex-direction: column;
  }
  .home-page .hero-main {
    align-content: start;
    padding-block: clamp(48px, 7svh, 72px) 8px;
  }
  .home-page .hero-routes {
    grid-area: 2 / 1;
  }
  .home-page .hero-routes .container {
    padding-inline: 0;
  }
  .home-page .hero-routes-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: max(0px, calc(var(--gutter) - 20px));
  }
  .home-page .hero-routes h2 {
    grid-column: 1 / -1;
    padding: 22px 20px 6px;
  }
  .home-page .hero-routes li {
    border-left: 0;
  }
  .home-page .hero-routes li + li {
    border-left: 1px solid var(--line);
  }
  .home-page .hero-routes a {
    gap: 14px;
    padding: 16px 20px;
  }
  .home-page .hero-route-icon {
    width: 44px;
    height: 44px;
  }
  .home-page .hero-route-icon svg {
    width: 26px;
    height: 26px;
  }
  .home-page .hero-copy {
    max-width: 44rem;
  }
  .home-page .hero-subtitle {
    max-width: 32rem;
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.75;
  }
  .home-page .hero-actions {
    gap: 12px 20px;
    margin-top: 28px;
  }
  .home-page .hero-actions .button-primary {
    padding-inline: 20px;
    font-size: 15px;
  }
  .home-page .hero-company-link {
    gap: 4px;
    font-size: 15px;
  }
  .home-page .text-link.home-more-link {
    --more-icon-size: 28px;
    gap: 10px;
  }
}
@media (max-width: 640px) {
  .home-page .hero-routes-panel {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-page .hero-routes li + li {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .home-page .hero-route-text {
    font-size: 16px;
  }
}
@media (max-width: 340px) {
  .home-page .hero-routes a {
    gap: 8px;
    padding: 14px 12px;
  }
  .home-page .hero-route-icon {
    width: 32px;
    height: 32px;
  }
  .home-page .hero-route-icon svg {
    width: 22px;
    height: 22px;
  }
  .home-page .hero-route-arrow {
    width: 28px;
    height: 28px;
  }
}
