/*
 * Audio editor mock-ups for /audio_editing/.
 * Drawn in HTML and CSS (no screenshots), in the dark palette of the app
 * mock-ups on the landing page. Everything inside a phone is sized in em,
 * and the screen's font size follows the phone's width (cqw), so a phone
 * scales as one picture at any width.
 */

/* ---------- Figure layout ---------- */
.ed-figure {
  margin: 28px 0 0;
}

.article-card .ed-figure + p {
  margin-top: 22px;
}

.ed-figure figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Phone and numbered legend side by side */
.ed-tour {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

/* Two phones side by side: wrong and right */
.ed-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.ed-pair__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.ed-pair__item .ed-phone {
  max-width: 280px;
}

.ed-pair__note {
  max-width: 300px;
  margin: 0 !important;
  color: var(--text-2);
  font-size: 0.94rem !important;
  line-height: 1.6 !important;
  text-align: center;
}

.ed-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
}

.ed-verdict .material-symbols-outlined {
  font-size: 1.15rem;
}

.ed-verdict--bad {
  background: var(--tint-red);
  color: var(--tint-red-fg);
}

.ed-verdict--good {
  background: var(--tint-green);
  color: var(--tint-green-fg);
}

/* Legend for the numbered marks */
.ed-legend {
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

.ed-legend li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: 0.97rem;
  line-height: 1.6;
}

.ed-legend li + li {
  margin-top: 12px;
}

.ed-key {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 999px;
  background: #f5b83d;
  color: #2a1d00;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Phone ---------- */
.ed-phone {
  --d-bg: #242e3a;
  --d-panel: #1c232c;
  --d-raised: #313d4c;
  --d-text: #f1f5f9;
  --d-muted: #94a3b8;
  --d-accent: #8ec5ff;
  --d-accent-ink: #12345a;
  --d-tool: rgba(75, 91, 113, 0.7);
  --mark: #f5b83d;

  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 9 / 18;
  overflow: hidden;
  border-radius: 22px;
  background: var(--d-bg);
  color: var(--d-text);
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.08), 0 12px 32px rgba(15, 15, 15, 0.12);
  user-select: none;
}

.ed-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  font-size: 13px; /* browsers without container units */
  font-size: 4.4cqw;
  line-height: 1.2;
}

.ed-screen .material-symbols-outlined {
  color: inherit;
  font-size: 1.35em;
}

/* Top bar: Cancel · name · Undo · Save */
.ed-bar {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 1.1em 1em 0.7em;
  font-size: 0.86em;
}

.ed-bar__text {
  color: var(--d-accent);
  font-weight: 500;
}

.ed-bar__save {
  color: var(--d-accent);
  font-weight: 700;
}

.ed-bar__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ed-bar__undo {
  color: var(--d-muted);
  opacity: 0.55;
}

.ed-bar__undo.is-on {
  color: var(--d-text);
  opacity: 1;
}

/* Selection start / end steppers */
.ed-steppers {
  display: flex;
  justify-content: space-between;
  padding: 0 0.6em;
}

.ed-stepper {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.35em 0.5em;
  border-radius: 0.7em;
  background: var(--d-raised);
  font-size: 0.86em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ed-stepper .material-symbols-outlined {
  font-size: 1.25em;
}

/* Waveform panel */
.ed-panel {
  position: relative;
  flex: 1;
  margin: 0.6em 0.6em 0.5em;
  border-radius: 1.1em;
  background: var(--d-panel);
}

.ed-ruler {
  position: absolute;
  top: 0.7em;
  left: 1.5em;
  right: 1.5em;
  height: 1.7em;
}

.ed-ruler span {
  position: absolute;
  top: 0;
  color: var(--d-muted);
  font-size: 0.6em;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

.ed-ruler i {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 0.4em;
  background: var(--d-muted);
  opacity: 0.6;
}

.ed-ruler i.is-major {
  width: 0.24em;
  height: 0.24em;
  margin-left: -0.12em;
  border-radius: 999px;
  opacity: 1;
}

/* --s / --e: selection start and end, --p: playhead (percent of the recording) */
.ed-track {
  position: absolute;
  top: 3em;
  bottom: 1.6em;
  left: 1.5em;
  right: 1.5em;
}

.ed-wave {
  position: absolute;
  top: 20%;
  left: 0;
  width: 100%;
  height: 60%;
  color: var(--d-accent);
  opacity: 0.32;
}

.ed-wave--on {
  opacity: 1;
  clip-path: inset(0 calc(100% - var(--e)) 0 var(--s));
}

.ed-sel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--s);
  right: calc(100% - var(--e));
  border: 0.13em solid var(--d-accent);
  border-radius: 1em;
  background: rgba(142, 197, 255, 0.1);
}

/* Drag handles on the left and right edge of the selection */
.ed-sel::before,
.ed-sel::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.5em;
  height: 2.6em;
  margin-top: -1.3em;
  background:
    linear-gradient(var(--d-accent-ink), var(--d-accent-ink)) center / 0.1em 1.2em no-repeat,
    var(--d-accent);
}

