/* 화면 담당 전용 — css/ds-home.css. 디자인 시스템 v1(ds.css)의 st-* 컴포넌트를 쓰는 홈(pages/intro.js)의 스타일만 둔다.
   이 화면 전용 클래스는 모두 hm- 로 시작한다(app.css의 옛 .hero·.step·.faq 등과 겹치지 않게). 움직임은 transform·opacity만. */

/* 한국어는 낱말 중간에서 줄을 바꾸지 않는다 */
.hm-hero, .hm-section, .hm-ticker { word-break: keep-all; overflow-wrap: break-word; }

/* ---------- 섹션 리듬 ---------- */
.hm-section { padding: var(--st-space-24) 0; }
.hm-alt { background: var(--st-paper-warm); }
.hm-section .st-sec-head { margin-bottom: var(--st-space-10); }
@media (max-width: 720px) {
  .hm-section { padding: var(--st-space-16) 0; }
  .hm-section .st-sec-head { margin-bottom: var(--st-space-8); }
}

/* ---------- 첫 화면 ---------- */
.hm-hero { padding: calc(var(--st-header-h) + var(--st-space-10)) 0 var(--st-space-16); } /* 헤더는 fixed라 그 높이만큼 내려 시작한다 */
.hm-hero h1 { font-size: clamp(46px, 6.6vw, 84px); }
.hm-hero .st-hero-lead { max-width: 540px; }
.hm-hero .st-hero-lead b { font-weight: 800; }
.hm-cloud { width: 100%; max-width: 560px; justify-self: end; }
.hm-cloud-layer { position: absolute; inset: 0; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.hm-cloud-layer > * { position: absolute; }
.hm-pop { animation: st-pop 0.62s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d, 0s); }
.hm-say {
  left: 18%; top: 0; z-index: 2; padding: 12px 18px; border-radius: var(--st-radius-lg) var(--st-radius-lg) var(--st-radius-lg) 4px;
  background: var(--st-paper); box-shadow: var(--st-shadow-md); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap;
}
.hm-countdown { display: flex; flex-wrap: wrap; align-items: center; gap: var(--st-space-3) var(--st-space-4); margin-top: var(--st-space-6); }
.hm-cd-label { color: var(--st-ink-2); font: 600 14px/1 var(--st-font-sans); }
.hm-cd { display: inline-flex; gap: var(--st-space-2); }
.hm-cd-cell { display: inline-flex; align-items: baseline; gap: 3px; height: 40px; padding: 0 12px; border-radius: var(--st-radius-md); background: var(--st-paper-sunk); align-items: center; }
.hm-cd-cell b { font: 800 20px/1 var(--st-font-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.hm-cd-cell span { color: var(--st-ink-2); font: 600 12.5px/1 var(--st-font-sans); }
@media (max-width: 720px) {
  .hm-hero { padding: calc(var(--st-header-h) + var(--st-space-6)) 0 var(--st-space-12); }
  .hm-hero h1 { font-size: clamp(42px, 13vw, 56px); }
  .hm-cloud { justify-self: center; }
  .hm-say { left: 10%; font-size: 14px; padding: 10px 14px; }
}

/* ---------- 실시간 줄 ---------- */
.hm-ticker { display: flex; align-items: center; background: var(--st-paper-warm); border-block: 1px solid var(--st-line); height: 56px; overflow: hidden; }
.hm-ticker-label { flex: none; display: flex; align-items: center; height: 100%; padding: 0 var(--st-space-5) 0 max(var(--st-space-6), calc((100vw - var(--st-container)) / 2)); background: var(--st-paper-warm); position: relative; z-index: 1; }
.hm-ticker-view { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.hm-ticker-track { display: flex; gap: var(--st-space-12); width: max-content; white-space: nowrap; padding-left: var(--st-space-6); animation: hm-marquee var(--dur, 60s) linear infinite; }
.hm-ticker:hover .hm-ticker-track { animation-play-state: paused; }
@keyframes hm-marquee { to { transform: translateX(-50%); } }
.hm-tick { color: var(--st-ink-2); font: 500 14px/1 var(--st-font-sans); }
.hm-tick .h { color: var(--st-ink-3); font-weight: 700; }
.hm-tick b { color: var(--st-ink); font-weight: 700; }
.hm-tick .amt { margin-left: 4px; color: var(--st-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-tick .amt.neg { color: var(--st-danger); }
.hm-tick.wd b { text-decoration: line-through; text-decoration-color: var(--st-ink-3); }
@media (max-width: 720px) { .hm-ticker-label { padding-left: var(--st-space-4); padding-right: var(--st-space-3); } }

/* ---------- 큰 숫자 보드 ---------- */
.hm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); box-shadow: var(--st-shadow-sm); }
.hm-stats .st-stat { padding: var(--st-space-8) var(--st-space-6); }
.hm-stats .st-stat-value { font-size: clamp(32px, 3.5vw, 44px); white-space: nowrap; }
.hm-stats .st-stat-value small { margin-left: 4px; }
.hm-stats .st-stat-sub { margin-top: var(--st-space-3); }
.nw { white-space: nowrap; }
.hm-vstat { grid-template-columns: minmax(0, 1fr); margin-top: var(--st-space-4); }
.hm-vstat .st-stat-value { white-space: nowrap; }
.hm-stats-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--st-space-3); margin-top: var(--st-space-4); padding: 0 var(--st-space-2); color: var(--st-ink-2); font: 500 14px/1.5 var(--st-font-sans); }
.hm-asof { display: inline-flex; align-items: center; gap: var(--st-space-2); }
.hm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-ok); flex: none; }
@media (max-width: 960px) {
  .hm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-stats .st-stat + .st-stat { box-shadow: none; }
  .hm-stats .st-stat:nth-child(even) { box-shadow: inset 1px 0 0 var(--st-line); }
  .hm-stats .st-stat:nth-child(n + 3) { box-shadow: inset 0 1px 0 var(--st-line); }
  .hm-stats .st-stat:nth-child(4) { box-shadow: inset 1px 1px 0 var(--st-line); }
}
@media (max-width: 560px) {
  .hm-stats { grid-template-columns: 1fr; }
  .hm-stats .st-stat:nth-child(n) { box-shadow: none; }
  .hm-stats .st-stat + .st-stat { box-shadow: inset 0 1px 0 var(--st-line); }
  .hm-stats .st-stat { padding: var(--st-space-6); }
}

