:root {
  color-scheme: light;
  --ink: #223329;
  --ink-soft: #5f6d64;
  --forest: #204f3c;
  --forest-dark: #173c2e;
  --mint: #dbe8d8;
  --mint-soft: #ecf3e8;
  --paper: #f4efe5;
  --paper-light: #fbf8f1;
  --line: rgba(34, 51, 41, 0.14);
  --orange: #d46f43;
  --shadow: 0 24px 70px rgba(54, 53, 36, 0.12);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 4%, rgba(218, 229, 200, 0.86), transparent 31rem),
    linear-gradient(180deg, #f8f4eb 0%, var(--paper) 100%);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 20rem;
  height: 20rem;
  top: 28%;
  left: -13rem;
  background: rgba(217, 120, 78, 0.11);
}

.ambient-two {
  width: 14rem;
  height: 14rem;
  right: -8rem;
  bottom: 5%;
  background: rgba(56, 107, 80, 0.12);
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 44px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-weight: 720;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--forest);
}

.brand-mark span {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: currentColor;
}

.brand-mark span:nth-child(1),
.brand-mark span:nth-child(5) { height: 6px; opacity: 0.7; }
.brand-mark span:nth-child(2),
.brand-mark span:nth-child(4) { height: 12px; }
.brand-mark span:nth-child(3) { height: 18px; }

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(32, 79, 60, 0.12);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(235, 242, 228, 0.76);
  font-size: 12px;
  font-weight: 650;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4e8765;
  box-shadow: 0 0 0 4px rgba(78, 135, 101, 0.12);
}

.intro {
  max-width: 780px;
  margin-bottom: 42px;
}

.eyebrow,
.label {
  margin: 0 0 9px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-family: "Cormorant", Georgia, serif;
  font-size: clamp(46px, 6.7vw, 78px);
  font-weight: 530;
  line-height: 0.88;
  letter-spacing: -0.045em;
}

.intro h1 em {
  color: var(--forest);
  font-weight: 520;
}

.intro-copy {
  max-width: 590px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.document-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.drop-zone,
.document-card,
.player-card {
  border: 1px solid rgba(34, 51, 41, 0.11);
  box-shadow: var(--shadow);
}

.drop-zone {
  position: relative;
  display: flex;
  min-height: 166px;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  border: 1.5px dashed rgba(32, 79, 60, 0.37);
  border-radius: 20px;
  background: rgba(250, 248, 240, 0.78);
  transition: 160ms ease;
  transition-property: transform, border-color, background, box-shadow;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
  transform: translateY(-2px);
  border-color: var(--forest);
  background: rgba(238, 245, 233, 0.97);
  box-shadow: 0 20px 60px rgba(41, 71, 53, 0.13);
}

.drop-icon {
  display: grid;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 20px;
  color: var(--forest);
  background: var(--mint);
}

.drop-icon svg {
  width: 39px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone h2 {
  margin: 0 0 6px;
  font-family: "Cormorant", Georgia, serif;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.drop-zone p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.browse-link {
  color: var(--forest);
  font-weight: 720;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.drop-note {
  position: absolute;
  right: 20px;
  bottom: 15px;
  color: #7d887f;
  font-size: 10px;
  font-weight: 620;
}

.document-card {
  padding: 24px;
  border-radius: 20px;
  background: rgba(251, 248, 241, 0.92);
}

.document-card.is-empty .text-preview-wrap {
  opacity: 0.58;
}

.document-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-badge {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 52px;
  place-items: center;
  border-radius: 8px 12px 8px 8px;
  color: white;
  background: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.file-heading-copy {
  min-width: 0;
  flex: 1;
}

.file-heading-copy .label {
  margin-bottom: 3px;
}

.file-heading-copy h2 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-heading-copy > p:last-child {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.text-button,
.icon-text-button {
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 12px;
  font-weight: 720;
}

.text-button {
  padding: 8px 0 8px 12px;
}

.text-button:disabled,
.icon-text-button:disabled {
  opacity: 0.38;
}

.text-button:not(:disabled):hover,
.icon-text-button:not(:disabled):hover {
  color: var(--orange);
}

.loading-panel {
  padding: 19px 0 2px;
}

.loading-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.loading-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7e6dc;
}

.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  transition: width 180ms ease;
}

.notice {
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid rgba(160, 91, 50, 0.18);
  border-radius: 10px;
  color: #7b482f;
  background: #f9eadc;
  font-size: 12px;
  line-height: 1.5;
}

.notice.is-success {
  border-color: rgba(49, 103, 76, 0.15);
  color: var(--forest);
  background: var(--mint-soft);
}

.text-preview-wrap {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: opacity 150ms ease;
}

.preview-toolbar {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 15px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  background: #f3f0e8;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px;
  font-size: 10px;
  text-transform: uppercase;
}

.icon-text-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

#textPreview {
  display: block;
  position: relative;
  width: 100%;
  height: clamp(380px, 48vh, 580px);
  min-height: 380px;
  overflow: auto;
  padding: 16px;
  border: 0;
  border-radius: 0 0 13px 13px;
  outline: none;
  color: #405047;
  background: rgba(255, 254, 250, 0.66);
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  scroll-behavior: smooth;
  white-space: pre-wrap;
}

#textPreview:empty::before {
  content: attr(data-placeholder);
  color: #99a098;
}

#textPreview mark {
  margin: 0 -3px;
  padding: 2px 3px;
  border-radius: 4px;
  color: #263d30;
  background: #f8d4a8;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

#textPreview:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(32, 79, 60, 0.38);
}

.player-card {
  position: sticky;
  top: 20px;
  padding: 28px;
  border-radius: 22px;
  color: #f7f4ec;
  background:
    radial-gradient(circle at 100% 0%, rgba(129, 159, 120, 0.28), transparent 14rem),
    var(--forest-dark);
  box-shadow: 0 28px 70px rgba(26, 57, 43, 0.22);
}

.player-topline {
  display: flex;
  min-height: 49px;
  justify-content: space-between;
  gap: 16px;
}

.player-card .label {
  color: #a9bea6;
}

.player-card h2 {
  max-width: 235px;
  margin: 0;
  overflow: hidden;
  color: white;
  font-family: "Cormorant", Georgia, serif;
  font-size: 25px;
  font-weight: 590;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equalizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 29px;
  padding: 0 4px;
  opacity: 0.35;
}

.equalizer span {
  width: 2px;
  height: 8px;
  border-radius: 3px;
  background: #d6e4cf;
}

.equalizer span:nth-child(2) { height: 15px; }
.equalizer span:nth-child(3) { height: 11px; }

.equalizer.is-playing {
  opacity: 1;
}

.equalizer.is-playing span {
  animation: pulse 0.78s ease-in-out infinite alternate;
}

.equalizer.is-playing span:nth-child(2) { animation-delay: -0.42s; }
.equalizer.is-playing span:nth-child(3) { animation-delay: -0.24s; }
.equalizer.is-playing span:nth-child(4) { animation-delay: -0.62s; }

@keyframes pulse {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.3); }
}

.playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
  padding: 34px 0 29px;
}

.round-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  transition: 140ms ease;
  transition-property: transform, background, opacity;
}

.round-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-button:disabled {
  opacity: 0.3;
}

.round-button:not(:disabled):hover {
  transform: translateY(-2px);
}

.round-button:focus-visible,
.player-card select:focus-visible,
.player-card input:focus-visible {
  outline: 2px solid #e3aa80;
  outline-offset: 3px;
}

.round-button.secondary {
  width: 39px;
  height: 39px;
  color: #d5ded2;
  background: rgba(255, 255, 255, 0.07);
}

.play-button {
  width: 70px;
  height: 70px;
  color: var(--forest-dark);
  background: #f2b47f;
  box-shadow: 0 10px 28px rgba(242, 180, 127, 0.2);
}

.play-button svg {
  width: 27px;
  stroke-width: 2;
}

.play-button .pause-icon,
.play-button.is-playing .play-icon {
  display: none;
}

.play-button.is-playing .pause-icon {
  display: block;
}

.progress-area {
  margin-bottom: 27px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, #f1b17e var(--fill, 0%), rgba(255, 255, 255, 0.16) var(--fill, 0%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 3px solid var(--forest-dark);
  border-radius: 50%;
  background: #f1b17e;
  box-shadow: 0 0 0 1px #f1b17e;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid var(--forest-dark);
  border-radius: 50%;
  background: #f1b17e;
  box-shadow: 0 0 0 1px #f1b17e;
}

input[type="range"]:disabled {
  opacity: 0.38;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #aebcb1;
  font-size: 10px;
  font-weight: 620;
}

.control-group {
  margin-top: 21px;
}

.control-group > label,
.control-label-row label {
  display: block;
  margin-bottom: 9px;
  color: #c7d2c8;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 44px;
  appearance: none;
  padding: 0 37px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
  color: #f5f4ef;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.select-wrap select option {
  color: var(--ink);
  background: white;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: #b6c5b8;
  stroke-width: 1.8;
  pointer-events: none;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-label-row label {
  margin: 0;
}

.control-label-row output {
  padding: 3px 7px;
  border-radius: 5px;
  color: #f3bb8e;
  background: rgba(242, 180, 127, 0.1);
  font-size: 10px;
  font-weight: 760;
}

.speed-row {
  display: grid;
  grid-template-columns: 29px 1fr 29px;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: #91a496;
  font-size: 9px;
}

.speed-row span:last-child {
  text-align: right;
}

.keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
  color: #92a297;
  font-size: 9px;
}

kbd {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 4px;
  color: #bac6bc;
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  font-size: 8px;
  text-transform: uppercase;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 4px 0;
  color: #7f887f;
  font-size: 10px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .player-card {
    position: static;
  }

  .topbar {
    padding-bottom: 34px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }

  .privacy-badge {
    padding: 7px 9px;
    font-size: 10px;
  }

  .intro {
    margin-bottom: 30px;
  }

  .intro h1 {
    font-size: 45px;
  }

  .drop-zone {
    min-height: 205px;
    flex-direction: column;
    justify-content: center;
    padding: 26px 20px 36px;
    text-align: center;
  }

  .drop-note {
    right: 0;
    bottom: 13px;
    left: 0;
    text-align: center;
  }

  .document-card,
  .player-card {
    padding: 20px;
  }

  #textPreview {
    height: 50vh;
    min-height: 320px;
  }

  .file-heading-copy h2 {
    max-width: 180px;
  }

  footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
