/* 프로덕트 스토리 컴포넌트 스타일. tokens.css 다음에 불러온다.
   글자 크기는 tokens.json 의 type 스타일과 같은 값이며, 반응형 단계만 여기서 바꾼다. */

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; line-height: 27px; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  word-break: keep-all; overflow-wrap: break-word;
}
.ps-root *, .ps-root *::before, .ps-root *::after { box-sizing: border-box; }
.ps-root p, .ps-root h1, .ps-root h2, .ps-root h3, .ps-root h4 { margin: 0; }
.ps-root b, .ps-root strong { font-weight: 600; color: var(--ink); }

/* ── 섹션과 콘텐츠 폭 ── */
.ps-section {
  padding-left: max(var(--gutter-min), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-min), env(safe-area-inset-right, 0px));
  padding-block: var(--section-pad);
  background: var(--bg);
}
.ps-section--alt { background: var(--surface); }
.ps-section--stage { background: var(--stage-dark); color: var(--on-stage-dark); }
.ps-wrap { width: min(100%, var(--content-width), var(--content-max)); margin-inline: auto; display: flex; flex-direction: column; gap: var(--space-block); }

/* ── 헤드라인 묶음 ── */
.ps-lockup { display: flex; flex-direction: column; margin-bottom: 24px; }
.ps-eyebrow { font-size: 21px; line-height: 21px; font-weight: 600; margin-bottom: var(--space-eyebrow); }
.ps-headline { font-size: 80px; line-height: 92px; font-weight: 700; text-wrap: balance; }
.ps-headline--hero { font-size: 80px; line-height: 92px; }
.ps-lead { max-width: var(--text-max); margin-top: var(--space-lead); color: var(--ink-copy); font-size: 21px; line-height: 32px; font-weight: 400; }
.ps-lead b, .ps-lead strong { font-weight: 500; color: var(--ink); }
.ps-section--stage .ps-lead { color: var(--on-stage-dark-copy); }
.ps-section--stage .ps-lead b { color: var(--on-stage-dark); }

/* ── 큰 숫자 ── */
.ps-stats { display: flex; flex-wrap: wrap; gap: var(--space-stat-row) var(--space-stat-col); }
.ps-stat { flex: 0 1 260px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ps-stat__value { font-family: var(--font-numeric); font-size: 48px; line-height: 48px; font-weight: 600; color: var(--ink); }
.ps-stat__caption { font-size: 14px; line-height: 20px; color: var(--ink); }
.ps-stat--orange .ps-stat__value { color: var(--accent-orange); }
.ps-stat--blue .ps-stat__value { color: var(--accent-blue); }
.ps-section--stage .ps-stat__value, .ps-section--stage .ps-stat__caption { color: var(--on-stage-dark); }
@media (prefers-reduced-motion: no-preference) {
  .ps-stat__value { transition: color var(--reveal-duration) ease; }
  .ps-stat.is-pre:not(.ps-stat--orange):not(.ps-stat--blue) .ps-stat__value { color: var(--mark-neutral); }
}

/* ── 결론 한 문장 ── */
.ps-verdict { max-width: var(--text-max); font-size: 28px; line-height: 35px; font-weight: 600; }
.ps-verdict span { color: var(--ink-copy); }

/* ── 이미지 ── */
.ps-media { margin: 0; display: flex; flex-direction: column; gap: var(--space-caption); }
.ps-media__stage { position: relative; overflow: hidden; border-radius: var(--radius-panel); background: var(--stage-light); aspect-ratio: 16 / 10; max-width: 100%; }
.ps-media__stage--dark { background: var(--stage-dark); }
.ps-media__stage--bleed { border-radius: 0; }
.ps-media__stage img, .ps-media__stage picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.ps-media__caption { max-width: 420px; font-size: 14px; line-height: 20px; color: var(--ink-secondary); }
.ps-section--stage .ps-media__caption { color: var(--on-stage-dark-copy); }
.ps-media__caption b { color: var(--ink); }
.ps-section--stage .ps-media__caption b { color: var(--on-stage-dark); }
/* 테마별 이미지 바꾸기: 밝은 이미지에는 .ps-only-light, 어두운 이미지에는 .ps-only-dark */
.ps-only-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ps-only-dark { display: block !important; } :root:not([data-theme="light"]) .ps-only-light { display: none !important; } }
:root[data-theme="dark"] .ps-only-dark { display: block !important; }
:root[data-theme="dark"] .ps-only-light { display: none !important; }

