* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
  gap: 42px;
  align-items: start;
}

.intro {
  padding-top: 12px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 9ch;
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.intro p:last-child {
  max-width: 34rem;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.compressor,
.comparison {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgb(19 45 35 / 8%);
}

.compressor {
  padding: 24px;
}

.dropzone {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  border: 2px dashed #b9c9c2;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone:active {
  transform: scale(0.995);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.dropzone-icon {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 900;
}

.dropzone strong {
  color: var(--text);
  font-size: 1.15rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(190px, 0.9fr) minmax(120px, 0.55fr) auto;
  gap: 16px;
  align-items: end;
  margin-top: 20px;
}

fieldset {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.quality-control span,
.size-control span {
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-weight: 700;
}

.quality-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.quality-control input {
  grid-column: 1 / -1;
  accent-color: var(--accent);
}

.quality-control output {
  color: var(--accent-strong);
  font-weight: 800;
}

.range-labels {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  margin-top: -6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.size-control {
  display: grid;
  gap: 8px;
}

.size-control input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  background: #b8c2be;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--accent);
  background: #ffffff;
  color: var(--accent-strong);
}

.secondary-button:hover {
  background: #d6ece5;
}

.status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.status.is-error {
  color: var(--danger);
}

.comparison {
  margin-top: 28px;
  padding: 18px;
}

.comparison[hidden] {
  display: none;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preview-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.preview-grid header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.preview-grid header span {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.preview-grid img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: #eef2ee;
}

@media (max-width: 980px) {
  .hero,
  .controls,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 8ch;
    font-size: clamp(2.7rem, 16vw, 4.8rem);
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding: 28px 0;
  }

  .compressor {
    padding: 16px;
  }

  .dropzone {
    min-height: 220px;
  }

  .section-header {
    display: grid;
    align-items: start;
  }

  .preview-grid img {
    height: 260px;
  }
}
