/* Lignums WREN — 음성 모델 페이지(라이트 페이지 위 어두운 재생기). 화면이 없는 제품이라 "디바이스" 대신 재생기 하나가 고정되고, 스크롤이 음원을 따라간다. */
.wr, .wv, .ws { --sp-ko: #E3BE43; --sp-w: #88AEF4; --sp-m: #66C3A4; }
.wv { --sp-ko: #D9A520; --sp-w: #4F7BD3; --sp-m: #26A07A; }

/* ---------- 스크롤 재생기 ---------- */
.wr { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 72px); width: min(1200px, 100% - var(--gutter) * 2); margin-inline: auto; padding-bottom: 20vh; }
.wr-copy { position: relative; z-index: 1; }
.wr-head { position: sticky; top: calc(var(--nav-h) + 12px); padding: 12px 0 18px; z-index: 2; background: linear-gradient(var(--bg) 70%, transparent); }
.wr-head p { margin: 8px 0 0; font-size: 14px; color: var(--fg-3); }
.wr-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity 400ms var(--ease-out); }
.wr-step.is-on { opacity: 1; }
.wr-step .n { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--brand); }
.wr-step h3 { font-size: clamp(26px, 3vw, 40px); line-height: 1.15; letter-spacing: -.025em; margin: 12px 0 0; }
.wr-step p { margin: 16px 0 0; font-size: clamp(16px, 1.3vw, 18px); color: var(--fg-2); max-width: 40ch; }
.wr-stage { position: sticky; top: calc(var(--nav-h) + 24px); height: calc(100svh - var(--nav-h) - 48px); display: grid; align-items: center; align-self: start; }

.wc { --fg: #ECEDEF; --fg-2: #A3A7AF; --fg-3: #8A8E96; --bg: #0E0F11; --line: rgba(255, 255, 255, .13); --line-2: rgba(255, 255, 255, .22); --brand: #88AEF4; --on-brand: #0E1016; color: var(--fg); position: relative; border-radius: 28px; padding: clamp(18px, 2.2vw, 28px); background: linear-gradient(180deg, #17181C, #111215); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 90px rgba(22, 32, 56, .28); display: grid; gap: 18px; isolation: isolate; overflow: hidden; }
.wc::before { content: ""; position: absolute; inset: -40% -20% auto; height: 80%; z-index: -1; background: radial-gradient(50% 50% at 50% 50%, var(--glow, rgba(136, 174, 244, .18)), transparent 70%); opacity: var(--glow-o, .5); transition: background 600ms ease, opacity 300ms ease; }
.wc-top { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-3); }
.wc-top b { color: var(--fg); letter-spacing: .06em; font-size: 12.5px; }
.wc-rec { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.wc.is-playing .wc-rec { background: var(--critical); box-shadow: 0 0 0 4px rgba(242, 106, 95, .18); animation: wc-blink 1.2s steps(2, jump-none) infinite; }
@keyframes wc-blink { 50% { opacity: .35; } }
.wc-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.wc-time b { color: var(--fg); font-weight: 600; }

.wc-who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.who { --c: var(--sp-ko); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 250ms ease, box-shadow 250ms ease, transform 250ms var(--ease-out); }
.who[data-sp="W"] { --c: var(--sp-w); }
.who[data-sp="M"] { --c: var(--sp-m); }
.who .lv { grid-row: span 2; display: flex; align-items: center; gap: 2px; width: 22px; height: 22px; }
.who .lv i { flex: 1; height: 20%; border-radius: 2px; background: var(--c); opacity: .35; transform-origin: center; }
.who b { font-size: 14px; line-height: 1.2; }
.who small { font-size: 11.5px; color: var(--fg-3); }
.who.is-on { background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); }
.who.is-on .lv i { opacity: 1; }

.wc-line { min-height: 7.2em; display: grid; align-content: center; gap: 8px; }
.wc-item { font-size: 12px; font-weight: 600; letter-spacing: .05em; color: var(--fg-3); }
.wc-text { margin: 0; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.4; letter-spacing: -.01em; color: var(--fg); text-wrap: pretty; }
.wc-text.is-gap { color: var(--fg-3); font-size: 15px; }
.wc-text .sp { display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 6px; font-size: .62em; font-weight: 700; vertical-align: .32em; color: #0E0F11; background: var(--c, var(--sp-ko)); }

.wc-wave { position: relative; height: 112px; cursor: pointer; touch-action: none; outline-offset: 6px; }
.wc-marks { position: absolute; inset: 0 0 auto; height: 16px; }
.wc-marks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--fg-3); }
.wc-marks span::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 82px; background: var(--line); }
.wc-svg { position: absolute; left: 0; right: 0; top: 20px; width: 100%; height: 68px; overflow: visible; }
.wc-svg .dim rect { opacity: .22; }
.wc-lane { position: absolute; left: 0; right: 0; bottom: 6px; height: 8px; }
.wc-lane i { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--c); opacity: .35; transition: opacity 200ms ease; }
.wc-lane i.is-on { opacity: 1; }
.wc-head { position: absolute; top: 14px; bottom: 0; left: 0; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--fg); box-shadow: 0 0 12px rgba(255, 255, 255, .45); will-change: transform; pointer-events: none; }