/* ---------- 참가 방법 ---------- */
.hm-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--st-space-5); }
.hm-steps .st-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--st-space-5); padding: var(--st-space-8); box-shadow: var(--st-shadow-sm); }
.hm-steps .st-step h3 { margin: 6px 0 var(--st-space-2); }
.hm-steps .st-step p { font-size: 15px; line-height: 1.65; }
.hm-step-tags { margin-top: var(--st-space-4); gap: var(--st-space-2); }
@media (max-width: 720px) {
  .hm-steps { grid-template-columns: 1fr; }
  .hm-steps .st-step { padding: var(--st-space-6); gap: var(--st-space-4); }
}

/* ---------- 산식·계산기 ---------- */
.hm-score { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--st-space-6); align-items: stretch; }
.hm-formula { display: flex; flex-direction: column; justify-content: center; padding: var(--st-space-10); }
.hm-formula-line { font: 800 clamp(30px, 3.6vw, 48px)/1.15 var(--st-font-sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-story-line { font: 800 clamp(30px, 3.6vw, 44px)/1.2 var(--st-font-sans); letter-spacing: -0.04em; text-wrap: balance; }
.hm-score-foot { margin: var(--st-space-6) 0 0; color: var(--st-ink-2); font-size: 15px; line-height: 1.7; max-width: 640px; }
.hm-dev-fold { margin-top: var(--st-space-2); }
.hm-dev-fold > summary { width: fit-content; min-height: 44px; display: flex; align-items: center; gap: var(--st-space-2); padding: 0 var(--st-space-5); border-radius: var(--st-radius-pill); background: var(--st-paper-sunk); cursor: pointer; list-style: none; font: 700 15px/1 var(--st-font-sans); color: var(--st-ink); }
.hm-dev-fold > summary::-webkit-details-marker { display: none; }
.hm-dev-fold > summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--st-ink-2); border-bottom: 2px solid var(--st-ink-2); transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.hm-dev-fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.hm-dev-fold[open] > summary { margin-bottom: var(--st-space-5); }
.hm-formula-line .op { color: var(--st-ink-3); font-weight: 600; }
.hm-formula-line .v { display: inline-block; padding: 0 6px; border-radius: var(--st-radius-sm); cursor: help; transition: background-color 0.3s, color 0.3s; }
.hm-formula-line .v.on, .hm-formula-line .v:hover { background: var(--st-brand-soft); color: var(--st-brand-display); }
.hm-legend { display: grid; gap: var(--st-space-4); margin: var(--st-space-8) 0 0; }
.hm-legend > div { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--st-space-3); align-items: start; }
.hm-legend dt { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--st-radius-agent); background: var(--st-paper); box-shadow: inset 0 0 0 1px var(--st-line); font: 800 15px/1 var(--st-font-sans); }
.hm-legend dd { margin: 0; padding-top: 4px; color: var(--st-ink-2); font-size: 15px; line-height: 1.6; }
.hm-calc { display: grid; gap: var(--st-space-4); align-content: start; padding: var(--st-space-8); }
.hm-calc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--st-space-3); margin-bottom: var(--st-space-2); }
.hm-calc .st-tab[aria-pressed="true"] { background: var(--st-paper); color: var(--st-ink); font-weight: 700; box-shadow: var(--st-shadow-sm); }
.hm-calc-row { display: flex; align-items: center; justify-content: space-between; gap: var(--st-space-3); color: var(--st-ink-2); font-size: 15px; }
.hm-calc-row b { color: var(--st-ink); font-weight: 700; }
.hm-calc-row .hm-calc-b { color: var(--st-brand-ink); }
.hm-calc input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: var(--st-space-1) 0; background: transparent; cursor: pointer; }
.hm-calc input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: var(--st-radius-pill); background: linear-gradient(90deg, var(--st-brand) var(--p, 45%), var(--st-paper-deep) var(--p, 45%)); }
.hm-calc input[type="range"]::-moz-range-track { height: 8px; border-radius: var(--st-radius-pill); background: var(--st-paper-deep); }
.hm-calc input[type="range"]::-moz-range-progress { height: 8px; border-radius: var(--st-radius-pill); background: var(--st-brand); }
.hm-calc input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: var(--st-radius-agent); border: 0; background: var(--st-brand); box-shadow: 0 0 0 3px var(--st-paper), var(--st-shadow-agent); }
.hm-calc input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: var(--st-radius-agent); border: 0; background: var(--st-brand); box-shadow: 0 0 0 3px var(--st-paper), var(--st-shadow-agent); }
.hm-calc input[type="range"]:focus-visible { outline: none; box-shadow: none; }
.hm-calc input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--st-shadow-focus), var(--st-shadow-agent); }
.hm-calc input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: var(--st-shadow-focus), var(--st-shadow-agent); }
.hm-calc-result { margin-top: var(--st-space-2); padding-top: var(--st-space-5); border-top: 1px dashed var(--st-line-strong); }
.hm-calc-big { margin: 4px 0; font: 800 44px/1.1 var(--st-font-sans); letter-spacing: -0.045em; }
.hm-calc-note { color: var(--st-ink-3); font: 500 13px/1.55 var(--st-font-sans); }
@media (max-width: 960px) { .hm-score { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .hm-formula, .hm-calc { padding: var(--st-space-6); }
  .hm-formula-line { font-size: clamp(22px, 6.2vw, 34px); white-space: nowrap; }
}

/* ---------- 경기장 미리보기 ---------- */
.hm-arena { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--st-space-8); align-items: start; }
.hm-col-title { margin: 0 0 var(--st-space-4); font: 700 18px/1.4 var(--st-font-sans); letter-spacing: -0.02em; }
.hm-arena .st-board { box-shadow: var(--st-shadow-sm); }
.hm-me { height: 20px; padding: 0 8px; font-size: 12px; vertical-align: 2px; }
.hm-pub-note { margin: var(--st-space-4) 0 0; color: var(--st-ink-2); font: 500 14px/1.55 var(--st-font-sans); }
.hm-feed-item { color: inherit; text-decoration: none; animation: hm-feed-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes hm-feed-in { from { transform: translateY(10px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.hm-feed-item .st-bubble { background: var(--st-paper); box-shadow: var(--st-shadow-sm); transition: box-shadow 0.2s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.hm-feed-item:hover .st-bubble { box-shadow: var(--st-shadow-md); transform: translateY(-2px); }
.hm-feed-name { color: var(--st-ink) !important; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hm-feed-amt { font-weight: 800; letter-spacing: -0.02em; }
.hm-feed-amt.neg { color: var(--st-danger); }
.hm-feed-amt.dim { color: var(--st-ink-3); font-weight: 600; }
.hm-feed-sub { color: var(--st-ink-3); font: 600 12.5px/1.4 var(--st-font-sans); }
.hm-feed-item.held .hm-feed-amt { opacity: 0.6; }
.hm-feed-item.wd { opacity: 0.7; }
.hm-feed-item.wd .hm-feed-name { text-decoration: line-through; text-decoration-color: var(--st-ink-3); }
.hm-empty { display: grid; justify-items: center; gap: var(--st-space-3); padding: var(--st-space-10) var(--st-space-6); border-radius: var(--st-radius-xl); background: var(--st-paper); text-align: center; }
.hm-empty p { margin: 0; max-width: 320px; color: var(--st-ink-2); font-size: 15px; line-height: 1.6; }
@media (max-width: 960px) { .hm-arena { grid-template-columns: 1fr; } }

/* ---------- 코드 예시 ---------- */
.hm-section .st-code { box-shadow: var(--st-shadow-sm); }
.hm-code-actions { display: flex; align-items: center; gap: var(--st-space-3); margin-left: auto; }
.hm-code-name { color: var(--st-ink-2); font: 600 13px/1 var(--st-font-sans); }
.hm-section .st-code pre { min-height: 232px; font-size: 13.5px; }
.hm-code-note { margin: var(--st-space-4) 0 0; max-width: 820px; color: var(--st-ink-2); font: 500 14px/1.7 var(--st-font-sans); }
@media (max-width: 720px) { .hm-code-name { display: none; } .hm-section .st-code pre { padding: var(--st-space-4); } }

/* ---------- 공정성 카드 ---------- */
.hm-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--st-space-5); }
.hm-feature { display: flex; flex-direction: column; gap: var(--st-space-3); padding: var(--st-space-8); }
.hm-feature h3 { margin: var(--st-space-2) 0 0; font: 700 20px/1.32 var(--st-font-sans); letter-spacing: -0.025em; }
.hm-feature p { margin: 0; color: var(--st-ink-2); font-size: 15px; line-height: 1.65; }
.hm-feature-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--st-radius-agent); background: var(--st-brand-soft); color: var(--st-brand-ink); }
.hm-feature-ico svg { width: 22px; height: 22px; }
.hm-features--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-features--2 .hm-feature { padding: var(--st-space-6); }
.hm-features--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hm-features--4 .hm-feature { padding: var(--st-space-6); }
@media (max-width: 1100px) { .hm-features--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .hm-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hm-features, .hm-features--2, .hm-features--4 { grid-template-columns: 1fr; } .hm-feature { padding: var(--st-space-6); } }

/* ---------- 일정 ---------- */
.hm-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hm-timeline .tl { position: relative; padding: 0 var(--st-space-5) 0 0; }
.hm-timeline .tl-dot { position: relative; z-index: 1; display: block; width: 22px; height: 22px; border-radius: var(--st-radius-agent); background: var(--st-paper); box-shadow: inset 0 0 0 3px var(--st-paper-deep); }
.hm-timeline .tl.done .tl-dot { background: var(--st-brand); box-shadow: none; }
.hm-timeline .tl.now .tl-dot { background: var(--st-brand); box-shadow: 0 0 0 4px var(--st-brand-soft), var(--st-shadow-agent); }
.hm-timeline .tl:not(:last-child)::after { content: ''; position: absolute; top: 9.5px; left: 30px; right: 8px; height: 3px; border-radius: 2px; background: var(--st-paper-deep); }
.hm-timeline .tl.done:not(:last-child)::after { background: var(--st-brand); }
.hm-timeline .tl-when { margin-top: var(--st-space-4); color: var(--st-ink-3); font: 600 13px/1.4 var(--st-font-sans); }
.hm-timeline h3 { margin: 4px 0 var(--st-space-2); font: 700 20px/1.32 var(--st-font-sans); letter-spacing: -0.025em; }
.hm-timeline p { margin: 0 0 var(--st-space-3); color: var(--st-ink-2); font-size: 15px; line-height: 1.6; }
@media (max-width: 960px) {
  .hm-timeline { grid-template-columns: 1fr; }
  .hm-timeline .tl { padding: 0 0 var(--st-space-8) 46px; }
  .hm-timeline .tl:last-child { padding-bottom: 0; }
  .hm-timeline .tl-dot { position: absolute; left: 0; top: 2px; }
  .hm-timeline .tl:not(:last-child)::after { top: 30px; bottom: 6px; left: 9.5px; right: auto; width: 3px; height: auto; }
  .hm-timeline .tl-when { margin-top: 0; }
}

/* ---------- 자주 묻는 질문 ---------- */
.hm-faq-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--st-space-12); align-items: start; }
.hm-faq-title { margin: var(--st-space-3) 0 0; font: 800 clamp(30px, 3.6vw, 44px)/1.12 var(--st-font-sans); letter-spacing: -0.04em; text-wrap: balance; }
.hm-faq-more { margin: var(--st-space-4) 0 0; color: var(--st-ink-2); font-size: 16px; }
.hm-faq details { border-bottom: 1px solid var(--st-line); }
.hm-faq details:first-child { border-top: 1px solid var(--st-line); }
.hm-faq summary { display: flex; align-items: center; gap: var(--st-space-4); padding: var(--st-space-5) 0; cursor: pointer; list-style: none; font: 700 18px/1.45 var(--st-font-sans); letter-spacing: -0.02em; }
.hm-faq summary::-webkit-details-marker { display: none; }
.hm-faq summary::after { content: '+'; margin-left: auto; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--st-radius-agent); background: var(--st-paper); box-shadow: inset 0 0 0 1px var(--st-line); color: var(--st-ink); font: 700 20px/1 var(--st-font-sans); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s; }
.hm-faq summary:hover::after { background: var(--st-brand-soft); }
.hm-faq details[open] summary::after { transform: rotate(45deg); background: var(--st-brand); box-shadow: none; }
.hm-faq details p { margin: 0; padding: 0 var(--st-space-12) var(--st-space-6) 0; color: var(--st-ink-2); font-size: 16px; line-height: 1.7; }
@media (max-width: 960px) { .hm-faq-wrap { grid-template-columns: 1fr; gap: var(--st-space-8); } }
@media (max-width: 720px) { .hm-faq summary { font-size: 16px; } .hm-faq details p { padding-right: 0; } }