.ed-sel::before {
  left: -0.63em;
  border-radius: 0.35em 0 0 0.35em;
}

.ed-sel::after {
  right: -0.63em;
  border-radius: 0 0.35em 0.35em 0;
}

.ed-head {
  position: absolute;
  top: -0.35em;
  bottom: -0.35em;
  left: var(--p);
  width: 0.1em;
  margin-left: -0.05em;
  background: var(--d-text);
}

.ed-head::before,
.ed-head::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0.6em;
  height: 0.6em;
  margin-left: -0.3em;
  border-radius: 999px;
  background: var(--d-text);
}

.ed-head::before {
  top: -0.3em;
}

.ed-head::after {
  bottom: -0.3em;
}

/* Playback slider */
.ed-slider {
  position: relative;
  height: 1.5em;
  margin: 0 1.2em;
}

.ed-slider::before,
.ed-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 0.55em;
  margin-top: -0.275em;
  border-radius: 999px;
}

.ed-slider::before {
  left: 0;
  width: calc(var(--p) - 0.4em);
  background: var(--d-accent);
}

.ed-slider::after {
  left: calc(var(--p) + 0.4em);
  right: 0;
  background: rgba(142, 197, 255, 0.22);
}

.ed-slider i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--p);
  width: 0.2em;
  margin-left: -0.1em;
  border-radius: 999px;
  background: var(--d-accent);
}

/* Elapsed · speed · zoom · remaining */
.ed-times {
  display: flex;
  align-items: center;
  gap: 0.9em;
  padding: 0.2em 1.2em 0;
  color: var(--d-muted);
  font-size: 0.78em;
  font-variant-numeric: tabular-nums;
}

.ed-times > span:first-child {
  margin-right: auto;
}

.ed-times > span:last-child {
  margin-left: auto;
}

.ed-times b {
  color: var(--d-accent);
  font-weight: 600;
}

.ed-times .material-symbols-outlined {
  font-size: 1.6em;
}

/* Crop · Play · Cut */
.ed-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  padding: 1em 1em 1.6em;
}

.ed-tool,
.ed-play {
  position: relative;
  display: grid;
  place-items: center;
}

.ed-tool {
  width: 3.6em;
  height: 2.5em;
  border-radius: 999px;
  background: var(--d-tool);
}

.ed-play {
  width: 3.4em;
  height: 3.4em;
  border-radius: 1.1em;
  background: var(--d-accent);
  color: var(--d-accent-ink);
}

.ed-play .material-symbols-outlined {
  font-size: 1.7em;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* The button being tapped in a picture */
.ed-tool.is-tapped {
  box-shadow: 0 0 0 0.2em var(--d-bg), 0 0 0 0.4em var(--mark);
}

/* Android-style toast */
.ed-toast {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 4.3em;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.65em 0.9em;
  border-radius: 1.4em;
  background: #ffffff;
  color: #1f2933;
  font-size: 0.78em;
  line-height: 1.35;
  box-shadow: 0 0.3em 1.2em rgba(0, 0, 0, 0.35);
}

.ed-toast__icon {
  width: 2em;
  height: 2em;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border-radius: 999px;
  background: #e5484d;
  color: #ffffff;
}

.ed-toast__icon .material-symbols-outlined {
  font-size: 1.3em;
}

/* Numbered marks laid over a phone (not part of the app) */
.ed-mark {
  position: absolute;
  z-index: 2;
  width: 1.55em;
  height: 1.55em;
  display: grid;
  place-items: center;
  margin: -0.775em 0 0 -0.775em;
  border-radius: 999px;
  background: var(--mark);
  color: #2a1d00;
  box-shadow: 0 0 0 0.18em var(--d-bg);
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Crop vs Cut diagram ---------- */
.ed-diagram {
  margin-top: 22px;
  padding: 22px 24px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.ed-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.ed-row + .ed-row {
  margin-top: 18px;
}

.ed-row--split {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.ed-row__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 650;
}

.ed-row__label .material-symbols-outlined {
  color: var(--muted);
  font-size: 1.2rem;
}

.ed-strip {
  display: flex;
  gap: 3px;
  height: 46px;
}

.ed-seg {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.ed-seg svg {
  position: absolute;
  inset: 8px 6px;
  width: calc(100% - 12px);
  height: calc(100% - 16px);
  color: var(--faint);
  opacity: 0.45;
}

.ed-seg span {
  position: relative;
  padding: 1px 7px;
  border-radius: 6px;
  background: inherit;
}

.ed-seg--sel {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
}

.ed-seg--sel svg {
  color: var(--accent);
  opacity: 0.35;
}

.ed-ticks {
  position: relative;
  height: 20px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.ed-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.ed-ticks span:first-child {
  transform: none;
}

.ed-ticks span:last-child {
  transform: translateX(-100%);
}

.article-card .ed-result {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.ed-result strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Small screens ---------- */
@media (max-width: 680px) {
  .ed-tour,
  .ed-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .ed-tour .ed-phone {
    max-width: 290px;
  }

  .ed-pair {
    gap: 36px;
  }

  .ed-diagram {
    padding: 18px 16px 14px;
  }

  .ed-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}
