/* How it works opens with a real voice note beside the report it became.
   Player on the left (top on phones), a before/after slider on the right. */
#how { padding-top: 40px; }
.vn-head { margin-bottom: 24px; }
.steps-head { margin: 56px 0 24px; }

.vn-grid { display: grid; gap: 20px; align-items: start; }

/* Audio player */
.vn-player {
  background: var(--pitch); color: var(--chalk);
  border-radius: 24px; padding: 22px 20px;
  display: grid; gap: 18px;
  box-shadow: 0 24px 50px rgba(15, 56, 42, .18);
}
.vn-meta { display: flex; align-items: center; gap: 12px; }
.vn-meta .avatar { width: 44px; height: 44px; background: var(--mint); color: var(--pitch); font-size: .9rem; flex: none; }
.vn-meta b { display: block; font: 600 1.02rem/1.25 var(--body); }
.vn-meta small { display: block; color: var(--on-pitch-2); font-size: .84rem; margin-top: 2px; }

.vn-controls { display: flex; align-items: center; gap: 14px; }
.vn-play {
  flex: none; width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0;
  background: var(--mint); color: var(--pitch);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
  box-shadow: 0 0 0 0 rgba(46, 229, 157, .5);
}
.vn-play:hover { background: #4CEDAE; }
.vn-play:active { transform: scale(.95); }
.vn-play svg { width: 26px; height: 26px; fill: currentColor; }
.vn-play .i-pause, .vn-play[aria-pressed="true"] .i-play { display: none; }
.vn-play[aria-pressed="true"] .i-pause { display: block; }
.vn-play:not([aria-pressed="true"]) { animation: vn-ring 2.4s ease-out infinite; }
@keyframes vn-ring { 0% { box-shadow: 0 0 0 0 rgba(46, 229, 157, .45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(46, 229, 157, 0); } }

.vn-wave {
  --played: 0%;
  position: relative; flex: 1; height: 56px;
  display: flex; align-items: center; gap: 2px;
  cursor: pointer; touch-action: none; border-radius: 6px;
}
.vn-wave i { flex: 1; min-width: 1px; border-radius: 2px; background: var(--pitch-3); transition: background-color .2s ease; }
.vn-wave i.on { background: var(--mint); }
.vn-wave::after {
  content: ""; position: absolute; top: 2px; bottom: 2px; left: var(--played); width: 2px; margin-left: -1px;
  background: var(--chalk); border-radius: 2px; opacity: 0; transition: opacity .2s ease;
}
.vn-player.started .vn-wave::after { opacity: .9; }

.vn-time { display: flex; align-items: center; justify-content: space-between; font: 500 .85rem/1 var(--body); color: var(--on-pitch-2); font-variant-numeric: tabular-nums; margin-top: -8px; }
.vn-speed {
  border: 0; border-radius: 999px; padding: 6px 12px; min-width: 52px;
  background: var(--pitch-2); color: var(--chalk); font: 600 .82rem/1 var(--body); cursor: pointer;
}
.vn-speed:hover { background: var(--pitch-3); }

.vn-yield { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vn-yield li { background: var(--pitch-2); border-radius: 14px; padding: 12px; display: grid; gap: 4px; }
.vn-yield b { font: 700 1.6rem/1 var(--head); color: var(--mint); }
.vn-yield span { font-size: .8rem; line-height: 1.25; color: var(--on-pitch-2); }
.vn-foot { font-size: .86rem; color: var(--on-pitch-2); }

/* Before / after */
.vn-out { display: grid; gap: 14px; min-width: 0; }
.vn-compare {
  --pos: 50%;
  position: relative; height: 600px; overflow: hidden;
  border-radius: 24px; background: var(--chalk);
  box-shadow: 0 0 0 1.5px var(--line), 0 24px 50px rgba(15, 56, 42, .12);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.vn-layer { position: absolute; inset: 0; padding: 22px 20px; overflow: hidden; }
.vn-layer::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(to bottom, transparent, var(--fade, var(--chalk)));
  pointer-events: none;
}
.vn-compare.dragging .vn-note, .vn-compare.dragging .vn-handle { transition: none; }
.vn-compare.easing .vn-note { transition: clip-path .45s cubic-bezier(.3, .7, .2, 1); }
.vn-compare.easing .vn-handle { transition: left .45s cubic-bezier(.3, .7, .2, 1); }

/* Before: the transcript, as the coach said it */
.vn-note {
  --fade: var(--paper);
  background: var(--paper);
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.vn-note p { font-size: .98rem; line-height: 1.6; color: var(--ink-2); }
.vn-note p + p { margin-top: 12px; }
.vn-note mark { background: var(--mint-soft); color: var(--ink); border-radius: 4px; padding: 1px 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.nt-head, .rp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.nt-head small, .rp-head small { display: block; font: 600 .7rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--pitch-3); }
.nt-head b, .rp-head b { display: block; font: 700 1.2rem/1.2 var(--head); letter-spacing: -.01em; }
.nt-head span, .rp-head span { display: block; font-size: .8rem; color: var(--ink-2); }
.nt-mic {
  flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--pitch);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232EE59D' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21'/%3E%3C/svg%3E");
  background-size: 22px; background-position: center; background-repeat: no-repeat;
}

/* After: the report */
.vn-report { border-top: 6px solid var(--mint); }
.rp-badge {
  flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--pitch); color: var(--mint);
  display: grid; place-items: center; font: 700 1.1rem/1 var(--head);
}
.rp-summary { font: 500 1rem/1.5 var(--body); color: var(--ink); margin-bottom: 16px; }
.rp-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.rp-pillars > div { background: var(--paper); border-radius: 12px; padding: 10px; min-width: 0; }
.rp-pillars span { font-size: .74rem; color: var(--ink-2); }
.rp-pillars > div > b { display: block; font: 700 1.35rem/1.1 var(--head); margin: 2px 0 6px; }
.rp-pillars > div > b small { font-size: .7rem; color: var(--ink-2); }
.rp-pillars dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 6px; font-size: .72rem; line-height: 1.25; color: var(--ink-2); }
.rp-pillars dt, .rp-pillars dd { margin: 0; }
.rp-pillars dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-pillars dd { font-variant-numeric: tabular-nums; color: var(--ink); }
.rp-block { border-left: 3px solid var(--mint); padding-left: 12px; margin-bottom: 14px; }
.rp-block h4 { margin: 0 0 6px; font: 600 .92rem/1.2 var(--body); color: var(--pitch-3); }
.rp-block ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.rp-block li, .rp-block p { font-size: .88rem; line-height: 1.45; color: var(--ink-2); }
.rp-next { border-left-color: #F2A65A; }
.rp-next h4 { color: #B4641A; }
.rp-next p b { color: var(--ink); font-weight: 600; }
.rp-drill { background: var(--paper); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.rp-drill small { display: block; font: 600 .66rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.rp-drill b { display: block; font-size: .9rem; margin: 3px 0 2px; color: var(--ink); }
.rp-drill p { font-size: .82rem; }

/* Handle and labels */
.vn-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; z-index: 2; }
.vn-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: var(--pitch); }
.vn-handle span {
  position: absolute; top: 50%; left: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; background: var(--pitch); box-shadow: 0 0 0 4px var(--chalk), 0 6px 18px rgba(0,0,0,.25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232EE59D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E");
  background-size: 24px; background-position: center; background-repeat: no-repeat;
}
.vn-compare:has(.vn-range:focus-visible) .vn-handle span { outline: 3px solid var(--mint); outline-offset: 5px; }
.vn-tag {
  position: absolute; bottom: 14px; z-index: 1; pointer-events: none;
  font: 600 .72rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 999px; transition: opacity .2s ease;
}
.vn-tag-note { left: 14px; background: var(--pitch); color: var(--mint); }
.vn-tag-report { right: 14px; background: var(--mint); color: var(--pitch); }
.vn-compare[data-side="report"] .vn-tag-note, .vn-compare[data-side="note"] .vn-tag-report { opacity: 0; }
.vn-range { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; bottom: 0; left: 0; }

.vn-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vn-switch button {
  min-height: 46px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--chalk); color: var(--ink); font: 600 .9rem/1.1 var(--body); padding: 0 12px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.vn-switch button:hover { box-shadow: inset 0 0 0 1.5px var(--pitch); }
.vn-switch button[aria-pressed="true"] { background: var(--pitch); color: var(--chalk); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .vn-play:not([aria-pressed="true"]) { animation: none; }
  .vn-compare.easing .vn-note, .vn-compare.easing .vn-handle { transition: none; }
}

@media (min-width: 720px) {
  .vn-player { padding: 28px; }
  .vn-layer { padding: 28px; }
  .rp-pillars { gap: 8px; }
  .rp-pillars > div { padding: 12px; }
  .rp-pillars dl { font-size: .78rem; }
}
@media (min-width: 960px) {
  #how { padding-top: 56px; }
  .steps-head { margin-top: 80px; }
  .vn-grid { grid-template-columns: .82fr 1.18fr; gap: 40px; align-items: center; }
  .vn-compare { height: 620px; }
}
