/* 시안 9 「요금은 투명하게, 할인은 확실하게.」 — 영상 프레임 안 흰 카드에서 계산기가 혼자 한 번 돈다.
   단계는 .demo9-frame 의 클래스로 켠다: step-1(칩) → step-2(영수증) → step-3(막대) → step-4(절약) → is-done(버튼). 움직임 줄이기면 바로 is-done. */
.demo9 {
  padding: clamp(40px, 6vw, 80px) 0;
  background: #fff;
}
.demo9-head {
  max-width: 920px;
  margin: 0 auto clamp(16px, 2.5vw, 24px);
}
.demo9-head h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 3.8vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.demo9-head h2 span {
  color: var(--blue);
}
.demo9-lead {
  margin: 0;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
  color: var(--muted);
}
/* 프레임 — 영상 위 어두운 막, 그 위 흰 카드 */
.demo9-frame {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
  border-radius: 24px;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
}
.demo9-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.demo9-frame.video-on .demo9-video {
  opacity: 1;
}
.demo9-frame.no-video .demo9-video {
  display: none;
}
.demo9-frame.no-video {
  background:
    linear-gradient(180deg, rgba(18, 60, 101, 0.6), rgba(18, 60, 101, 0.9)),
    url("./img/visual/season-poster.jpg") center / cover no-repeat;
}
.demo9-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 34, 58, 0.35) 0%, rgba(9, 34, 58, 0.72) 100%);
}
.demo9-card {
  position: relative;
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  padding: clamp(18px, 2.6vw, 28px);
  box-shadow: 0 20px 50px rgba(9, 34, 58, 0.35);
  display: grid;
  gap: 8px;
}
/* 단계 머리말 */
.demo9-step {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3ad;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.demo9-step small {
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}
.demo9-step-2,
.demo9-step-3 {
  margin-top: 8px;
}
/* 1. 조건 칩 — 하나씩 켜진다 */
.demo9-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.demo9-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid #dbe4ea;
  background: #f5f8fa;
  color: #94a3ad;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.demo9-chip.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  transform: translateY(-1px);
}
/* 2. 영수증 줄 — 떨어지며 들어오고 합계가 올라간다 */
.demo9-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.demo9-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 1px dashed #e3eaef;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.demo9-lines li.is-on {
  opacity: 1;
  transform: none;
}
.demo9-lines li b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 예약 할인 줄 — 빼는 금액(대표 2026-10-27 예약가로 비교) */
.demo9-lines li.is-off,
.demo9-lines li.is-off b {
  color: #0968ae;
}
/* 합계 줄과 「매표소와 비교」 머리말도 차례가 와야 보인다 */
.demo9-total,
.demo9-step-3 {
  opacity: 0;
  transition: opacity 0.3s;
}
.demo9-total.is-on,
.demo9-step-3.is-on {
  opacity: 1;
}
.demo9-total {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.demo9-total span {
  margin-right: auto;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.demo9-total b {
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.demo9-total i {
  font-style: normal;
  font-weight: 700;
  font-size: 18px;
}
/* 3. 막대 — 정상가(연함) · 매표소 할인가 · 월드스키(파랑) */
.demo9-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.demo9-bar {
  display: grid;
  grid-template-columns: minmax(92px, 1.1fr) 2fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s;
}
.demo9-bar.is-on {
  opacity: 1;
}
.demo9-bar-label {
  line-height: 1.25;
}
.demo9-bar-track {
  height: 14px;
  border-radius: 999px;
  background: #eef2f5;
  overflow: hidden;
}
.demo9-bar-track i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 999px;
  background: #b9c6d0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.demo9-bar.is-on .demo9-bar-track i {
  transform: scaleX(1);
}
.demo9-bar.is-onsite .demo9-bar-track i {
  background: #7d8f9d;
}
.demo9-bar.is-ours .demo9-bar-track i {
  background: var(--blue);
}
.demo9-bar b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 700;
}
.demo9-bar.is-list b {
  text-decoration: line-through;
  color: #94a3ad;
  font-weight: 600;
}
.demo9-bar.is-ours b {
  color: var(--blue);
  font-weight: 800;
}
/* 4. 절약 */
.demo9-save {
  margin: 6px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eaf7ef;
  color: #0a6d3a;
  display: grid;
  /* 박스 가운데로(대표 2026-10-17 「왼쪽으로 치우친 거 같아, 가운데쯤」) — 숫자+「원 절약」 한 덩어리를 가운데, 윗줄 설명도 가운데 */
  grid-template-columns: auto auto;
  justify-content: center;
  grid-template-areas:
    "who who"
    "num unit";
  align-items: baseline;
  column-gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s,
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.demo9-save.is-on {
  opacity: 1;
  transform: none;
}
.demo9-save b {
  grid-area: num;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #0a9d4f;
}
.demo9-save i {
  grid-area: unit;
  font-style: normal;
  font-weight: 800;
  font-size: 18px;
}
.demo9-save small {
  font-size: 13px;
  font-weight: 600;
}
.demo9-save small:first-child {
  grid-area: who;
  justify-self: center;
  text-align: center;
}
.demo9-save.is-hidden,
.demo9-bars.is-hidden,
.demo9-step-3.is-hidden {
  display: none;
}
/* PC — 한눈에 들어오게 두 칸(대표 2026-10-04): 왼쪽 조건·영수증·합계, 오른쪽 매표소 비교·절약 */
@media (min-width: 760px) {
  .demo9-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-areas:
      "s1 s3"
      "chips bars"
      "s2 bars"
      "lines bars"
      "total save";
    column-gap: 32px;
    align-content: start;
    padding: 22px 26px;
  }
  .demo9-step-1 {
    grid-area: s1;
  }
  .demo9-chips {
    grid-area: chips;
  }
  .demo9-step-2 {
    grid-area: s2;
  }
  .demo9-lines {
    grid-area: lines;
  }
  .demo9-total {
    grid-area: total;
    align-self: end;
  }
  .demo9-step-3 {
    grid-area: s3;
    margin-top: 0;
  }
  .demo9-bars {
    grid-area: bars;
    align-self: start;
    align-content: start;
  }
  .demo9-save {
    grid-area: save;
    margin: 0;
    align-self: end;
  }
  .demo9-frame {
    padding: 22px;
  }
  .demo9-total b {
    font-size: 40px;
  }
  .demo9-save b {
    font-size: 40px;
  }
}
/* 빨간 펜 — 절약액 둘레를 한 바퀴 그린다(is-pen). 마지막 큰 숫자에도 같은 선 */
.demo9-save,
.demo9-final-num {
  position: relative;
}
.demo9-pen {
  position: absolute;
  inset: -10px -12px;
  width: calc(100% + 24px);
  height: calc(100% + 20px);
  pointer-events: none;
  overflow: visible;
}
.demo9-pen path {
  fill: none;
  stroke: #e5322d;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  /* 둥근 끝점이 그리기 전에 점으로 보이지 않게 — 그릴 때만 나타난다 */
  opacity: 0;
}
.is-pen .demo9-pen path {
  stroke-dashoffset: 0;
  opacity: 0.92;
  transition:
    stroke-dashoffset 0.7s ease-in-out,
    opacity 0.05s;
}
.demo9-final-num .demo9-pen {
  inset: -14px -22px;
  width: calc(100% + 44px);
  height: calc(100% + 28px);
}
.demo9-final-num .demo9-pen path {
  stroke: #ff5a4f;
  stroke-width: 4;
}
.demo9-frame.is-final .demo9-final-num .demo9-pen path {
  stroke-dashoffset: 0;
  opacity: 0.95;
  transition:
    stroke-dashoffset 0.6s 0.45s ease-in-out,
    opacity 0.05s 0.45s;
}
/* 마지막 — 카드가 흐려지고(is-final) 그 위에 절약액 + 버튼만 */
.demo9-card {
  transition:
    opacity 0.5s ease,
    filter 0.5s ease,
    transform 0.5s ease;
}
.demo9-frame.is-final .demo9-card {
  opacity: 0.16;
  filter: blur(2px);
  transform: scale(0.985);
  cursor: pointer;
}
.demo9-final {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.45s 0.15s ease,
    transform 0.45s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.demo9-final[hidden] {
  display: none;
}
.demo9-frame.is-final .demo9-final {
  opacity: 1;
  transform: none;
}
.demo9-final-who {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #d5e4ef;
}
.demo9-final-num {
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}
.demo9-final-num b {
  font-size: clamp(56px, 9vw, 88px);
  font-weight: 800;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: #7ef0ad;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
.demo9-final-num i {
  font-style: normal;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
}
.demo9-cta {
  width: min(100%, 360px);
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.demo9-all-prices {
  min-height: 44px;
  border: 1px solid #bcd3e3;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
}
.demo9-replay {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #bcd3e3;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.demo9-foot {
  position: relative;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #bcd3e3;
}
.demo9-foot a {
  color: inherit;
}
.demo9-foot:empty {
  display: none;
}
.demo9-lines li small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
/* 폰 — 카드가 한 화면(약 650px) 안에 들어가게 촘촘히. 「조건」「계산」 머리말은 숨기고 「매표소와 비교」만 남긴다 */
@media (max-width: 599px) {
  .demo9-frame {
    padding: 12px;
    border-radius: 18px;
  }
  .demo9-card {
    padding: 14px;
    gap: 6px;
  }
  .demo9-step-1,
  .demo9-step-2 {
    display: none;
  }
  .demo9-chips {
    gap: 6px;
  }
  .demo9-chip {
    padding: 6px 10px;
    font-size: 13px;
  }
  .demo9-lines {
    margin-top: 4px;
    gap: 0;
  }
  .demo9-lines li {
    font-size: 14px;
    padding: 5px 0;
  }
  .demo9-total b {
    font-size: 30px;
  }
  .demo9-total i {
    font-size: 15px;
  }
  .demo9-step-3 {
    margin-top: 6px;
  }
  .demo9-bars {
    gap: 5px;
  }
  .demo9-bar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label value"
      "track track";
    row-gap: 2px;
    font-size: 12px;
  }
  .demo9-bar-label {
    grid-area: label;
  }
  .demo9-bar-track {
    grid-area: track;
    height: 8px;
  }
  .demo9-bar b {
    grid-area: value;
    font-size: 13px;
  }
  .demo9-save {
    padding: 10px 12px;
    column-gap: 4px;
  }
  .demo9-save b {
    font-size: 34px;
  }
  .demo9-save i {
    font-size: 15px;
  }
  .demo9-save small {
    font-size: 12px;
  }
  .demo9-cta {
    min-height: 48px;
    font-size: 16px;
  }
  .demo9-foot {
    margin-top: 10px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo9-chip,
  .demo9-lines li,
  .demo9-bar,
  .demo9-bar-track i,
  .demo9-save,
  .demo9-total,
  .demo9-step-3,
  .demo9-card,
  .demo9-final,
  .demo9-pen path,
  .demo9-video {
    transition: none;
  }
}

/* 오른쪽 「매표소와 비교」 첫 줄을 왼쪽 칩 줄과 같은 윗선에서(대표 2026-10-19 빨간 선 「위쪽 높이 맞추기」) —
   막대 줄은 가운데 정렬이라 첫 막대 윗변이 칩 윗변보다 5px 낮았다 */
@media (min-width: 760px) {
  .demo9-bars {
    margin-top: -5px;
  }
}
/* PC — 오른쪽 막대 셋을 굵게(14 → 30px)·줄 사이를 넓게(8 → 40px), 글자도 한 단계 크게(대표 2026-10-19 「우측 가로 막대 3개 하단이 너무 비어 보여, 굵기·높이 굵게, 여백 더」).
   막대가 줄 높이를 거의 채워 위 -5px 대신 -1px — 첫 막대 윗변 = 칩 윗변 */
@media (min-width: 760px) {
  .demo9-bars {
    margin-top: -1px;
    gap: 40px;
  }
  .demo9-bar {
    gap: 14px;
    font-size: 15px;
  }
  .demo9-bar-track {
    height: 30px;
  }
  .demo9-bar b {
    font-size: 17px;
  }
}
/* 빨간 펜 선이 끝까지 안 이어지던 진짜 원인 — vector-effect: non-scaling-stroke 이면 크롬은 점선 길이를 화면 크기로 재서
   pathLength=100 기준 「100」이 큰 화면에선 둘레의 절반쯤만 덮었다(PC 마지막 숫자 둘레 약 1,400px). 점선·빈칸을 300 으로 넉넉히 — 숨김(300)·그림(0) 동작은 같다 */
.demo9-pen path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
/* 마지막 큰 절약액의 빨간 동그라미가 「원 절약」까지 감싸게(대표 2026-10-19 「동그라미 쳐지는 효과가 끝까지 적용되지 않아」) —
   타원이 글자 상자에 딱 맞으면 오른쪽 아래 「원 절약」 모서리가 선에 걸린다. 타원 상자를 글자보다 가로 1.5배·세로 1.5배로 */
.demo9-final-num .demo9-pen {
  inset: auto;
  top: -26%;
  left: -24%;
  width: 148%;
  height: 152%;
}
