/* Warp 데모: 현재 Warp 앱의 플로팅 위젯으로 보여 주는 받아쓰기 장면.
   site.css 의 예전 .app-mock / .wv-widget 규칙과 섞이지 않도록 wd- 접두어만 쓴다.
   재생은 assets/js/warp-demo.js 가 맡는다. 스크립트가 없거나 모션을 줄인 환경에서는
   완성된 메일과 마무리 문구가 그대로 보인다. */

.warp-demo {
  --wd-line: rgba(255, 255, 255, 0.08);
  --wd-line-strong: rgba(255, 255, 255, 0.16);
  --wd-gold: #d7b65e;
  --wd-gold-pale: #f6e6a8;
  --wd-check: #7191ef;
  --wd-ink: #9bd2f3;
  /* 앱 위젯(34px 높이)을 메일 창 크기에 맞춰 줄이는 비율 */
  --wd-widget-scale: 0.82;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
  gap: 2rem 1.5rem;
  align-items: start;
  justify-self: stretch;
  width: 100%;
  text-align: left;
}

/* 홈: 문구를 위에, 두 장면을 아래에 둔다. */
.landing-flow-inner > .warp-demo { grid-column: 1 / -1; }
.landing-flow-inner:has(> .warp-demo) {
  grid-template-columns: minmax(0, 1fr);
  gap: 2.25rem;
}

/* 홈의 세 장면: 같은 말을 함께 듣고 결과만 다르게 입력한다.
   넓은 화면에서는 세 칸으로 나란히, 좁아지면 한 칸으로 쌓는다.
   두 칸에 하나가 따로 떨어지는 배치는 만들지 않는다. */
.warp-demo--trio {
  grid-template-columns: minmax(0, 1fr);
  max-width: 42rem;
  margin-inline: auto;
}
@media (min-width: 1024px) {
  .warp-demo--trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem 1.25rem;
    align-items: stretch;
    max-width: none;
  }
  .warp-demo--trio .wd-win { flex: 1 1 auto; }
  /* 제목이 두 줄이 되어도 세 장면의 창 위아래가 맞도록 행을 함께 쓴다. */
  @supports (grid-template-rows: subgrid) {
    .warp-demo--trio { grid-template-rows: auto auto 1fr auto; }
    .warp-demo--trio .wd-scene { display: grid; grid-template-rows: subgrid; grid-row: span 4; gap: 0.9rem; }
  }
}

/* 제품 페이지: 예전 메일 창과 같은 폭의 한 장면 */
.warp-demo--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 42rem;
  margin-inline: auto;
}

.wd-scene { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; margin: 0; }
.wd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.75rem; }
.wd-head h3 {
  margin: 0;
  color: var(--wt-text);
  font-family: var(--wt-font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.6;
}
.wd-pair {
  color: var(--wd-ink);
  font-family: var(--wt-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 말한 내용: 앱 창 밖에 따로 보여 준다. */
.wd-speech {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--wd-line);
  border-radius: 10px;
  background: var(--wt-bg-deep);
}
.wd-speech-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.12rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.wd-speech-label svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wd-scene.is-listening .wd-speech-label { color: var(--wd-gold-pale); }
.wd-speech-window { height: 3.2em; overflow: hidden; font-size: 0.8125rem; line-height: 1.6; word-break: keep-all; }
.wd-speech-text { position: relative; margin: 0; color: rgba(255, 255, 255, 0.88); transition: transform 240ms ease; }
.wd-speech-text span { color: rgba(255, 255, 255, 0.22); transition: color 160ms ease; }
.wd-speech-text span.is-said { color: rgba(255, 255, 255, 0.88); }

/* 번역 장면의 출력 언어: 지금 보여 주는 언어만 밝게 한다. */
.wd-langs { display: inline-flex; flex-wrap: wrap; gap: 0 0.55rem; margin-left: 0.15rem; }
.wd-langs [data-wd-mark] { opacity: 0.4; transition: opacity 240ms ease; }
.wd-langs [data-wd-mark].is-active { opacity: 1; }
.wd-langs-more { color: rgba(255, 255, 255, 0.5); font-family: var(--wt-font-body); letter-spacing: 0; }

/* 돌아가며 보여 주는 결과: 꺼진 것은 감추되, 메일 본문은 자리를 지켜 창 높이가 변하지 않게 한다. */
.warp-demo [data-wd-variant].is-off { display: none; }
.wd-text--variants { display: grid; }
.wd-text--variants > [data-wd-variant] { grid-area: 1 / 1; }
.wd-text--variants > [data-wd-variant].is-off { display: block; visibility: hidden; }

/* 메일 창 */
.wd-win {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--wd-line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  text-align: left;
}
.wd-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 2.15rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--wd-line);
  background: rgba(255, 255, 255, 0.03);
}
.wd-dots { display: inline-flex; gap: 0.34rem; }
.wd-dots i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.wd-app {
  flex: 1;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-align: center;
  transform: translateX(-1.2rem);
}
.wd-body { padding: 0.7rem 1.05rem 3.6rem; }
.wd-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--wd-line);
  font-size: 0.72rem;
  line-height: 1.6;
}
.wd-row .k { flex: 0 0 auto; min-width: 4.2rem; color: rgba(255, 255, 255, 0.5); }
.wd-row .v { color: rgba(255, 255, 255, 0.82); }
.wd-doc {
  display: grid;
  align-items: start;
  height: 15rem;
  overflow: hidden;
  margin-top: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  line-height: 1.75;
  word-break: keep-all;
  -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent);
  mask-image: linear-gradient(to bottom, #000 92%, transparent);
}
.wd-empty, .wd-text { grid-area: 1 / 1; justify-self: start; margin: 0; }
.wd-empty { visibility: hidden; }
.wd-text { padding: 0.3rem 0.55rem; margin: -0.3rem -0.55rem; border-radius: 7px; background: transparent; }
.wd-text p { margin: 0 0 0.8em; }
.wd-text p:last-child { margin-bottom: 0; }
.wd-caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  border-radius: 1px;
  background: var(--wt-text);
  vertical-align: -0.14em;
  animation: wd-caret-blink 1s steps(1, end) infinite;
}
@keyframes wd-caret-blink { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }

.wd-slot {
  position: absolute;
  left: 50%;
  bottom: calc(0.85rem - 5px);
  z-index: 2;
  transform: translateX(-50%) scale(var(--wd-widget-scale));
  transform-origin: 50% 100%;
}

.wd-outro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 1.7rem;
  margin: 0.15rem 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-align: center;
  word-break: keep-all;
}
.wd-outro img { flex: 0 0 auto; width: 1rem; height: 1rem; }

/* 재생 중: 스크립트가 .is-live 를 붙인 뒤에만 숨겼다가 단계에 맞춰 드러낸다. */
.warp-demo.is-live .wd-empty { visibility: visible; }
.warp-demo.is-live .wd-text {
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 150ms linear, transform 150ms linear, background-color 400ms linear;
}
.warp-demo.is-live .wd-scene.has-text .wd-text { opacity: 1; transform: translateY(0); }
.warp-demo.is-live .wd-scene.is-flashing .wd-text {
  background: rgba(215, 182, 94, 0.12);
  transition: opacity 150ms linear, transform 150ms linear, background-color 0ms;
}
.warp-demo.is-live .wd-scene.is-clearing .wd-text { opacity: 0; transition: opacity 600ms linear; }
.warp-demo.is-live .wd-scene.has-text .wd-empty { visibility: hidden; }
.warp-demo.is-live .wd-outro { opacity: 0; transform: translateY(0.4rem); transition: opacity 400ms ease, transform 400ms ease; }
.warp-demo.is-live .wd-scene.has-outro .wd-outro { opacity: 1; transform: translateY(0); }

/* 현재 Warp 위젯: 앱의 src/Overlay.css 값을 옮겼다. */
.wd-overlay { display: grid; place-items: center; width: 131px; height: 44px; }
.wd-overlay-shell {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 182, 94, 0.36);
  border-radius: 17px;
  background: linear-gradient(180deg, #191813, #11110f);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(215, 182, 94, 0.025);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.wd-overlay.is-active .wd-overlay-shell { width: 105px; }
.wd-logo {
  position: absolute;
  top: 50%;
  left: 2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
}
.wd-logo img { display: block; width: 24px; height: 24px; max-width: none; object-fit: contain; }
.wd-orbit { position: absolute; inset: 0; opacity: 0; transition: opacity 120ms ease; }
.wd-orbit::before, .wd-orbit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg 175deg, rgba(215, 182, 94, 0.08) 205deg, rgba(215, 182, 94, 0.45) 265deg, #f6e6a8 310deg, #d7b65e 340deg, transparent 350deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.3px));
}
.wd-orbit::after { inset: -1px; opacity: 0.25; filter: blur(1px); }
.wd-overlay.is-transcribing .wd-orbit { opacity: 1; animation: wd-orbit-turn 1000ms linear infinite; }
.wd-content { position: absolute; left: 37px; top: 0; width: 80px; height: 100%; opacity: 0; transition: opacity 160ms ease; }
.wd-overlay.is-active .wd-content { opacity: 1; }
.wd-bars { position: absolute; inset: 0 auto 0 0; display: flex; align-items: center; gap: 2.4px; }
.wd-bars i {
  display: block;
  width: 3px;
  height: 17px;
  border-radius: 1px;
  background: linear-gradient(180deg, #f6e6a8, #d7b65e 60%, #a48235);
  transform-origin: center;
  transform: scaleY(0.2);
  opacity: 0.95;
}
.wd-overlay.is-transcribing .wd-bars i {
  transform: scaleY(calc(0.22 + var(--wd-bar-weight) * 0.15)) !important;
  transition: transform 160ms ease;
  opacity: 0.8;
}
.wd-overlay.is-pasted .wd-bars { visibility: hidden; }
.wd-close {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 28px;
  padding: 6px;
  box-sizing: border-box;
  transform: translateY(-50%);
  color: #939397;
  opacity: 0;
  transition: opacity 160ms ease;
}
.wd-overlay.is-listening .wd-close, .wd-overlay.is-transcribing .wd-close { opacity: 1; }
.wd-close svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.wd-check {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  opacity: 0;
  fill: none;
  stroke: var(--wd-check);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wd-overlay.is-pasted .wd-check { opacity: 1; animation: wd-check-appear 180ms ease-out; }
@keyframes wd-orbit-turn { to { transform: rotate(360deg); } }
@keyframes wd-check-appear {
  from { opacity: 0; transform: translateY(-50%) scale(0.8); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}

@media (max-width: 640px) {
  .wd-body { padding: 0.6rem 0.8rem 3.3rem; }
  .wd-row, .wd-app { font-size: 0.66rem; }
  .wd-row .k { min-width: 3.4rem; }
  .wd-doc { height: 11.5rem; font-size: 0.7rem; line-height: 1.7; }
  .wd-outro { font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wd-caret, .wd-overlay.is-transcribing .wd-orbit, .wd-overlay.is-pasted .wd-check { animation: none; }
  .wd-overlay-shell, .wd-content, .wd-speech-text, .wd-speech-text span, .wd-langs [data-wd-mark] { transition: none; }
}