.wc-ctrl { display: flex; align-items: center; justify-content: center; gap: 18px; }
.wc-ctrl button { appearance: none; border: 0; font: inherit; color: var(--fg); background: transparent; cursor: pointer; display: grid; place-items: center; transition: transform 160ms var(--ease-out), background-color 200ms ease; }
.wc-ctrl button:active { transform: scale(.96); }
.wc-play { width: 64px; height: 64px; border-radius: 50%; background: var(--fg) !important; color: var(--bg) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.wc-play svg { width: 26px; height: 26px; grid-area: 1 / 1; transition: opacity 160ms ease, transform 200ms var(--ease-out); }
.wc-play .i-pause, .wc.is-playing .wc-play .i-play { opacity: 0; transform: scale(.6); }
.wc.is-playing .wc-play .i-pause { opacity: 1; transform: none; }
.wc-back { position: relative; width: 44px; height: 44px; border-radius: 50%; }
.wc-back svg { width: 26px; height: 26px; grid-area: 1 / 1; }
.wc-back span { grid-area: 1 / 1; font-size: 9.5px; font-weight: 700; margin-top: 2px; }
.wc-rate { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px !important; font-weight: 600; color: var(--fg-2) !important; box-shadow: inset 0 0 0 1px var(--line-2); font-variant-numeric: tabular-nums; }
.wc-rate[aria-pressed="true"] { color: var(--on-brand) !important; background: var(--brand) !important; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .wc-back:hover { background: rgba(255, 255, 255, .07); }
  .wc-rate:hover { background: rgba(255, 255, 255, .07); }
}
.wc-note { margin: -4px 0 0; text-align: center; font-size: 12px; color: var(--fg-3); }

@media (max-width: 900px) {
  .wr { grid-template-columns: 1fr; gap: 0; }
  .wr-stage { order: -1; top: 0; height: auto; z-index: 3; margin-bottom: 8px; padding: calc(var(--nav-h) + 6px) 0 10px; background: var(--bg); }
  .wr-stage::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
  .wr-head { position: static; background: none; padding-top: 28px; }
  .wc { border-radius: 22px; padding: 14px; gap: 10px; }
  .wc-top .wc-title { display: none; }
  .who { padding: 7px 8px; column-gap: 6px; }
  .who .lv { width: 16px; height: 16px; }
  .who b { font-size: 12.5px; }
  .who small { font-size: 10px; }
  .wc-line { min-height: 5.6em; gap: 4px; }
  .wc-text { font-size: 15.5px; }
  .wc-wave { height: 76px; }
  .wc-svg { top: 16px; height: 44px; }
  .wc-marks span::after { height: 52px; }
  .wc-play { width: 52px; height: 52px; }
  .wc-note { display: none; }
  .wr-step { min-height: 62svh; justify-content: flex-start; padding-top: 4svh; }
}

/* ---------- 화자 카드 ---------- */
.wv { padding-block: clamp(80px, 12vh, 140px) 0; }
.wv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.vc { --c: var(--sp-ko); position: relative; display: grid; gap: 16px; align-content: start; padding: 22px; border-radius: var(--r-xl); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(22, 32, 56, .04); isolation: isolate; overflow: hidden; }
.vc[data-sp="W"] { --c: var(--sp-w); }
.vc[data-sp="M"] { --c: var(--sp-m); }
.vc::before { content: ""; position: absolute; inset: auto -30% -60%; height: 100%; z-index: -1; background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); opacity: 0; transition: opacity 400ms ease; }
.vc.is-playing::before { opacity: 1; }
.vc-head { display: flex; align-items: center; gap: 12px; }
.vc-av { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #0E0F11; background: var(--c); }
.vc-head b { display: block; font-size: 17px; line-height: 1.2; }
.vc-head small { font-size: 12.5px; color: var(--fg-3); }
.vc-q { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg-2); min-height: 4.65em; }
.vc-q[lang="en"] { font-size: 14.5px; }
.vc-bot { display: flex; align-items: center; gap: 14px; }
.vc-play { appearance: none; border: 0; cursor: pointer; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--fg); color: var(--bg); transition: transform 160ms var(--ease-out); }
.vc-play:active { transform: scale(.96); }
.vc-play svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity 160ms ease, transform 200ms var(--ease-out); }
.vc-play .i-pause, .vc.is-playing .vc-play .i-play { opacity: 0; transform: scale(.6); }
.vc.is-playing .vc-play .i-pause { opacity: 1; transform: none; }
.vc-wave { flex: 1; height: 36px; overflow: visible; }
.vc-wave .dim rect { opacity: .25; }
.vc-dur { font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .wv-grid { grid-template-columns: 1fr; } .vc-q { min-height: 0; } }

/* ---------- 입력과 출력 ---------- */
.ws { padding-block: clamp(80px, 12vh, 140px) 0; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.ws-out { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 0; }
.ws-out li { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.ws-out b { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 500; font-size: 13.5px; color: var(--fg); }
.ws-out span { color: var(--fg-2); }
.ws-files { display: grid; gap: 14px; }
.ws-file { margin: 0; border-radius: var(--r-lg); background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(22, 32, 56, .14); overflow: hidden; }
.ws-file figcaption { padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--ink-line); background: var(--paper-2); }
.ws-file pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.65; white-space: pre; }
.ws-file .k { color: var(--ink-3); }
.ws-file .b { color: var(--brand-ink); font-weight: 700; }
.ws-file .s0 { color: #9A7A0C; font-weight: 700; }
.ws-file .s1 { color: var(--brand-ink); font-weight: 700; }
.ws-file .s2 { color: var(--leaf-ink); font-weight: 700; }
.ws-file .n { color: #B4442F; }
.ws-file .c { color: var(--ink-3); }
.ws-json { margin-left: clamp(0px, 6vw, 72px); }
@media (max-width: 900px) { .ws-grid { grid-template-columns: 1fr; } .ws-json { margin-left: 0; } .ws-file pre { font-size: 12px; } }

@media (prefers-reduced-motion: reduce) {
  .wr-step { transition: none; }
  .wc.is-playing .wc-rec { animation: none; }
}