/* ---------- 마무리 띠 ---------- */
.hm-cta { padding-top: calc(var(--st-space-24) + 40px); padding-bottom: var(--st-space-24); }
.hm-cta .st-band h2 { margin-top: var(--st-space-2); }
@media (max-width: 720px) {
  .hm-cta { padding-top: calc(var(--st-space-16) + 36px); padding-bottom: var(--st-space-16); }
  .hm-cta .st-band-perch { gap: 4px; }
  .hm-cta .st-band-perch .st-agent--lg { width: 52px; height: 52px; }
}

/* ---------- 움직임 줄이기 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hm-pop, .hm-feed-item { animation: none; }
  .hm-ticker-track { animation: none; }
  .hm-ticker-view { overflow-x: auto; }
  .hm-cloud-layer, .hm-faq summary::after, .hm-feed-item .st-bubble { transition: none; }
}

/* 내 줄(is-me)은 바탕이 brand-soft라 '나' 알약은 흰 바탕으로 */
.st-rank-row.is-me .hm-me { background: var(--st-paper); }

/* 코드 상자 머리: 좁은 화면에서도 탭 줄과 복사 버튼이 한 줄에 있고, 탭이 넘치면 탭 줄 안에서 민다 */
.hm-section .st-code-head { flex-wrap: nowrap; }
.hm-section .st-code-head .st-tabs { flex: 0 1 auto; min-width: 0; }
.hm-section .st-code-head .hm-code-actions { flex: none; }
@media (max-width: 720px) { .hm-section .st-code-head .st-tab { padding: 0 12px; } }
/* 확정 전 「이의 신청 기간」 안내는 문장이라 줄바꿈을 허용하고 금액보다 작게 */
.hm-vstat .st-stat-value.hm-vperiod { white-space: normal; font-size: clamp(18px, 2.2vw, 24px); }
