/* UI 도감 - 화면 구성 (ui-layout) */

.dm-hero-opt:focus-visible, .dm-hero-go:focus-visible, .dm-hero-more:focus-visible, .dm-splash-splash:focus-visible,
.dm-onboarding-skip:focus-visible, .dm-onboarding-dot:focus-visible, .dm-onboarding-next:focus-visible, .dm-onboarding-again:focus-visible,
.dm-onboarding-view:focus-visible, .dm-placeholder-input:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---- 히어로 ---- */
.dm-hero-wrap { max-width: 440px; margin: 0 auto; }
.dm-hero-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 12px; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.dm-hero-opt { padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 0.8rem; cursor: pointer; transition: background .25s var(--ease), color .25s; }
.dm-hero-opt:hover { color: var(--ink); }
.dm-hero-opt[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.dm-hero-box { display: grid; gap: 18px; padding: 26px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dm-hero-copy { display: grid; gap: 10px; align-content: center; justify-items: start; min-width: 0; }
.dm-hero-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; color: var(--signal-text); letter-spacing: .04em; }
.dm-hero-title { margin: 0; font-size: clamp(1.25rem, 1rem + 1.2vw, 1.7rem); line-height: 1.25; color: var(--ink); text-wrap: balance; }
.dm-hero-sub { margin: 0; font-size: 0.86rem; line-height: 1.6; color: var(--ink-soft); }
.dm-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.dm-hero-go { padding: 10px 18px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); font: inherit; font-size: 0.85rem; cursor: pointer; transition: transform .15s var(--ease), background .2s; }
.dm-hero-go:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.dm-hero-go:active { transform: scale(.95); }
.dm-hero-more { padding: 10px 14px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.85rem; cursor: pointer; border-radius: 999px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.dm-hero-more:hover { text-decoration-color: var(--signal); }
.dm-hero-art { position: relative; display: none; min-height: 120px; }
.dm-hero-card { position: absolute; left: 50%; top: 50%; width: 70%; height: 56px; margin: -28px 0 0 -35%; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-deep); }
.dm-hero-card:nth-child(1) { transform: translate(-6%, -36px) rotate(-6deg); }
.dm-hero-card:nth-child(2) { transform: translate(4%, -2px) rotate(3deg); background: var(--card); }
.dm-hero-card:nth-child(3) { transform: translate(-2%, 32px) rotate(-2deg); background: var(--signal-soft); border-color: var(--signal); }

.dm-hero-box[data-layout="center"] .dm-hero-copy { justify-items: center; text-align: center; }
.dm-hero-box[data-layout="center"] .dm-hero-cta { justify-content: center; }
.dm-hero-box[data-layout="center"] { padding-block: 34px; }
.dm-hero-box[data-layout="split"] { grid-template-columns: minmax(0, 1.4fr) minmax(70px, 1fr); align-items: center; }
.dm-hero-box[data-layout="split"] .dm-hero-art { display: block; }
.dm-hero-box.is-in .dm-hero-copy > * { animation: dm-layout-rise .5s var(--ease) backwards; }
.dm-hero-box.is-in .dm-hero-copy > :nth-child(2) { animation-delay: 60ms; }
.dm-hero-box.is-in .dm-hero-copy > :nth-child(3) { animation-delay: 120ms; }
.dm-hero-box.is-in .dm-hero-copy > :nth-child(4) { animation-delay: 180ms; }
.dm-hero-box.is-in .dm-hero-card { animation: dm-layout-rise .6s var(--ease) backwards; }
@keyframes dm-layout-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