/* 이미지 위 숫자: 어두운 스테이지의 빈 곳에만 */
.ps-media__overlay { position: absolute; left: 6%; bottom: 8%; display: flex; flex-direction: column; gap: 6px; max-width: 40%; }
.ps-media__overlay .ps-stat__value, .ps-media__overlay .ps-stat__caption { color: var(--on-stage-dark); }

/* 갤러리: 같은 비율의 이미지 2~3장 */
.ps-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ps-gallery .ps-media__stage { aspect-ratio: 4 / 5; }

/* ── 패널 ── */
.ps-panel { background: var(--surface-raised); border-radius: var(--radius-panel); padding: var(--space-panel); }
.ps-section:not(.ps-section--alt) .ps-panel { background: var(--surface); }
.ps-panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: 28px; }
.ps-panel__title { font-size: 21px; line-height: 29px; font-weight: 600; }
.ps-panel__unit { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--ink-tertiary); }

/* ── 범례 ── */
.ps-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; line-height: 20px; color: var(--ink-secondary); }
.ps-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ps-swatch { width: 12px; height: 12px; border-radius: var(--radius-swatch); background: var(--c, var(--ink)); flex: none; }
.ps-swatch--diamond { width: 11px; height: 11px; border-radius: 1px; transform: rotate(45deg); }

/* ── 탭 (세그먼트) ── */
.ps-segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-segment {
  font: inherit; font-size: 14px; line-height: 20px; font-weight: 400; cursor: pointer;
  padding: 8px 20px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
.ps-section--alt .ps-segment, .ps-panel .ps-segment { background: var(--surface-raised); }
.ps-segment[aria-pressed="true"] { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }
.ps-segment:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ── 알약과 태그 ── */
.ps-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; line-height: 16px; font-weight: 600; padding: 4px 12px 4px 10px; border-radius: var(--radius-pill); }
.ps-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ps-pill--positive { color: var(--positive); background: var(--positive-soft); }
.ps-pill--caution { color: var(--caution); background: var(--caution-soft); }
.ps-pill--negative { color: var(--negative); background: var(--negative-soft); }
.ps-tag { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--ink-secondary); }
.ps-tag--strong { border-color: var(--ink); color: var(--ink); }

/* ── 3단 설명 ── */
.ps-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 56px 48px; }
.ps-feature { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ps-feature__title { font-size: 28px; line-height: 35px; font-weight: 600; margin-bottom: 4px; }
.ps-feature__body { font-size: 17px; line-height: 27px; color: var(--ink-secondary); }
.ps-feature__source { font-size: 12px; line-height: 17px; color: var(--ink-tertiary); }

/* ── 타일 ── */
.ps-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ps-tile { background: var(--surface-raised); border-radius: var(--radius-tile); padding: var(--space-tile); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ps-section:not(.ps-section--alt) .ps-tile { background: var(--surface); }
.ps-tile__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ps-tile__title { font-size: 21px; line-height: 29px; font-weight: 600; }
.ps-tile__body { font-size: 14px; line-height: 22px; color: var(--ink-secondary); }

/* ── 나란히 비교 ── */
.ps-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 56px 48px; }
.ps-split__col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ps-split__name { font-size: 24px; line-height: 28px; font-weight: 600; padding-bottom: 16px; border-bottom: 3px solid var(--c, var(--ink)); }
.ps-split__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ps-split .ps-stat__value { font-size: 40px; line-height: 44px; color: var(--c, var(--ink)); }
.ps-split__body { font-size: 17px; line-height: 27px; color: var(--ink-secondary); }

/* ── 표 ── */
.ps-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ps-table { width: 100%; min-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; line-height: 20px; }
.ps-table th, .ps-table td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ps-table th { font-size: 12px; font-weight: 600; color: var(--ink-tertiary); padding-bottom: 12px; }
.ps-table .ps-num { text-align: right; padding-right: 0; padding-left: 16px; }
.ps-table tr.ps-table__group td { padding-top: 32px; border-bottom: none; font-size: 17px; line-height: 23px; font-weight: 600; }
.ps-table .ps-sub { display: block; font-size: 12px; line-height: 17px; color: var(--ink-tertiary); }
.ps-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--mark-neutral)); margin-right: 8px; vertical-align: 2px; }