/* ---- 스플래시 ---- */
.dm-splash-wrap { display: grid; justify-items: center; gap: 12px; }
.dm-splash-phone { position: relative; width: min(100%, 210px); height: 232px; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; }
.dm-splash-hbar { padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.85rem; }
.dm-splash-hbody { display: grid; gap: 10px; padding: 16px; }
.dm-splash-hh { margin: 0 0 2px; font-size: 1rem; }
.dm-splash-skel { display: block; height: 8px; border-radius: 4px; background: var(--paper-deep); }
.dm-splash-home { position: absolute; inset: 0; opacity: .0; transform: scale(.96); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.is-done .dm-splash-home, .dm-splash-phone:not(.is-run) .dm-splash-home { opacity: 1; transform: none; }
.dm-splash-splash { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; border: 0; background: var(--ink); color: var(--paper); font: inherit; cursor: pointer; transition: transform .65s var(--ease), opacity .45s; }
.is-done .dm-splash-splash { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.dm-splash-mark { width: 68px; height: 68px; overflow: visible; }
.dm-splash-ring { fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 32px 32px; }
.dm-splash-dot { fill: var(--signal); transform-origin: 32px 32px; transform: scale(0); }
.dm-splash-name { font-family: var(--font-mono); letter-spacing: .12em; font-size: 0.95rem; opacity: 0; }
.dm-splash-bar { width: 84px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; opacity: 0; }
.dm-splash-bar i { display: block; height: 100%; background: var(--signal); transform: scaleX(0); transform-origin: 0 50%; }
.is-run .dm-splash-ring { animation: dm-splash-draw 1s .15s var(--ease) forwards; }
.is-run .dm-splash-dot { animation: dm-splash-pop .55s .85s var(--ease) forwards; }
.is-run .dm-splash-name { animation: dm-splash-in .5s 1.1s var(--ease) forwards; }
.is-run .dm-splash-bar { animation: dm-splash-in .3s 1.4s forwards; }
.is-run .dm-splash-bar i { animation: dm-splash-fill 1s 1.5s linear forwards; }
@keyframes dm-splash-draw { to { stroke-dashoffset: 0; } }
@keyframes dm-splash-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes dm-splash-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@keyframes dm-splash-fill { to { transform: scaleX(1); } }
.dm-splash-status { min-height: 1.2em; font-size: 0.76rem; color: var(--ink-soft); font-family: var(--font-mono); }

/* ---- 온보딩 ---- */
.dm-onboarding-wrap { display: grid; justify-items: center; }
.dm-onboarding-phone { position: relative; width: min(100%, 230px); height: 280px; display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; }
.dm-onboarding-top { display: flex; justify-content: flex-end; padding: 8px 10px 0; min-height: 40px; }
.dm-onboarding-skip { padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 0.8rem; cursor: pointer; transition: background .2s, color .2s; }
.dm-onboarding-skip:hover { background: var(--signal-soft); color: var(--ink); }
.dm-onboarding-view { flex: 1; overflow: hidden; touch-action: pan-y; user-select: none; }
.dm-onboarding-track { display: flex; width: 300%; height: 100%; transition: transform .5s var(--ease); }
.dm-onboarding-slide { width: calc(100% / 3); padding: 4px 18px; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center; }
.dm-onboarding-art { width: 76px; height: 76px; fill: var(--signal-soft); stroke: var(--signal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 8px; }
.dm-onboarding-art .tick { fill: none; }
.dm-onboarding-slide.is-in .dm-onboarding-art { animation: dm-layout-rise .55s .1s var(--ease) backwards; }
.dm-onboarding-h { margin: 0; font-size: 1rem; }
.dm-onboarding-p { margin: 0; font-size: 0.8rem; line-height: 1.55; color: var(--ink-soft); }
.dm-onboarding-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 14px; }
.dm-onboarding-dots { display: flex; gap: 6px; }
.dm-onboarding-dot { position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: var(--line); cursor: pointer; transition: width .35s var(--ease), background .3s; }
.dm-onboarding-dot::after { content: ""; position: absolute; inset: -10px -3px; }
.dm-onboarding-dot[aria-current] { width: 22px; background: var(--signal); }
.dm-onboarding-next { padding: 9px 18px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font: inherit; font-size: 0.82rem; cursor: pointer; transition: transform .15s var(--ease), background .2s; }
.dm-onboarding-next:hover { background: var(--signal); color: var(--on-signal); }
.dm-onboarding-next:active { transform: scale(.94); }
.dm-onboarding-done { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: var(--card); animation: dm-layout-rise .45s var(--ease); }
.dm-onboarding-done[hidden] { display: none; }
.dm-onboarding-dh { font-size: 1.1rem; }
.dm-onboarding-dp { font-size: 0.8rem; color: var(--ink-soft); }
.dm-onboarding-again { margin-top: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.8rem; cursor: pointer; }
.dm-onboarding-again:hover { border-color: var(--signal); }
.dm-onboarding-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- 플레이스홀더 ---- */
.dm-placeholder-wrap { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.dm-placeholder-col { flex: 1 1 200px; max-width: 260px; min-width: 0; }
.dm-placeholder-cap { margin: 0 0 8px; font-size: 0.82rem; text-align: center; }
.dm-placeholder-card { display: grid; gap: 14px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.dm-placeholder-field { display: grid; gap: 5px; }
.dm-placeholder-label { font-size: 0.76rem; color: var(--ink-soft); }
.dm-placeholder-input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.85rem; transition: border-color .2s, box-shadow .2s; }
.dm-placeholder-input::placeholder { color: var(--ink-faint); transition: opacity .25s; }
.dm-placeholder-input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.dm-placeholder-input:focus::placeholder { opacity: .5; }
.dm-placeholder-note { margin: 0; font-size: 0.72rem; line-height: 1.5; }
.dm-placeholder-note.is-bad { color: var(--signal-text); }
.dm-placeholder-note.is-good { color: var(--live); }
.dm-placeholder-live { display: grid; gap: 10px; }
.dm-placeholder-profile { display: flex; align-items: center; gap: 10px; }
.dm-placeholder-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--signal); color: var(--on-signal); display: grid; place-items: center; font-size: 0.9rem; }
.dm-placeholder-lines { flex: 1; display: grid; gap: 5px; min-width: 0; }
.dm-placeholder-ln1 { font-size: 0.88rem; font-weight: 600; }
.dm-placeholder-ln2 { font-size: 0.72rem; color: var(--ink-faint); }
.dm-placeholder-body { font-size: 0.8rem; line-height: 1.5; color: var(--ink-soft); }
.dm-placeholder-reload { justify-self: start; }
.dm-placeholder-reload:disabled { opacity: .45; cursor: default; }
.dm-placeholder-live.is-loading span, .dm-placeholder-live.is-loading .dm-placeholder-avatar { position: relative; overflow: hidden; color: transparent; background: var(--paper-deep); border-radius: 6px; }
.dm-placeholder-live.is-loading .dm-placeholder-avatar { border-radius: 50%; }
.dm-placeholder-live.is-loading span::after, .dm-placeholder-live.is-loading .dm-placeholder-avatar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--line), transparent); transform: translateX(-100%); animation: dm-placeholder-shimmer 1.3s infinite; }
.dm-placeholder-live.is-loading .dm-placeholder-ln1 { height: 12px; width: 70%; }
.dm-placeholder-live.is-loading .dm-placeholder-ln2 { height: 9px; width: 40%; }
.dm-placeholder-live.is-loading .dm-placeholder-body { display: block; height: 10px; }
.dm-placeholder-live.is-loading .dm-placeholder-body.is-short { width: 60%; }
.dm-placeholder-status { margin-top: 8px; min-height: 1.2em; text-align: center; font-size: 0.72rem; font-family: var(--font-mono); color: var(--ink-soft); }
@keyframes dm-placeholder-shimmer { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .dm-hero-box.is-in .dm-hero-copy > *, .dm-hero-box.is-in .dm-hero-card, .dm-onboarding-slide.is-in .dm-onboarding-art, .dm-onboarding-done { animation: none; }
  .is-run .dm-splash-ring, .is-run .dm-splash-dot, .is-run .dm-splash-name, .is-run .dm-splash-bar, .is-run .dm-splash-bar i { animation: none; stroke-dashoffset: 0; transform: none; opacity: 1; }
  .is-run .dm-splash-bar i { transform: scaleX(1); }
  .dm-splash-home, .dm-splash-splash, .dm-onboarding-track, .dm-onboarding-dot { transition: none; }
  .dm-placeholder-live.is-loading span::after, .dm-placeholder-live.is-loading .dm-placeholder-avatar::after { animation: none; }
}