/* ── 가로 막대 ── */
.ps-bars { display: flex; flex-direction: column; }
.ps-bar-row { display: grid; grid-template-columns: minmax(0, 18em) minmax(0, 1fr); gap: 8px 24px; align-items: center; padding-block: 10px; }
.ps-bar-row__name { font-size: 14px; line-height: 20px; }
.ps-bar-row__name small { display: block; font-size: 12px; line-height: 17px; color: var(--ink-tertiary); }
.ps-bar-row__bar { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ps-bar-row__bar i { display: block; height: 22px; border-radius: 0 var(--radius-bar) var(--radius-bar) 0; background: var(--c, var(--ink)); flex: none; }
.ps-bar-row__bar span { font-size: 14px; color: var(--ink-secondary); min-width: 0; }
.ps-bar-row__bar b { font-family: var(--font-numeric); font-size: 21px; line-height: 25px; font-weight: 600; margin-right: 6px; }

/* ── 점 차트 (덤벨) ── */
.ps-dotplot { display: flex; flex-direction: column; }
.ps-dot-row { display: grid; grid-template-columns: 3em minmax(0, 1fr) 11em; gap: 16px; align-items: center; padding-block: 10px; border-bottom: 1px solid var(--line); }
.ps-dot-row:last-of-type { border-bottom: 0; }
.ps-dot-row__x { font-family: var(--font-numeric); font-size: 24px; line-height: 28px; font-weight: 600; white-space: nowrap; }
.ps-dot-row__plot { position: relative; height: 44px; }
.ps-dot-row__grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--track); }
.ps-dot-row__gap { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--line); }
.ps-marker { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--c, var(--ink)); box-shadow: 0 0 0 2px var(--surface-raised); }
.ps-section:not(.ps-section--alt) .ps-marker { box-shadow: 0 0 0 2px var(--surface); }
.ps-marker--diamond { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 1px; transform: rotate(45deg); }
.ps-dot-row__sum { font-size: 14px; line-height: 20px; text-align: right; }
.ps-dot-row__sum b { font-family: var(--font-numeric); font-size: 21px; }
.ps-dot-row__sum small { display: block; font-size: 12px; line-height: 17px; color: var(--ink-tertiary); }
@media (prefers-reduced-motion: no-preference) { .ps-marker, .ps-dot-row__gap { transition: left var(--state-duration) ease, width var(--state-duration) ease; } }

/* ── 단계 표 ── */
.ps-levels { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--ink-secondary); margin-bottom: 20px; }
.ps-levels span { display: inline-flex; align-items: center; gap: 8px; }
.ps-level-chip { width: 14px; height: 14px; border-radius: var(--radius-bar); flex: none; }
.ps-matrix { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); gap: 6px; }
.ps-matrix__head { font-size: 12px; line-height: 17px; font-weight: 600; color: var(--ink-tertiary); padding: 0 4px 8px; }
.ps-matrix__head small { display: block; font-weight: 400; }
.ps-matrix__row { padding: 14px 8px 14px 4px; display: flex; flex-direction: column; gap: 2px; }
.ps-matrix__row b { font-size: 17px; line-height: 23px; }
.ps-matrix__row small { font-size: 12px; line-height: 17px; color: var(--ink-tertiary); }
.ps-cell { border-radius: var(--radius-cell); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ps-cell b { font-size: 14px; line-height: 20px; color: inherit; }
.ps-cell span { font-size: 12px; line-height: 17px; opacity: 0.88; }
.ps-cell__label { display: none; font-weight: 600; }
.ps-cell--0 { background: var(--surface-raised); color: var(--ink-secondary); box-shadow: inset 0 0 0 1px var(--line); }
.ps-cell--1 { background: var(--level-1); color: var(--ink); }
.ps-cell--2 { background: var(--inverse); color: var(--on-inverse); }

/* ── 로컬 내비게이션: 화면 위·양옆 10px 띄운 둥근 막대 ── */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.ps-localnav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; pointer-events: none;
  padding: var(--localnav-offset) max(var(--localnav-offset), env(safe-area-inset-right, 0px)) 2px max(var(--localnav-offset), env(safe-area-inset-left, 0px));
}
.ps-localnav__in {
  pointer-events: auto; max-width: var(--localnav-max); margin-inline: auto; padding: 12px var(--localnav-pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: var(--radius-localnav); background: rgba(255, 255, 255, 0.8); box-shadow: 0 0 0 1px var(--nav-ring);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
[data-theme="dark"] .ps-localnav__in { background: rgba(29, 29, 31, 0.8); }
.ps-localnav__title { font-size: 19px; line-height: 25px; font-weight: 600; white-space: nowrap; }
.ps-localnav__links { display: flex; align-items: center; gap: var(--chip-gap); }
.ps-chip {
  display: inline-block; font-size: 12px; line-height: 17px; font-weight: 400;
  padding: var(--chip-pad-y) var(--chip-pad-x); border-radius: var(--radius-pill); text-decoration: none; white-space: nowrap;
  color: var(--ink); background: rgba(255, 255, 255, 0.8); box-shadow: 0 0 0 1px var(--chip-ring);
}
[data-theme="dark"] .ps-chip { background: rgba(29, 29, 31, 0.8); }
.ps-chip--primary, [data-theme="dark"] .ps-chip--primary { background: var(--cta); color: #ffffff; box-shadow: none; }
.ps-chip:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ps-section[id] { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 76px); }

/* ── 가로 넘김 카드 (모바일에서만 넘김, 넓은 화면에서는 격자) ── */
.ps-carousel { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--carousel-gap); }
.ps-carousel__card { background: var(--surface-raised); border-radius: var(--radius-panel); padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ps-section:not(.ps-section--alt) .ps-carousel__card { background: var(--surface); }
.ps-carousel__title { font-size: 21px; line-height: 29px; font-weight: 600; }
.ps-carousel__body { font-size: 14px; line-height: 22px; color: var(--ink-secondary); }
.ps-pager { display: none; }
.ps-pager__in { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: var(--radius-pill); background: var(--level-1); }
.ps-pager i { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--mark-neutral); }
.ps-pager i.is-on { width: 28px; background: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .ps-pager i { transition: width .3s ease, background-color .3s ease; } }

/* ── 1068px 이하 ── */
@media (max-width: 1068px) {
  .ps-section { padding-block: var(--section-pad-tablet); }
  .ps-headline { font-size: 64px; line-height: 75px; }
  .ps-feature__title, .ps-verdict { font-size: 24px; line-height: 31px; }
  .ps-panel { padding: 32px; }
}
/* ── 734px 이하 ── */
@media (max-width: 734px) {
  .ps-section { padding-block: var(--section-pad-mobile); }
  .ps-wrap { width: min(100%, var(--content-width), var(--content-max-mobile)); gap: 48px; }
  .ps-lockup { margin-bottom: 8px; }
  .ps-eyebrow { font-size: 19px; line-height: 25px; margin-bottom: var(--space-eyebrow-mobile); }
  .ps-headline { font-size: 40px; line-height: 48px; }
  .ps-headline--hero { font-size: 48px; line-height: 57px; }
  .ps-lead { font-size: 19px; line-height: 29px; margin-top: var(--space-lead-mobile); }
  .ps-feature__title, .ps-verdict { font-size: 21px; line-height: 27px; }
  .ps-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-stat-row-mobile) 20px; }
  .ps-stats--wide { grid-template-columns: minmax(0, 1fr); }
  .ps-stat__value { font-size: 40px; line-height: 44px; }
  .ps-panel { padding: 28px 20px; }
  .ps-features { gap: 40px; }
  .ps-split { gap: 48px; }
  .ps-table-wrap--bleed { margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); scrollbar-width: none; }
  .ps-table-wrap--bleed::-webkit-scrollbar { display: none; }
  .ps-carousel {
    grid-auto-flow: column; grid-auto-columns: min(var(--carousel-card), 340px); grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); scroll-padding-inline: calc(50vw - 50%); padding-bottom: 4px;
  }
  .ps-carousel::-webkit-scrollbar { display: none; }
  .ps-carousel__card { scroll-snap-align: start; min-height: 220px; }
  .ps-carousel__title { font-size: 17px; line-height: 23px; }
  .ps-pager { display: flex; justify-content: center; margin-top: -24px; }
  .ps-localnav__in { padding: 12px; }

  .ps-media__stage--hero { aspect-ratio: 4 / 5; }
  .ps-media__overlay { max-width: 80%; }
  .ps-tile { padding: 24px; }
  .ps-bar-row { grid-template-columns: minmax(0, 1fr); }
  .ps-dot-row { grid-template-columns: 2.8em minmax(0, 1fr); }
  .ps-dot-row__x { font-size: 21px; }
  .ps-dot-row__sum { grid-column: 2; text-align: left; }
  .ps-dot-row__sum small { display: inline; margin-left: 6px; }
  .ps-matrix { grid-template-columns: minmax(0, 1fr); }
  .ps-matrix__head { display: none; }
  .ps-matrix__row { padding: 24px 0 4px; }
  .ps-cell__label { display: block; }
}

/* ── 자간: Pretendard 글자 사이 빈 공간을 애플(SF Pro KR) 실측에 맞춘 값. 크기와 굵기마다 하나 ──
   본문 400 (17 · 14px) -0.02em · 같은 크기 600 -0.01em · 리드 21 · 19px -0.011em · 12px 400 -0.01em · 12px 600 0
   제목 · 소제목 · eyebrow 600 (19~28px) 0 · 섹션 헤드라인 700 -0.015em · 숫자 0
   em 값이 요소마다 다시 계산되도록 .ps-root 아래 모든 요소에 건다. */
.ps-root, .ps-root * { letter-spacing: -0.02em; }
.ps-headline { letter-spacing: -0.015em; }
.ps-eyebrow, .ps-verdict, .ps-feature__title, .ps-panel__title, .ps-tile__title, .ps-split__name, .ps-carousel__title, .ps-localnav__title { letter-spacing: 0; }
.ps-lead { letter-spacing: -0.011em; }
.ps-lead b, .ps-lead strong, .ps-verdict span { letter-spacing: inherit; }
.ps-root b, .ps-root strong, .ps-matrix__row b, .ps-cell b, .ps-table tr.ps-table__group td { letter-spacing: -0.01em; }
.ps-stat__value, .ps-bar-row__bar b, .ps-dot-row__x, .ps-dot-row__sum b { letter-spacing: 0; }
.ps-root small, .ps-feature__source, .ps-sub, .ps-chip, .ps-cell span, .ps-dot-row__sum small, .ps-bar-row__name small, .ps-matrix__row small, .ps-matrix__head small { letter-spacing: -0.01em; }
.ps-table th, .ps-pill, .ps-tag, .ps-matrix__head, .ps-cell__label { letter-spacing: 0; }
.ps-root svg text { letter-spacing: 0; }
@media (max-width: 734px) { .ps-carousel__title { letter-spacing: -0.01em; } }
